/* SIDIK LN — Minimalist modern, palet hijau TNI AD */
:root {
  --ground: #F4F5EF;
  --surface: #FFFFFF;
  --surface-2: #FBFBF8;
  --line: #E1E4D8;
  --line-2: #ECEEE5;
  --input-line: #D5DAC8;
  --ink: #1B2112;
  --ink-2: #3B4233;
  --muted: #5A6150;
  --muted-2: #8C9480;
  --green-900: #26311A;
  --green-800: #313F20;
  --green-700: #34431F;
  --green-650: #3B4A24;
  --green-600: #4B5B2A;
  --green-300: #A9B48C;
  --green-100: #E3EBD3;
  --green-50: #EEF1E4;
  --olive-text: #5A6A2E;
  --gold: #D9B85C;
  --gold-soft: #F1E3B5;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45; }
a { color: var(--green-700); }
a:hover { color: var(--ink); }
img, svg { flex-shrink: 0; }
h1, h2, h3 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-weight: 500; }
.muted { color: var(--muted); }

/* ---------- Layout ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--green-900); color: #E9ECDF;
  padding: 24px 16px; display: flex; flex-direction: column; gap: 28px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__logo { width: 40px; height: 40px; border-radius: 10px; background: var(--green-650); display: flex; align-items: center; justify-content: center; }
.brand__name { font-weight: 800; font-size: 17px; letter-spacing: .04em; display: block; }
.brand__sub { font-size: 12px; color: #B9C1A8; display: block; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: var(--radius-sm);
  color: #D3D9C4; text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--green-800); color: #fff; }
.nav a[aria-current="page"] { background: var(--green-650); color: #fff; font-weight: 600; }
.user-card { margin-top: auto; padding: 14px; border-radius: 12px; background: var(--green-800); display: flex; align-items: center; gap: 12px; }
.user-card form { margin-left: auto; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0; background: var(--green-100); color: #33461A;
}
.avatar--gold { background: var(--gold); color: var(--green-900); }
.avatar--lg { width: 56px; height: 56px; font-size: 18px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid #DDE1D2; background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink);
}
.icon-btn--dark { background: transparent; border-color: transparent; color: #D3D9C4; }
.icon-btn--dark:hover { background: var(--green-650); color: #fff; }

.main { flex: 1; min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 48px; display: flex; flex-direction: column; gap: 24px; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }

/* Mobile chrome (disembunyikan di desktop) */
.m-header, .bottom-nav, .fab { display: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--olive-text); letter-spacing: .08em; text-transform: uppercase; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.01em; margin-top: 4px; }
.page-lead { margin: 6px 0 0; font-size: 15px; color: var(--muted); max-width: 640px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.search {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; background: var(--surface);
  border: 1px solid #DDE1D2; border-radius: var(--radius-sm); min-width: 260px; flex: 1 1 260px;
}
.search input { border: 0; outline: none; background: transparent; font: inherit; color: var(--ink); width: 100%; }
.search:focus-within { outline: 2px solid var(--green-600); outline-offset: 1px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-sm); font: inherit; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer;
  border: 1px solid #C9CFBA; background: var(--surface); color: var(--ink);
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn--primary { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.btn--primary:hover { background: var(--green-900); color: #fff; }
.btn--danger { color: #8A2E14; border-color: #E8C2B5; }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn--block { width: 100%; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card__pad { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card__head { padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--line-2); }
.card__title { font-size: 16px; font-weight: 700; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--green-300); color: inherit; }
.kpi__label { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi__value { font-size: 40px; font-weight: 800; line-height: 1; }
.kpi__hint { font-size: 13px; color: var(--muted); }
.kpi--primary { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.kpi--primary .kpi__label, .kpi--primary .kpi__hint { color: #D3D9C4; }

/* Split layout */
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split__main { flex: 999 1 620px; min-width: 0; }
.split__side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* Pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 99px; font-size: 13px; font-weight: 600;
  text-decoration: none; border: 1px solid #DDE1D2; background: var(--surface); color: var(--ink-2); white-space: nowrap;
}
.pill:hover { border-color: var(--green-600); color: var(--ink); }
.pill[aria-current="true"] { background: var(--green-700); border-color: var(--green-700); color: #fff; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink); }
.badge--berlangsung, .badge--hijau { background: var(--green-100); color: #33461A; }
.badge--persiapan, .badge--kuning { background: #FBF0D6; color: #7A5A0E; }
.badge--selesai, .badge--abu { background: #E6E8EC; color: #3F4654; }
.badge--belum_lapor, .badge--merah { background: #F9E1D9; color: #8A2E14; }

/* Table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; min-width: 760px; border-collapse: collapse; }
.table th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; padding: 12px; }
.table td { padding: 14px 12px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table tbody tr:hover { background: var(--surface-2); }
.person { display: flex; align-items: center; gap: 12px; }
.person__name { font-weight: 600; color: var(--ink); text-decoration: none; display: block; }
.person__name:hover { text-decoration: underline; }
.sub { font-size: 12px; color: var(--muted); display: block; }
.strong { font-weight: 500; display: block; }
.nowrap { white-space: nowrap; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }

/* Mobile card list (pengganti tabel) */
.card-list { display: none; flex-direction: column; gap: 10px; padding: 12px; }
.m-item { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); }
.m-item:hover { color: var(--ink); border-color: var(--green-300); }
.m-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.m-item__title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-item__sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.m-item .badge { max-width: 100%; padding: 3px 8px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }

/* Bars */
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-row__label { display: flex; justify-content: space-between; font-size: 13px; }
.bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--green-600); }
.bar--muted > span { background: var(--green-300); }

/* Date chip list */
.date-item { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); }
.date-chip { width: 48px; height: 52px; border-radius: var(--radius-sm); background: var(--ground); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.date-chip small { font-size: 11px; font-weight: 600; color: var(--olive-text); }
.date-chip b { font-size: 18px; font-weight: 800; line-height: 1.1; }

/* ---------- Forms ---------- */
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.stepper a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; }
.stepper a:hover { border-color: var(--green-300); }
.stepper .num { width: 28px; height: 28px; border-radius: 50%; background: var(--green-100); color: #33461A; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.stepper a.is-done { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.stepper a.is-done .num { background: var(--gold); color: var(--green-900); }

.form-stack { display: flex; flex-direction: column; gap: 20px; }
fieldset.section { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 24px; display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 16px; min-width: 0; }
fieldset.section legend { padding: 0 8px; font-size: 16px; font-weight: 700; }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field > label, .field__label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .req { color: #8A2E14; }
.field input:not([type="radio"]):not([type="checkbox"]):not([type="file"]), .field select, .field textarea {
  height: 46px; padding: 0 14px; border: 1px solid var(--input-line); border-radius: var(--radius-sm); background: var(--surface-2);
  font: inherit; font-size: 14px; color: var(--ink); width: 100%;
}
.field textarea { height: auto; padding: 12px 14px; resize: vertical; }
.field select { padding: 0 12px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--green-600); outline-offset: 1px; border-color: var(--green-600); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #B5482A; background: #FFF8F5; }
.errorlist { list-style: none; margin: 0; padding: 0; font-size: 12px; color: #8A2E14; font-weight: 500; }
.help { font-size: 12px; color: var(--muted); }
/* Kotak "tambah baru" di bawah dropdown jenis/negara. Aturan [hidden] wajib:
   display:flex akan menimpa display:none bawaan atribut hidden. */
.field-tambah { display: flex; flex-direction: column; gap: 6px; }
.field-tambah[hidden] { display: none; }

/* Barisan calon peserta pada form penawaran */
.calon-list { display: flex; flex-direction: column; gap: 14px; }
.calon-baris { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--ground); }
.calon-baris > .btn { align-self: flex-start; }
.calon-hapus { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; font-weight: 600; color: #8A2E14; cursor: pointer; }
.calon-hapus input { width: 18px; height: 18px; cursor: pointer; }

/* Chip radio (Jenis pendidikan) */
.chip-group > div, .chip-group ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chip-group label { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--input-line); background: var(--surface-2); color: var(--ink-2); font-weight: 600; cursor: pointer; }
.chip-group input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip-group label:has(input:checked) { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.chip-group label:has(input:focus-visible) { outline: 2px solid var(--green-600); outline-offset: 2px; }

/* Upload */
.uploads { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.upload { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border: 1.5px dashed #B9C1A8; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.upload:hover { border-color: var(--green-600); }
.upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload:focus-within { outline: 2px solid var(--green-600); outline-offset: 2px; }
.upload__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.upload__title { font-weight: 600; }
.upload__file { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload.has-file { border-style: solid; border-color: var(--green-600); background: var(--green-50); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.checklist li.is-done { color: var(--ink); }
.checklist .ic-done { display: none; }
.checklist li.is-done .ic-done { display: block; }
.checklist li.is-done .ic-todo { display: none; }
.note-card { background: var(--green-50); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.note-card h2 { font-size: 15px; color: var(--green-900); }
.note-card p { margin: 0; line-height: 1.55; color: var(--ink-2); }

/* Detail */
.profile { background: var(--green-700); color: #fff; border-radius: 18px; padding: 22px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.profile__who { display: flex; gap: 16px; align-items: center; min-width: 0; }
.profile__name { font-size: 20px; font-weight: 800; }
.profile__meta { font-size: 13px; color: #D3D9C4; }
.profile__progress { flex: 1 1 280px; max-width: 420px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: #D3D9C4; }
.profile__progress .bar { background: var(--green-600); }
.profile__progress .bar > span { background: var(--gold); }
.dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 16px; }
.dl > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dl dt { font-size: 12px; color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.dl .span-all { grid-column: 1 / -1; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.timeline li { display: flex; gap: 12px; }
.timeline .dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--green-600); flex-shrink: 0; }
.timeline .dot--open { background: transparent; border: 2px solid var(--muted-2); }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.doc-row:first-child { border-top: 0; }
.doc-row__body { flex: 1; min-width: 0; }
.alert-box { border-radius: 12px; padding: 14px 16px; background: #F9E1D9; color: #6E2510; }

/* Messages */
.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 12px 16px; border-radius: 12px; font-weight: 500; background: var(--green-100); color: #26341A; }
.messages li.error { background: #F9E1D9; color: #6E2510; }
.messages li.warning { background: #FBF0D6; color: #5E450B; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 16px 20px; border-top: 1px solid var(--line-2); }

/* Filters */
.filters { display: grid; grid-template-columns: 2fr repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.filters--empat { grid-template-columns: 2fr repeat(4, minmax(0, 1fr)) auto; }
.filters .field input, .filters .field select { height: 44px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--green-900); }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .field--search { grid-column: 1 / -1; }
}

@media (max-width: 1023px) {
  .sidebar { display: none; }
  .m-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 20;
    background: var(--green-900); color: #fff; padding: 10px 16px; min-height: 60px;
  }
  .bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(10px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px; padding: 0 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
  .bottom-nav a[aria-current="page"] { color: var(--green-700); font-weight: 700; }
  .fab {
    display: flex; position: fixed; right: 20px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 21; width: 56px; height: 56px;
    border-radius: 16px; background: var(--green-700); color: #fff; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(38,49,26,.28);
  }
  .fab:hover { color: #fff; background: var(--green-900); }
  .app { flex-direction: column; }
  .main { padding: 20px 16px 120px; gap: 18px; }
  .hide-mobile { display: none !important; }
}

@media (max-width: 720px) {
  .page-title { font-size: 22px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; gap: 6px; border-radius: 14px; }
  .kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi__value { font-size: 26px; }
  .kpi__hint { display: none; }
  .table-wrap.responsive { display: none; }
  .card-list { display: flex; }
  .pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .card__head { padding: 16px; }
  fieldset.section { padding: 18px 16px; }
  .form-actions .btn { flex: 1; }
  .filters { grid-template-columns: 1fr; }
  .search { min-width: 0; }
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stepper a { padding: 10px; font-size: 13px; }
  .no-fab .fab { display: none; }
}
