/* ERP Dapur Aqiqah86 — satu file CSS, tanpa build step. */

:root {
  --ink: #1d2420;
  --ink-2: #4b5650;
  --ink-3: #7a857f;
  --line: #e2e6e3;
  --line-2: #eef1ef;
  --bg: #f6f7f5;
  --panel: #ffffff;
  --brand: #1f5f45;
  --brand-2: #2b7a5a;
  --brand-tint: #e8f2ec;
  --side: #17241e;
  --side-ink: #c9d4ce;
  --side-active: #26382f;
  --ok: #1e7a4c;
  --ok-tint: #e3f3ea;
  --warn: #9a6200;
  --warn-tint: #fdf2dd;
  --bad: #b3261e;
  --bad-tint: #fbe9e7;
  --info: #24589a;
  --info-tint: #e6eef9;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 13px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
small, .muted { color: var(--ink-3); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-ink);
  padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px; background: var(--brand-2);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.brand b { display: block; font-size: 14px; }
.brand small { color: var(--side-ink); font-size: 11.5px; }
.nav-group { margin: 14px 0 4px; padding: 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #7f9188; }
.nav a {
  display: block; padding: 7px 10px; border-radius: 6px; color: var(--side-ink); font-size: 13.5px;
}
.nav a:hover { background: var(--side-active); color: #fff; text-decoration: none; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #5fbf93; }
.side-foot { margin-top: 22px; padding: 12px 10px 0; border-top: 1px solid #2c3d35; font-size: 12.5px; }
.side-foot b { color: #fff; display: block; }
.side-foot button { margin-top: 8px; }

.main { min-width: 0; }
.topbar { display: none; }
.content { padding: 24px 28px 48px; max-width: 1280px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { font-size: 12px; color: var(--ink-3); }
.stat .value { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat a { font-size: 12.5px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--ink-2); background: #fafbfa; white-space: nowrap; }
tbody tr:hover td { background: #fbfcfb; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
tr.total td { font-weight: 650; border-top: 2px solid var(--line); background: #fafbfa; }
tr.subtotal td { font-weight: 600; background: #fbfcfb; }
tr.section td { font-weight: 650; background: var(--brand-tint); color: var(--brand); }
tr.inactive td { color: var(--ink-3); }
tr.header-row td { font-weight: 600; color: var(--ink-2); }
.indent-1 { padding-left: 28px !important; }
.indent-2 { padding-left: 44px !important; }
.neg { color: var(--bad); }
.empty { padding: 28px; text-align: center; color: var(--ink-3); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge.draft { background: #eef0ef; color: var(--ink-2); }
.badge.submitted { background: var(--warn-tint); color: var(--warn); }
.badge.approved { background: var(--info-tint); color: var(--info); }
.badge.posted { background: var(--ok-tint); color: var(--ok); }
.badge.reversed { background: var(--bad-tint); color: var(--bad); }
.badge.off { background: #eef0ef; color: var(--ink-3); }
.badge.on { background: var(--ok-tint); color: var(--ok); }
.badge.open { background: var(--ok-tint); color: var(--ok); }
.badge.closed { background: #eef0ef; color: var(--ink-2); }

/* ---------- Forms ---------- */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; font: inherit; color: var(--ink);
  border: 1px solid #cfd6d2; border-radius: 6px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9fd2b8; outline-offset: 0; border-color: var(--brand-2); }
input.amount { text-align: right; font-variant-numeric: tabular-nums; }
input[readonly] { background: #f3f5f4; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--ink); }
.check input { width: auto; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.is-invalid { border-color: var(--bad) !important; background: #fff8f7 !important; }
.error-text { color: var(--bad); font-size: 12px; margin-top: 3px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font: inherit; font-weight: 600; font-size: 13.5px;
  border-radius: 6px; border: 1px solid #c8d0cc; background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f4f6f5; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); border-color: #e6bcb7; }
.btn.danger:hover { background: var(--bad-tint); }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn.link { border: 0; background: none; color: var(--brand-2); padding: 4px 6px; }
.btn.ghost-light { background: transparent; color: var(--side-ink); border-color: #3a4d44; }
.inline { display: inline; }

/* Jurnal: tabel baris */
.lines td { padding: 6px 6px; }
.lines td:first-child { padding-left: 12px; }
.lines select, .lines input { padding: 6px 8px; }
.lines .col-account { min-width: 280px; }
.lines .col-amount { width: 160px; }
.lines .col-memo { min-width: 160px; }
.lines .col-del { width: 40px; text-align: center; }
.balance-bar { display: flex; gap: 22px; justify-content: flex-end; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.balance-bar .item { text-align: right; }
.balance-bar .item small { display: block; }
.balance-bar .item b { font-variant-numeric: tabular-nums; font-size: 15px; }
.balance-ok { color: var(--ok); }
.balance-bad { color: var(--bad); }

/* ---------- Alerts ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.alert.success { background: var(--ok-tint); border-color: #bfe2cd; color: #14532f; }
.alert.error { background: var(--bad-tint); border-color: #f0c4be; color: #7c1a14; }
.alert.warn { background: var(--warn-tint); border-color: #f0d9a8; color: #6b4500; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Detail ---------- */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 20px; }
.meta div span { display: block; font-size: 12px; color: var(--ink-3); }
.meta div b { font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.timeline li:last-child { border-bottom: 0; }
details.action-box { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-top: 10px; }
details.action-box summary { cursor: pointer; font-weight: 600; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; min-width: 150px; }
.filters .field.grow { flex: 1; min-width: 200px; }

.pagination { display: flex; gap: 6px; padding: 12px 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 4px; }
.pagination a, .pagination span.page { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.pagination span.current { background: var(--brand); border-color: var(--brand); color: #fff; }

.report-head { text-align: center; margin-bottom: 14px; }
.report-head h2 { margin: 0; font-size: 16px; }
.report-head p { margin: 2px 0 0; color: var(--ink-3); }

/* ---------- Login ---------- */
.guest { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #17241e 0%, #1f5f45 100%); }
.guest-card { width: 100%; max-width: 380px; background: #fff; border-radius: 12px; padding: 28px; box-shadow: 0 18px 40px rgba(0,0,0,.25); }
.guest-card .brand { color: var(--ink); padding: 0 0 18px; }
.guest-card .brand small { color: var(--ink-3); }

/* ---------- Responsif ---------- */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 20; }
  .topbar button { background: none; border: 1px solid #3a4d44; color: #fff; border-radius: 6px; padding: 6px 10px; font: inherit; }
  .content { padding: 16px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  th, td { padding: 7px 8px; }
  .page-head { flex-direction: column; }
}

/* ---------- Cetak ---------- */
@media print {
  .side, .topbar, .no-print, .filters, .actions { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .panel { border: 0; padding: 0; }
  body { background: #fff; font-size: 12px; }
}

/* ---- Logistik ---- */
.qty-input { width: 90px; text-align: right; padding: 6px 8px; }
.logistic-table td { vertical-align: middle; }
.logistic-table .col-note input { min-width: 140px; padding: 6px 8px; }
.logistic-table tr.has-std td { background: #f7fbf8; }
.logistic-table tr.over td.diff { color: var(--warn); font-weight: 600; }
.logistic-table tr.under td.diff { color: var(--bad); font-weight: 600; }
.package-rows .form-row { grid-template-columns: minmax(240px, 3fr) minmax(90px, 1fr); }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-row label { display: flex; gap: 6px; align-items: center; font-weight: 500; }
.radio-row input { width: auto; }
.badge.none { background: #eef0ef; color: var(--ink-2); }
