/* ============================================================
   SISTEM SURAT — Design Tokens & Base Styles
   Institutional navy + gold, Plus Jakarta Sans
   ============================================================ */

:root {
  /* Brand */
  --navy-900: oklch(0.27 0.055 256);
  --navy-800: oklch(0.33 0.07 256);
  --navy-700: oklch(0.40 0.085 256);
  --navy-600: oklch(0.47 0.10 256);
  --navy-500: oklch(0.55 0.10 256);
  --navy-300: oklch(0.78 0.05 256);
  --navy-100: oklch(0.93 0.02 256);
  --navy-50:  oklch(0.97 0.012 256);

  --gold-600: oklch(0.62 0.12 75);
  --gold-500: oklch(0.74 0.13 78);
  --gold-400: oklch(0.83 0.11 82);
  --gold-100: oklch(0.94 0.045 85);

  /* Neutrals */
  --ink:       oklch(0.27 0.018 256);
  --ink-soft:  oklch(0.44 0.016 256);
  --muted:     oklch(0.58 0.014 256);
  --faint:     oklch(0.72 0.012 256);
  --line:      oklch(0.91 0.008 256);
  --line-soft: oklch(0.945 0.006 256);
  --surface:   #ffffff;
  --surface-2: oklch(0.985 0.004 256);
  --bg:        oklch(0.972 0.006 256);

  /* Status */
  --ok:    oklch(0.58 0.12 155);
  --ok-bg: oklch(0.95 0.04 155);
  --warn:    oklch(0.70 0.14 65);
  --warn-bg: oklch(0.95 0.05 75);
  --hot:    oklch(0.60 0.18 30);
  --hot-bg: oklch(0.95 0.04 30);
  --info:    oklch(0.55 0.12 245);
  --info-bg: oklch(0.95 0.035 245);
  --purple:    oklch(0.52 0.14 300);
  --purple-bg: oklch(0.95 0.035 300);

  /* Radius / shadow */
  --r-sm: 7px;
  --r:    11px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-sm: 0 1px 2px oklch(0.4 0.04 256 / 0.06), 0 1px 3px oklch(0.4 0.04 256 / 0.05);
  --shadow:    0 2px 6px oklch(0.4 0.04 256 / 0.07), 0 6px 16px oklch(0.4 0.04 256 / 0.06);
  --shadow-lg: 0 12px 34px oklch(0.35 0.05 256 / 0.13), 0 4px 12px oklch(0.35 0.05 256 / 0.08);

  /* Density (driven by tweak) */
  --row-py: 13px;
  --cell-px: 18px;
  --card-pad: 22px;

  --ff: "Plus Jakarta Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ff);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: 0; color: var(--ink); }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--gold-400); color: var(--navy-900); }

.tabnum { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; letter-spacing: 0;
  padding: 9px 15px; border-radius: var(--r-sm);
  transition: background .15s, box-shadow .15s, transform .05s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(0.5px); }
.btn-primary { background: var(--navy-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--navy-800); }
.btn-gold { background: var(--gold-500); color: var(--navy-900); box-shadow: var(--shadow-sm); }
.btn-gold:hover { background: var(--gold-600); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--navy-300); color: var(--ink); }
.btn-soft { background: var(--navy-100); color: var(--navy-700); }
.btn-soft:hover { background: var(--navy-300); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 6px; }
.btn-icon { padding: 7px; border-radius: 7px; }

/* ---------- Icon button group (table actions) ---------- */
.iconbtn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 7px;
  color: var(--muted); transition: background .14s, color .14s;
}
.iconbtn:hover { background: var(--navy-100); color: var(--navy-700); }
.iconbtn.danger:hover { background: var(--hot-bg); color: var(--hot); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  padding: 3px 9px; border-radius: 100px; line-height: 1.4;
  white-space: nowrap;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-biasa   { background: var(--info-bg);   color: var(--info); }
.b-penting { background: var(--warn-bg);   color: var(--warn); }
.b-segera  { background: var(--hot-bg);    color: var(--hot); }
.b-rahasia { background: var(--purple-bg); color: var(--purple); }
.b-ok      { background: var(--ok-bg);     color: var(--ok); }
.b-draft   { background: var(--navy-100);  color: var(--navy-600); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--card-pad); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl thead th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
  padding: 12px var(--cell-px); border-bottom: 1px solid var(--line);
  background: var(--surface-2); white-space: nowrap;
}
table.tbl tbody td {
  padding: var(--row-py) var(--cell-px);
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft); vertical-align: middle;
}
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: var(--navy-50); }
.td-strong { color: var(--ink); font-weight: 600; }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field .req { color: var(--hot); }
.input, .select, .textarea {
  width: 100%; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 11px 13px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--navy-500);
  box-shadow: 0 0 0 3.5px var(--navy-100);
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 38px; }
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.hint { font-size: 11.5px; color: var(--muted); }

/* Upload dropzone */
.dropzone {
  border: 1.5px dashed var(--navy-300); border-radius: var(--r);
  background: var(--navy-50); padding: 26px; text-align: center;
  color: var(--muted); transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--navy-500); background: var(--navy-100); }

/* ---------- Utilities ---------- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.grow { flex: 1; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { align-items: center; }
.muted { color: var(--muted); }
.soft { color: var(--ink-soft); }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--navy-500); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--navy-300); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--navy-500); }
