/* ============================================================
   JadwalUjian Pro — Design System & Layout
   Crisp Modern SaaS UI for Indonesian Academic Exam Scheduling
   ============================================================ */

:root {
  --bg-app: #fefce8;
  --bg-surface: #ffffff;
  --bg-subtle: #fffdf5;
  --bg-sidebar: #1c1917;
  --bg-sidebar-hover: #292524;
  --bg-sidebar-active: rgba(250, 204, 21, 0.16);

  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #78716c;
  --text-sidebar: #e7e5e4;
  --text-sidebar-muted: #a8a29e;

  --border: #f3e8c8;
  --border-strong: #e5d29c;

  --primary: #a16207;
  --primary-hover: #854d0e;
  --primary-soft: #fef9c3;
  --primary-border: #fde047;
  --gold: #facc15;
  --gold-hover: #eab308;

  --success: #059669;
  --success-soft: #ecfdf5;
  --success-border: #a7f3d0;

  --warning: #b45309;
  --warning-soft: #fffbeb;
  --warning-border: #fcd34d;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;

  --info: #b45309;
  --info-soft: #fef3c7;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(113, 63, 18, 0.06);
  --shadow-sm: 0 2px 6px rgba(113, 63, 18, 0.08), 0 1px 2px rgba(113, 63, 18, 0.04);
  --shadow-md: 0 10px 26px rgba(113, 63, 18, 0.12);
  --shadow-lg: 0 20px 50px rgba(28, 25, 23, 0.22);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --sidebar-w: 268px;
  --topbar-h: 68px;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.hidden { display: none !important; }
.print-only { display: none; }
.mono { font-family: var(--font-mono); }

/* ==================== App Shell ==================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ==================== Sidebar ==================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.22s ease;
}

.sidebar-header {
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

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

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fde047 0%, #facc15 55%, #eab308 100%);
  color: #1c1917;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.38);
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 800; font-size: 15px; color: #fef08a; letter-spacing: -0.02em; line-height: 1.2; }
.brand-tagline { font-size: 11px; color: #a8a29e; font-weight: 500; }

.project-switcher {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(250, 204, 21, 0.1);
}

.switcher-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #a8a29e;
  margin-bottom: 6px;
}

.switcher-row { display: flex; gap: 6px; }

.project-select {
  flex: 1;
  min-width: 0;
  background: #292524;
  color: #fefce8;
  border: 1px solid rgba(250, 204, 21, 0.22);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
.project-select:focus { border-color: #facc15; }

.btn-mini-dark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #292524;
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.25);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-mini-dark:hover { background: #44403c; color: #fef08a; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 16px;
}

.nav-group { margin-bottom: 16px; }
.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #a8a29e;
  padding: 0 10px 6px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: none;
  background: transparent;
  color: var(--text-sidebar);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background 0.14s, color 0.14s;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-sidebar-hover); color: #fef9c3; }
.nav-item.active {
  background: var(--bg-sidebar-active);
  color: #fde047;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #facc15;
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  opacity: 0.9;
}

.nav-pill {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(250, 204, 21, 0.22);
  color: #fde047;
}

.nav-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(250, 204, 21, 0.12);
  color: #fde68a;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(250, 204, 21, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.autosave-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: #a8a29e;
}
.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.25);
}

.btn-export-sidebar {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #fde047, #eab308);
  color: #1c1917;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.35);
  transition: transform 0.12s, filter 0.15s;
}
.btn-export-sidebar:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* ==================== Main Wrapper & Topbar ==================== */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: rgba(255, 253, 245, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #fde68a;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.topbar-left > div { min-width: 0; flex: 1; }
.page-title { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-subtitle { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.health-pill.ok { background: var(--success-soft); border-color: var(--success-border); color: var(--success); }
.health-pill.warn { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning); }
.health-pill.error { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }

.health-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.view-container {
  padding: 22px 24px 48px;
  max-width: 1520px;
  width: 100%;
  margin: 0 auto;
}

/* ==================== Buttons & Inputs ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-xs { padding: 4px 9px; font-size: 11.5px; border-radius: 6px; }
.btn-lg { padding: 12px 22px; font-size: 14.5px; font-weight: 700; }

.btn-primary {
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #1c1917;
  font-weight: 700;
  border-color: #ca8a04;
  box-shadow: 0 2px 6px rgba(202, 138, 4, 0.25);
}
.btn-primary:hover { background: linear-gradient(135deg, #eab308, #ca8a04); color: #1c1917; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }

.btn-secondary { background: #fff; color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover { background: #fefce8; border-color: #ca8a04; }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: #fef3c7; color: var(--text-primary); }

.btn-danger-soft { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.btn-danger-soft:hover { background: #fee2e2; }

.btn-wa { background: #16a34a; color: #fff; }
.btn-wa:hover { background: #15803d; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }
.mobile-only { display: none; }

.input, .select, .textarea {
  width: 100%;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: #ca8a04;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.28);
}
.input-sm, .select-sm { padding: 6px 10px; font-size: 12.5px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.form-hint { font-size: 11.5px; color: var(--text-muted); }

/* ==================== Cards & Panels ==================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.card-subtitle { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }
.card-body { padding: 18px 20px; }

/* ==================== KPI Grid ==================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.kpi-icon.indigo { background: var(--primary-soft); color: var(--primary); }
.kpi-icon.emerald { background: var(--success-soft); color: var(--success); }
.kpi-icon.amber { background: var(--warning-soft); color: var(--warning); }
.kpi-icon.rose { background: var(--danger-soft); color: var(--danger); }
.kpi-icon.sky { background: var(--info-soft); color: var(--info); }

.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.kpi-meta { font-size: 12px; color: var(--text-muted); }

/* ==================== Hero Banner on Dashboard ==================== */
.hero-banner {
  background: linear-gradient(125deg, #1c1917 0%, #422006 48%, #a16207 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border: 1px solid rgba(250, 204, 21, 0.35);
  box-shadow: 0 10px 28px rgba(133, 77, 14, 0.22);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(250, 204, 21, 0.22);
  color: #fef08a;
  border: 1px solid rgba(250, 204, 21, 0.45);
  margin-bottom: 8px;
}
.hero-title { margin: 0 0 6px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.hero-desc { margin: 0; font-size: 13px; color: #fef3c7; max-width: 640px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ==================== Badges & Chips ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
}
.badge-indigo { background: var(--primary-soft); color: var(--primary); }
.badge-emerald { background: var(--success-soft); color: var(--success); }
.badge-amber { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-slate { background: #f1f5f9; color: #475569; }
.badge-sky { background: var(--info-soft); color: var(--info); }

.code-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}
.code-chip.conflict {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
  animation: pulseErr 1.6s infinite;
}
.code-chip.empty {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: var(--warning-border);
}
.code-chip.locked::after {
  content: " 🔒";
  font-size: 10px;
}

@keyframes pulseErr {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.25); }
  50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12); }
}

/* ==================== Toolbar & Tabs ==================== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tabs {
  display: inline-flex;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
}
.tab-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #78350f;
  cursor: pointer;
  transition: all 0.14s;
}
.tab-btn:hover { color: #422006; }
.tab-btn.active { background: #fff; color: #a16207; font-weight: 700; box-shadow: var(--shadow-xs); }

/* ==================== Tables ==================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: #fefce8;
  color: #713f12;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #fde68a;
  white-space: nowrap;
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #faf3dd;
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #fffdf2; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tr.row-conflict { background: #fef2f2 !important; }
.data-table tr.row-selected { background: #fef9c3 !important; }
.data-table tr.row-subtotal td { background: #fefce8; font-weight: 700; border-top: 1px solid #fde68a; }

.check-col { width: 38px; text-align: center !important; }
.table-check {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  vertical-align: middle;
}

.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}
.bulk-bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn:disabled { opacity: 0.48; cursor: not-allowed; pointer-events: none; }

/* ==================== Kesediaan Pengawas Matrix ==================== */
.avail-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.avail-sidebar-list {
  max-height: 68vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
}
.avail-dosen-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  padding: 9px 11px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.13s, border-color 0.13s;
}
.avail-dosen-item:hover { background: var(--bg-subtle); border-color: var(--border); }
.avail-dosen-item.active { background: var(--primary-soft); border-color: var(--primary-border); }
.avail-dosen-name { font-size: 12.5px; font-weight: 700; color: var(--text-primary); line-height: 1.25; }
.avail-dosen-sub { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 2px; }

.avail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.avail-table th, .avail-table td {
  border: 1px solid var(--border);
  padding: 6px 5px;
  text-align: center;
  vertical-align: middle;
}
.avail-table th.grp-reguler {
  background: #ca8a04;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.avail-table th.grp-karyawan {
  background: #422006;
  color: #fde047;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.avail-table th.sesi-hdr {
  background: #fefce8;
  cursor: pointer;
  transition: background 0.12s;
}
.avail-table th.sesi-hdr:hover { background: #fef08a; }
.avail-sesi-title { display: block; font-weight: 800; color: var(--text-primary); font-size: 11.5px; }
.avail-sesi-time { display: block; font-family: var(--font-mono); font-size: 9.5px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; }

.avail-day-cell {
  text-align: left !important;
  cursor: pointer;
  background: #fffdf5;
  min-width: 110px;
}
.avail-day-cell:hover { background: #fef9c3; }

.avail-toggle {
  width: 100%;
  min-width: 68px;
  padding: 6px 4px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
}
.avail-toggle.yes {
  background: var(--success-soft);
  color: var(--success);
  border-color: var(--success-border);
}
.avail-toggle.yes:hover { background: #d1fae5; }
.avail-toggle.no {
  background: #f8fafc;
  color: #94a3b8;
  border-color: var(--border);
}
.avail-toggle.no:hover { background: #fee2e2; color: var(--danger); border-color: var(--danger-border); }

@media (max-width: 1180px) {
  .avail-layout { grid-template-columns: 1fr; }
}

/* ==================== 2-Column Campus Schedule Cards ==================== */
.kop-preview {
  background: #fff;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 3px double #854d0e;
}
.kop-left h3 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: 0.01em; color: #422006; }
.kop-left p { margin: 1px 0; font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.kop-right { text-align: right; font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }

.paired-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.class-schedule-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.class-card-head {
  background: linear-gradient(90deg, #1c1917 0%, #422006 100%);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.class-card-head h4 { margin: 0; font-size: 13.5px; font-weight: 700; color: #fef08a; }
.class-card-meta { font-size: 11.5px; color: #e7e5e4; font-family: var(--font-mono); }

.mini-sched-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.mini-sched-table th {
  background: #fefce8;
  color: #713f12;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 6px;
  border-bottom: 1px solid #fde68a;
  text-align: left;
  white-space: nowrap;
}
.mini-sched-table td {
  padding: 6px 6px;
  border-bottom: 1px solid #faf3dd;
  vertical-align: middle;
}
.mini-sched-table tr.clickable-slot { cursor: pointer; transition: background 0.12s; }
.mini-sched-table tr.clickable-slot:hover { background: #fef9c3; }
.mini-sched-table tr.slot-conflict { background: #fef2f2; }
.mini-sched-table tfoot td {
  background: #fefce8;
  font-weight: 700;
  border-top: 1px solid #fde68a;
  padding: 7px 8px;
}

.day-cell { font-weight: 700; color: var(--text-primary); line-height: 1.25; }
.date-sub { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-muted); font-family: var(--font-mono); }

/* ==================== Matriks Pengawas ==================== */
.matriks-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.matrix-table th, .matrix-table td {
  border: 1px solid var(--border);
  padding: 6px 6px;
  text-align: center;
  white-space: nowrap;
}
.matrix-table thead th {
  background: #1c1917;
  color: #fef08a;
  font-weight: 700;
  font-size: 11.5px;
  position: sticky;
  top: 0;
  z-index: 2;
}
.matrix-date-row td {
  background: #fef08a;
  color: #713f12;
  font-weight: 800;
  text-align: left;
  padding: 7px 12px;
  font-size: 12.5px;
}
.matrix-shift-row td {
  background: #fefce8;
  color: #854d0e;
  font-weight: 700;
  font-size: 11px;
  text-align: left;
  padding: 4px 12px;
  letter-spacing: 0.04em;
}
.matrix-cell {
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: 700;
  transition: background 0.12s;
  min-width: 54px;
}
.matrix-cell:hover { background: #fef08a !important; }
.matrix-cell.filled { color: #1c1917; background: #fff; }
.matrix-cell.empty-slot { color: #b45309; background: #fffbeb; }
.matrix-cell.conflict-cell { background: #fee2e2 !important; color: #b91c1c !important; font-weight: 800; }
.matrix-cell.unused { background: #fffdf5; color: #d6d3d1; cursor: default; }

/* ==================== Load Distribution Bars ==================== */
.load-list { display: flex; flex-direction: column; gap: 8px; max-height: 540px; overflow-y: auto; padding-right: 4px; }
.load-item { display: flex; flex-direction: column; gap: 4px; }
.load-row-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; gap: 8px; }
.load-name { font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.load-count { font-family: var(--font-mono); font-weight: 700; font-size: 12px; flex-shrink: 0; }
.load-track { height: 7px; border-radius: 99px; background: #fef3c7; overflow: hidden; }
.load-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #facc15, #ca8a04); transition: width 0.3s ease; }
.load-fill.high { background: linear-gradient(90deg, #f59e0b, #dc2626); }
.load-fill.zero { background: #e7e5e4; }

/* ==================== Dashboard 2-col ==================== */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
}

.conflict-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  margin-bottom: 8px;
  font-size: 12.5px;
}
.conflict-item.warn {
  border-color: var(--warning-border);
  background: var(--warning-soft);
}
.conflict-empty {
  text-align: center;
  padding: 28px 16px;
  border-radius: 10px;
  background: var(--success-soft);
  border: 1px dashed var(--success-border);
  color: var(--success);
}
.conflict-empty h4 { margin: 6px 0 4px; font-size: 15px; }
.conflict-empty p { margin: 0; font-size: 12.5px; color: #047857; }

/* ==================== Generator Wizard Cards ==================== */
.gen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
.option-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle);
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.14s, background 0.14s;
}
.option-toggle:hover { border-color: var(--primary-border); background: #fff; }
.option-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}
.option-title { font-weight: 700; font-size: 13.5px; color: var(--text-primary); display: block; }
.option-desc { font-size: 12px; color: var(--text-muted); display: block; margin-top: 2px; }

/* ==================== Modal & Toast ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.16s ease-out;
}
.modal-card.wide { max-width: 780px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 { margin: 0; font-size: 16px; font-weight: 800; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}
.toast {
  background: #1c1917;
  color: #fefce8;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid #facc15;
  animation: toastIn 0.18s ease-out;
}
.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.warn { border-left-color: #f59e0b; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==================== Responsive ==================== */
.brand-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.35);
}

/* ==================== License Gate & Seller Admin Panel ==================== */
.license-gate {
  min-height: 100vh;
  background: radial-gradient(circle at top right, #fef08a 0%, #fefce8 45%, #fffbeb 100%);
  padding: 28px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lic-gate-wrap {
  width: 100%;
  max-width: 470px;
}
.lic-card {
  background: #fff;
  border: 1px solid #fde047;
  border-radius: 18px;
  padding: 28px 26px;
  box-shadow: 0 20px 50px rgba(133, 77, 14, 0.16);
}
.lic-brand-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.lic-logo-img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(202, 138, 4, 0.3);
}
.lic-brand-title { font-size: 20px; font-weight: 800; color: #1c1917; letter-spacing: -0.02em; line-height: 1.2; }
.lic-brand-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.lic-lock-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  background: #fefce8;
  border: 1px solid #fde047;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: #713f12;
}
.lic-lock-banner p { margin: 3px 0 0; font-size: 12px; color: #854d0e; }

.lic-alert {
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 14px;
}
.lic-alert.error { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-border); }

.lic-form { display: flex; flex-direction: column; gap: 14px; }
.lic-input {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 12px 14px;
  border: 2px solid #eab308;
  background: #fffdf5;
}

.lic-device-meta {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #fafaf9;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.lic-footer-links {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.lic-admin-link {
  background: none;
  border: none;
  color: #a16207;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.lic-admin-link:hover { background: #fef9c3; }

.license-badge-box {
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: 9px;
  padding: 8px 10px;
}
.lic-footer-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.lic-footer-key { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; color: #fde047; }
.lic-footer-buyer { font-size: 10.5px; color: #d6d3d1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 145px; }
.btn-lic-logout {
  border: 1px solid rgba(250, 204, 21, 0.35);
  background: transparent;
  color: #fde047;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-lic-logout:hover { background: rgba(250, 204, 21, 0.18); }

.admin-panel-wrap {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
}
.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #fde047;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

/* ==================== Dual-Dashboard Suite Switcher ==================== */
.suite-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(250, 204, 21, 0.12);
  background: rgba(0, 0, 0, 0.22);
}

.suite-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 6px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #292524;
  color: #d6d3d1;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  line-height: 1.2;
}
.suite-btn:hover {
  background: #3f3a36;
  color: #fef9c3;
}
.suite-btn.active {
  background: linear-gradient(135deg, #fde047 0%, #eab308 100%);
  color: #1c1917;
  border-color: #fef08a;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.35);
}
.suite-ico {
  font-size: 14px;
  line-height: 1;
}

.topbar-suite-switch {
  display: inline-flex;
  align-items: center;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}
.top-suite-btn {
  border: none;
  background: transparent;
  color: #713f12;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.top-suite-btn:hover {
  background: rgba(250, 204, 21, 0.3);
}
.top-suite-btn.active {
  background: #1c1917;
  color: #fde047;
  box-shadow: 0 2px 6px rgba(28, 25, 23, 0.2);
}

.clickable-row {
  cursor: pointer;
  transition: background 0.12s ease;
}
.clickable-row:hover {
  background: #fefce8 !important;
}
.row-conflict {
  background: #fef2f2 !important;
}
.row-conflict:hover {
  background: #fee2e2 !important;
}

@media (max-width: 1180px) {
  .hide-md { display: none !important; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matriks-layout, .dash-grid, .paired-grid, .gen-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-wrapper { margin-left: 0; }
  .mobile-only { display: inline-flex; }
  .hide-sm { display: none; }
  .topbar { padding: 0 14px; }
  .view-container { padding: 16px 14px 40px; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
}
