/* ==================================================================
   Floral Sampling — tema putih & netral
   ================================================================== */
:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --soft: #f1f2f4;
  --border: #e6e7ea;
  --border-strong: #d4d6db;
  --ink: #16181d;
  --ink-2: #343a46;
  --muted: #6d7280;
  --accent: #1f2430;
  --accent-hover: #333a49;
  --blue: #1d4ed8;
  --green: #15803d;
  --amber: #b45309;
  --orange: #c2410c;
  --red: #b91c1c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -18px rgba(16, 24, 40, .25);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }

/* ---------------- Layout ---------------- */
.layout { min-height: 100vh; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 238px; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 12px 12px;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 2px 6px; border-radius: 10px; }
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; overflow: hidden;
}
.brand-mark.lg { width: 46px; height: 46px; flex-basis: 46px; border-radius: 13px; }
.brand-mark.has-logo { background: #fff; border: 1px solid var(--border); }
.brand-logo { width: 100%; height: 100%; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 14.5px; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-close { display: none; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px;
  color: var(--ink-2); font-weight: 500; font-size: 13.5px;
}
.nav-link .ico { color: var(--muted); flex: 0 0 auto; }
.nav-link:hover { background: var(--soft); }
.nav-link.is-active { background: var(--accent); color: #fff; }
.nav-link.is-active .ico { color: #fff; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: #fdecec; color: var(--red);
  font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.nav-link.is-active .nav-badge { background: rgba(255,255,255,.2); color: #fff; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px 4px; }
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-meta strong { font-size: 12.8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: var(--muted); font-size: 11px; }
.user-chip .icon-btn { margin-left: auto; }
.foot-guide {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
  padding: 8px 9px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--ink-2);
  font-size: 12.6px; font-weight: 600;
}
.foot-guide .ico { color: var(--muted); flex: 0 0 auto; }
.foot-guide:hover { background: var(--soft); border-color: var(--border-strong); }
.foot-guide.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.foot-guide.is-active .ico { color: #fff; }
.foot-links { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 11.5px; padding: 6px 6px 0; }
.foot-links a:hover { text-decoration: underline; }
.scrim { display: none; }

.avatar {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 999px;
  background: var(--soft); color: var(--ink-2); border: 1px solid var(--border);
  display: inline-grid; place-items: center; font-weight: 700; font-size: 12.5px;
}
.avatar.sm { width: 26px; height: 26px; flex-basis: 26px; font-size: 11px; }

.main { margin-left: 238px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: none; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-weight: 650; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-user { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.hamburger { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--soft); cursor: pointer; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); border: 0; background: transparent; cursor: pointer; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }

.content { padding: 24px 26px 36px; width: 100%; max-width: 1500px; }
.app-footer { padding: 14px 26px 22px; color: var(--muted); font-size: 11.5px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; letter-spacing: -.4px; font-weight: 700; }
.page-sub { color: var(--ink-2); font-size: 12.8px; margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 13px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13px;
  cursor: pointer; line-height: 1.2; white-space: nowrap; min-height: 36px;
}
.btn:hover { background: var(--soft); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: #ecfdf3; border-color: #b7e4c7; color: #146c37; }
.btn-success:hover { background: #dcfce7; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--soft); }
.btn-danger { background: #fef2f2; border-color: #f3c6c6; color: var(--red); }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 5px 9px; font-size: 12px; min-height: 30px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn .ico { flex: 0 0 auto; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; min-width: 0;
}
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 14.5px; font-weight: 700; letter-spacing: -.1px; }
.card-sub { color: var(--ink-2); font-size: 12.3px; margin-top: 2px; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card-flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.card .card + .card { margin-top: 0; }

/* ---------------- KPI ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 14px; box-shadow: var(--shadow); min-width: 0; position: relative; overflow: hidden;
}
a.kpi:hover { border-color: var(--border-strong); }
.kpi::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: transparent; }
.kpi.tone-over::after { background: #dc2626; }
.kpi.tone-warn::after { background: #f59e0b; }
.kpi.tone-ok::after { background: #16a34a; }
.kpi.tone-info::after { background: #2563eb; }
.kpi-top { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.kpi-label { font-size: 11.6px; font-weight: 600; letter-spacing: .1px; text-transform: uppercase; }
.kpi-value { font-size: 25px; font-weight: 750; letter-spacing: -.7px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 11.6px; margin-top: 1px; }

/* ---------------- Filters ---------------- */
.filter-bar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.filter-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filter-form .field { flex: 1 1 150px; min-width: 130px; margin: 0; }
.filter-form .field-search { flex: 2 1 220px; }
.filter-form .filter-actions { display: flex; gap: 8px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  background: var(--soft); border: 1px solid var(--border); font-size: 11.8px; color: var(--ink-2); font-weight: 600;
}
.chip .ico { color: var(--muted); }
.chip-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-active .ico { color: #fff; }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .col-span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field-label { font-size: 12.3px; font-weight: 650; color: var(--ink-2); }
.field .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; padding: 8px 10px; min-height: 38px;
  border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface);
  font-size: 13.5px; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 36, 48, .08); }
.textarea { min-height: 76px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236d7280' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.hint { color: var(--muted); font-size: 11.5px; }
.field-error { color: var(--red); font-size: 11.5px; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: #e7a3a3; background: #fffafa; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { flex: 1 1 130px; margin: 0; }
input[type="file"] { font-size: 12.5px; padding: 6px; min-height: 38px; width: 100%; border: 1px dashed var(--border-strong); border-radius: 9px; background: var(--surface-2); }
input[type="file"]::file-selector-button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 7px; padding: 5px 9px; font-size: 12px; font-weight: 600; margin-right: 8px; cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; padding: 8px 0; }
.check input { width: 17px; height: 17px; margin: 1px 0 0; flex: 0 0 17px; accent-color: var(--accent); }
.switch-row { display: flex; align-items: center; gap: 7px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 13px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--soft); border-radius: 9px; border: 1px solid var(--border); }
.segmented a { padding: 5px 11px; border-radius: 7px; font-size: 12.3px; font-weight: 650; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; }
.segmented a.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.08); }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; line-height: 1.45; white-space: nowrap;
  background: var(--soft); color: var(--ink-2); border: 1px solid transparent;
}
.st-belum { background: #f2f3f5; color: #4b5563; }
.st-bahan { background: #fef3c7; color: #92400e; }
.st-proses { background: #dbeafe; color: #1d4ed8; }
.st-review { background: #ede9fe; color: #5b21b6; }
.st-revisi { background: #ffedd5; color: #c2410c; }
.st-approved { background: #d1fae5; color: #047857; }
.st-siap { background: #ccfbf1; color: #0f766e; }
.st-batal { background: #f3f4f6; color: #9ca3af; text-decoration: line-through; }
.st-fbelum { background: #f6f7f8; color: #6b7280; border-color: var(--border); }
.st-fsiap { background: #e0f2fe; color: #0369a1; }
.st-fselesai { background: #dcfce7; color: #15803d; }
.cp-raya { background: #eef0f4; color: #1f2430; border-color: #dcdfe6; }
.cp-daily { background: #f7f7f8; color: #5b6270; border-color: var(--border); }
.pr-tinggi { background: #fee2e2; color: #b91c1c; }
.pr-normal { background: #f2f3f5; color: #4b5563; }
.pr-rendah { background: #f7f7f8; color: #6b7280; }

/* Deadline indicator */
.dl { display: inline-flex; align-items: center; gap: 5px; font-size: 11.8px; font-weight: 700; white-space: nowrap; }
.dl .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.dl-aman { color: #15803d; }
.dl-dekat { color: #a16207; }
.dl-hariini { color: #c2410c; }
.dl-lewat { color: #b91c1c; }
.dl-selesai { color: #6b7280; }
.dl-none { color: #9ca3af; }
.dl-date { font-size: 11.5px; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.dl-cell { display: flex; flex-direction: column; gap: 1px; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow: auto; max-height: calc(100vh - 250px); border-radius: var(--radius); }
.table-wrap.auto { max-height: none; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
table.data thead th + th { border-left: 1px solid var(--border); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:hover td { background: #fafbfc; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data th.num, table.data td.num, table.data th.text-right, table.data td.text-right {
  text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
table.data tfoot td { padding: 10px 12px; font-weight: 700; border-top: 2px solid var(--border-strong); background: var(--surface-2); }
table.data.compact td, table.data.compact th { padding: 8px 10px; }
table.data .cell-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
table.data .cell-main .name { font-weight: 650; color: var(--ink); }
table.data .cell-main .sub { color: var(--muted); font-size: 11.5px; }
table.data .sub-line { color: var(--muted); font-size: 11.5px; }
.table-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.quick-select { min-height: 30px; padding: 4px 24px 4px 7px; font-size: 11.8px; border-radius: 7px; border: 1px solid var(--border-strong); background-color: var(--surface); }
.cell-product { min-width: 190px; }

/* ---------------- Thumbs & photos ---------------- */
.thumb { display: block; border-radius: 8px; overflow: hidden; background: var(--soft); border: 1px solid var(--border); flex: 0 0 auto; }
.thumb.sm { width: 38px; height: 38px; }
.thumb.md { width: 56px; height: 56px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-empty { display: grid; place-items: center; color: #b0b4bd; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.photo-card { margin: 0; min-width: 0; }
.photo-box { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-zoom { display: block; width: 100%; height: 100%; }
.photo-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #a1a5ae; font-size: 12px; }
.photo-broken { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; text-align: center; color: #9a5b00; font-size: 11.6px; line-height: 1.5; }
.photo-broken strong { color: #8a4b00; font-size: 12.4px; }
.photo-box-broken { background: #fffbeb; border-color: #fcd34d; }
.thumb .photo-broken { display: none; }
.photo-card figcaption { margin-top: 6px; font-size: 12px; color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(14, 16, 20, .86); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(100%, 1100px); max-height: 82vh; border-radius: 10px; object-fit: contain; background: #fff; }
.lb-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 999px; border: 0; background: rgba(255,255,255,.92); color: #111; cursor: pointer; display: grid; place-items: center; }
.lb-caption { color: #e9eaee; margin-top: 10px; font-size: 12.5px; }

/* ---------------- Alerts / empty ---------------- */
.alert { display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; border: 1px solid var(--border); background: var(--surface); }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert .ico { flex: 0 0 auto; margin-top: 1px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 34px 16px; color: var(--muted); }
.empty strong { color: var(--ink-2); font-size: 13.5px; }
.empty p { font-size: 12.3px; max-width: 380px; }
.empty .ico { color: #b7bac1; }
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 12.3px; color: var(--ink-2); margin-bottom: 14px; }
.notice .ico { flex: 0 0 auto; margin-top: 1px; color: var(--muted); }

/* ---------------- Lists (dashboard) ---------------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }
.list-main { flex: 1; min-width: 0; }
.list-main .name { font-weight: 650; font-size: 13px; }
.list-main .sub { color: var(--muted); font-size: 11.6px; }
.list-side { text-align: right; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; flex: 0 0 auto; }
.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.metric { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.metric-label { color: var(--muted); font-size: 11.3px; font-weight: 600; text-transform: uppercase; letter-spacing: .2px; }
.metric-value { font-size: 18px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* Progress bars */
.bar { height: 7px; border-radius: 999px; background: var(--soft); overflow: hidden; width: 100%; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bar.tone-ok > span { background: #16a34a; }
.bar.tone-warn > span { background: #f59e0b; }
.bar.tone-over > span { background: #dc2626; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .bar { flex: 1; }
.bar-pct { font-size: 12px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }
.camp-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.camp-row:last-child { border-bottom: 0; }
.camp-name { width: 150px; min-width: 0; font-size: 12.8px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp-count { font-size: 11.6px; color: var(--muted); white-space: nowrap; }

/* ---------------- Kanban ---------------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kb-col { flex: 0 0 268px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-width: 0; }
.kb-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 10px; }
.kb-head .cnt { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.kb-cards { display: flex; flex-direction: column; gap: 8px; }
.kb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 7px; }
.kb-card:hover { border-color: var(--border-strong); }
.kb-card-top { display: flex; gap: 8px; align-items: flex-start; }
.kb-title { font-weight: 650; font-size: 13px; line-height: 1.35; flex: 1; min-width: 0; }
.kb-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 11.5px; color: var(--muted); }
.kb-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-top: 1px solid var(--border); padding-top: 7px; }
.kb-foot form { display: flex; }

/* ---------------- Timeline / Gantt ---------------- */
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg-bar { width: 18px; height: 8px; border-radius: 3px; background: #94a3b8; display: inline-block; }
.lg-bar.ok { background: #16a34a; }
.lg-bar.warn { background: #f59e0b; }
.lg-bar.late { background: #dc2626; }
.lg-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; background: #2563eb; }
.lg-tri { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid #7c3aed; display: inline-block; }
.gantt-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.gantt-inner { min-width: var(--gw, 900px); }
.g-head { display: grid; grid-template-columns: 190px repeat(var(--days, 30), minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--border-strong); position: sticky; top: 0; z-index: 3; }
.g-head .g-name-head { position: sticky; left: 0; z-index: 4; background: var(--surface-2); padding: 8px 10px; font-size: 11.3px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--ink-2); border-right: 1px solid var(--border-strong); }
.g-day { padding: 5px 2px; text-align: center; font-size: 10.6px; color: var(--muted); line-height: 1.25; border-left: 1px solid var(--border); }
.g-day b { display: block; font-size: 11.6px; color: var(--ink-2); font-weight: 700; }
.g-day.we { background: #f4f5f7; }
.g-day.today { background: #fff7ed; }
.g-day.today b { color: #c2410c; }
.g-row { display: grid; grid-template-columns: 190px 1fr; border-bottom: 1px solid var(--border); }
.g-row:last-child { border-bottom: 0; }
.g-name { position: sticky; left: 0; z-index: 2; background: var(--surface); padding: 8px 10px; border-right: 1px solid var(--border); min-width: 0; }
.g-row:hover .g-name { background: var(--surface-2); }
.g-name .nm { font-weight: 650; font-size: 12.6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-name .mt { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-track { position: relative; min-height: 46px; background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / var(--days, 30) - 1px), var(--border) calc(100% / var(--days, 30) - 1px), var(--border) calc(100% / var(--days, 30))); }
.g-bar { position: absolute; top: 11px; height: 12px; border-radius: 4px; background: #64748b; display: block; min-width: 4px; }
.g-bar.ok { background: #34a853; }
.g-bar.warn { background: #f59e0b; }
.g-bar.late { background: #dc2626; }
.g-bar.done { background: #94a3b8; }
.g-bar:hover { filter: brightness(1.08); }
.g-bar-label { position: absolute; top: 24px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.g-mark { position: absolute; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid #7c3aed; transform: translateX(-50%); top: 4px; }
.g-mark.foto { width: 8px; height: 8px; border: 0; border-radius: 999px; background: #0ea5e9; top: 5px; transform: translateX(-50%); }
.g-mark.selesai { width: 10px; height: 10px; border: 0; border-radius: 999px; background: #16a34a; top: 4px; transform: translateX(-50%); box-shadow: 0 0 0 2px #fff; }
.g-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #f97316; opacity: .5; pointer-events: none; }

/* ---------------- Detail ---------------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.info-item { min-width: 0; }
.info-label { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 650; }
.info-value { font-size: 13.3px; font-weight: 600; margin-top: 2px; word-break: break-word; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.breadcrumb a:hover { text-decoration: underline; }
.quick-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.quick-bar .btn { min-height: 42px; }
.timeline-feed { display: flex; flex-direction: column; gap: 0; }
.feed-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.feed-item:last-child { border-bottom: 0; }
.feed-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--border-strong); margin-top: 6px; flex: 0 0 8px; }
.feed-main { min-width: 0; flex: 1; }
.feed-title { font-size: 12.8px; font-weight: 650; }
.feed-sub { font-size: 11.8px; color: var(--muted); word-break: break-word; }
.feed-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.rev-card { border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; background: var(--surface-2); }
.rev-card + .rev-card { margin-top: 8px; }
.rev-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.rev-no { font-weight: 700; font-size: 12.8px; }
.rev-detail { font-size: 12.8px; color: var(--ink-2); white-space: pre-line; }
.rev-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.issue-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.issue-row:last-child { border-bottom: 0; }
.issue-main { flex: 1; min-width: 0; }
.issue-title { font-size: 12.9px; font-weight: 600; }
.issue-sub { font-size: 11.8px; color: var(--muted); }
.issue-done .issue-title { color: var(--muted); text-decoration: line-through; font-weight: 500; }
.bahan-item { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.bahan-item:last-child { border-bottom: 0; }
.bahan-item .nm { flex: 1; min-width: 0; font-size: 12.9px; }
.bahan-item.is-siap .nm { color: var(--ink); }
.bahan-item .mini-form { display: inline-flex; }
.pill-toggle { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 3px 9px; cursor: pointer; color: var(--muted); }
.pill-toggle.on { background: #ecfdf3; border-color: #b7e4c7; color: #146c37; }
.status-locked { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 38px; padding: 7px 10px; border: 1px dashed var(--border-strong); border-radius: 9px; background: var(--surface-2); }
.status-locked .hint { font-size: 11.4px; }
.validasi-list { display: grid; gap: 2px; }
.validasi-list .check { padding: 5px 0; font-size: 12.8px; }
.validasi-ok { color: #146c37; font-weight: 650; }
.approval-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 11px 12px; font-size: 12.6px; color: #14532d; }
.approval-box strong { display: block; font-size: 12.2px; text-transform: uppercase; letter-spacing: .3px; }

/* ---------------- Panduan ---------------- */
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.toc a {
  display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2);
  font-size: 12px; font-weight: 600;
}
.toc a:hover { background: var(--soft); border-color: var(--border-strong); }
.steps { display: flex; flex-direction: column; gap: 12px; }
.step {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px;
  padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
}
.step-no {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 750; font-size: 14px; font-variant-numeric: tabular-nums;
}
.step h3 { font-size: 13.6px; font-weight: 700; margin-bottom: 5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.step-text { font-size: 13px; color: var(--ink-2); line-height: 1.62; }
.step-text a { font-weight: 650; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.step-text a:hover { text-decoration-color: var(--ink); }
.step-note { font-size: 12.1px; color: var(--muted); margin-top: 6px; }
.guide-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--ink-2); line-height: 1.62; }
.guide-list li::marker { color: var(--muted); }
.guide-list a { font-weight: 650; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.faq details { border-bottom: 1px solid var(--border); padding: 11px 0; }
.faq details:last-child { border-bottom: 0; padding-bottom: 0; }
.faq summary {
  cursor: pointer; font-weight: 650; font-size: 13.2px; color: var(--ink);
  list-style: none; display: flex; align-items: flex-start; gap: 8px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+"; flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px;
  display: grid; place-items: center; border-radius: 6px; background: var(--soft);
  color: var(--ink-2); font-weight: 700; font-size: 13px; line-height: 1;
}
.faq details[open] summary::before { content: "−"; }
.faq details p { margin: 7px 0 0 26px; font-size: 12.9px; color: var(--ink-2); line-height: 1.65; }
.faq details p a { font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }

/* ---------------- Pager / misc ---------------- */
.pager { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 12px 2px 0; font-size: 12.3px; color: var(--muted); flex-wrap: wrap; }
.pg { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; color: var(--ink-2); }
.pg:hover { background: var(--soft); }
.pg.is-off { opacity: .45; }
.pg-info { font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.split-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.table-note { font-size: 11.8px; color: var(--muted); margin-top: 8px; }
.legend-inline { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.autosave-note { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.preview-box { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.form-section { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.form-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.form-section h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 10px; }
.badge-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------------- Login ---------------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 24px; }
.auth-card { width: 100%; max-width: 396px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 26px 24px; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.auth-brand h1 { font-size: 17px; letter-spacing: -.3px; }
.auth-brand p { font-size: 11.8px; color: var(--muted); }
.auth-card h2 { font-size: 19px; letter-spacing: -.4px; margin-bottom: 2px; }
.auth-card .auth-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.auth-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; font-size: 11.5px; color: var(--muted); }
.denied-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.denied { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 26px; text-align: center; max-width: 400px; }
.denied h1 { font-size: 18px; margin-bottom: 6px; }
.denied p { color: var(--muted); margin-bottom: 14px; font-size: 13px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .split-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-104%); transition: transform .22s ease; box-shadow: 0 20px 40px rgba(16,24,40,.18); width: 264px; }
  .nav-toggle:checked ~ .sidebar { transform: translateX(0); }
  .nav-toggle:checked ~ .scrim { display: block; position: fixed; inset: 0; background: rgba(16,18,22,.42); z-index: 35; }
  .drawer-close { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--soft); color: var(--ink-2); cursor: pointer; }
  .main { margin-left: 0; }
  .topbar { display: flex; }
  .content { padding: 16px 14px 28px; }
  .app-footer { padding: 10px 14px 18px; }
  body:has(.nav-toggle:checked) { overflow: hidden; }
  .g-head { grid-template-columns: 150px repeat(var(--days, 30), minmax(0, 1fr)); }
  .g-row { grid-template-columns: 150px 1fr; }
  .g-name { padding: 7px 8px; }
  .kb-col { flex-basis: 240px; }
  .camp-name { width: 112px; }
  .table-wrap { max-height: none; }
}

@media (max-width: 760px) {
  .step { grid-template-columns: 30px minmax(0, 1fr); padding: 12px; gap: 10px; }
  .step-no { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
  .guide-list { padding-left: 16px; font-size: 12.8px; }
  .faq details p { margin-left: 0; }
  .toc { gap: 5px; }
  .toc a { font-size: 11.5px; padding: 4px 9px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .col-span-2 { grid-column: span 1; }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
  .photo-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .grid-3, .split-3 { grid-template-columns: minmax(0, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 22px; }
  .page-head h1 { font-size: 18.5px; }
  .content { padding: 14px 12px 26px; }
  .card { padding: 14px; }
  .input, .select, .textarea, input[type="file"] { font-size: 16px; min-height: 42px; }
  .chip { min-height: 34px; padding: 6px 12px; font-size: 12.4px; }
  .filter-chips { gap: 7px; }
  .segmented a { min-height: 34px; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 32px; }
  .filter-form .field { flex: 1 1 100%; }
  .filter-form .filter-actions { width: 100%; }
  .filter-form .filter-actions .btn { flex: 1; }
  .g-head { grid-template-columns: 132px repeat(var(--days, 30), minmax(0, 1fr)); }
  .g-row { grid-template-columns: 132px 1fr; }
  .g-name .nm { font-size: 11.8px; }
  .camp-name { width: 96px; font-size: 12px; }

  /* Tabel jadi kartu */
  table.data.card-mobile { display: block; width: 100%; }
  table.data.card-mobile tbody { display: block; width: 100%; }
  table.data.card-mobile thead { display: none; }
  table.data.card-mobile tbody tr { display: block; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; padding: 6px 10px; background: var(--surface); }
  table.data.card-mobile tbody tr:last-child { margin-bottom: 0; }
  table.data.card-mobile tbody td { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 4px 12px; border: 0; padding: 5px 0; text-align: right; word-break: break-word; }
  table.data.card-mobile tbody td > * { min-width: 0; max-width: 100%; }
  table.data.card-mobile tbody td .badge { white-space: normal; }
  table.data.card-mobile tbody td::before { content: attr(data-label); color: var(--muted); font-size: 11.3px; font-weight: 650; text-transform: uppercase; letter-spacing: .2px; text-align: left; flex: 0 0 auto; padding-top: 1px; }
  table.data.card-mobile tbody td[data-label=""]::before { display: none; }
  table.data.card-mobile tbody td.cell-span { display: block; text-align: left; }
  table.data.card-mobile tbody td .cell-main { justify-content: flex-end; text-align: right; }
  table.data.card-mobile tbody td .table-actions { justify-content: flex-end; flex-wrap: wrap; }
  table.data.card-mobile tbody td.cell-actions { justify-content: flex-end; padding-top: 8px; }
  table.data.card-mobile tbody tr:hover td { background: transparent; }
  table.data.card-mobile tbody td.num, table.data.card-mobile tbody td.text-right { text-align: right; }
  table.data.card-mobile tbody tr[data-href] { cursor: pointer; }
  table.data.card-mobile tfoot { display: block; margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
  table.data.card-mobile tfoot tr { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 9px 11px; }
  table.data.card-mobile tfoot td { display: inline-block; border: 0; padding: 0; font-size: 11.8px; text-align: left !important; white-space: normal; }
  table.data.card-mobile tfoot td:first-child { width: 100%; font-weight: 700; font-size: 12.5px; }
  .table-wrap { overflow: visible; }
}

/* Perangkat sentuh (HP & tablet, termasuk iPad 768–1024px): target sentuh lebih besar.
   Desktop dengan mouse tidak terpengaruh. */
@media (pointer: coarse) {
  .chip { min-height: 34px; padding: 6px 12px; }
  .filter-chips { gap: 7px; }
  .btn-sm { min-height: 36px; padding: 7px 11px; }
  .pg { min-height: 36px; }
  .tab { padding-top: 11px; padding-bottom: 11px; }
  .icon-btn { width: 36px; height: 36px; }
  .pill-toggle { min-height: 30px; padding: 5px 11px; }
  .quick-select { min-height: 34px; }
  .segmented a { min-height: 34px; }
  .sum-menu summary, details summary { min-height: 32px; }
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 11px 12px; }
  .kpi-value { font-size: 20px; }
  .kpi-label { font-size: 10.6px; }
  .quick-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented a { padding: 5px 8px; font-size: 11.6px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------------- Print ---------------- */
@media print {
  body { background: #fff; font-size: 11px; }
  .sidebar, .topbar, .scrim, .app-footer, .page-actions, .filter-bar, .btn, .segmented, .pager, .quick-bar, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .kpi { box-shadow: none; border-color: #ccc; }
  .table-wrap { max-height: none; overflow: visible; }
  .toc { display: none; }
  .step { break-inside: avoid; background: #fff; border-color: #ddd; }
  .step-no { background: #333; }
  .faq summary::before { display: none; }
  .faq details { break-inside: avoid; }
  .faq details:not([open]) p { display: block; }
  .foot-guide { display: none !important; }
  table.data thead th { position: static; background: #f2f2f2; color: #000; }
  table.data.card-mobile { display: table; }
  table.data.card-mobile tbody { display: table-row-group; }
  table.data.card-mobile thead { display: table-header-group; }
  table.data.card-mobile tbody tr { display: table-row; border: 0; margin: 0; padding: 0; }
  table.data.card-mobile tbody td { display: table-cell; text-align: left; border-bottom: 1px solid #ddd; padding: 5px 6px; }
  table.data.card-mobile tbody td::before { display: none; }
  table.data.card-mobile tfoot { display: table-footer-group; }
  table.data.card-mobile tfoot tr { display: table-row; padding: 0; }
  table.data.card-mobile tfoot td { display: table-cell; padding: 5px 6px; font-size: 10px; }
  table.data th, table.data td { font-size: 9.6px; padding: 4px 5px; }
  /* Tabel dengan banyak kolom (laporan 11, timeline 9) dulu melebar melewati A4
     sehingga kolom kanan terpotong. table-layout fixed memaksa semuanya muat. */
  table.data { table-layout: fixed; width: 100%; }
  table.data th, table.data td { white-space: normal; word-break: break-word; overflow-wrap: anywhere; }
  table.data .badge, table.data .nowrap, table.data .dl, table.data .cell-main { white-space: normal; }
  table.data .thumb { display: none; }
  table.data td .table-actions { justify-content: flex-start; }
  .gantt-scroll { overflow: visible; }
  .gantt-inner { min-width: 0; }
  .g-head { position: static; }
  .g-name { position: static; }
  .dl-date { color: #444; }
  a[href]::after { content: ""; }
}
