@import url("icons.css?v=21");
/* Supervisi Akademik SMK — v14 */

/* ══ LIGHT THEME (default) ══ */
:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --text: #0f172a;
  --text2: #334155;
  --text3: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #7c3aed;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
}

/* ══ DARK THEME ══ */
[data-theme="dark"],
html.dark {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #1a2540;
  --text: #f1f5f9;
  --text2: #cbd5e1;
  --text3: #94a3b8;
  --border: #2d3f55;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #1e3a5e;
  --accent: #a78bfa;
  --danger: #f87171;
  --success: #4ade80;
  --warning: #fbbf24;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.4);
}

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

html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color .2s ease, color .2s ease;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1,h2,h3,h4 { color: var(--text); line-height: 1.3; }

/* ══ BASE CONTENT & COMPONENT RESETS ══ */


/* ══ ALERTS ══ */
.alert {
  padding: 14px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  margin-bottom: 16px; border: 1px solid; transition: background-color .2s, color .2s, border-color .2s;
}
.alert.success { background-color: #ecfdf5; border-color: #86efac; color: #166534; }
.alert.error { background-color: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.alert.warning { background-color: #fffbeb; border-color: #fde68a; color: #92400e; }
[data-theme="dark"] .alert.success, html.dark .alert.success { background-color: #064e3b; border-color: #065f46; color: #a7f3d0; }
[data-theme="dark"] .alert.error, html.dark .alert.error { background-color: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .alert.warning, html.dark .alert.warning { background-color: #451a03; border-color: #78350f; color: #fde68a; }

/* ══ GRID ══ */
.grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 16px; }
.grid.two { grid-template-columns: repeat(2,1fr); }
.grid.three { grid-template-columns: repeat(3,1fr); }

/* ══ CARDS ══ */
.card {
  background-color: var(--surface); border: 1px solid var(--border);
  border-radius: 1.25rem; padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.05);
  transition: background-color .2s, border-color .2s, box-shadow .2s;
}
.stat { text-align: center; padding: 1.5rem 1rem; border-radius: 1.25rem; }
.stat span { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text3); display: block; margin-bottom: 4px; }
.stat b { font-size: 2rem; font-weight: 800; color: var(--primary); }

.hero {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border-radius: 1.25rem; padding: 2rem; margin-bottom: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(37,99,235,0.25);
}
.hero h1, .hero h2, .hero p { color: #fff; }

/* ══ TOOLBAR ══ */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.75rem; }

/* ══ BUTTONS ══ */
.btn, form > button:not([class]), form div > button:not([class]) {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  padding: 0.625rem 1.25rem; border-radius: 0.75rem; border: none;
  background-color: var(--primary); color: #fff;
  font-size: 0.8125rem; font-weight: 700; cursor: pointer;
  text-decoration: none; transition: all .15s ease; white-space: nowrap;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
}
.btn:hover, form > button:not([class]):hover, form div > button:not([class]):hover {
  background-color: var(--primary-dark); text-decoration: none; transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.btn:active, form > button:not([class]):active, form div > button:not([class]):active {
  transform: scale(0.97);
}
.btn.secondary { background-color: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn.secondary:hover { background-color: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.btn.danger { background-color: var(--danger); }
.btn.danger:hover { background-color: #dc2626; }
.btn.small { padding: 0.375rem 0.75rem; font-size: 0.75rem; border-radius: 0.5rem; }
.btn.ok { background-color: var(--success); }
.btn.large { padding: 0.875rem 1.75rem; font-size: 0.9375rem; border-radius: 1rem; }

/* Desktop view safety: ensure hamburger & mobile sidebar close buttons are never shown on large screens */
@media (min-width: 1024px) {
  #hamburgerBtn,
  #sidebarCloseBtn,
  #bottomNav,
  #sidebarBackdrop {
    display: none !important;
  }
}

/* ══ FORMS ══ */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text2); display: block; margin-bottom: 0.375rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
  width: 100%; padding: 0.6875rem 0.875rem; border-radius: 0.875rem;
  border: 1px solid var(--border); background-color: var(--surface); color: var(--text);
  font-size: 0.875rem; font-family: inherit;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
/* Ensure icon padding utility classes are never stomped by input defaults */
.pl-9, input.pl-9 { padding-left: 2.25rem !important; }
.pl-10, input.pl-10 { padding-left: 2.5rem !important; }
.pl-11, input.pl-11 { padding-left: 2.75rem !important; }
.pl-12, input.pl-12 { padding-left: 3rem !important; }
.pr-10, input.pr-10 { padding-right: 2.5rem !important; }
.pr-11, input.pr-11 { padding-right: 2.75rem !important; }
.pr-12, input.pr-12 { padding-right: 3rem !important; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
textarea { min-height: 90px; resize: vertical; }

/* ══ TABLES ══ */
.table-wrap { overflow-x: auto; border-radius: 1rem; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; background-color: var(--surface); }
th { text-align: left; padding: 0.75rem 1rem; background-color: var(--surface2); color: var(--text3); font-weight: 700; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: var(--primary-light); }

/* ══ BADGES ══ */
.badge { display: inline-flex; align-items: center; padding: 0.25rem 0.625rem; border-radius: 9999px; font-size: 0.6875rem; font-weight: 700; background-color: var(--primary-light); color: var(--primary); }
.badge.green { background-color: #dcfce7; color: #166534; }
.badge.red { background-color: #fee2e2; color: #991b1b; }
[data-theme="dark"] .badge.green, html.dark .badge.green { background-color: #064e3b; color: #86efac; }
[data-theme="dark"] .badge.red, html.dark .badge.red { background-color: #450a0a; color: #fca5a5; }
[data-theme="dark"] .badge.green, html.dark .badge.green { background-color: #064e3b; color: #86efac; }
[data-theme="dark"] .badge.red, html.dark .badge.red { background-color: #450a0a; color: #fca5a5; }

/* ══ UTILITIES ══ */
.muted { color: var(--text3); }
.eyebrow { font-size: 13px; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.compact th { width: 180px; }
.no-print {}
.print-only { display: none; }

/* ══ LOGIN ══ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background-color: var(--bg); padding: 24px; transition: background-color .2s; }
.login-card { width: 100%; max-width: 420px; background-color: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px; box-shadow: var(--shadow-lg); position: relative; transition: background-color .2s, border-color .2s; }
.login-logo { font-size: 48px; text-align: center; margin-bottom: 8px; }
.login-card h2 { text-align: center; font-size: 22px; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--text3); font-size: 14px; margin-bottom: 20px; }

/* ══ LETTERHEAD / REPORT ══ */
.letterhead { text-align: center; margin-bottom: 24px; }
.kop-line { border-top: 3px double var(--text); margin-top: 8px; }
.report-title { text-align: center; font-size: 18px; font-weight: 700; margin: 16px 0; color: var(--text); }
.signature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; text-align: center; }
.sign-box { padding-top: 80px; }
.sign-img { max-height: 60px; margin: 0 auto 4px; display: block; }
.school-logo-preview-box img, .school-logo-current { max-width: 90px; max-height: 90px; object-fit: contain; }

/* ══ LANDING ══ */
.landing-body { background-color: var(--bg); color: var(--text); transition: background-color .2s, color .2s; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; background-color: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; transition: background-color .2s, border-color .2s; }
.landing-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: var(--text); text-decoration: none; }
.landing-brand:hover { text-decoration: none; }
.landing-brand img { height: 36px; width: 36px; border-radius: 8px; object-fit: cover; }
.landing-hero { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; padding: 60px 32px; max-width: 1100px; margin: 0 auto; }
.landing-hero h1 { font-size: 32px; margin-top: 8px; line-height: 1.3; }
.landing-hero p { color: var(--text2); }
.landing-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.landing-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; padding: 32px; max-width: 1100px; margin: 0 auto; }
.landing-stats > div { text-align: center; padding: 24px; background-color: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: background-color .2s, border-color .2s; }
.landing-stats b { font-size: 28px; color: var(--primary); display: block; }
.landing-stats span { font-size: 13px; color: var(--text3); }
.landing-section { padding: 40px 32px; max-width: 1100px; margin: 0 auto; }
.landing-section h2 { font-size: 22px; margin-bottom: 20px; }

/* ══ PROGRESS ══ */
.progress-card { background-color: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; text-align: center; min-width: 200px; transition: background-color .2s, border-color .2s; }
.progress-card b { display: block; margin-top: 12px; color: var(--text); }
.progress-card small { color: var(--text3); }
.progress-ring { width: 100px; height: 100px; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--pct)*3.6deg), var(--border) 0); display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.progress-ring span { width: 76px; height: 76px; border-radius: 50%; background-color: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--primary); transition: background-color .2s; }

/* ══ DOWNLOADS ══ */
.download-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.download-tile { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius); background-color: var(--surface); border: 1px solid var(--border); text-decoration: none; transition: border-color .2s, transform .2s, background-color .2s; }
.download-tile:hover { border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.download-tile b { color: var(--text); font-size: 15px; }
.download-tile span { color: var(--text3); font-size: 13px; }
.file-card {}
.empty-download { text-align: center; padding: 40px; color: var(--text3); grid-column: 1/-1; }
.empty-download b { display: block; color: var(--text2); margin-bottom: 4px; }

/* ══ DASHBOARD ══ */
.dashboard-progress { display: flex; flex-direction: column; gap: 12px; }
.progress-bar { height: 12px; background-color: var(--border); border-radius: 6px; overflow: hidden; transition: background-color .2s; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 6px; }
.stage-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 12px; }
.stage-grid a { display: block; padding: 14px; text-align: center; background-color: var(--primary-light); color: var(--primary); border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; transition: background-color .2s, color .2s; }
.stage-grid a:hover { background-color: var(--primary); color: #fff; text-decoration: none; }

/* ══ RESPONSIVE HELPERS ══ */


  /* ── CARDS — rounder, elevated, stacked ── */
  .card {
    padding: 16px; border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    margin-bottom: 10px;
  }
  .card + .card { margin-top: 0; }
  .card h2 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
  .card h3 { font-size: 15px; font-weight: 600; }
  .card p.muted, .card .muted { font-size: 13px; line-height: 1.5; }

  /* ── GRID LAYOUT ── */
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
  .grid.two { grid-template-columns: 1fr; }

  /* ── STAT CARDS — compact app-style ── */
  .stat { padding: 16px 10px; border-radius: 14px; }
  .stat b { font-size: 24px; }
  .stat span { font-size: 11px; letter-spacing: .3px; }

  /* ── HERO ── */
  .hero { padding: 20px 16px; margin-bottom: 12px; border-radius: 14px; }
  .hero h1, .hero h2 { font-size: 18px; }
  .hero p { font-size: 13px; }

  /* ── ALERTS — floating toast-style ── */
  .alert {
    padding: 12px 16px; font-size: 13px; font-weight: 600;
    margin-bottom: 10px; border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
  }

  /* ── BUTTONS — touch-optimized ── */
  .btn, button:not(.hamburger):not(.theme-toggle):not(.sidebar-close):not(.bnav-item) {
    min-height: 46px; padding: 11px 18px;
    font-size: 14px; border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
  }
  .btn:active, button:not(.hamburger):not(.theme-toggle):not(.sidebar-close):not(.bnav-item):active {
    transform: scale(.97) !important; opacity: .9;
  }
  .btn.small {
    min-height: 36px; padding: 7px 12px;
    font-size: 12px; border-radius: 8px;
  }
  .btn.large { min-height: 52px; font-size: 16px; }

  /* ── FORMS — spacious & touch-friendly ── */
  .form { gap: 14px; }
  .form.two { grid-template-columns: 1fr; gap: 14px; }
  .form.two > div[style*="grid-column"] { grid-column: auto !important; }
  label {
    font-size: 13px; font-weight: 700; margin-bottom: 6px;
    color: var(--text2); letter-spacing: .2px;
  }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
    font-size: 16px !important;          /* prevents iOS zoom */
    min-height: 48px; padding: 12px 14px;
    border-radius: 12px !important;
    border: 1.5px solid var(--border) !important;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
  }
  input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(37,99,235,.1);
  }
  select {
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%2364748b' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
  }
  textarea { min-height: 100px; }
  input[type="file"] {
    padding: 10px 12px; font-size: 14px !important;
    border-style: dashed !important;
    background-color: var(--surface2) !important;
  }
  input[type="color"] { min-height: 44px; }
  input[type="date"], input[type="datetime-local"] {
    min-height: 48px;
  }
  small.muted, small { font-size: 12px; margin-top: 4px; display: block; }

  /* Simple tables become labelled cards. Complex tables remain scrollable. */
  .card { min-width: 0; }
  .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 640px; }
  .table-wrap table.compact { min-width: 0; }
  .table-wrap:has(.mobile-cards) { border: 0; border-radius: 0; overflow: visible; }
  table.mobile-cards { display: block; min-width: 0; background: none; }
  .mobile-cards thead { display: none; }
  .mobile-cards tbody { display: flex; flex-direction: column; gap: 12px; }
  .mobile-cards tbody tr { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
  .mobile-cards tbody td { display: block; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; line-height: 1.5; }
  .mobile-cards tbody tr:hover td { background: none; }
  .mobile-cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--text3); margin-bottom: 4px; }
  .mobile-cards td.table-actions { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
  .mobile-cards td.table-actions::before { flex-basis: 100%; }
  .mobile-cards td.table-actions .btn { flex: 1; justify-content: center; min-height: 44px; }
  .mobile-cards td.table-actions form { flex: 1; }
  .mobile-cards td.table-actions button { width: 100%; justify-content: center; }
  .mobile-cards td input, .mobile-cards td select, .mobile-cards td textarea { max-width: 100%; }

  /* ── STAGE GRID — pill buttons ── */
  .stage-grid { grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 10px; }
  .stage-grid a {
    padding: 14px 10px; font-size: 13px; font-weight: 700;
    min-height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
  }
  .stage-grid a.active {
    background-color: var(--primary); color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,.25);
  }

  /* ── TOOLBAR ── */
  .toolbar {
    flex-direction: column; align-items: stretch; gap: 10px;
    margin-bottom: 12px;
  }
  .toolbar h2 { font-size: 17px; }

  /* ── BADGES ── */
  .badge { font-size: 12px; padding: 4px 10px; border-radius: 8px; font-weight: 700; }

  /* ── PROGRESS ── */
  .progress-ring { width: 80px; height: 80px; }
  .progress-ring span { width: 60px; height: 60px; font-size: 16px; }
  .progress-card { padding: 20px; border-radius: 14px; }

  /* ── LANDING ── */
  .landing-nav { padding: 10px 16px; }
  .landing-hero { padding: 28px 16px; }
  .landing-hero h1 { font-size: 22px; }
  .landing-section { padding: 20px 16px; }
  .signature-grid { grid-template-columns: 1fr; gap: 20px; }
  .landing-stats { grid-template-columns: 1fr 1fr; padding: 12px; gap: 10px; }
  .landing-stats > div { padding: 16px 12px; border-radius: 12px; }
  .landing-stats b { font-size: 24px; }
  .landing-stats span { font-size: 12px; }
  .landing-actions { flex-direction: column; gap: 8px; }
  .landing-actions .btn { width: 100%; justify-content: center; min-height: 50px; }

  /* ── DOWNLOADS ── */
  .download-grid { grid-template-columns: 1fr; gap: 8px; }
  .download-tile { padding: 16px; border-radius: 12px; }

  /* ── LOGIN ── */
  .login-wrap { padding: 16px; }
  .login-card {
    padding: 28px 20px; border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
  }
  .login-card h2 { font-size: 20px; }
  .login-sub { font-size: 13px; }
  .login-logo { font-size: 44px; }

  /* ── SIGNATURE ── */
  .sign-box { padding-top: 40px; }

  /* ── FORUM — mobile-friendly ── */
  /* category tabs: horizontal scroll */
  .card > .toolbar { flex-direction: column; align-items: stretch; }
  .card > .toolbar > .tabs,
  .tabs {
    overflow-x: auto !important; -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important; white-space: nowrap;
    padding-bottom: 6px; margin: -4px -4px 0;
    scrollbar-width: none; /* Firefox */
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .btn { flex-shrink: 0; font-size: 12px; padding: 8px 14px; min-height: 38px; white-space: nowrap; }

  /* forum post list */
  .forum-list { gap: 10px !important; }
  .forum-post-card {
    padding: 14px !important; border-radius: 14px !important;
    border-left-width: 3px !important;
  }
  .forum-post-card h3 { margin: 0 0 6px 0 !important; }
  .forum-post-card h3 a { font-size: 15px !important; line-height: 1.4; }
  .forum-post-card p { margin: 10px 0 !important; font-size: 14px !important; }

  /* forum post detail */
  div[style*="max-width:900px"] { max-width: 100% !important; margin: 0 !important; }
  .card[style*="padding:25px"] { padding: 16px !important; }
  .card[style*="padding:20px"] { padding: 14px !important; }
  .card[style*="padding:15px"] { padding: 12px !important; }

  /* post header — stack avatar + text vertically on small screens */
  div[style*="display:flex; gap:15px;"] { gap: 10px !important; }
  div[style*="width:50px; height:50px"] { width: 40px !important; height: 40px !important; font-size: 18px !important; }
  .card h1[style*="font-size:22px"] { font-size: 17px !important; line-height: 1.3 !important; }
  div[style*="display:flex; gap:15px; flex-wrap:wrap; align-items:center"] {
    gap: 6px !important; font-size: 12px !important;
  }

  /* post actions (like, reply buttons) */
  div[style*="border-top:1px solid var(--border); display:flex; gap:10px"] {
    flex-wrap: wrap; gap: 8px !important;
  }

  /* reply cards */
  div[style*="padding-left:48px"] { padding-left: 0 !important; }
  div[style*="display:flex; gap:12px; align-items:flex-start"] { gap: 8px !important; }
  div[style*="width:36px; height:36px"] { width: 30px !important; height: 30px !important; font-size: 12px !important; }
  div[style*="white-space:pre-wrap"] {
    word-break: break-word !important; overflow-wrap: break-word !important;
    font-size: 14px !important;
  }

  /* forum create / edit */
  .card[style*="max-width:800px"] { max-width: 100% !important; }

  /* admin actions row on post — stack on mobile */
  div[style*="display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap"] {
    gap: 10px !important;
  }
  div[style*="display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap"] > div[style*="display:flex; gap:10px"] {
    width: 100%;
  }
  div[style*="display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap"] > div[style*="display:flex; gap:10px"] .btn {
    flex: 1;
  }
}

/* ══ RESPONSIVE — SMALL PHONES (≤480px) ══ */
@media(max-width:480px) {
  .content { padding: 8px 6px; padding-bottom: 72px !important; }
  .card { padding: 14px 12px; border-radius: 12px; }
  .grid, .grid.two, .grid.three { grid-template-columns: 1fr; gap: 8px; }
  .landing-stats { grid-template-columns: 1fr; }
  .stage-grid { grid-template-columns: 1fr; gap: 6px; }
  .login-card { padding: 24px 16px; }
  .download-grid { grid-template-columns: 1fr; }

  /* full-width primary buttons */
  .btn:not(.small):not(.secondary), button:not(.hamburger):not(.theme-toggle):not(.sidebar-close):not(.bnav-item):not(.small):not(.secondary):not(.bnav-item) {
    width: 100%; justify-content: center;
  }

  /* topbar ultra-compact */
  .topbar { padding: 6px 10px; }
  .topbar-title h1 { font-size: 15px; }
  .hamburger { width: 34px; height: 34px; }

  /* card-table tweaks */
  tr { padding: 12px; border-radius: 10px; }
  td:first-child { font-size: 14px; }
  td { font-size: 13px; }
  td .btn.small { font-size: 12px; min-height: 36px; }

  /* stat card */
  .stat b { font-size: 20px; }
  .stat span { font-size: 11px; }
}

/* ══ RESPONSIVE — VERY SMALL (≤360px) ══ */
@media(max-width:360px) {
  .topbar-title h1 { font-size: 14px; }
  .bottom-nav .bnav-label { font-size: 9px; }
  .bottom-nav .bnav-icon { font-size: 20px; }
  .card { padding: 12px 10px; }
  tr { padding: 10px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { padding: 10px 12px; }
}

/* ══ TOUCH FEEDBACK — global ══ */
@media(hover: none) and (pointer: coarse) {
  .btn:active, .nav-link:active, .stage-grid a:active,
  .download-tile:active, tr:active {
    transform: scale(.98);
    transition: transform .1s;
  }
  .card:has(form) { /* cards with forms get no transform */ }
  a { -webkit-tap-highlight-color: transparent; }
}

/* ══ SAFE AREA — notched phones ══ */
@supports(padding: env(safe-area-inset-bottom)) {
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom, 4px); }
  @media(max-width:768px) {
    .content { padding-bottom: calc(72px + env(safe-area-inset-bottom)) !important; }
  }
}

/* ══ PRINT ══ */
@media print {
  .no-print,.sidebar,.sidebar-overlay,.topbar,.hamburger,.theme-toggle,.btn,.alert,.bottom-nav { display: none !important; }
  .print-only { display: block !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  table { display: table !important; }
  thead { display: table-header-group !important; }
  tbody { display: table-row-group !important; }
  tr { display: table-row !important; padding: 0; border: none; box-shadow: none; border-radius: 0; }
  td, th { display: table-cell !important; padding: 8px 12px !important; border-bottom: 1px solid #ddd !important; }
}


/* ══ LANDING HERO — ALWAYS READABLE (white text on gradient/banner) ══ */
/* Without banner: use primary→accent gradient so text is always white */
.landing-hero {
  background: linear-gradient(135deg, var(--primary, #2563eb), var(--accent, #7c3aed)) !important;
  color: #fff !important;
}
.landing-hero .eyebrow { color: rgba(255,255,255,.85) !important; }
.landing-hero h1 { color: #fff !important; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.landing-hero p { color: rgba(255,255,255,.8) !important; }
.landing-hero .btn.secondary { background-color: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); color: #fff; }
.landing-hero .btn.secondary:hover { background-color: rgba(255,255,255,.25); }
.landing-hero .progress-card { background-color: rgba(255,255,255,.12); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.2); }
.landing-hero .progress-card b { color: #fff; }
.landing-hero .progress-card small { color: rgba(255,255,255,.75); }
.landing-hero .progress-ring span { background-color: rgba(0,0,0,.5); color: #fff; }

/* With banner image: the inline style already has overlay gradient, just enhance text shadow */
.landing-hero[style*="background-image"] { background: none !important; }
.landing-hero[style*="background-image"] h1 { text-shadow: 0 3px 20px rgba(0,0,0,.5); }


/* Compact choice controls on all devices; the label remains a large touch target. */
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-width: 18px; min-height: 18px; padding: 0; margin: 0; flex: 0 0 18px; accent-color: var(--primary); border-radius: 4px; box-shadow: none; vertical-align: middle; }
.choice-label { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; cursor: pointer; }
.choice-label input:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.nav-icon, .bnav-icon { display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.bottom-nav .bnav-icon { font-size: 20px; height: 22px; }
.theme-icon { display: inline-flex; align-items: center; justify-content: center; }
.main, .content, .form.two > div { min-width: 0; }
@media print {
  table.mobile-cards { display: table !important; background: var(--surface) !important; }
  .mobile-cards thead { display: table-header-group !important; }
  .mobile-cards tbody { display: table-row-group !important; }
  .mobile-cards tbody tr { display: table-row !important; border: 0; }
  .mobile-cards tbody td { display: table-cell !important; padding: 8px !important; border-bottom: 1px solid #ddd !important; }
  .mobile-cards td::before { display: none !important; }
  .table-wrap table { min-width: 0 !important; }
}

@media (min-width: 769px) {
  td.table-actions { white-space: nowrap; }
  td.table-actions .btn + .btn { margin-left: 4px; }
}
.theme-toggle { color: var(--text2); }
@media (max-width: 768px) {
  .sidebar-open .bottom-nav { visibility: hidden; pointer-events: none; }
}

/* v18: shared report layout; scoped so admin forms keep their existing styling. */
.report-card { max-width: 1120px; margin: 16px auto; padding: 28px; }
.report-options { margin-bottom: 16px; }
.report-card .report-letterhead { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 0 0 20px; padding: 0 0 16px; border-bottom: 3px double var(--text2); }
.report-card .letter-logo { width: 72px; height: 72px; max-width: 72px; max-height: 72px; flex: 0 0 72px; object-fit: contain; }
.report-card .letterhead-text { flex: 1; min-width: 0; text-align: center; }
.report-card .letterhead h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.3; text-transform: uppercase; }
.report-card .letterhead p { margin: 3px 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.report-card .report-title { margin: 16px 0 20px; text-align: center; font-size: 19px; line-height: 1.4; }
.report-card .report-title small { display: block; margin: 4px 0 0; font-size: 13px; font-weight: 400; }
.report-card h3 { margin: 20px 0 8px; font-size: 15px; break-after: avoid; }
.report-card p { line-height: 1.6; }
.report-card table { table-layout: auto; }
.report-card th, .report-card td { vertical-align: top; line-height: 1.5; }
.report-card .report-date { white-space: nowrap; }
.report-card .report-signatures { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px 40px; margin-top: 32px; text-align: center; }
.report-card .signature-person { min-width: 0; break-inside: avoid; page-break-inside: avoid; }
.report-card .signature-person:last-child { grid-column: 2; }
.report-card .signature-caption { min-height: 48px; }
.report-card .signature-caption p { margin: 0; }
.report-card .signature-space { height: 84px; display: flex; align-items: center; justify-content: center; }
.report-card .signature-space .sign-img { display: block; width: auto; max-width: 180px; height: auto; max-height: 76px; margin: 0; object-fit: contain; }
.report-card .signature-name { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 768px) {
  .report-card { padding: 16px; }
  .report-card .letterhead h2 { font-size: 18px; }
  .report-card .report-letterhead { gap: 12px; }
  .report-card .letter-logo { width: 52px; height: 52px; max-width: 52px; max-height: 52px; flex-basis: 52px; }
  .report-card .report-signatures { grid-template-columns: 1fr; gap: 24px; }
  .report-card .signature-person:last-child { grid-column: auto; }
  .report-card .signature-caption { min-height: 44px; }
}
@page { size: A4 portrait; margin: 12mm 12mm 14mm; }
@media print {
  html, body, .app-shell, .main, .content { display: block !important; width: auto !important; min-height: 0 !important; height: auto !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
  :root, html[data-theme], html.dark { --surface: #fff; --surface2: #f5f5f5; --text: #111; --text2: #333; --text3: #555; --border: #ccc; --primary-light: #f5f5f5; }
  .report-card { display: block; width: 100%; max-width: none; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; color: #111 !important; background: #fff !important; font: 10pt/1.4 Arial,sans-serif; }
  .report-card .report-letterhead { display: flex !important; gap: 5mm; padding-bottom: 4mm; margin-bottom: 5mm; break-inside: avoid; page-break-inside: avoid; }
  .report-card .letter-logo { width: 20mm; height: 20mm; max-width: 20mm; max-height: 20mm; flex-basis: 20mm; }
  .report-card .letterhead h2 { font-size: 16pt; }
  .report-card .letterhead p { font-size: 9pt; }
  .report-card .report-title { font-size: 13pt; margin: 4mm 0 5mm; break-after: avoid; }
  .report-card .report-title small { font-size: 9pt; }
  .report-card h3 { font-size: 10pt; margin: 4mm 0 2mm; break-after: avoid; page-break-after: avoid; }
  .report-card p { margin: 1mm 0 3mm; }
  .report-card .table-wrap { display: block; overflow: visible !important; width: 100%; max-width: none; border: 0; border-radius: 0; }
  .report-card table, .report-card table.mobile-cards { display: table !important; width: 100% !important; min-width: 0 !important; table-layout: fixed; font-size: 9pt; background: #fff !important; border-collapse: collapse; }
  .report-card thead, .report-card .mobile-cards thead { display: table-header-group !important; }
  .report-card tbody, .report-card .mobile-cards tbody { display: table-row-group !important; }
  .report-card tr, .report-card .mobile-cards tbody tr { display: table-row !important; break-inside: avoid; page-break-inside: avoid; border: 0; border-radius: 0; box-shadow: none; }
  .report-card th, .report-card td, .report-card .mobile-cards tbody td { display: table-cell !important; padding: 2mm !important; border: 1px solid #ccc !important; font-size: 9pt !important; color: #111 !important; line-height: 1.4; overflow-wrap: anywhere; }
  .report-card th { text-transform: none; letter-spacing: 0; background: #f5f5f5 !important; }
  .report-card td::before { display: none !important; }
  .report-card table.compact th { width: 38mm; }
  .report-card .report-instrument-table th:nth-child(1) { width: 23%; }
  .report-card .report-instrument-table th:nth-child(2) { width: 43%; }
  .report-card .report-instrument-table th:nth-child(3), .report-card .report-instrument-table th:nth-child(4) { width: 8%; }
  .report-card .report-instrument-table th:nth-child(5) { width: 18%; }
  .report-card .report-summary-table { font-size: 9pt; }
  .report-card .report-summary-table th, .report-card .report-summary-table td { font-size: 9pt !important; padding: 1.5mm !important; }
  .report-summary-table th:nth-child(1) { width: 5%; }
  .report-summary-table th:nth-child(2) { width: 14%; }
  .report-summary-table th:nth-child(3) { width: 10%; }
  .report-summary-table th:nth-child(4) { width: 20%; }
  .report-summary-table th:nth-child(5) { width: 15%; }
  .report-summary-table th:nth-child(6) { width: 12%; }
  .report-summary-table th:nth-child(7) { width: 6%; }
  .report-summary-table th:nth-child(8) { width: 18%; }
  .report-card .report-signatures { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 7mm 10mm; margin-top: 8mm; }
  .report-card .signature-person:last-child { grid-column: 2; }
  .report-card .signature-caption { min-height: 12mm; }
  .report-card .signature-caption p { margin: 0; }
  .report-card .signature-space { height: 22mm; }
  .report-card .signature-space .sign-img { max-width: 45mm; max-height: 20mm; }
  .report-card .signature-name { font-size: 9pt; margin: 0; }
  .report-card .no-print { display: none !important; }
}

@media print {
  .report-card .no-print,
  .report-card .mobile-cards tbody td.no-print,
  .report-card .mobile-cards thead th.no-print { display: none !important; }
  .report-recap-table th:nth-child(1) { width: 14%; }
  .report-recap-table th:nth-child(2) { width: 17%; }
  .report-recap-table th:nth-child(3) { width: 20%; }
  .report-recap-table th:nth-child(4) { width: 9%; }
  .report-recap-table th:nth-child(5) { width: 12%; }
  .report-recap-table th:nth-child(6) { width: 28%; }
}

@media print {
  .report-card .signature-group-compact { break-inside: avoid; page-break-inside: avoid; }
}

/* v22: configurable three-column letterhead with independent left/right logos. */
.report-card .report-letterhead {
  display: grid; grid-template-columns: 106px minmax(0,1fr) 106px;
  align-items: center; gap: 16px; border-bottom: 3px solid var(--text2);
  padding-bottom: 12px; margin-bottom: 20px; font-family: Arial,sans-serif;
}
.report-card .letterhead-logo-slot { display: flex; align-items: center; justify-content: center; min-width: 0; }
.report-card .letterhead-logo-slot .letter-logo { width: 106px; height: 140px; max-width: 100%; max-height: 140px; flex: none; object-fit: contain; }
.report-card .letterhead-text { min-width: 0; text-align: center; }
.report-card .letterhead p { margin: 0; }
.report-card .letterhead .letterhead-government { font-size: 20px; font-weight: 400; line-height: 1.25; text-transform: uppercase; }
.report-card .letterhead .letterhead-heading, .report-card .letterhead .letterhead-school-name { font-size: 22px; font-weight: 700; line-height: 1.2; text-transform: uppercase; margin: 0; }
.report-card .letterhead .letterhead-contact { font-size: 14px; line-height: 1.3; margin-top: 2px; overflow-wrap: anywhere; }
.report-card .letterhead .letterhead-school-name + .letterhead-contact { margin-top: 6px; }
.report-card .letterhead-email { text-decoration: underline; }
.report-card.report-header-preview { margin: 16px 0; padding: 0; border: 0; box-shadow: none; background: none; }
.report-card.report-header-preview .report-letterhead { grid-template-columns: 68px minmax(0,1fr) 68px; gap: 10px; }
.report-card.report-header-preview .letterhead-logo-slot .letter-logo { width: 68px; height: 106px; max-height: 106px; }
.report-card.report-header-preview .letterhead-government { font-size: 14px; }
.report-card.report-header-preview .letterhead-heading, .report-card.report-header-preview .letterhead-school-name { font-size: 17px; }
@media (max-width:768px) {
  .report-card .report-letterhead, .report-card.report-header-preview .report-letterhead { grid-template-columns: 44px minmax(0,1fr) 44px; gap: 8px; }
  .report-card .letterhead-logo-slot .letter-logo, .report-card.report-header-preview .letterhead-logo-slot .letter-logo { width: 44px; height: 72px; max-height: 72px; }
  .report-card .letterhead .letterhead-government { font-size: 14px; }
  .report-card .letterhead .letterhead-heading, .report-card .letterhead .letterhead-school-name, .report-card.report-header-preview .letterhead-heading, .report-card.report-header-preview .letterhead-school-name { font-size: 16px; }
}
@media print {
  /* 1. Aturan Kertas Resmi A4 */
  @page {
    size: A4 portrait;
    margin: 15mm 15mm 15mm 15mm;
  }

  /* 2. Sembunyikan SEMUA elemen navigasi, menu, sidebar, header, tombol, dan toolbar web */
  #mainSidebar,
  #sidebar,
  #sidebarBackdrop,
  header,
  #bottomNav,
  #gridMenuModal,
  .no-print,
  .print-hidden,
  nav,
  aside,
  button,
  .btn,
  form,
  input,
  select,
  .action-bar,
  .print-options,
  .toast,
  .alert,
  footer,
  #themeToggle,
  .theme-icon,
  [role="dialog"],
  #hamburgerBtn,
  #sidebarCloseBtn,
  #bottomNavMenu {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
  }

  /* 3. Reset background dan typography menjadi dokumen kedinasan resmi */
  html, body {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #000000 !important;
    font-family: 'Times New Roman', Times, Georgia, serif !important;
    font-size: 10pt !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 4. Reset wrapper flex/margin layout web */
  .min-h-screen,
  .lg\:pl-72,
  .lg\:ml-64,
  main,
  .flex-1,
  .max-w-7xl,
  body > div {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
  }

  /* 5. Lembar Dokumen Resmi */
  .report-card,
  .document-sheet {
    display: block !important;
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    font-size: 9.5pt !important;
    color: #000000 !important;
  }

  /* 6. Kop Surat Kedinasan Garis Ganda Resmi */
  .report-card .report-letterhead,
  .report-letterhead,
  .letterhead {
    display: grid !important;
    grid-template-columns: 24mm minmax(0,1fr) 24mm !important;
    gap: 4mm !important;
    border-bottom: 3px double #000000 !important;
    padding-bottom: 3.5mm !important;
    margin-bottom: 5mm !important;
    text-align: center !important;
  }
  .report-letterhead.letterhead-no-logos {
    grid-template-columns: 1fr !important;
  }
  .report-card .letterhead-logo-slot .letter-logo,
  .letter-logo {
    width: 24mm !important;
    height: 32mm !important;
    max-width: 24mm !important;
    max-height: 32mm !important;
    flex: none !important;
    object-fit: contain !important;
  }
  .report-card .letterhead .letterhead-government {
    font-size: 11pt !important;
    line-height: 1.2 !important;
    color: #000000 !important;
  }
  .report-card .letterhead .letterhead-heading,
  .report-card .letterhead .letterhead-school-name {
    font-size: 13pt !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    color: #000000 !important;
    margin: 0 !important;
  }
  .report-card .letterhead .letterhead-contact {
    font-size: 8.5pt !important;
    line-height: 1.25 !important;
    color: #000000 !important;
    margin-top: 1mm !important;
  }

  /* 7. Tabel Dokumen Kedinasan (Garis 1px Hitam Tegas) */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 8pt !important;
    font-size: 9pt !important;
    color: #000000 !important;
    page-break-inside: auto !important;
  }
  table th, table td {
    border: 1px solid #000000 !important;
    color: #000000 !important;
    padding: 3.5pt 5pt !important;
    background: transparent !important;
    vertical-align: middle !important;
    line-height: 1.35 !important;
  }
  table thead th, table th {
    background-color: #f2f2f2 !important;
    font-weight: bold !important;
    text-align: center !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 8. Hilangkan Badge Web - Tampilkan Sebagai Teks Dokumen Formal */
  .badge,
  span[class*="rounded-full"],
  span[class*="rounded-md"] {
    background: transparent !important;
    color: #000000 !important;
    border: none !important;
    padding: 0 !important;
    font-weight: bold !important;
    display: inline !important;
  }

  /* 9. Elemen Avoid Page Break & Tanda Tangan */
  .page-break-inside-avoid,
  .signature-grid,
  .report-signatures,
  tr,
  .avoid-break {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .sign-img {
    max-height: 52px !important;
    object-fit: contain !important;
  }
}

.report-card .report-letterhead.letterhead-no-logos { grid-template-columns: minmax(0,1fr) !important; }
.report-card .letterhead-no-logos .letterhead-logo-slot { display: none; }
.settings-preview-card { align-self: start; }

/* ═════════════════════════════════════════════════════════════════════
   SEARCHABLE DROPDOWN COMPONENT (Select dengan Pencarian Interaktif)
   ═════════════════════════════════════════════════════════════════════ */
.custom-searchable-select {
  position: relative;
  width: 100%;
}
.custom-searchable-select.is-open {
  z-index: 50;
}

/* Sembunyikan select asli namun tetap ada untuk form submit & validasi */
.custom-searchable-select select.ss-native-select {
  position: absolute !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 0 !important;
  opacity: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  pointer-events: none !important;
}

/* Tombol Pemicu / Trigger */
.ss-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.875rem;
  border-radius: 1rem; /* rounded-2xl */
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface2, #f8fafc);
  color: var(--text, #0f172a);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  min-height: 46px;
}
[data-theme="dark"] .ss-trigger,
html.dark .ss-trigger {
  border-color: #334155;
  background: rgba(30, 41, 59, 0.7);
  color: #f1f5f9;
}
.ss-trigger:hover {
  border-color: #94a3b8;
  background: #ffffff;
}
[data-theme="dark"] .ss-trigger:hover,
html.dark .ss-trigger:hover {
  border-color: #475569;
  background: rgba(30, 41, 59, 0.9);
}
.ss-trigger:focus,
.custom-searchable-select.is-open .ss-trigger {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #ffffff;
}
[data-theme="dark"] .ss-trigger:focus,
[data-theme="dark"] .custom-searchable-select.is-open .ss-trigger,
html.dark .ss-trigger:focus,
html.dark .custom-searchable-select.is-open .ss-trigger {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  background: #1e293b;
}

/* Validasi: Wajib dipilih jika required */
.ss-trigger.is-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

/* Label & Ikon pada Trigger */
.ss-label-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  flex: 1;
}
.ss-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 0.5rem;
  flex-shrink: 0;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}
[data-theme="dark"] .ss-icon-badge,
html.dark .ss-icon-badge {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}
.ss-selected-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ss-placeholder {
  color: #94a3b8;
  font-weight: 400;
}
[data-theme="dark"] .ss-placeholder,
html.dark .ss-placeholder {
  color: #64748b;
}

/* Tombol Reset (X) & Panah Chevron */
.ss-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.ss-clear-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ss-clear-btn:hover {
  background: #e2e8f0;
  color: #475569;
}
[data-theme="dark"] .ss-clear-btn:hover,
html.dark .ss-clear-btn:hover {
  background: #334155;
  color: #f1f5f9;
}
.custom-searchable-select.has-value .ss-clear-btn {
  display: flex;
}
.ss-arrow {
  width: 1rem;
  height: 1rem;
  color: #94a3b8;
  transition: transform 0.2s ease;
}
.custom-searchable-select.is-open .ss-arrow {
  transform: rotate(180deg);
  color: #2563eb;
}
[data-theme="dark"] .custom-searchable-select.is-open .ss-arrow,
html.dark .custom-searchable-select.is-open .ss-arrow {
  color: #60a5fa;
}

/* Menu Dropdown Popup */
.ss-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: ssFadeDown 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.custom-searchable-select.is-open .ss-dropdown {
  display: flex;
}
.ss-dropdown.ss-open-above {
  top: auto;
  bottom: calc(100% + 6px);
  animation: ssFadeUp 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ssFadeDown {
  from { opacity: 0; transform: translateY(-6px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ssFadeUp {
  from { opacity: 0; transform: translateY(6px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
[data-theme="dark"] .ss-dropdown,
html.dark .ss-dropdown {
  background: #0f172a;
  border-color: #334155;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* Header Pencarian di Dalam Dropdown */
.ss-search-wrap {
  padding: 0.625rem;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}
[data-theme="dark"] .ss-search-wrap,
html.dark .ss-search-wrap {
  border-bottom-color: #1e293b;
  background: #111827;
}
.ss-search-input-box {
  position: relative;
  display: flex;
  align-items: center;
}
.ss-search-icon {
  position: absolute;
  left: 0.625rem;
  width: 0.875rem;
  height: 0.875rem;
  color: #94a3b8;
  pointer-events: none;
}
.ss-search-input {
  width: 100%;
  padding: 0.5rem 1.875rem 0.5rem 2rem;
  border-radius: 0.75rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  transition: all 0.15s ease;
}
[data-theme="dark"] .ss-search-input,
html.dark .ss-search-input {
  border-color: #334155;
  background: #1e293b;
  color: #f8fafc;
}
.ss-search-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
[data-theme="dark"] .ss-search-input:focus,
html.dark .ss-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.ss-search-clear {
  position: absolute;
  right: 0.5rem;
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  color: #94a3b8;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
}
.ss-search-clear:hover {
  color: #475569;
}
.ss-search-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.375rem;
  padding: 0 0.25rem;
  font-size: 0.6875rem;
  color: #64748b;
  font-weight: 500;
}
[data-theme="dark"] .ss-search-info,
html.dark .ss-search-info {
  color: #94a3b8;
}

/* List Opsi */
.ss-options-list {
  max-height: 250px;
  overflow-y: auto;
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.ss-options-list::-webkit-scrollbar {
  width: 6px;
}
.ss-options-list::-webkit-scrollbar-track {
  background: transparent;
}
.ss-options-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
[data-theme="dark"] .ss-options-list::-webkit-scrollbar-thumb,
html.dark .ss-options-list::-webkit-scrollbar-thumb {
  background: #334155;
}

.ss-option {
  padding: 0.55rem 0.75rem;
  border-radius: 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: background-color 0.1s, color 0.1s;
  user-select: none;
}
[data-theme="dark"] .ss-option,
html.dark .ss-option {
  color: #cbd5e1;
}
.ss-option:hover,
.ss-option.is-highlighted {
  background-color: #f1f5f9;
  color: #0f172a;
}
[data-theme="dark"] .ss-option:hover,
[data-theme="dark"] .ss-option.is-highlighted,
html.dark .ss-option:hover,
html.dark .ss-option.is-highlighted {
  background-color: #1e293b;
  color: #f8fafc;
}
.ss-option.is-selected {
  background-color: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}
[data-theme="dark"] .ss-option.is-selected,
html.dark .ss-option.is-selected {
  background-color: rgba(30, 58, 94, 0.6);
  color: #60a5fa;
}
.ss-option-check {
  display: none;
  width: 0.875rem;
  height: 0.875rem;
  color: #2563eb;
  flex-shrink: 0;
}
[data-theme="dark"] .ss-option-check,
html.dark .ss-option-check {
  color: #60a5fa;
}
.ss-option.is-selected .ss-option-check {
  display: inline-block;
}
.ss-option mark {
  background-color: #fef08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  font-weight: 700;
}
[data-theme="dark"] .ss-option mark,
html.dark .ss-option mark {
  background-color: rgba(161, 98, 7, 0.5);
  color: #fef08a;
}

/* Empty State / Hasil Kosong */
.ss-empty {
  display: none;
  padding: 1.75rem 1rem;
  text-align: center;
}
.ss-empty-icon {
  width: 2.25rem;
  height: 2.25rem;
  margin: 0 auto 0.5rem;
  border-radius: 0.75rem;
  background: #f1f5f9;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .ss-empty-icon,
html.dark .ss-empty-icon {
  background: #1e293b;
  color: #64748b;
}
.ss-empty-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #475569;
}
[data-theme="dark"] .ss-empty-title,
html.dark .ss-empty-title {
  color: #cbd5e1;
}
.ss-empty-desc {
  font-size: 0.6875rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

