:root {
  --bg: #f3f6f7;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --text: #172126;
  --muted: #66737a;
  --line: #dde5e8;
  --primary: #0f766e;
  --primary-2: #0b5f59;
  --primary-soft: #e7f6f3;
  --warning: #b7791f;
  --warning-soft: #fff8e7;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --success: #18794e;
  --success-soft: #eaf8f1;
  --info: #2767a6;
  --info-soft: #edf5ff;
  --shadow: 0 12px 34px rgba(24, 45, 55, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mobile-only { display: none; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #edf8f6, #f4f6f7 58%, #e8f1f3); }
.login-card { width: min(440px, 100%); background: var(--surface); border: 1px solid rgba(15,118,110,.12); border-radius: 24px; padding: 34px; box-shadow: var(--shadow); }
.brand-mark { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: var(--primary); color: white; font-weight: 800; letter-spacing: .5px; margin-bottom: 18px; }
.brand-mark.small { width: 42px; height: 42px; border-radius: 12px; margin: 0; }
.eyebrow { margin: 0 0 5px; font-size: 11px; letter-spacing: .12em; font-weight: 800; color: var(--primary); }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: 34px; margin-bottom: 8px; }
h2 { font-size: 25px; margin-bottom: 0; }
h3 { font-size: 17px; margin-bottom: 8px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; line-height: 1.5; }
.error-text { min-height: 20px; color: var(--danger); font-size: 13px; }
.stack-lg { display: grid; gap: 16px; margin-top: 25px; }
label span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--text); padding: 11px 12px; outline: none; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }

.btn { border: 0; border-radius: 11px; padding: 10px 14px; font-weight: 750; transition: .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-2); }
.btn.secondary { background: var(--primary-soft); color: var(--primary-2); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.wide { width: 100%; }
.btn.small { padding: 7px 10px; font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { background: #12343a; color: #edf8f8; padding: 20px 16px; display: flex; flex-direction: column; min-height: 100vh; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 2px 4px 22px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand span { font-size: 12px; color: #a8c3c7; margin-top: 2px; }
.nav-list { display: grid; gap: 7px; }
.nav-item { text-decoration:none; cursor:pointer; border: 0; background: transparent; color: #cde0e2; text-align: left; padding: 11px 12px; border-radius: 11px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.10); color: white; }
.nav-item.disabled { opacity: .52; cursor: default; }
.nav-item.disabled:hover { background: transparent; color: #cde0e2; }
.nav-item em { margin-left: auto; font-size: 10px; font-style: normal; font-weight: 600; }
.nav-separator { height: 1px; background: rgba(255,255,255,.12); margin: 8px 4px; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; }
.user-mini { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.user-mini strong, .user-mini span { display: block; }
.user-mini strong { font-size: 12px; }
.user-mini span { font-size: 10px; margin-top: 2px; color: #a8c3c7; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.13); font-weight: 800; }
.sidebar .btn.ghost { color: white; border-color: rgba(255,255,255,.18); }

.main-area { min-width: 0; }
.topbar { min-height: 88px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); padding: 18px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-actions select { min-width: 180px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.neutral { background: #eef2f3; color: #56636a; }
.content { padding: 24px 28px 42px; max-width: 1600px; margin: 0 auto; }

.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.hero h3 { font-size: 21px; }
.hero p { margin: 0; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(5, minmax(0,1fr)); }
.grid.two { grid-template-columns: 1.25fr .75fr; }
.grid.equal { grid-template-columns: repeat(2, minmax(0,1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(24,45,55,.035); }
.card.pad { padding: 18px; }
.stat-card { padding: 17px; }
.stat-card .label { color: var(--muted); font-size: 12px; font-weight: 750; }
.stat-card .value { font-size: 28px; line-height: 1; font-weight: 850; margin: 10px 0 7px; }
.stat-card .hint { font-size: 11px; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: center; padding: 17px 18px 12px; }
.section-head h3 { margin: 0; }
.section-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

.table-wrap { overflow: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #edf1f2; font-size: 12px; vertical-align: middle; }
th { font-size: 10px; letter-spacing: .05em; color: var(--muted); background: #fbfcfc; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tr.clickable:hover { background: #f8fbfb; cursor: pointer; }
.cell-title { font-weight: 800; font-size: 12.5px; }
.cell-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }

.progress { height: 8px; border-radius: 999px; background: #ecf1f2; overflow: hidden; min-width: 110px; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.progress-row { display: grid; grid-template-columns: 115px 1fr 48px; gap: 10px; align-items: center; margin-bottom: 13px; }
.progress-row:last-child { margin-bottom: 0; }
.progress-row strong { font-size: 12px; }
.progress-row span:last-child { text-align: right; font-size: 12px; font-weight: 800; }

.alert-list { display: grid; gap: 10px; }
.alert-item { display: flex; gap: 11px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.alert-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--warning); flex: 0 0 auto; }
.alert-item.danger .alert-dot { background: var(--danger); }
.alert-item.success .alert-dot { background: var(--success); }
.alert-item strong { font-size: 12.5px; display: block; }
.alert-item span { color: var(--muted); font-size: 11px; display: block; margin-top: 3px; }

.filter-bar { padding: 14px 16px; display: grid; grid-template-columns: 1.2fr .8fr .8fr auto; gap: 10px; align-items: end; }
.filter-bar label span { font-size: 10px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }

.quota-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.quota-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.quota-box strong { display: block; font-size: 19px; }
.quota-box span { font-size: 11px; color: var(--muted); }

.school-banner { padding: 18px; background: linear-gradient(120deg, #0f766e, #145b68); border-radius: var(--radius); color: white; margin-bottom: 16px; }
.school-banner .eyebrow { color: #bcebe5; }
.school-banner h3 { margin-bottom: 5px; font-size: 22px; }
.school-banner p { margin: 0; color: #d4e8ea; }
.school-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.school-actions .btn { background: rgba(255,255,255,.14); color: white; border: 1px solid rgba(255,255,255,.14); }

.placement-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; }
.centre-list { display: grid; gap: 8px; padding: 14px; max-height: 680px; overflow: auto; }
.centre-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: white; }
.centre-row.active { border-color: rgba(15,118,110,.5); background: var(--primary-soft); }
.centre-row:hover { border-color: #a8c5c4; cursor: pointer; }
.centre-row h4 { margin: 0 0 3px; font-size: 13px; }
.centre-row p { margin: 0; color: var(--muted); font-size: 11px; }
.centre-metrics { text-align: right; }
.centre-metrics strong { display: block; font-size: 14px; }
.centre-metrics span { color: var(--muted); font-size: 10px; }

.candidate-list { display: grid; gap: 9px; padding: 14px; }
.candidate { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.candidate-head { display: flex; justify-content: space-between; gap: 10px; }
.candidate h4 { margin: 0 0 4px; font-size: 13px; }
.candidate p { margin: 0; font-size: 11px; color: var(--muted); }
.candidate-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.tag { font-size: 10px; background: #eef3f4; color: #5e696f; border-radius: 999px; padding: 4px 7px; }

.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 6px; }
.notice { border: 1px dashed #b9cbce; border-radius: 12px; padding: 12px; background: #f8fbfb; font-size: 12px; color: var(--muted); }
.notice strong { color: var(--text); }

.toast { position: fixed; right: 22px; bottom: 22px; min-width: 260px; max-width: 400px; padding: 12px 14px; border-radius: 12px; background: #153b40; color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; z-index: 100; font-size: 13px; }
.toast.show { opacity: 1; transform: translateY(0); }
.icon-btn { border: 0; background: transparent; font-size: 24px; padding: 0 8px 0 0; }

@media (max-width: 1150px) {
  .grid.stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid.two, .placement-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .mobile-only { display: inline-block; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; width: 260px; z-index: 50; transition: .2s ease; }
  .sidebar.open { left: 0; }
  .topbar { padding: 16px 18px; }
  .content { padding: 18px; }
  .grid.stats, .grid.equal { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .quota-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 560px) {
  .login-card { padding: 26px 21px; }
  .grid.stats, .grid.equal, .filter-bar, .quota-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-direction: column; align-items: stretch; }
  .top-actions select { min-width: 145px; }
  .hero { flex-direction: column; }
}

/* v2: import + component-aware data */
.component-card { cursor:pointer; transition:.15s ease; }
.component-card:hover { transform:translateY(-1px); box-shadow:0 10px 24px rgba(15,23,42,.08); }
.section-head.compact { padding:0 0 12px; border:0; }
.mini-metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:14px; }
.mini-metrics span { display:flex; flex-direction:column; gap:2px; padding:9px; border:1px solid var(--line); border-radius:10px; font-size:11px; color:var(--muted); }
.mini-metrics b { color:var(--ink); font-size:18px; }
.pad-topless { padding:0 18px 18px; }
.compact-notice { align-self:end; margin:0; min-height:42px; display:flex; align-items:center; }
.import-drop { display:grid; grid-template-columns:auto 1fr minmax(220px,360px); gap:14px; align-items:center; padding:18px; border:1px dashed #a7b6c5; border-radius:14px; background:#f8fafc; }
.import-drop input[type=file] { width:100%; padding:10px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.import-stats { margin-top:16px; }
.warning-notice { border-color:#f3c969; background:#fffaf0; }
.candidate.placed { background:#f7fbf9; }
@media (max-width:760px){ .import-drop{grid-template-columns:1fr;} .mini-metrics{grid-template-columns:1fr 1fr 1fr;} }

/* v2.1: reliable native file picker */
.import-drop { grid-template-columns:auto 1fr auto; }
.file-picker-actions { display:flex; flex-direction:column; align-items:flex-start; gap:8px; min-width:220px; }
.native-file-input { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
.file-picker-label { cursor:pointer; user-select:none; display:inline-flex; align-items:center; justify-content:center; min-width:190px; }
.selected-file-list { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.selected-file-list > span:not(.selected-file) { color:var(--muted); font-size:12px; }
.selected-file { display:inline-flex; gap:8px; align-items:center; padding:7px 9px; background:#fff; border:1px solid var(--line); border-radius:9px; font-size:12px; max-width:100%; }
.selected-file b { max-width:360px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.selected-file small { color:var(--muted); white-space:nowrap; }
@media (max-width:760px){ .import-drop{grid-template-columns:1fr;} .file-picker-actions{min-width:0;width:100%;} .file-picker-label{width:100%;} }

/* v2.2 navigation + import reliability */
.build-tag{font-size:10px;color:#86a9ad;text-align:center;margin:0 0 8px;letter-spacing:.04em;}
.native-file-input-v22{display:block;width:100%;max-width:260px;font-size:12px;color:var(--muted);}
.native-file-input-v22::file-selector-button{margin-right:8px;padding:7px 9px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);cursor:pointer;}

/* v2.5: bulk placement + auto draft */
.info-notice { border-color:#a9cbe8; background:var(--info-soft); color:#4e6578; }
.distance-input { min-width:110px; max-width:135px; padding:8px 9px; }
.candidate-select-wrap { display:flex; gap:10px; align-items:flex-start; min-width:0; }
.candidate-actions { display:flex; gap:7px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.bulk-check { width:18px; height:18px; margin-top:2px; accent-color:var(--primary); flex:0 0 auto; }
.candidate-locked { background:#fffaf0; border-color:#ead39a; }
.btn:disabled { cursor:not-allowed; opacity:.48; transform:none !important; }
.criteria-grid { display:grid; gap:12px; }
.check-row { display:grid; grid-template-columns:auto 1fr; gap:10px; align-items:flex-start; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.check-row input { width:18px; height:18px; margin-top:2px; accent-color:var(--primary); }
.check-row span { display:block; margin:0; text-transform:none; letter-spacing:0; color:var(--text); font-size:13px; }
.check-row b { display:block; margin-bottom:3px; }
.check-row small { display:block; color:var(--muted); font-size:11px; line-height:1.45; font-weight:500; }
.draft-component-select { margin:-2px 0 16px; max-width:360px; padding:12px 14px !important; box-shadow:none; }
.draft-component-select label span { margin-bottom:6px; }
@media (max-width:700px){ .candidate-head{flex-direction:column;} .candidate-actions{justify-content:flex-start;} }

/* v2.6: placement workspace */
.placement-hero { margin-bottom: 14px; }
.placement-top-filters { padding: 14px 16px; display:grid; grid-template-columns: 1fr 1fr .8fr auto; gap:10px; align-items:end; }
.placement-top-filters label span,
.candidate-filter-grid label span { font-size:10px; text-transform:uppercase; color:var(--muted); letter-spacing:.05em; }
.placement-workspace { display:grid; grid-template-columns:minmax(300px,.9fr) minmax(420px,1.25fr) minmax(300px,.85fr); gap:16px; align-items:start; }
.placement-column { min-width:0; }
.candidate-panel, .placement-summary-panel { overflow:hidden; }
.candidate-scroll, .placed-scroll { max-height:650px; overflow:auto; }
.candidate-filter-grid { display:grid; grid-template-columns:1.4fr .8fr .75fr .8fr; gap:8px; padding:0 14px 12px; border-bottom:1px solid var(--line); }
.bulk-toolbar { margin:0 14px 12px; padding:12px; border:1px solid #a9cbe8; background:var(--info-soft); border-radius:12px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.bulk-toolbar > div:first-child { display:flex; flex-direction:column; gap:2px; }
.bulk-toolbar > div:first-child strong { font-size:11px; color:var(--info); letter-spacing:.04em; }
.bulk-toolbar > div:first-child span { font-size:12px; color:var(--muted); }
.bulk-toolbar-actions { display:flex; gap:7px; flex-wrap:wrap; align-items:center; }
.bulk-toolbar-actions select { width:auto; min-width:160px; padding:7px 9px; font-size:12px; }
.summary-strip { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:12px; }
.summary-strip span { display:flex; flex-direction:column; gap:2px; padding:10px; border:1px solid var(--line); border-radius:10px; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.04em; background:var(--surface-2); }
.summary-strip b { color:var(--text); font-size:20px; line-height:1.1; }
.compact-quota { grid-template-columns:repeat(2,minmax(0,1fr)); }
.placement-card-actions { justify-content:flex-start; margin-top:10px; }
.placement-locked { border-color:#e4c36d; background:#fffaf0 !important; }
.tag-warning { background:var(--warning-soft); color:var(--warning); }
.tag-lock { background:#fff3d6; color:#8a6115; }
@media (max-width:1280px){ .placement-workspace{grid-template-columns:minmax(280px,.85fr) minmax(390px,1.15fr);} .placement-summary-panel{grid-column:1/-1;} .placed-scroll{max-height:360px;} }
@media (max-width:900px){ .placement-top-filters{grid-template-columns:1fr 1fr;} .placement-workspace{grid-template-columns:1fr;} .placement-summary-panel{grid-column:auto;} .candidate-filter-grid{grid-template-columns:1fr 1fr;} }
@media (max-width:560px){ .placement-top-filters,.candidate-filter-grid{grid-template-columns:1fr;} .bulk-toolbar{align-items:stretch;} .bulk-toolbar-actions{display:grid;grid-template-columns:1fr 1fr;} .bulk-toolbar-actions select,.bulk-toolbar-actions .btn{width:100%;} }


/* v2.6.2 - Carian Petugas */
.staff-search-card label{display:grid;gap:7px;max-width:760px}.staff-search-card input{font-size:16px;padding:13px 14px}.search-help{display:flex;gap:18px;flex-wrap:wrap;margin-top:10px;color:var(--muted);font-size:13px}.profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}.profile-grid>div{border:1px solid var(--line);border-radius:12px;padding:11px 12px;background:var(--soft)}.profile-grid span{display:block;color:var(--muted);font-size:12px;margin-bottom:4px}.profile-grid strong{font-size:14px;word-break:break-word}@media(max-width:720px){.profile-grid{grid-template-columns:1fr}}
