/* Portal PWE: same palette and type as the public website */

@font-face {
  font-family: "PWE Hyphen";
  src: local("Segoe UI"), local("SegoeUI"), local("Helvetica Neue"), local("Roboto"), local("Arial");
  font-weight: 100 500;
  unicode-range: U+002D, U+2010, U+2011;
}
@font-face {
  font-family: "PWE Hyphen";
  src: local("Segoe UI Bold"), local("SegoeUI-Bold"), local("Helvetica Neue Bold"), local("Roboto Bold"), local("Arial Bold");
  font-weight: 600 900;
  unicode-range: U+002D, U+2010, U+2011;
}

:root {
  --ink: #0f1a14;
  --ink-2: #2b3a32;
  --muted: #5c6b62;
  --forest: #0c3a29;
  --forest-2: #114a35;
  --green: #2f9e44;
  --green-700: #237a35;
  --lime: #9ccf4a;
  --lime-soft: #e6f3cf;
  --sand: #f6f2ea;
  --sand-2: #ebe4d5;
  --bg: #f4f5f1;
  --paper: #fff;
  --line: #e2e6e0;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --warning: #8a5a10;
  --warning-soft: #fbf0dc;
  --info: #1f5f9e;
  --info-soft: #e5f0fb;
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 248px;
  --font: "PWE Hyphen", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --arc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 12'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%232f9e44'/%3E%3Cstop offset='1' stop-color='%239ccf4a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M1 11C12 1 36 1 47 11C36 5 12 5 1 11Z' fill='url(%23g)'/%3E%3C/svg%3E");
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 0.95rem; line-height: 1.5; color: var(--ink-2); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; color: var(--ink); line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0 0 0.6em; }
p:last-child { margin-bottom: 0; }
a { color: var(--green-700); }
a:hover { color: var(--green); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; border-radius: 6px; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon--muted { color: var(--muted); }
.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); }
.small { font-size: 0.85rem; }
.block { display: block; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pre { white-space: pre-line; }
.skip-link { position: absolute; left: 12px; top: -50px; z-index: 100; padding: 8px 14px; background: var(--ink); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 7px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink);
  font-weight: 600; font-size: 0.9rem; line-height: 1.2; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: #c9d1c6; background: #fafbf8; color: var(--ink); }
.btn--primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: rgba(0, 0, 0, 0.04); border-color: transparent; }
.btn--danger-ghost { color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); border-color: #f3c6c2; color: var(--danger); }
.btn--sm { min-height: 32px; padding: 5px 10px; font-size: 0.85rem; }
.btn--block { width: 100%; min-height: 46px; }
.btn[disabled] { opacity: 0.6; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--danger-soft); color: var(--danger); }
.inline-form { display: inline; margin: 0; }
.link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 0.88rem; text-decoration: none; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px; background: var(--forest); color: rgba(255, 255, 255, 0.82);
  overflow-y: auto;
}
.sb-brand { display: flex; align-items: flex-end; gap: 8px; padding: 4px 10px 10px; text-decoration: none; }
.sb-brand img { height: 38px; width: auto; }
.sb-brand span { padding-bottom: 3px; font-size: 0.78rem; font-weight: 700; color: var(--lime); letter-spacing: 0.02em; }
.sb-nav { display: grid; gap: 2px; flex: 1; align-content: start; }
.sb-label { margin: 16px 10px 4px; font-size: 0.75rem; font-weight: 700; color: rgba(255, 255, 255, 0.45); }
.sb-link {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: 10px; background: none;
  color: inherit; font-weight: 600; text-decoration: none; text-align: left; cursor: pointer;
}
.sb-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sb-link[aria-current="page"] { background: rgba(156, 207, 74, 0.14); color: #fff; }
.sb-link[aria-current="page"] .icon { color: var(--lime); }
.sb-foot { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.sb-user:hover, .sb-user[aria-current="page"] { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sb-user span:last-child { display: grid; line-height: 1.25; min-width: 0; }
.sb-user b { color: #fff; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user small { font-size: 0.78rem; color: rgba(255, 255, 255, 0.55); }
.sb-logout { color: rgba(255, 255, 255, 0.7); }
.avatar { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--lime); color: var(--forest); font-size: 0.78rem; font-weight: 800; }
.avatar--sm { width: 24px; height: 24px; font-size: 0.65rem; background: var(--lime-soft); color: var(--green-700); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 28px; background: rgba(244, 245, 241, 0.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 1.45rem; font-weight: 800; overflow-wrap: anywhere; }
.crumbs { margin: 0 0 2px; font-size: 0.82rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--green-700); text-decoration: underline; }
.topbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.menu-btn { display: none; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; }
.content { padding: 24px 28px 48px; display: grid; gap: 20px; align-content: start; }

.flash { display: flex; align-items: center; gap: 10px; margin: 16px 28px 0; padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 600; }
.flash--success { background: var(--lime-soft); color: var(--green-700); }
.flash--error { background: var(--danger-soft); color: var(--danger); }
.bare .flash, .login-page .flash { margin: 16px; }

/* ---------- panels & lists ---------- */
.panel { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-title { position: relative; padding-top: 11px; margin-bottom: 12px; font-size: 1rem; font-weight: 700; }
.panel-head .panel-title { margin-bottom: 0; }
.panel-title::before { content: ""; position: absolute; left: -1px; top: 0; width: 30px; height: 8px; background: var(--arc) no-repeat left top / contain; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-main, .detail-wide { grid-column: 1 / -1; }

.mini-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.mini-list li:first-child { border-top: 0; padding-top: 0; }
.mini-list a { display: grid; min-width: 0; text-decoration: none; color: var(--ink); }
.mini-list a:hover b { color: var(--green-700); text-decoration: underline; }
.mini-list small { color: var(--muted); font-size: 0.82rem; }
.mini-list .num { display: inline-flex; align-items: center; gap: 8px; }

.dl { display: grid; gap: 10px; }
.dl > div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; }
.dl--grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 24px; }
.dl--grid > div { display: block; }
.dl dt { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.dl dd { font-weight: 600; color: var(--ink); }
.notes { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--sand); white-space: pre-line; }

.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.detail-head p { margin-bottom: 4px; }
.detail-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--lime-soft); color: var(--green-700); }
.detail-icon .icon { width: 22px; height: 22px; }
.contact-lines { display: grid; gap: 8px; }
.contact-lines li { display: flex; align-items: center; gap: 10px; }
.contact-lines .icon { color: var(--muted); }

.empty { padding: 48px 24px; border: 1px dashed #cdd5c9; border-radius: var(--radius); background: var(--paper); text-align: center; }
.empty p { max-width: 46ch; margin: 0 auto 16px; color: var(--muted); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.badge--neutral { background: #eef0ec; color: var(--ink-2); }
.badge--soft { background: var(--sand); color: var(--ink-2); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--success { background: var(--lime-soft); color: var(--green-700); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--muted { background: #eef0ec; color: var(--muted); text-decoration: line-through; }

/* ---------- filters & tables ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters select, .search input { min-height: 38px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; padding-left: 36px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.seg { display: inline-flex; margin-left: auto; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.seg a { padding: 5px 12px; border-radius: 7px; font-size: 0.86rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.seg a[aria-current] { background: var(--forest); color: #fff; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.panel .table-wrap { border: 0; border-radius: 0; }
.table { width: 100%; font-size: 0.9rem; }
.table th { padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbf8; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-align: left; white-space: nowrap; }
.panel .table th { background: none; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfcf9; }
.table tfoot td { padding: 11px 14px; border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.table td a { font-weight: 600; }
.row-link { display: flex; align-items: flex-start; gap: 10px; text-decoration: none; }
.row-link span { display: grid; }
.row-link b { color: var(--ink); }
.row-link:hover b { color: var(--green-700); text-decoration: underline; }
.row-link small { color: var(--muted); font-weight: 500; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-stack { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; align-content: start; margin: 0; padding: 0; border: 0; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field label, .field legend, .field .label { font-size: 0.85rem; font-weight: 700; color: var(--ink); padding: 0; }
.req { color: var(--danger); }
.field input:not([type="radio"]):not([type="checkbox"]), .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid #d6dcd3; border-radius: 10px; background: var(--paper);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .filters select:focus, .search input:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 158, 68, 0.15);
}
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger) !important; }
.field-error { margin: 0; font-size: 0.82rem; font-weight: 600; color: var(--danger); }
.field-hint { margin: 0; font-size: 0.8rem; color: var(--muted); }
.field-pair { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.radio-row legend { width: 100%; margin-bottom: 6px; }
.radio-row label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-alert { margin-bottom: 14px; padding: 10px 14px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.settings-form, .doc-form { display: grid; gap: 20px; }

/* activity */
.activity-form { display: grid; gap: 8px; margin-bottom: 18px; }
.activity-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #d6dcd3; border-radius: 10px; resize: vertical; }
.activity-form-row { display: flex; gap: 8px; justify-content: flex-end; }
.activity-form select { min-height: 32px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.timeline { display: grid; gap: 0; }
.tl { position: relative; padding: 0 0 16px 22px; }
.tl::before { content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.tl--sistem::before { background: #c7cec3; }
.tl:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.tl-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 0.82rem; }
.tl-head b { color: var(--ink); }
.tl-head span { color: var(--muted); }
.tl p { margin: 2px 0 0; white-space: pre-line; }
.tl--sistem p { color: var(--muted); font-size: 0.88rem; }

/* ---------- CRM board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.column { display: flex; flex-direction: column; min-height: 320px; border-radius: var(--radius); background: #ebeee7; transition: background-color 0.15s, box-shadow 0.15s; }
.column.is-over { background: var(--lime-soft); box-shadow: inset 0 0 0 2px var(--green); }
.column header { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 12px 14px 8px; }
.column h2 { font-size: 0.88rem; font-weight: 700; }
.column .count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--paper); font-size: 0.76rem; font-weight: 700; }
.column header p { grid-column: 1 / -1; margin: 2px 0 0; font-size: 0.8rem; color: var(--muted); }
.column--menang h2 { color: var(--green-700); }
.column--kalah h2 { color: var(--danger); }
.cards { display: grid; gap: 8px; align-content: start; flex: 1; padding: 4px 10px 12px; }
.deal-card { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: grab; }
.deal-card:hover { border-color: #c5cfc1; }
.deal-card.is-dragging { opacity: 0.5; }
.deal-card a { color: var(--ink); text-decoration: none; }
.deal-card a:hover { color: var(--green-700); text-decoration: underline; }
.deal-card p { margin: 2px 0 0; font-size: 0.82rem; color: var(--muted); }
.deal-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }
.due { font-size: 0.78rem !important; }
.due--late { color: var(--danger) !important; font-weight: 600; }
.board-hint { margin-top: -8px; }

.stage-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.stage-bar button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 0.82rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.stage-bar button:hover { border-color: var(--green); color: var(--green-700); }
.stage-bar .is-current button { border-color: var(--forest); background: var(--forest); color: #fff; cursor: default; opacity: 1; }
.stage-bar .is-current.stage--menang button { background: var(--green); border-color: var(--green); }
.stage-bar .is-current.stage--kalah button { background: var(--danger); border-color: var(--danger); }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { display: grid; gap: 4px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink-2); text-decoration: none; }
.kpi:hover { border-color: #c5cfc1; color: var(--ink-2); }
.kpi p { margin: 0; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.kpi b { font-size: 1.5rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 0.82rem; color: var(--muted); }
.bars { display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 110px 1fr 28px; gap: 10px; align-items: center; font-size: 0.86rem; }
.bar { height: 10px; border-radius: 999px; background: #eef0ec; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--green); min-width: 2px; }
.bar-num { text-align: right; font-weight: 700; }

/* ---------- document form & view ---------- */
.lines { width: 100%; min-width: 720px; }
.lines th { padding: 8px 6px; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); }
.lines td { padding: 6px; vertical-align: top; border-bottom: 1px solid var(--line); }
.lines td:nth-child(2), .lines td:nth-child(3) { width: 110px; }
.lines td:nth-child(4) { width: 170px; }
.lines td:nth-child(5) { width: 150px; padding-top: 16px; font-weight: 600; }
.lines td:last-child { width: 40px; }
.lines textarea, .lines input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #d6dcd3; border-radius: 8px; background: var(--paper); resize: none; overflow: hidden; }
.lines textarea:focus, .lines input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 158, 68, 0.15); }
.lines-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 14px; }
.totals { display: grid; gap: 6px; min-width: 280px; }
.totals > div { display: flex; justify-content: space-between; gap: 20px; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--muted); }
.totals dd { font-weight: 600; }
.totals-grand { padding-top: 8px; border-top: 1px solid var(--line); font-size: 1.1rem; }
.totals-grand dt, .totals-grand dd { color: var(--ink); font-weight: 800; }

.doc-view { display: grid; gap: 20px; }
.doc-status { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.doc-lines td:nth-child(2) { width: 48%; min-width: 220px; }
.doc-lines tfoot td { border-top: 0; padding-top: 6px; padding-bottom: 6px; font-weight: 600; color: var(--muted); }
.doc-lines tfoot tr:first-child td { border-top: 1px solid var(--line); padding-top: 12px; }
.doc-lines tfoot .grand td { font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.terbilang { margin: 12px 14px 0; font-style: italic; color: var(--ink-2); }
.terbilang span { font-style: normal; font-weight: 700; }
.payment-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 16px; align-items: end; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.payment-form .form-actions { grid-column: 1 / -1; }

/* ---------- login ---------- */
.login-page { background: var(--forest); }
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-side { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px clamp(24px, 5vw, 64px); color: rgba(255, 255, 255, 0.8); }
.login-logo img { height: 52px; width: auto; }
.login-kicker { position: relative; padding-top: 12px; font-weight: 700; color: var(--lime); }
.login-kicker::before { content: ""; position: absolute; left: -1px; top: 0; width: 40px; height: 10px; background: var(--arc) no-repeat left top / contain; }
.login-side h1 { max-width: 20ch; margin: 6px 0 14px; font-size: clamp(1.7rem, 3vw, 2.5rem); font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.login-back { display: inline-flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, 0.75); font-weight: 600; text-decoration: none; }
.login-back:hover { color: #fff; }
.login-main { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.login-form { display: grid; gap: 16px; width: min(100%, 380px); padding: 32px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.login-form h2 { font-size: 1.5rem; font-weight: 800; }
.login-help { margin: 0; font-size: 0.85rem; color: var(--muted); text-align: center; }

/* ---------- printable document (A4) ---------- */
.print-page { background: #e9ece6; }
.print-toolbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 20px; background: var(--paper); border-bottom: 1px solid var(--line); }
.print-toolbar p { margin: 0 0 0 8px; }
.sheet {
  position: relative; width: 210mm; min-height: 297mm; margin: 24px auto; padding: 16mm 15mm 18mm;
  background: #fff; color: #1d2621; font-size: 10pt; line-height: 1.45; box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}
.sheet--draft::before, .sheet--void::before {
  position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-24deg);
  font-size: 72pt; font-weight: 800; letter-spacing: 0.1em; color: rgba(180, 35, 24, 0.08); pointer-events: none;
}
.sheet--draft::before { content: "DRAFT"; }
.sheet--void::before { content: "BATAL"; }
.sheet-head { display: flex; justify-content: space-between; gap: 10mm; padding-bottom: 6mm; border-bottom: 2px solid var(--forest); }
.sheet-company { display: flex; gap: 5mm; align-items: flex-start; max-width: 60%; }
.sheet-company img { width: 32mm; height: auto; }
.sheet-company b { display: block; margin-bottom: 1mm; font-size: 11pt; color: var(--forest); }
.sheet-company p { margin: 0; font-size: 8.5pt; color: #4a5650; }
.sheet-title { text-align: right; }
.sheet-title h1 { font-size: 17pt; font-weight: 800; color: var(--forest); letter-spacing: 0.04em; }
.sheet-title > p { margin: 0 0 3mm; font-size: 9pt; color: #4a5650; }
.sheet-meta { margin-left: auto; font-size: 9pt; }
.sheet-meta th { padding: 0.6mm 4mm 0.6mm 0; font-weight: 600; color: #4a5650; text-align: left; }
.sheet-meta td { padding: 0.6mm 0; font-weight: 700; text-align: right; }
.sheet-to { margin: 7mm 0 6mm; }
.sheet-to b { font-size: 11pt; }
.sheet-to p { margin: 0; }
.sheet-label { margin: 0 0 1mm; font-size: 8pt; font-weight: 700; color: #6b7770; letter-spacing: 0.04em; }
.sheet .table-wrap { border: 0; border-radius: 0; overflow: visible; }
.sheet .table { font-size: 9.5pt; }
.sheet .table th { padding: 2.2mm 2.5mm; background: var(--forest); color: #fff; font-size: 8.5pt; }
.sheet .table td { padding: 2.2mm 2.5mm; border-bottom: 1px solid #dfe4dc; }
.sheet .table tbody tr:hover td { background: none; }
.sheet .doc-lines tfoot td { color: #1d2621; }
.sheet .terbilang { margin: 3mm 0 0; font-size: 9pt; }
.sheet-foot { display: grid; grid-template-columns: 1fr 55mm; gap: 10mm; margin-top: 9mm; font-size: 9pt; }
.sheet-foot .sheet-label { margin-top: 3mm; }
.sheet-foot .sheet-label:first-child { margin-top: 0; }
.sheet-sign { text-align: center; }
.sign-space { height: 22mm; }
.sheet-sign b { display: block; padding-top: 1.5mm; border-top: 1px solid #1d2621; }

@page { size: A4; margin: 0; }
@media print {
  .no-print { display: none !important; }
  body.print-page { background: #fff; }
  .sheet { margin: 0; box-shadow: none; width: auto; min-height: auto; }
  .sheet .table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .payment-form { grid-template-columns: 1fr 1fr; }
  /* line editor: each row becomes a small card */
  .lines { min-width: 0; }
  .lines thead { display: none; }
  .lines tr.line { display: grid; grid-template-columns: repeat(3, 1fr) 40px; gap: 8px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .lines td { display: block; width: auto !important; padding: 0 !important; border: 0; }
  .lines td:first-child { grid-column: 1 / -1; }
  .lines td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
  .lines td.line-amount { grid-column: 1 / 4; text-align: left; }
  .lines td:last-child { align-self: end; justify-self: end; }
  .panel .table-wrap:has(.lines) { overflow: visible; }
}
@media (max-width: 900px) {
  .app { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(82vw, 280px);
    transform: translateX(-100%); transition: transform 0.2s ease;
  }
  .nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(5, 20, 14, 0.45); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 1.2rem; }
  .content { padding: 16px 16px 40px; }
  .flash { margin: 12px 16px 0; }
  .grid-2, .detail, .form-grid { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-side { padding: 28px 20px; gap: 18px; }
  .login-side h1 { font-size: 1.5rem; }
  .seg { margin-left: 0; }
  .sheet { width: 100%; min-height: auto; margin: 0; padding: 20px 16px; box-shadow: none; }
  .sheet-head { flex-direction: column; }
  .sheet-company { max-width: none; }
  .sheet-title { text-align: left; }
  .sheet-meta { margin-left: 0; }
  .sheet-foot { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .payment-form { grid-template-columns: 1fr; }
  .dl > div { grid-template-columns: 1fr; gap: 2px; }
  .topbar-actions { width: 100%; }
  .bars li { grid-template-columns: 90px 1fr 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
