:root {
  --navy: #0b1f45; --navy-2: #13295a; --ink: #0e1a33; --body: #4a5670; --muted: #6a7590;
  --soft: #f4f6f9; --line: #e2e6ee; --orange: #f7931e; --orange-d: #b85f05;
  --ok: #1c7c45; --ok-bg: #e6f4ec; --warn: #a15c00; --warn-bg: #fff3e0; --bad: #b3261e; --bad-bg: #fdecea;
  --wa: #1c9c4f; --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 'Schibsted Grotesk', system-ui, sans-serif; color: var(--body); background: var(--soft); }
h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.25; }
h1 { font-size: 1.45rem; font-weight: 700; }
h2 { font-size: 1.02rem; font-weight: 700; margin-bottom: 12px; }
h3 { font-size: .95rem; margin-bottom: 8px; }
a { color: var(--navy); }
code { font: 600 .82rem ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--navy); background: #eef1f7; padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
small { display: block; color: var(--muted); font-size: .8rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.boot { padding: 40px; text-align: center; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-family: inherit; font-size: .9rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c5ccda; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #1d1100; }
.btn.primary:hover { background: #ee8611; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.danger-ghost { color: var(--bad); border-color: transparent; background: transparent; }
.btn.danger-ghost:hover { background: var(--bad-bg); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: .84rem; }
.btn:disabled { opacity: .55; cursor: progress; }
.link { background: none; border: 0; color: var(--on, #b9c4d8); font: inherit; cursor: pointer; padding: 4px; text-decoration: underline; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* shell */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #b9c4d8; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: block; margin: 0 4px 22px; padding: 10px 12px; background: #fff; border-radius: 8px; }
.brand img { display: block; height: auto; max-width: 100%; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: #c9d2e3; text-decoration: none; font-weight: 500; }
.side nav a:hover { background: var(--navy-2); color: #fff; }
.side nav a.on { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.side svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.who { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 8px 0; border-top: 1px solid #22386a; }
.who b { display: block; color: #fff; font-size: .9rem; }
.who span { font-size: .78rem; }
.main { min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 32px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.content { padding: 24px 32px 60px; max-width: 1200px; }

/* cards & layout */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-head a { font-size: .88rem; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.hint { margin: -4px 0 14px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat span { font-size: .84rem; color: var(--muted); }
.stat b { display: block; font-size: 1.5rem; color: var(--ink); margin: 4px 0 2px; }
.stat.warn { border-top: 3px solid var(--orange); }
.stat.ok { border-top: 3px solid var(--ok); }
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.pipe { text-decoration: none; border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 2px; }
.pipe:hover { border-color: var(--navy); }
.pipe b { font-size: 1.4rem; color: var(--ink); }
.pipe span { font-size: .85rem; color: var(--muted); }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; background: #eef1f7; color: var(--navy); white-space: nowrap; }
.b-penawaran, .b-terkirim { background: #e8eefc; color: #2446a6; }
.b-dikerjakan, .b-dp { background: var(--warn-bg); color: var(--warn); }
.b-selesai, .b-lunas, .b-disetujui { background: var(--ok-bg); color: var(--ok); }
.b-batal, .b-ditolak { background: var(--bad-bg); color: var(--bad); }

/* tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover, .tbl tbody tr:focus { background: #f7f9fc; outline: none; }
.tbl td b { color: var(--ink); font-weight: 600; }
.card:not(.flush) .tbl th, .card:not(.flush) .tbl td { padding-left: 0; }
.num-cols td { }
.empty { padding: 36px 20px; text-align: center; }
.empty p { margin: 0 0 14px; }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.search { flex: 1 1 280px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--body); font-size: .86rem; }
.chips a.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* forms */
.form label { display: grid; gap: 5px; font-size: .84rem; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); width: 100%; padding: 9px 11px; border: 1px solid #cfd5e1; border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(247, 147, 30, .35); border-color: var(--orange); }
.search input { padding: 10px 14px; }
textarea { resize: vertical; }
select.sm { width: auto; padding: 6px 10px; font-size: .85rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 6px; }
.spacer { flex: 1; }
.form.sub { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }

/* docs */
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list a { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--body); font-size: .88rem; }
.doc-list a:hover b { text-decoration: underline; }
.items-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 6px 0 10px; }
.items-head h2 { margin: 0; }
.items { width: 100%; border-collapse: collapse; min-width: 640px; }
.items th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; padding: 6px 4px; }
.items td { padding: 4px; }
.items td:nth-child(1) { width: 46%; }
.items td:nth-child(2) { width: 9%; } .items td:nth-child(3) { width: 11%; } .items td:nth-child(4) { width: 16%; }
.items .line { text-align: right; white-space: nowrap; padding-right: 8px; color: var(--ink); }
.items input { padding: 8px; }
.x { border: 0; background: none; font-size: 1.3rem; color: var(--muted); cursor: pointer; width: 32px; height: 32px; border-radius: 6px; }
.x:hover { background: var(--bad-bg); color: var(--bad); }
.sum { display: grid; grid-template-columns: repeat(3, minmax(0, 170px)) 1fr; gap: 16px; align-items: start; margin: 18px 0 4px; }
.sum dl { margin: 0; justify-self: end; min-width: 260px; }
.sum dl div { display: flex; justify-content: space-between; gap: 20px; padding: 4px 0; }
.sum dt { color: var(--muted); } .sum dd { margin: 0; color: var(--ink); }
.sum .grand { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; font-weight: 700; font-size: 1.05rem; }
.sum .grand dt, .sum .due dt { color: var(--ink); }
.sum .due dd { color: var(--orange-d); font-weight: 700; }
.users { list-style: none; margin: 0; padding: 0; }
.users li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.users li:first-child { border-top: 0; }
.users .btn-row { margin: 0; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--navy); }
.auth-card { width: min(400px, 100%); padding: 32px; }
.auth-card img { height: auto; margin-bottom: 20px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card p { margin: 0 0 20px; }
.auth-card label { display: grid; gap: 5px; font-size: .84rem; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.auth-card .btn { width: 100%; margin-top: 4px; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--bad); }

/* print sheet */
.print-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 20px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.sheet { width: 210mm; min-height: 297mm; margin: 24px auto; background: #fff; padding: 16mm 16mm 14mm; color: #222; font-size: 10.5pt; box-shadow: 0 2px 12px rgba(11, 31, 69, .12); position: relative; }
.sh-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--navy); padding-bottom: 12px; }
.sh-head img { height: auto; }
.co-tag { margin: 4px 0 0; font-size: 8.5pt; color: var(--muted); }
.co { text-align: right; font-size: 9pt; line-height: 1.45; }
.sh-title { display: flex; justify-content: space-between; align-items: flex-start; margin: 18px 0 14px; }
.sh-title h1 { font-size: 18pt; letter-spacing: .04em; color: var(--navy); }
.kv th { text-align: left; font-weight: 400; color: var(--muted); padding: 1px 12px 1px 0; }
.kv td { font-weight: 600; }
.to { background: var(--soft); border-left: 3px solid var(--orange); padding: 10px 14px; margin-bottom: 16px; line-height: 1.5; }
.to span { display: block; font-size: 8.5pt; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.lines { width: 100%; border-collapse: collapse; }
.lines th { background: var(--navy); color: #fff; text-align: left; padding: 7px 8px; font-size: 9pt; font-weight: 600; }
.lines td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lines th:nth-child(n+3), .lines td:nth-child(n+3) { text-align: right; white-space: nowrap; }
.lines td:first-child { width: 28px; }
.tot { margin: 10px 0 0 auto; border-collapse: collapse; min-width: 260px; }
.tot th { text-align: left; font-weight: 400; padding: 4px 16px 4px 0; color: #444; }
.tot td { text-align: right; padding: 4px 0; }
.tot .g th, .tot .g td { font-weight: 700; font-size: 11.5pt; color: var(--navy); border-top: 1px solid var(--line); padding-top: 7px; }
.stamp { float: left; margin: 18px 0 0 6mm; transform: rotate(-10deg); border: 3px solid var(--ok); color: var(--ok); font-size: 20pt; font-weight: 800; letter-spacing: .06em; padding: 2px 14px; border-radius: 6px; opacity: .8; }
.notes { clear: both; margin-top: 16px; font-size: 9.5pt; }
.notes p { margin: 3px 0 0; }
.sh-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 28px; font-size: 9.5pt; }
.sign { text-align: center; min-width: 160px; }
.sign span { display: block; margin-bottom: 54px; }

@media (max-width: 1000px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .cols, .cols.even { grid-template-columns: 1fr; }
  .sum { grid-template-columns: 1fr 1fr; }
  .sum dl { grid-column: 1 / -1; justify-self: stretch; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; gap: 8px; overflow-x: auto; }
  .brand { display: none; }
  .side nav { display: flex; gap: 2px; }
  .side nav a { padding: 8px 10px; font-size: .85rem; gap: 6px; }
  .side nav a.on { box-shadow: inset 0 -3px 0 var(--orange); }
  .who { margin: 0 0 0 auto; border: 0; padding: 0; }
  .who div { display: none; }
  .top { position: static; padding: 16px; flex-wrap: wrap; }
  .content { padding: 16px 12px 48px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .stat b { font-size: 1.2rem; }
  .sheet { width: auto; min-height: 0; margin: 0; padding: 16px; box-shadow: none; }
}
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .no-print, #toast { display: none !important; }
  .sheet { margin: 0; box-shadow: none; width: 210mm; min-height: 297mm; }
  .lines th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .to, .stamp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
