/* OpenProject-inspired University Admissions Management System Styles */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #dce3ec;
  --border-strong: #c5d0df;
  --text: #1e293b;
  --text-muted: #64748b;
  --primary: #1a67a3;       /* OpenProject Blue */
  --primary-hover: #135082;
  --primary-soft: #e8f2fa;
  --accent: #0ea5e9;
  --income: #0f766e;
  --income-bg: #e6f7f5;
  --expense: #be123c;
  --expense-bg: #fff1f2;
  --gyobi: #2563eb;
  --ipsi: #d97706;
  --status-plan: #64748b;
  --status-prog: #1a67a3;
  --status-done: #15803d;
  --status-hold: #b45309;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.18);
  --font-sans: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Auth Pages (Simple & Clean) ---- */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f1f5f9;
}
.auth-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.auth-title {
  margin: 0 0 18px 0;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}
.auth-form .form-group { margin-bottom: 14px; }
.auth-error {
  margin: 0 0 12px 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--expense-bg);
  color: var(--expense);
  font-size: 13px;
}
.auth-footer {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
}

/* ---- Top Navigation ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 20px;
  background: #0f3a5d;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; opacity: 0.92; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #38bdf8;
  color: #082f49;
  font-weight: 800;
  font-size: 13px;
}
.main-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: #dbeafe;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.12); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(255, 255, 255, 0.22); color: #fff; font-weight: 700; }
.user-badge { font-size: 13px; color: #e2e8f0; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.topbar .btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }

/* ---- Page Container & Panels ---- */
.page-container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 16px 20px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel, .toolbar-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toolbar-panel { padding: 12px 16px; }
.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.filter-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
}
.checkbox-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.user-check-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-alt);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s;
}
.user-check-chip:has(input:checked) {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.user-check-chip input { margin: 0; accent-color: var(--primary); }

.view-mode-group, .zoom-group, .tab-pills {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-alt);
}
.btn-toggle, .btn-zoom, .btn-tab {
  border: none !important;
  border-radius: 0 !important;
  background: transparent;
  color: var(--text);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-toggle + .btn-toggle, .btn-zoom + .btn-zoom, .btn-tab + .btn-tab {
  border-left: 1px solid var(--border) !important;
}
.btn-toggle.active, .btn-zoom.active, .btn-tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-title-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-title { margin: 0; font-size: 15.5px; font-weight: 700; }
.panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
}
.board-hint {
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---- Buttons & Form Inputs ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-xs { padding: 2px 6px; font-size: 11.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }

.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: #334155; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"],
input[type="search"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(26, 103, 163, 0.22);
  border-color: var(--primary);
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

/* ---- Tree Gantt Chart (OpenProject-style) ---- */
.gantt-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}
.gantt-split {
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-height: calc(100vh - 210px);
  min-height: 460px;
  overflow-y: auto;
  overflow-x: hidden;
}
.gantt-left {
  flex: 0 0 580px;
  border-right: 2px solid var(--border-strong);
  background: #fff;
  z-index: 2;
  min-height: 100%;
}
.gantt-right {
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: visible;
  background: #fff;
  position: relative;
  min-width: 0;
  cursor: grab;
}
.gantt-right.is-panning,
.gantt-right.is-panning * {
  cursor: grabbing !important;
  user-select: none !important;
}
.gantt-header-row {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 38px;
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-strong);
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
.gantt-row {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #edf2f7;
  font-size: 12.5px;
  transition: background 0.1s;
}
.gantt-row.is-parent {
  background: #f8fafc;
  font-weight: 700;
}
.gantt-row.is-clickable { cursor: pointer; }
.gantt-row.is-clickable:hover { background: #eef6ff; }

.gl-cell {
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gl-title {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 180px;
}
.gl-assignees { flex: 0 0 120px; }
.gl-dates { flex: 0 0 118px; font-size: 11.5px; color: var(--text-muted); text-align: center; }
.gl-cost { flex: 0 0 114px; font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; }
.gl-actions { flex: 0 0 42px; text-align: center; }

.tree-toggle {
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  padding: 0;
  font-size: 10px;
  flex-shrink: 0;
  border-radius: 3px;
}
.tree-toggle:hover { background: #e2e8f0; }
.tree-spacer { display: inline-block; width: 18px; flex-shrink: 0; }
.wbs-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}
.task-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assignee-pill {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 3px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 500;
}
.quick-add-btn {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.quick-add-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Right Timeline Canvas */
.gantt-timeline-inner { position: relative; min-width: 100%; }
.gantt-time-header {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 38px;
  display: flex;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-strong);
}
.gantt-time-col {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}
.gantt-bars-area { position: relative; }
.gantt-grid-lines {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}
.gantt-grid-col {
  flex-shrink: 0;
  border-right: 1px dashed #edf2f7;
  height: 100%;
}
.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  z-index: 4;
  pointer-events: none;
}
.gantt-bar-row {
  position: relative;
  height: 36px;
  border-bottom: 1px solid #edf2f7;
}
.gantt-bar-row.is-parent { background: rgba(248, 250, 252, 0.7); }

/* Leaf Task Bar */
.gantt-bar-leaf {
  position: absolute;
  top: 8px;
  height: 20px;
  border-radius: 4px;
  background: var(--status-prog);
  color: #fff;
  font-size: 11px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 6px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
  cursor: pointer;
}
.gantt-bar-leaf.st-예정 { background: var(--status-plan); }
.gantt-bar-leaf.st-진행중 { background: var(--status-prog); }
.gantt-bar-leaf.st-완료 { background: var(--status-done); }
.gantt-bar-leaf.st-보류 { background: var(--status-hold); }
.gantt-bar-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.24);
  pointer-events: none;
}
.gantt-bar-label { position: relative; z-index: 1; font-weight: 600; }

/* Parent Summary Rollup Bar (OpenProject bracket style) */
.gantt-bar-parent {
  position: absolute;
  top: 11px;
  height: 10px;
  background: #1e3a5f;
  border-radius: 2px 2px 0 0;
  cursor: pointer;
}
.gantt-bar-parent::before,
.gantt-bar-parent::after {
  content: "";
  position: absolute;
  bottom: -5px;
  width: 0;
  height: 0;
  border-top: 5px solid #1e3a5f;
}
.gantt-bar-parent::before { left: 0; border-right: 6px solid transparent; }
.gantt-bar-parent::after { right: 0; border-left: 6px solid transparent; }
.gantt-bar-parent-fill {
  height: 100%;
  background: #38bdf8;
  border-radius: 2px 0 0 0;
}

.gantt-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* ---- Cost KPIs & Tree Cost Table ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
}
.kpi-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.kpi-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.kpi-value { font-size: 21px; font-weight: 800; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--text-muted); }
.text-income { color: var(--income); }
.text-expense { color: var(--expense); }

.cost-visual-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 16px 16px;
}
.fund-bar-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #fff;
}
.fund-bar-title {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.bar-track {
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.bar-fill-income { height: 100%; background: var(--income); border-radius: 999px; }
.bar-fill-expense { height: 100%; background: var(--expense); border-radius: 999px; }
.bar-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }

.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-gyobi { background: var(--gyobi); }
.dot-ipsi { background: var(--ipsi); }

/* ---- Data Tables ---- */
.table-scroll { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th, .data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.data-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}
.data-table th.num, .data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cost-tree-table tr.is-parent { background: #f8fafc; font-weight: 700; }
.cost-tree-table tr.total-row { background: #eef6ff; font-weight: 800; border-top: 2px solid var(--primary); }
.fund-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
}
.fund-교비 { background: #dbeafe; color: #1d4ed8; }
.fund-입시비 { background: #fef3c7; color: #b45309; }

/* ---- Modals ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: 100%;
  max-height: 90vh;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-md { max-width: 720px; }
.modal-lg { max-width: 920px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  margin-top: 10px;
  border-top: 1px solid var(--border);
}
.modal-footer-right { display: flex; gap: 8px; margin-left: auto; }

.info-banner {
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: #0c4a6e;
  font-size: 12.5px;
}
.assignee-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-alt);
}
.cost-editor-block {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  background: var(--surface-alt);
}
.cost-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cost-editor-header h4 { margin: 0; font-size: 13.5px; }
.cost-input-table td { padding: 5px 6px; }
.cost-input-table input, .cost-input-table select { padding: 5px 7px; font-size: 12.5px; }

.inline-master-form {
  display: grid;
  grid-template-columns: 95px 110px 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 14px;
}

/* ---- Forum & Attachments ---- */
.search-form { display: flex; gap: 6px; }
.search-form input { width: 220px; padding: 5px 10px; font-size: 13px; }
.forum-table tbody tr { cursor: pointer; }
.forum-table tbody tr:hover { background: #f8fafc; }
.col-num { width: 70px; text-align: center !important; }
.col-author { width: 110px; }
.col-date { width: 140px; }
.col-views { width: 70px; text-align: center !important; }
.pin-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
}
.att-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
}
.post-meta {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.post-content {
  white-space: pre-wrap;
  line-height: 1.65;
  min-height: 120px;
  margin-bottom: 16px;
}
.post-attachments {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.att-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 6px;
  background: var(--surface-alt);
  font-size: 13px;
}
.upload-bar {
  padding: 12px 16px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.upload-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.upload-note { font-size: 12px; color: var(--text-muted); }
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 14px;
}
.checkbox-inline label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 10px 16px;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
}
.toast.error { background: var(--danger); }
.toast.success { background: #15803d; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .kpi-grid, .cost-visual-bars, .form-grid-2, .form-grid-4, .inline-master-form {
    grid-template-columns: 1fr;
  }
  .topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
}


/* ---- Profile Modal & Small Modal ---- */
.modal-sm { max-width: 440px; }
.user-profile-btn { font-weight: 500; }

/* ---- Inline Editable Cells ---- */
.cell-editable {
  cursor: text;
  border-radius: 4px;
  transition: background 0.12s;
}
.cell-editable:hover {
  background: #e0f2fe;
  outline: 1px dashed #38bdf8;
}
.inline-cell-input {
  width: 100%;
  min-width: 50px;
  padding: 2px 5px !important;
  font-size: 12px !important;
  height: 24px;
  border: 1.5px solid var(--primary) !important;
  border-radius: 4px;
  background: #fff;
}
.inline-date-wrap {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}
.inline-date-wrap input[type="date"] {
  width: 104px;
  padding: 1px 3px !important;
  font-size: 11px !important;
  height: 24px;
}

/* ---- Draggable Row Cards & Multi-select ---- */
.gantt-left.board-mode { flex: 0 0 700px; }
.gl-select { flex: 0 0 46px; display: flex; align-items: center; gap: 4px; justify-content: center; }
.drag-handle {
  cursor: grab;
  color: #94a3b8;
  font-size: 13px;
  user-select: none;
  padding: 0 2px;
}
.drag-handle:active { cursor: grabbing; }
.gantt-row.row-card {
  margin: 0;
  border-left: 3px solid transparent;
}
.gantt-row.row-selected {
  background: #dbeafe !important;
  border-left-color: var(--primary);
}
.gantt-row.dragging { opacity: 0.45; }
.gantt-row.drop-before { box-shadow: inset 0 3px 0 0 #2563eb; }
.gantt-row.drop-after { box-shadow: inset 0 -3px 0 0 #2563eb; }
.gantt-row.drop-inside { background: #dcfce7 !important; outline: 2px dashed #16a34a; outline-offset: -2px; }

.gl-actions-board {
  flex: 0 0 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.row-act-btn {
  height: 22px;
  min-width: 22px;
  padding: 0 4px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.row-act-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Calendar View ---- */
.calendar-wrapper { padding: 14px 16px 18px; }
.calendar-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
}
.calendar-nav-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}
.calendar-month-center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.calendar-toolbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.calendar-month-label {
  font-size: 17px;
  font-weight: 800;
  color: #0f3a5d;
}
.cal-user-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cal-user-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  user-select: none;
}
.calendar-nav { display: flex; gap: 6px; align-items: center; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
}
.calendar-grid.calendar-grid-weeks {
  display: flex;
  flex-direction: column;
}
.cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal-dow {
  background: #f1f5f9;
  padding: 7px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}
.cal-dow.sun { color: #dc2626; }
.cal-dow.sat { color: #2563eb; }
.cal-week-row {
  position: relative;
  min-height: 112px;
}
.cal-week-bg {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  pointer-events: none;
}
.cal-day-cell {
  min-height: 112px;
  background: #fff;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-week-bg .cal-day-cell {
  min-height: 100%;
  padding: 0;
}
.cal-day-cell.other-month { background: #f8fafc; opacity: 0.6; }
.cal-day-cell.cal-today {
  position: relative;
  background: linear-gradient(160deg, rgba(56, 189, 248, 0.15) 0%, rgba(99, 102, 241, 0.08) 100%);
  box-shadow:
    inset 0 0 0 2px rgba(14, 165, 233, 0.72),
    inset 0 0 18px rgba(56, 189, 248, 0.18);
  border-radius: 6px;
}
.cal-day-cell.cal-today::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(90deg, #0ea5e9 0%, #6366f1 100%);
}
.cal-day-num.is-today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  color: #fff !important;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: 0 2px 7px rgba(37, 99, 235, 0.35);
}
.cal-day-num.is-today::after {
  content: "오늘";
  font-size: 10px;
  font-weight: 700;
  opacity: 0.92;
}
.cal-week-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 6px;
}
.cal-week-dates {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}
.cal-week-dates .cal-day-head {
  padding: 4px 6px 3px;
  margin-bottom: 0;
}
.cal-week-dates .cal-day-head.other-month { opacity: 0.55; }
.cal-day-num.sun { color: #dc2626; }
.cal-day-num.sat { color: #2563eb; }
.cal-add-btn {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #94a3b8;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.cal-day-cell:hover .cal-add-btn,
.cal-week-dates .cal-day-head:hover .cal-add-btn,
.cal-add-btn:hover { background: var(--primary-soft); color: var(--primary); }
.cal-week-events {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 22px;
  row-gap: 3px;
  align-items: stretch;
}
.cal-event-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  margin: 0 3px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 22px;
  color: #fff;
  background: var(--status-prog);
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14);
  transition: filter 0.12s, box-shadow 0.12s;
}
.cal-event-bar.cont-left {
  margin-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding-left: 5px;
}
.cal-event-bar.cont-right {
  margin-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding-right: 5px;
}
.cal-event-bar-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.cal-event-bar-cont {
  flex-shrink: 0;
  font-size: 10px;
  opacity: 0.9;
}
.cal-event-bar:hover,
.cal-event-bar.is-hovered {
  filter: brightness(1.08);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.24);
  z-index: 2;
}
.cal-events-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  max-height: 88px;
}
.cal-event-pill {
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
  color: #fff;
  background: var(--status-prog);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cal-event-pill.st-예정 { background: var(--status-plan); }
.cal-event-pill.st-진행중 { background: var(--status-prog); }
.cal-event-pill.st-완료 { background: var(--status-done); }
.cal-event-pill.st-보류 { background: var(--status-hold); }
.cal-event-pill.is-parent { background: #1e3a5f; font-weight: 700; }
.cal-event-pill:hover { filter: brightness(1.08); }

/* ---- Drag & Drop File Dropzone ---- */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 8px;
  padding: 18px 14px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dropzone-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.dropzone-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  justify-content: center;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border-strong);
  font-size: 12px;
  color: var(--text);
}
.file-chip-remove {
  border: none;
  background: transparent;
  color: var(--danger);
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
}
.upload-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 10px;
}


/* ---- User Color Picker & High-Contrast Swatches ---- */
.user-color-input {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1.5px solid rgba(15, 23, 42, 0.25);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}
.user-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.user-color-input::-webkit-color-swatch { border: none; border-radius: 50%; }

.color-picker-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.color-picker-row input[type="color"] {
  width: 34px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  cursor: pointer;
}
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.color-swatch.active, .color-swatch:hover {
  border-color: #0f172a;
  transform: scale(1.1);
}
.color-preview-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

/* ---- Gantt Column Hide/Show Sub-header Bar ---- */
.gantt-col-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.gantt-col-bar-label {
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 4px;
}
.col-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: #334155;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.col-toggle-chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.col-toggle-chip.is-hidden {
  background: #f1f5f9;
  color: #94a3b8;
  text-decoration: line-through;
}
.col-hide-x {
  margin-left: 4px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  border-radius: 3px;
}
.col-hide-x:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ---- Contrast-Safe & Non-Clipping Gantt Bars ---- */
.gantt-bar-leaf {
  overflow: visible;
}
.gantt-bar-progress-strip {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom-left-radius: 4px;
  pointer-events: none;
}
.gantt-bar-label {
  position: relative;
  z-index: 2;
  font-weight: 700;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.gantt-bar-label-outside {
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  color: #0f172a;
  background: rgba(255, 255, 255, 0.92);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.25);
  z-index: 3;
}
.gantt-bar-parent-label {
  position: absolute;
  left: calc(100% + 6px);
  top: -3px;
  color: #1e3a5f;
  background: rgba(255, 255, 255, 0.88);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}


/* ---- Fullscreen Popup Modal for Gantt & Calendar ---- */
.modal-backdrop-full {
  z-index: 105;
  padding: 12px;
}
.modal-backdrop-top {
  z-index: 120;
}
.modal-fullscreen {
  width: 98vw;
  max-width: 98vw;
  height: 94vh;
  max-height: 94vh;
}
.fullscreen-body {
  flex: 1 1 auto;
  padding: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.gantt-fullscreen {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.gantt-fullscreen .gantt-split {
  max-height: calc(94vh - 102px);
  flex: 1 1 auto;
}
.calendar-fullscreen {
  flex: 1 1 auto;
}
.calendar-fullscreen .cal-day-cell,
.calendar-fullscreen .cal-week-row {
  min-height: 132px;
}
.calendar-fullscreen .cal-events-list {
  max-height: 112px;
}


/* ---- Excel-like Draggable Row Cards & Inline Cell Popovers ---- */
.gantt-row.row-card.board-card {
  cursor: grab;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  border-left: 3px solid transparent;
  transition: box-shadow 0.12s, background 0.12s, transform 0.12s;
}
.gantt-row.row-card.board-card.is-parent {
  background: #f8fafc;
}
.gantt-row.row-card.board-card:hover {
  background: #f0f7ff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  z-index: 2;
  position: relative;
}
.gantt-row.row-card.board-card:active {
  cursor: grabbing;
}
.gantt-row.row-card.row-focused {
  background: #eff6ff !important;
  border-left-color: #2563eb;
}

/* Inline Cell Floating Popover (for Assignees & Costs without full modal) */
.cell-popover {
  position: fixed;
  z-index: 250;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  padding: 10px 12px;
  min-width: 240px;
  max-width: 560px;
}
.cell-popover-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cell-popover-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.cell-popover-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.mini-cost-row {
  display: grid;
  grid-template-columns: 150px 72px 96px 1fr 26px;
  gap: 5px;
  align-items: center;
  margin-bottom: 6px;
}
.mini-cost-row select, .mini-cost-row input {
  padding: 4px 6px !important;
  font-size: 12px !important;
  height: 28px;
}

/* Excel-like Right-Click Row Context Menu */
.row-context-menu {
  position: fixed;
  z-index: 260;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  padding: 4px 0;
  min-width: 170px;
}
.row-ctx-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 14px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
}
.row-ctx-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.row-ctx-item.danger { color: var(--danger); }
.row-ctx-item.danger:hover { background: var(--expense-bg); }
.row-ctx-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}


/* ---- Pure Fullscreen Gantt (Timeline Only, No WBS Table) ---- */
.fullscreen-body {
  min-height: 0;
}
.gantt-fullscreen {
  min-height: 0;
  height: 100%;
}
.gantt-split.gantt-only-mode {
  display: block;
  height: calc(94vh - 64px);
  max-height: calc(94vh - 64px);
  overflow: hidden;
}
.gantt-right-full {
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: auto;
}
.gantt-only-mode .gantt-bar-row:nth-child(even):not(.is-parent) {
  background: rgba(248, 250, 252, 0.55);
}


/* ---- Header Inline Column Hide Checkboxes ---- */
.hdr-col-chk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 700;
}
.hdr-col-chk input {
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.gl-col-collapsed {
  flex: 0 0 26px !important;
  padding: 0 4px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(241, 245, 249, 0.55);
}


/* ---- Dashboard Main Tabs ([일정관리] / [비용관리]) ---- */
.dash-main-tabs {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.dash-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface-alt);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.dash-tab-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.dash-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tab-mini-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}
.dash-tab-btn.active .tab-mini-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}


/* ---- Multi-Assignee Initial Avatar Badges ---- */
.assignee-avatar-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.assignee-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}


/* ---- Dashboard Drag-Only Handle Column ---- */
.gl-drag-only {
  flex: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px !important;
  font-size: 11px;
}


/* ---- Calendar Visibility Column in WBS ---- */
.gl-cal {
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.cal-vis-chk {
  margin: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}
.cal-vis-chk:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}


/* ---- Standalone Browser Popup Window Layout ---- */
.popup-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: #fff;
}
.popup-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #0f3a5d;
  color: #fff;
  gap: 10px;
}
.popup-topbar .btn-ghost, .popup-topbar .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: transparent;
}
.popup-topbar .btn-ghost:hover, .popup-topbar .btn-outline:hover {
  background: rgba(255, 255, 255, 0.16);
}
.popup-topbar .zoom-group {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}
.popup-topbar .btn-zoom { color: #e2e8f0; }
.popup-topbar .btn-zoom.active { background: #38bdf8; color: #082f49; }
.popup-title { font-size: 15px; }
.popup-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.popup-gantt-full {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.popup-gantt-full .gantt-split.gantt-only-mode {
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
}
.popup-calendar-full {
  flex: 1 1 auto;
}
.popup-calendar-full .cal-day-cell,
.popup-calendar-full .cal-week-row {
  min-height: 136px;
}


/* ---- Detached WBS-Only Mode (when Gantt Popup is Open) & Bidirectional Row Sync Highlight ---- */
.wbs-only-mode .wbs-left-expanded {
  flex: 1 1 100% !important;
  width: 100% !important;
  border-right: none;
}
.wbs-only-mode .gantt-header-row {
  font-size: 13px;
  background: #eaf1f8;
  border-bottom: 2px solid var(--border-strong);
}
.wbs-only-mode .gl-cell {
  padding: 0 14px;
  border-right: 1px solid #edf2f7;
}
.wbs-only-mode .gl-cell:last-child {
  border-right: none;
}
.wbs-only-mode .gl-drag-only {
  flex: 0 0 44px;
  padding: 0 6px !important;
}
.wbs-only-mode .gl-select {
  flex: 0 0 62px;
  padding: 0 8px !important;
}
.wbs-only-mode .gl-title {
  flex: 1 1 auto;
  min-width: 320px;
  gap: 8px;
}
.wbs-only-mode .gl-assignees {
  flex: 0 0 165px;
}
.wbs-only-mode .gl-dates {
  flex: 0 0 170px;
  font-size: 12.5px;
}
.wbs-only-mode .gl-cost {
  flex: 0 0 165px;
  font-size: 12.5px;
}
.wbs-only-mode .gl-cal {
  flex: 0 0 92px;
}
.wbs-only-mode .hdr-col-chk {
  gap: 6px;
  font-size: 12.5px;
}
.gantt-row.sync-hover,
.gantt-bar-row.sync-hover {
  background: rgba(56, 189, 248, 0.22) !important;
  outline: 1px solid rgba(26, 103, 163, 0.45);
  outline-offset: -1px;
}


/* ---- All-day Toggle & Time Range Inputs ---- */
.allday-time-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.time-range-inputs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
}
.time-range-inputs[hidden] { display: none; }
.time-range-inputs input[type="time"] {
  width: 118px;
  padding: 5px 8px;
  font-size: 13px;
}
.pop-sched-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pop-sched-grid[hidden] { display: none; }
.pop-sched-grid label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}
.pop-sched-grid input {
  padding: 4px 6px !important;
  font-size: 12px !important;
}


/* ---- Academic Year Selector in Topbar ---- */
.year-select {
  width: auto !important;
  min-width: 112px;
  padding: 5px 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 700;
  cursor: pointer;
}
.year-select option {
  background: #0f3a5d;
  color: #fff;
}

/* ---- Admin User & Access History Tree ---- */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.role-badge.role-admin {
  background: #fee2e2;
  color: #b91c1c;
}
.role-badge.role-user {
  background: #e2e8f0;
  color: #334155;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.status-pill.status-online {
  background: #dcfce7;
  color: #15803d;
}
.status-pill.status-offline {
  background: #f1f5f9;
  color: #64748b;
}
.access-tree-table tr.access-parent-row {
  background: #f8fafc;
}
.access-tree-table tr.access-parent-row:hover {
  background: #eef6ff;
}
.access-tree-table tr.access-child-row {
  background: #ffffff;
  font-size: 12.5px;
}
.access-tree-table tr.access-child-row:hover {
  background: #f8fafc;
}
.access-tree-child-cell {
  padding-left: 34px !important;
}
.tree-branch-mark {
  display: inline-block;
  margin-right: 6px;
  color: #94a3b8;
  font-weight: 700;
}

/* ---- Topbar Admin Copy Academic Year Button ---- */
.year-copy-btn {
  color: #e0f2fe !important;
  border-color: rgba(125, 211, 252, 0.55) !important;
  background: rgba(56, 189, 248, 0.16) !important;
  font-size: 12.5px;
  padding: 5px 10px;
}
.year-copy-btn:hover {
  background: rgba(56, 189, 248, 0.3) !important;
  color: #fff !important;
}

/* ---- WBS Depth (<-, ->) Controls & Auto Index ---- */
.depth-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-right: 3px;
}
.depth-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1.5px solid #94a3b8;
  border-radius: 4px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  -webkit-text-stroke: 0.45px currentColor;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.depth-btn:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.depth-btn:disabled {
  opacity: 0.28;
  cursor: default;
}
.wbs-auto-tag {
  cursor: default;
  user-select: none;
}

/* ---- Between-Row Hover [+] Quick Insert Zone ---- */
.row-between-zone {
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 148px;
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: auto;
}
.row-between-zone.is-top {
  top: -6px;
}
.row-between-zone.is-bottom {
  bottom: -6px;
}
.row-between-zone::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 2px;
  background: var(--primary);
  transform: translateY(-50%);
  border-radius: 2px;
  pointer-events: none;
}
.row-between-zone:hover,
.row-between-zone:focus-within {
  opacity: 1;
}
.row-between-add-btn {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.32);
  transition: transform 0.12s, background 0.12s;
}
.row-between-add-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.14);
}

/* ---- Right-Click Delete Cue on Hover ---- */
.row-rclick-hint {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}
.gantt-row:hover .row-rclick-hint {
  opacity: 0.92;
}

/* ---- Cost Tree Table Collapsed Column ---- */
.cost-tree-table th.cost-col-collapsed,
.cost-tree-table td.cost-col-collapsed {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  padding: 6px 4px !important;
  text-align: center !important;
  background: rgba(241, 245, 249, 0.55);
}
