/* ==========================================================================
   MAS HEADCOUNT — ARCHITECTURAL MINIMALIST DESIGN SYSTEM
   Typography: Inter (400 Regular, 500 Medium, 600 SemiBold, 700 Bold)
   ========================================================================== */

:root {
  --bg-canvas: #09090b;
  --bg-surface: #111114;
  --bg-elevated: #17171c;
  --bg-hover: rgba(255, 255, 255, 0.035);
  --bg-input: #0d0d10;

  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --mas-red: #dc2626;
  --mas-red-hover: #b91c1c;
  --red-soft: rgba(239, 68, 68, 0.12);
  --red-text: #f87171;

  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);

  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.12);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
}

.kpi-big, .tab-num, .badge-count, .k-lane-num, .pulse-cell, td, code {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

code {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   TOP NAVIGATION BAR
   ========================================================================== */

.app-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 54px;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 clamp(48px, 7vw, 112px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.primary-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.tab-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
}

.tab-num {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shift-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.shift-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.shift-btn:hover {
  color: var(--text-primary);
}

.shift-btn.active {
  background: var(--mas-red);
  color: #ffffff;
  font-weight: 600;
}

.btn-subtle-action {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-subtle-action:hover {
  color: var(--text-primary);
  border-color: var(--line-strong);
  background: var(--bg-hover);
}

.auth-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.auth-trigger:hover {
  border-color: var(--line-strong);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.active {
  background: var(--green);
}

.auth-cta {
  color: var(--text-primary);
  font-weight: 600;
  padding-left: 6px;
  border-left: 1px solid var(--line);
}

/* ==========================================================================
   MAIN CANVAS — GENEROUS HORIZONTAL BREATHING ROOM
   ========================================================================== */

.canvas {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px clamp(48px, 7vw, 112px) 80px;
}

.view {
  display: none;
}

.view.active {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ==========================================================================
   1. APPLE-GRADE MACHINED BENTO KPI DECK (QUIET AUTHORITY, TACTILE DEPTH)
   ========================================================================== */

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.kpi-pillar {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.042) 0%, rgba(255, 255, 255, 0.014) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.11),
    0 10px 28px -12px rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.kpi-pillar:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.kpi-pillar.has-deficit {
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.09) 0%, rgba(255, 255, 255, 0.015) 100%);
  border-color: rgba(239, 68, 68, 0.28);
  box-shadow:
    inset 0 1px 0 0 rgba(248, 113, 113, 0.22),
    0 10px 28px -12px rgba(0, 0, 0, 0.6);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.kpi-action-pill {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.kpi-action-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
}

.kpi-reset-link {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.kpi-reset-link:hover {
  color: var(--text-primary);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0;
}

.kpi-big {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #ffffff;
}

.kpi-total {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}

.kpi-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}

.tag-green {
  background: var(--green-soft);
  color: var(--green);
}

/* Tier 3: Unified Bottom Micro-Docks Across All 4 Cards */
.kpi-dock {
  margin-top: auto;
  height: 46px;
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-meter-track {
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.kpi-meter-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.fill-green {
  background: var(--green);
}

.kpi-dock-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

.kpi-dock-meta b {
  font-weight: 600;
  color: var(--text-secondary);
}

/* Card 2: Segmented Absence Strip */
.kpi-seg-grid {
  margin-top: auto;
  height: 46px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.kpi-seg-grid.kpi-seg-5 {
  grid-template-columns: repeat(5, 1fr);
}

.seg-stat {
  background: transparent;
  border: none;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  transition: background 0.14s ease;
}

.seg-stat:hover {
  background: rgba(255, 255, 255, 0.06);
}

.seg-stat.active {
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.seg-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.1;
}

.seg-val {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* Card 3 & 4: 2-Column Split Micro-Dock */
.kpi-split-dock {
  margin-top: auto;
  height: 46px;
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  gap: 10px;
}

.split-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.07);
}

.split-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.split-label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.15;
  white-space: nowrap;
}

.split-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.text-primary { color: var(--text-primary); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red { color: var(--red-text); }
.text-subtle { font-size: 12px; color: var(--text-muted); }

/* ==========================================================================
   2. 35-LINE SINGLE-ROW PULSE BAR
   ========================================================================== */

.pulse-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pulse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pulse-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pulse-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.pulse-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-item b {
  font-weight: 600;
  color: var(--text-primary);
}

.dot-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.dot-ok { background: var(--green); }
.dot-cov { background: var(--amber); }
.dot-def { background: var(--mas-red); }

.pulse-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pulse-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 0;
}

.pulse-cell {
  min-width: 34px;
  height: 28px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s ease;
}

.pulse-cell:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--text-primary);
}

.pulse-cell.cell-ok {
  border-bottom: 2px solid rgba(34, 197, 94, 0.45);
}

.pulse-cell.cell-covered {
  background: var(--amber-soft);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--amber);
  font-weight: 600;
}

.pulse-cell.cell-deficit {
  background: var(--red-soft);
  border-color: rgba(239, 68, 68, 0.45);
  color: var(--red-text);
  font-weight: 600;
}

.pulse-cell.active-filter {
  outline: 1.5px solid var(--text-primary);
  color: var(--text-primary);
}

/* ==========================================================================
   3. WORKSPACE BLOCK, TOOLBARS & TABLES
   ========================================================================== */

.workspace-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.block-heading {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.badge-count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
}

.view-toggle {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.toggle-btn {
  background: transparent;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-btn:hover {
  color: var(--text-primary);
}

.toggle-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 600;
}

.input-minimal {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
}

.input-minimal:focus {
  border-color: var(--line-strong);
}

.search-w {
  width: 200px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--line-strong);
  background: var(--bg-hover);
}

.btn-solid {
  background: var(--mas-red);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-solid:hover {
  background: var(--mas-red-hover);
}

.btn-danger-subtle {
  background: var(--red-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--red-text);
  cursor: pointer;
}

.btn-danger-subtle:hover {
  background: var(--mas-red);
  color: #ffffff;
}

.btn-icon-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-icon-delete:hover {
  color: var(--red-text);
  border-color: rgba(239, 68, 68, 0.45);
  background: var(--red-soft);
}

.btn-icon-delete svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Clean Table */
.surface-table {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.surface-table[hidden] {
  display: none !important;
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.clean-table th {
  padding: 10px 16px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.clean-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text-primary);
  vertical-align: middle;
}

.clean-table tbody tr:last-child td {
  border-bottom: none;
}

.clean-table tbody tr.clickable-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.clean-table tbody tr.clickable-row:hover {
  background: var(--bg-hover);
}

.text-right {
  text-align: right;
}

.cell-primary {
  font-weight: 600;
  color: var(--text-primary);
}

.cell-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 11.5px;
  font-weight: 500;
}

.badge-active,
.badge-onhand,
.badge-permanent {
  background: var(--green-soft);
  color: var(--green);
}

.badge-leave,
.badge-notyet {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
}

.badge-suden,
.badge-sudden,
.badge-sick,
.badge-allocated {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-vop,
.badge-resign {
  background: var(--red-soft);
  color: var(--red-text);
}

.badge-ml {
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
}

.badge-megatraining {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
}

.action-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 2px 0;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  accent-color: var(--mas-red);
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   CLEAN 4-STAGE KANBAN (BORDERLESS LANES, TACTILE CARDS)
   ========================================================================== */

.kanban-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

.kanban-grid[hidden] {
  display: none !important;
}

.k-lane {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
}

.k-lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.k-lane-head small {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

.k-lane-num {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.k-lane-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.k-ticket {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.14s ease;
}

.k-ticket:hover {
  border-color: var(--line-strong);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

.k-ticket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.k-ticket-line {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.k-ticket-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.k-ticket-foot {
  font-size: 12px;
  color: var(--text-secondary);
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   POOLS SPLIT VIEW
   ========================================================================== */

.pools-split {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  align-items: start;
}

.pools-split.single-col {
  grid-template-columns: 1fr;
}

.pool-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pool-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   RIGHT-SIDE SLIDE-OVER INSPECTOR DRAWER
   ========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: flex-end;
}

.drawer-backdrop[hidden] {
  display: none !important;
}

.inspector-drawer {
  width: 100%;
  max-width: 440px;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.6);
  animation: slideInRight 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.drawer-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mas-red);
}

.drawer-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-top: 2px;
}

.drawer-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inline-edit-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 4px;
}

.inline-edit-link:hover {
  color: var(--text-primary);
}

.drawer-dept-bar {
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.drawer-tab {
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.drawer-tab:hover {
  color: var(--text-primary);
  border-color: var(--line-strong);
}

.drawer-tab.active {
  background: var(--bg-elevated);
  border-color: var(--line-strong);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.drawer-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-body {
  flex: 1;
  overflow: hidden;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-section[hidden] {
  display: none !important;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.drawer-sec-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.drawer-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg-canvas);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-foot-right {
  display: flex;
  gap: 8px;
}

/* 5-Day VOP Visual Segments inside Drawer */
.vop-mini-bar {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vop-mini-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.vop-segments {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.vop-seg {
  height: 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.vop-seg.active {
  background: var(--amber);
}

.vop-seg.critical {
  background: var(--mas-red);
}

/* ==========================================================================
   CENTER DIALOG MODALS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.dialog {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.dialog-sm { max-width: 390px; }
.dialog-md { max-width: 480px; }
.dialog-lg { max-width: 780px; }

.dialog-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: var(--text-primary);
}

.dialog-body {
  padding: 18px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialog-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.input-control {
  width: 100%;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}

.input-control:focus {
  border-color: var(--line-strong);
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-row-batch {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
}

.credentials-note {
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 4px;
}

.error-msg {
  font-size: 12px;
  color: var(--red-text);
}

/* Floor Grid & Line Detail inside Dialog */
.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.floor-tile {
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.floor-tile:hover {
  border-color: var(--line-strong);
}

.line-stat-bar {
  display: flex;
  gap: 18px;
  font-size: 12.5px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.seat-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.seat-tile {
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.seat-tile:hover {
  border-color: var(--line-strong);
}

/* Toast */
.toast-stack {
  position: fixed;
  bottom: 20px;
  left: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 1024px) {
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .kpi-pillar + .kpi-pillar {
    padding-left: 0;
    border-left: none;
  }
  .pulse-strip {
    grid-template-columns: repeat(7, 1fr);
  }
  .kanban-grid, .pools-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-inner {
    padding: 0 16px;
    flex-wrap: wrap;
  }
  .canvas {
    padding: 20px 16px 48px;
  }
  .kpi-strip, .form-row-2, .seat-grid {
    grid-template-columns: 1fr;
  }
}
