/* ============================================================
   MONIKA v2 — identitas: navy korporat + pipeline stepper
   ============================================================ */

:root {
  --navy-950: #041F3A;
  --navy-900: #062C53;
  --navy-700: #0C447C;
  --navy-500: #185FA5;
  --navy-100: #DCE9F6;
  --navy-50:  #EEF4FB;

  --ink:      #22303F;
  --ink-soft: #5B6B7C;
  --ink-faint:#93A1B0;

  --bg:       #F1F4F8;
  --card:     #FFFFFF;
  --line:     #E2E8F0;

  --teal-600: #0F7A5C;
  --teal-100: #D6F1E6;
  --amber-700:#8A5A0B;
  --amber-500:#E9A21B;
  --amber-100:#FCF0D5;
  --coral-700:#A33224;
  --coral-100:#FBE4DF;
  --purple-600:#5A4FB8;
  --purple-100:#E8E6F9;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(6,44,83,.06), 0 4px 14px rgba(6,44,83,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--navy-500); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--navy-500); outline-offset: 2px; }

/* ---------- Topbar ---------- */

.topbar {
  background: linear-gradient(120deg, var(--navy-950), var(--navy-900) 55%, var(--navy-700));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(4,31,58,.35);
}
.topbar-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 20px;
  height: 56px; display: flex; align-items: center; gap: 22px;
}
.brand {
  color: #fff; font-weight: 800; font-size: 17px; letter-spacing: .12em;
  display: flex; align-items: center; gap: 9px;
}
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber-500);
  box-shadow: 0 0 0 4px rgba(233,162,27,.25);
}
.brand small {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  color: #9FC0E4; align-self: flex-end; margin-bottom: 2px;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: #C4D8EE; padding: 7px 12px; border-radius: 8px;
  font-weight: 600; font-size: 13px;
}
.nav a:hover { background: rgba(255,255,255,.09); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.topbar-user { color: #C4D8EE; font-size: 12.5px; display: flex; align-items: center; gap: 12px; }
.topbar-user b { color: #fff; }
.topbar-user a { color: #FBD07C; font-weight: 600; }

/* ---------- Layout ---------- */

.wrap { max-width: 1200px; margin: 0 auto; padding: 24px 26px 64px; }

/* ============ Sidebar shell (tata letak MONIKA) ============ */
.app-shell { display: flex; align-items: stretch; min-height: 100vh; }

.sidebar {
  width: 236px; flex: 0 0 236px; align-self: stretch;
  background: linear-gradient(170deg, var(--navy-950), var(--navy-900) 60%, var(--navy-700));
  color: #C4D8EE; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; color: #fff; }
.side-brand:hover { text-decoration: none; }
.side-brand img { width: 38px; height: 38px; border-radius: 9px; background: rgba(255,255,255,.04); }
.side-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.side-brand b { font-size: 17px; font-weight: 800; letter-spacing: .04em; color: #F4B739; }
.side-brand small { font-size: 10.5px; color: #9DB8D6; font-weight: 600; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.side-group { font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: #6E8DB4; padding: 16px 10px 6px; }
.side-nav a { display: block; padding: 9px 12px; margin: 2px 0; border-radius: 8px;
  color: #C4D8EE; font-size: 13.5px; font-weight: 600; }
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.side-nav a.active { background: rgba(244,183,57,.16); color: #FBD07C; }
.side-logout { padding: 12px 16px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.side-logout button { background: none; border: none; color: #F4A0A0; font-weight: 700; font-size: 13.5px;
  cursor: pointer; padding: 6px 4px; }
.side-logout button:hover { color: #ff8686; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 26px; height: 54px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; }
.main-top-title { font-size: 15px; font-weight: 800; color: var(--navy-900); }
.main-top-user { color: var(--ink-soft); font-size: 12.5px; }
.main-top-user b { color: var(--navy-900); }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: auto; flex: none; height: auto; position: static; }
  .side-brand { padding: 14px 16px; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 10px 10px; }
  .side-group { width: 100%; padding: 10px 10px 2px; }
  .main-top { position: static; }
  .wrap { padding: 18px 16px 48px; }
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; font-weight: 800; color: var(--navy-900); letter-spacing: -.01em; }
.page-head .sub { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card + .card, .section-gap { margin-top: 18px; }
.card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-head h2 { font-size: 14.5px; font-weight: 700; color: var(--navy-900); }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ---------- Kartu status dashboard ---------- */

.status-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  margin-bottom: 20px;
}
.status-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
  border-top: 3px solid var(--navy-500);
  box-shadow: var(--shadow);
}
.status-card .num { font-size: 24px; font-weight: 800; color: var(--navy-900); line-height: 1.1; }
.status-card .lbl { font-size: 11px; font-weight: 600; color: var(--ink-soft); margin-top: 2px; letter-spacing: .02em; }
.status-card.t-done { border-top-color: var(--teal-600); }
.status-card.t-cancel { border-top-color: var(--ink-faint); }

/* ---------- Panel Perlu Perhatian ---------- */

.attn-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.attn { border-left: 4px solid var(--amber-500); }
.attn.stuck { border-left-color: var(--purple-600); }
.attn.overdue { border-left-color: var(--coral-700); }
.attn ul { list-style: none; }
.attn li { padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.attn li:last-child { border-bottom: none; }
.attn .meta { color: var(--ink-soft); font-size: 12px; margin-top: 1px; }
.attn .empty { color: var(--ink-faint); font-style: italic; padding: 14px 18px; font-size: 13px; }

/* ---------- Badge ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 99px; white-space: nowrap;
}
.b-navy   { background: var(--navy-100);  color: var(--navy-700); }
.b-teal   { background: var(--teal-100);  color: var(--teal-600); }
.b-amber  { background: var(--amber-100); color: var(--amber-700); }
.b-coral  { background: var(--coral-100); color: var(--coral-700); }
.b-purple { background: var(--purple-100);color: var(--purple-600); }
.b-gray   { background: #EAEDF1; color: var(--ink-soft); }

/* ---------- SIGNATURE: pipeline stepper ---------- */

.stepper { display: flex; align-items: center; min-width: 210px; }
.step {
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line);
  flex: none; position: relative;
}
.step-link { height: 2px; flex: 1 1 10px; background: var(--line); min-width: 8px; }
.step.done { background: var(--teal-600); border-color: var(--teal-600); }
.step-link.done { background: var(--teal-600); }
.step.now {
  background: #fff; border-color: var(--navy-500);
  box-shadow: 0 0 0 4px rgba(24,95,165,.18);
}
.step.now::after {
  content: ''; position: absolute; inset: 2.5px;
  border-radius: 50%; background: var(--navy-500);
}
.step.cancel, .step-link.cancel { background: var(--coral-100); border-color: var(--coral-700); }

/* Stepper besar (detail proyek) */
.stepper-lg { margin: 4px 0 6px; }
.stepper-lg .step { width: 30px; height: 30px; border-width: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: var(--ink-faint); }
.stepper-lg .step.done { color: #fff; }
.stepper-lg .step.done::before { content: '✓'; }
.stepper-lg .step.now { color: var(--navy-500); }
.stepper-lg .step.now::after { display: none; }
.stepper-labels { display: flex; margin-top: 6px; }
.stepper-labels span {
  flex: 1; text-align: center; font-size: 10.5px; font-weight: 600;
  color: var(--ink-faint); letter-spacing: .01em;
}
.stepper-labels span.now { color: var(--navy-700); font-weight: 800; }
.stepper-labels span.done { color: var(--teal-600); }

/* ---------- Tabel ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft); background: var(--navy-50);
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #FAFCFE; }
.table .right { text-align: right; }
.table-scroll { overflow-x: auto; }

/* ---------- Form ---------- */

label { display: block; font-size: 12.5px; font-weight: 700; color: var(--navy-900); margin-bottom: 5px; }
.hint { font-size: 12px; color: var(--ink-soft); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=file], select, textarea {
  width: 100%; padding: 9px 12px; font: inherit; color: var(--ink);
  border: 1px solid #C9D4E0; border-radius: 9px; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy-500); outline: none;
  box-shadow: 0 0 0 3px rgba(24,95,165,.14); }
textarea { min-height: 84px; resize: vertical; }
.field { margin-bottom: 15px; }
.form-grid { display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ---------- Tombol ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13px; font-weight: 700;
  padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn-primary { background: var(--navy-700); color: #fff; }
.btn-outline { background: #fff; color: var(--navy-700); border-color: #C9D4E0; }
.btn-warn    { background: var(--amber-100); color: var(--amber-700); border-color: #EBD3A0; }
.btn-danger  { background: var(--coral-100); color: var(--coral-700); border-color: #EFC5BB; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Flash ---------- */

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 13.5px; font-weight: 600; }
.flash.ok   { background: var(--teal-100);  color: var(--teal-600); }
.flash.err  { background: var(--coral-100); color: var(--coral-700); }
.flash.warn { background: var(--amber-100); color: var(--amber-700); }

/* ---------- Timeline log ---------- */

.timeline { list-style: none; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before {
  content: ''; position: absolute; left: 6px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--navy-500);
}
.timeline li.ovr::before { background: var(--amber-500); }
.timeline li::after {
  content: ''; position: absolute; left: 10px; top: 16px; bottom: -2px;
  width: 1.5px; background: var(--line);
}
.timeline li:last-child::after { display: none; }
.timeline .t-title { font-weight: 700; font-size: 13px; color: var(--navy-900); }
.timeline .t-meta { font-size: 12px; color: var(--ink-soft); }
.timeline .t-note { font-size: 12.5px; color: var(--ink); margin-top: 3px;
  background: var(--navy-50); border-radius: 8px; padding: 7px 10px; }

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(24,95,165,.28), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(233,162,27,.14), transparent 55%),
    var(--navy-950);
}
.login-card {
  width: 100%; max-width: 380px; background: #fff;
  border-radius: 16px; padding: 34px 30px 30px;
  box-shadow: 0 24px 60px rgba(2,16,32,.5);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-banner { width: 100%; max-width: 340px; height: auto; border-radius: 12px; display: block; margin: 0 auto; box-shadow: 0 6px 20px rgba(4,31,58,.18); }
.login-logo { width: 64px; height: 64px; margin-bottom: 10px; }
.login-brand .name { font-size: 24px; font-weight: 800; letter-spacing: .18em; color: var(--navy-900); }
.login-brand .tag { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.login-pipe { display: flex; align-items: center; justify-content: center; margin-top: 14px; }
.login-pipe .step { width: 10px; height: 10px; }
.login-pipe .step-link { max-width: 26px; }

/* ---------- Util ---------- */

.muted { color: var(--ink-soft); }
.small { font-size: 12px; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin-bottom: 0; min-width: 150px; flex: 1; }
.logo-preview { max-height: 54px; border-radius: 8px; border: 1px solid var(--line); padding: 4px; background: #fff; }

@media (max-width: 720px) {
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .wrap { padding: 18px 14px 56px; }
  .stepper-labels span { font-size: 9px; }
}

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

/* ============ Modal ============ */
.modal-overlay { position: fixed; inset: 0; background: rgba(4,31,58,.5); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto; }
.modal { background: #fff; width: 100%; max-width: 540px; border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(4,31,58,.35); }
.modal-head { display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(120deg, var(--navy-950), var(--navy-700)); color: #fff; padding: 14px 18px; }
.modal-head h2 { font-size: 15px; font-weight: 700; color: #fff; }
.modal-x { background: none; border: none; color: #C4D8EE; font-size: 22px; line-height: 1; cursor: pointer; }
.modal-x:hover { color: #fff; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; background: var(--navy-50); border-top: 1px solid var(--line); }

/* ============ Costing Sheet ============ */
.form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .form-grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .form-grid.cols-4 { grid-template-columns: 1fr; } }
.req { color: var(--coral-700); }
.err-msg { font-size: 12px; color: var(--coral-700); margin-top: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.btn-teal { background: var(--teal-600); color: #fff; border-color: var(--teal-600); }
.btn-teal:hover { filter: brightness(1.06); }

.costing-band {
  background: linear-gradient(120deg, var(--navy-950), var(--navy-700));
  color: #fff; border-radius: var(--radius); padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.costing-band .cb-sub { font-size: 11px; color: #9FC0E4; letter-spacing: .04em; }
.costing-band .cb-title { font-size: 19px; font-weight: 800; }
.costing-band .cb-code { text-align: right; background: rgba(255,255,255,.12); border-radius: 9px; padding: 8px 14px; }
.costing-band .cb-code small { display: block; font-size: 10px; color: #C4D8EE; }
.costing-band .cb-code b { font-size: 15px; letter-spacing: .03em; }

.costing-items th, .costing-items td { padding: 6px 8px; vertical-align: middle; }
.costing-items input.cell, .costing-items select.cell {
  padding: 6px 8px; font-size: 12.5px; min-width: 70px; width: 100%;
}
.costing-items input.num { width: 90px; text-align: right; }
.btn-x { background: var(--coral-100); color: var(--coral-700); border: none; border-radius: 6px;
  width: 26px; height: 26px; font-size: 16px; line-height: 1; cursor: pointer; }
.btn-x:hover { background: #f6cfc7; }

.costing-foot { display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; align-items: flex-start; }
.costing-note { flex: 1; min-width: 240px; font-size: 12.5px; color: var(--ink-soft);
  background: var(--amber-100); border-radius: 10px; padding: 12px 14px; }
.costing-summary { width: 300px; max-width: 100%; }
.costing-summary > div { display: flex; justify-content: space-between; padding: 5px 0;
  font-size: 13px; color: var(--ink-soft); }
.costing-summary > div b { color: var(--navy-900); }
.costing-summary .grand { border-top: 2px solid var(--line); margin-top: 4px; padding-top: 10px; font-size: 15px; }
.costing-summary .grand b { color: var(--navy-700); font-size: 17px; }

/* ============ Dashboard 9 kotak (SPH vs PO) ============ */
.bucket-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-bottom: 22px; }
@media (max-width: 1050px) { .bucket-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .bucket-grid { grid-template-columns: 1fr; } }

.bucket-card { position: relative; display: block; border-radius: 14px; padding: 16px 18px 14px;
  color: #fff; overflow: hidden; box-shadow: 0 6px 18px rgba(4,31,58,.16); min-height: 128px; }
.bucket-card:hover { text-decoration: none; transform: translateY(-2px); transition: transform .12s; box-shadow: 0 10px 24px rgba(4,31,58,.24); }
.bucket-card::after { content: ''; position: absolute; right: -30px; bottom: -40px; width: 130px; height: 130px;
  background: rgba(255,255,255,.10); border-radius: 50%; }
.bc-go { position: absolute; top: 12px; right: 14px; width: 22px; height: 22px; border-radius: 6px;
  background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; }
.bc-label { font-size: 12.5px; font-weight: 700; letter-spacing: .01em; opacity: .95; text-transform: uppercase; padding-right: 26px; }
.bc-num { font-size: 34px; font-weight: 800; line-height: 1.1; margin: 2px 0 6px; }
.bc-money { font-size: 11.5px; line-height: 1.7; position: relative; z-index: 1; }
.bc-money b { font-weight: 700; }

.bc-navy   { background: linear-gradient(135deg, #0B2545, #123a66); }
.bc-purple { background: linear-gradient(135deg, #5B2AA5, #7A3FC4); }
.bc-green  { background: linear-gradient(135deg, #0D6A4E, #12855F); }
.bc-blue   { background: linear-gradient(135deg, #1E62C9, #2E86D6); }
.bc-amber  { background: linear-gradient(135deg, #B4700C, #D98A15); }
.bc-orange { background: linear-gradient(135deg, #C1490E, #E06617); }
.bc-brown  { background: linear-gradient(135deg, #8A4A1E, #A65E24); }
.bc-slate  { background: linear-gradient(135deg, #3D4A5C, #55657A); }
.bc-red    { background: linear-gradient(135deg, #A11E1E, #C62A2A); }

.linklike { background: none; border: none; color: var(--navy-500); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.linklike:hover { color: var(--navy-700); }
