/* ==========================================================
   HPP Resto — tenang, presisi, mobile-first
   Kertas hangat · Hijau #00704A · Mustard #E1AD01 (aksen tipis)
   Newsreader (judul & angka utama) · Schibsted Grotesk (antarmuka)
   ========================================================== */

@font-face {
    font-family: "Schibsted Grotesk";
    src: url("../fonts/schibsted-grotesk-latin.woff2") format("woff2");
    font-weight: 400 700;
    font-display: swap;
}
@font-face {
    font-family: "Newsreader";
    src: url("../fonts/newsreader-latin.woff2") format("woff2");
    font-weight: 400 600;
    font-display: swap;
}

:root {
    --green: #00704A;
    --green-dark: #005638;
    --green-ink: #0C3B2A;
    --green-soft: #EDF4F0;
    --green-line: #D3E4DB;
    --mustard: #E1AD01;
    --mustard-dark: #8F6E00;
    --mustard-soft: #FBF5E3;
    --mustard-line: #EEDFAE;
    --red: #B4372D;
    --red-soft: #FAEEEC;
    --red-line: #EFCFCB;
    --blue-soft: #EFF2F5;

    --bg: #F7F6F2;
    --surface: #FFFFFF;
    --muted-bg: #F2F1EC;
    --line: #E6E4DD;
    --line-strong: #D6D3CA;
    --text: #18211D;
    --text-2: #56605B;
    --text-3: #7D8580;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(24, 33, 29, .04);
    --shadow-lift: 0 2px 4px rgba(24, 33, 29, .04), 0 12px 32px -8px rgba(24, 33, 29, .12);
    --nav-h: 64px;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --font: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    caret-color: var(--green);
}

::selection { background: #CFE3D8; color: var(--green-ink); }

* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }

a { color: var(--green); text-decoration: none; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
h1 {
    font-family: var(--serif); font-weight: 500; font-size: 1.75rem; line-height: 1.15;
    letter-spacing: -.015em; font-variation-settings: "opsz" 48;
}
h2 { font-size: 1.02rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
small, .small { font-size: .82rem; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-green { color: var(--green); }
.text-mustard { color: var(--mustard-dark); }
.text-red { color: var(--red); }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    height: 60px; padding: 0 16px;
    background: rgba(247, 246, 242, .88);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 600; font-size: 1rem; color: var(--text); letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 30px; height: 30px; border-radius: 8px;
    display: grid; place-items: center;
    background: var(--green-ink); color: #fff;
    font-family: var(--serif); font-size: .92rem; font-weight: 500; font-style: italic; letter-spacing: -.02em;
    box-shadow: inset 0 -2px 0 var(--mustard);
}
.topnav { display: none; margin-left: 28px; gap: 2px; align-self: stretch; }
.topnav a {
    position: relative; display: flex; align-items: center;
    padding: 0 12px; color: var(--text-2); font-weight: 500; font-size: .9rem;
    transition: color .2s var(--ease);
}
.topnav a::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
    background: var(--green); border-radius: 2px 2px 0 0;
    transform: scaleX(0); transition: transform .3s var(--ease);
}
.topnav a:hover { color: var(--text); text-decoration: none; }
.topnav a.is-active { color: var(--text); }
.topnav a.is-active::after { transform: scaleX(1); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface); color: var(--green-ink); font-weight: 600; font-size: .82rem;
    border: 1px solid var(--line-strong);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.avatar:hover { text-decoration: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 16px calc(var(--nav-h) + 32px); }

.bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-top: 1px solid var(--line);
}
.bottomnav a {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    color: var(--text-3); font-size: .68rem; font-weight: 500; letter-spacing: .01em;
}
.bottomnav a::before {
    content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; border-radius: 0 0 2px 2px;
    background: var(--green); transform: scaleX(0); transition: transform .3s var(--ease);
}
.bottomnav a:hover { text-decoration: none; }
.bottomnav a.is-active { color: var(--green-ink); }
.bottomnav a.is-active::before { transform: scaleX(1); }
.bottomnav svg { width: 22px; height: 22px; stroke-width: 1.6; }

@media (min-width: 900px) {
    .topbar { padding: 0 28px; }
    .topnav { display: flex; }
    .bottomnav { display: none; }
    .container { padding: 40px 28px 64px; }
    h1 { font-size: 2.15rem; }
}

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 16px; margin-bottom: 24px; }
.page-head h1 { margin-bottom: 4px; }
.page-head .sub { color: var(--text-2); margin: 0; font-size: .92rem; max-width: 60ch; }
.breadcrumb { font-size: .8rem; color: var(--text-3); margin-bottom: 6px; }
.breadcrumb a { color: var(--text-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
a.card { transition: border-color .2s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease); }
a.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flat { box-shadow: none; background: transparent; }
.card.accent-green, .card.accent-mustard { border-top-width: 1px; }
@media (min-width: 700px) { .card { padding: 22px 24px; } }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid-3 .stat { padding: 12px; }
.grid-3 .stat .value { font-size: 1.4rem; }
.grid-3 .stat .label { font-size: .72rem; }
.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) {
    .grid-3 { gap: 12px; }
    .grid-3 .stat { padding: 16px 18px; }
    .grid-3 .stat .value { font-size: 1.75rem; }
    .grid-3 .stat .label { font-size: .8rem; }
    .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
    .layout-split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
}

.stat {
    padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.stat .label { font-size: .8rem; color: var(--text-2); font-weight: 500; }
.stat .value {
    font-family: var(--serif); font-size: 1.75rem; font-weight: 500; line-height: 1.15; letter-spacing: -.01em;
    font-variant-numeric: lining-nums tabular-nums; font-variation-settings: "opsz" 36; margin-top: 4px;
}
.stat .hint { font-size: .78rem; color: var(--text-3); margin-top: 2px; }
.stat.green .value { color: var(--green); }
.stat.mustard .value { color: var(--mustard-dark); }

.hero-number {
    padding: 20px 22px; border-radius: var(--radius); color: #fff;
    background: var(--green-ink);
    position: relative; overflow: hidden;
    box-shadow: inset 0 -3px 0 var(--mustard);
}
.hero-number .label { font-size: .82rem; color: rgba(255, 255, 255, .72); font-weight: 500; }
.hero-number .value {
    font-family: var(--serif); font-size: 1.85rem; font-weight: 500; line-height: 1.1; letter-spacing: -.015em; white-space: nowrap;
    font-variant-numeric: lining-nums tabular-nums; font-variation-settings: "opsz" 60; margin: 4px 0 2px;
}
.hero-number .hint { font-size: .82rem; color: rgba(255, 255, 255, .72); }
@media (min-width: 700px) { .hero-number .value { font-size: 2.4rem; } }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
    font: inherit; font-weight: 500; font-size: .9rem; cursor: pointer; white-space: nowrap;
    transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .1s var(--ease);
}
.btn:hover { text-decoration: none; border-color: #BDB9AE; background: #FBFAF7; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-accent { background: var(--mustard); border-color: var(--mustard); color: #2A2000; }
.btn-accent:hover { background: #CF9F00; border-color: #CF9F00; }
.btn-outline { background: var(--surface); }
.btn-danger { background: var(--surface); color: var(--red); border-color: var(--red-line); }
.btn-danger:hover { background: var(--red-soft); border-color: #E5B5AF; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: .84rem; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; color: var(--text-2); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--green); cursor: pointer; font-weight: 500; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: span 2; } }
.field label { display: block; font-size: .84rem; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.field .help { font-size: .78rem; color: var(--text-3); margin-top: 5px; }
.input, select.input, textarea.input {
    width: 100%; min-height: 44px; padding: 10px 12px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
    font: inherit; font-size: 16px; color: var(--text); /* 16px mencegah zoom di iOS */
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: #BDB9AE; }
textarea.input { min-height: 88px; resize: vertical; }
.input:focus, .input:focus-visible { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 112, 74, .14); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); min-width: 0; }
.input-group .addon {
    display: flex; align-items: center; padding: 0 12px; font-size: .84rem; color: var(--text-2); font-weight: 500;
    border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--muted-bg);
}
.input-group .addon.pre { border-left: 1px solid var(--line-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .addon.pre + .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.money-hint { font-size: .78rem; color: var(--green); margin-top: 5px; min-height: 1em; font-weight: 500; }

.segmented { display: inline-flex; background: var(--muted-bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 7px 14px; border-radius: 7px; font-size: .85rem; font-weight: 500; color: var(--text-2); cursor: pointer; margin: 0; transition: color .2s var(--ease), background .2s var(--ease); }
.segmented input:checked + label { background: var(--surface); color: var(--green-ink); box-shadow: 0 1px 2px rgba(24, 33, 29, .08), 0 0 0 1px var(--line); }
.segmented input:focus-visible + label { outline: 2px solid var(--green); outline-offset: 1px; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }

fieldset { border: 0; padding: 0; margin: 0; }
.section-title {
    display: flex; align-items: center; gap: 10px; font-size: .8rem; font-weight: 600; letter-spacing: .02em;
    color: var(--text-2); margin: 4px 0 14px;
}
.section-title .num {
    width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--green-line); background: var(--green-soft);
    color: var(--green-ink); display: grid; place-items: center; font-size: .72rem; font-weight: 600;
}

/* ---------- Recipe item rows ---------- */
.item-list { display: grid; gap: 10px; }
.item-row {
    display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: end;
    padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.item-row .f-ingredient { grid-column: 1 / -1; }
.item-row .f-qty { grid-column: 1 / 2; }
.item-row .f-remove { grid-column: 2 / 3; }
.item-row .f-meta { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .82rem; }
.item-row .cost { font-weight: 600; color: var(--text); }
@media (min-width: 760px) {
    .item-row { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) auto auto; }
    .item-row .f-ingredient { grid-column: auto; }
    .item-row .f-qty { grid-column: auto; }
    .item-row .f-meta { grid-column: 1 / -1; }
    .item-row .f-remove { grid-column: auto; }
}

.sticky-summary {
    position: sticky; bottom: calc(var(--nav-h) + 8px); z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; margin-top: 16px; border-radius: var(--radius);
    background: var(--green-ink); color: #fff; box-shadow: 0 12px 32px -8px rgba(12, 59, 42, .45);
}
.sticky-summary .lbl { font-size: .74rem; color: rgba(255, 255, 255, .7); font-weight: 500; }
.sticky-summary .val {
    font-family: var(--serif); font-size: 1.35rem; font-weight: 500; line-height: 1.2;
    font-variant-numeric: lining-nums tabular-nums;
}
.sticky-summary .val.mustard { color: #F2C94C; }
@media (min-width: 900px) { .sticky-summary { bottom: 16px; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -18px; padding: 0 18px; }
@media (min-width: 700px) { .table-wrap { margin: 0 -24px; padding: 0 24px; } }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
    text-align: left; font-size: .76rem; color: var(--text-3); font-weight: 500;
    padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:hover { background: #FBFAF7; }
.table tr:last-child td { border-bottom: 0; }
.table .num, .table th.num { text-align: right; white-space: nowrap; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); }
.table tr.row-total td { background: var(--green-soft); font-weight: 600; }

/* Daftar ringkas (mobile friendly) */
.list { display: grid; gap: 0; }
.list-item {
    display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--text);
}
.list-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.list-item:hover { text-decoration: none; }
a.list-item .li-title { transition: color .2s var(--ease); }
a.list-item:hover .li-title { color: var(--green); }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: .8rem; color: var(--text-2); margin-top: 1px; }
.li-sub strong, .li-sub b { font-weight: 600; color: var(--text); }
.li-end { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.li-end .v { font-weight: 600; }

/* ---------- Badges & alerts ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px;
    font-size: .74rem; font-weight: 500; white-space: nowrap;
    background: var(--muted-bg); color: var(--text-2); border: 1px solid var(--line);
}
.badge-healthy, .badge-low, .badge-green { background: var(--green-soft); color: var(--green-dark); border-color: var(--green-line); }
.badge-warning, .badge-medium, .badge-mustard { background: var(--mustard-soft); color: var(--mustard-dark); border-color: var(--mustard-line); }
.badge-danger, .badge-loss, .badge-high { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.badge-unset { background: var(--blue-soft); color: #4A5B6D; border-color: #DDE3EA; }
.badge-healthy::before, .badge-warning::before, .badge-danger::before, .badge-loss::before,
.badge-low::before, .badge-medium::before, .badge-high::before, .badge-unset::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85;
}

.alert {
    position: relative; padding: 12px 14px 12px 40px; border-radius: var(--radius-sm); margin-bottom: 10px;
    font-size: .9rem; border: 1px solid; background-repeat: no-repeat; background-position: 14px 13px; background-size: 16px;
}
.alert-success {
    background-color: var(--green-soft); border-color: var(--green-line); color: #0C4A33;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300704A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.5 2.5 2.5L16 9.5'/%3E%3C/svg%3E");
}
.alert-error, .alert-danger {
    background-color: var(--red-soft); border-color: var(--red-line); color: #6E1D16;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B4372D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E");
}
.alert-warning {
    background-color: var(--mustard-soft); border-color: var(--mustard-line); color: #574300;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238F6E00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 2.5 20h19z'/%3E%3Cpath d='M12 10v4M12 17v.01'/%3E%3C/svg%3E");
}
.alert-info {
    background-color: var(--blue-soft); border-color: #DDE3EA; color: #2C3B4B;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A5B6D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.5M12 7.5v.01'/%3E%3C/svg%3E");
}
.flash-stack { margin-bottom: 16px; }

/* ---------- Bars ---------- */
.bar { height: 6px; border-radius: 999px; background: var(--muted-bg); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.bar.mustard > span { background: var(--mustard); }
.bar.red > span { background: var(--red); }

.stacked-bar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; background: var(--muted-bg); }
.stacked-bar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: .8rem; color: var(--text-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.c-food { background: var(--green); }
.c-waste { background: #7DB89D; }
.c-pack { background: var(--mustard); }
.c-labor { background: #33433C; }
.c-util { background: #9AA59F; }
.c-other { background: #D7DAD5; }

/* Gauge food cost */
.gauge { position: relative; height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--green) 0%, var(--green) 50%, var(--mustard) 50%, var(--mustard) 70%, var(--red) 70%); }
.gauge .pin { position: absolute; top: -5px; width: 4px; height: 18px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px var(--surface); transform: translateX(-2px); }
.gauge-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-3); margin-top: 6px; }

/* ---------- Tabs ---------- */
.tabs {
    display: flex; gap: 4px; overflow-x: auto; margin: 0 -16px 20px; padding: 0 16px;
    border-bottom: 1px solid var(--line); scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
    padding: 10px 12px; font-weight: 500; font-size: .92rem; color: var(--text-2); white-space: nowrap;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color .2s var(--ease), border-color .2s var(--ease);
}
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.is-active { color: var(--text); border-color: var(--green); }
@media (min-width: 900px) { .tabs { margin: 0 0 24px; padding: 0; } .tabs a:first-child { padding-left: 0; } }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: panel-in .35s var(--ease); }
.no-js .tab-panel { display: block; }
@keyframes panel-in { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Price tiers ---------- */
.tiers { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .tiers { grid-template-columns: repeat(3, 1fr); } }
.tier { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); position: relative; }
.tier .t-label { font-size: .8rem; font-weight: 500; color: var(--text-2); }
.tier .t-price {
    font-family: var(--serif); font-size: 1.6rem; font-weight: 500; line-height: 1.2; margin: 4px 0;
    font-variant-numeric: lining-nums tabular-nums;
}
.tier .t-desc { font-size: .8rem; color: var(--text-2); }
.tier.recommended { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 1px var(--green); }
.tier.recommended .t-price { color: var(--green-ink); }
.tier .ribbon {
    position: absolute; top: -9px; right: 12px; background: var(--green-ink); color: #fff;
    font-size: .68rem; font-weight: 500; padding: 2px 8px; border-radius: 6px; letter-spacing: .01em;
    box-shadow: inset 0 -2px 0 var(--mustard);
}
.tier .use-price { margin-top: 10px; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--text-2); max-width: 44ch; margin: 0 auto; }
.empty h1, .empty h2 { color: var(--text); }
.empty h2 { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; font-variation-settings: "opsz" 36; }
.empty .icon {
    width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px;
    background: var(--green-soft); border: 1px solid var(--green-line); color: var(--green);
    display: grid; place-items: center;
}
.empty .icon svg { width: 24px; height: 24px; }

/* ---------- Template picker ---------- */
.template-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .template-grid { grid-template-columns: repeat(2, 1fr); } }
.template-btn {
    display: block; width: 100%; text-align: left; padding: 13px 15px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--bg); cursor: pointer; font: inherit; color: var(--text);
    transition: border-color .2s var(--ease), background .2s var(--ease);
}
.template-btn:hover { border-color: var(--green); background: var(--surface); }
.template-btn strong { display: block; font-weight: 500; }
.template-btn span { font-size: .8rem; color: var(--text-2); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: flex-end; justify-content: center; background: rgba(12, 24, 18, .4); backdrop-filter: blur(2px); }
.modal.is-open { display: flex; }
.modal-box {
    width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
    background: var(--surface); border-radius: 16px 16px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 40px rgba(12, 24, 18, .18);
    animation: sheet-in .35s var(--ease);
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 600px) { .modal { align-items: center; } .modal-box { border-radius: 16px; padding: 24px; } }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; background: var(--bg); }
.auth-aside { display: none; }
.auth-main { display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 360px; }
.auth-card .brand { font-size: 1.05rem; margin-bottom: 40px; }
.auth-card .brand-mark { width: 34px; height: 34px; font-size: 1.05rem; border-radius: 9px; }
.auth-card h1 { font-size: 2rem; margin-bottom: 6px; }
.auth-lead { color: var(--text-2); margin-bottom: 28px; }
.auth-card .form-grid { gap: 18px; }
.auth-card .btn-primary { min-height: 46px; margin-top: 4px; font-size: .95rem; }
.auth-foot { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--text-3); font-size: .84rem; }

@media (min-width: 900px) {
    .auth-wrap:not(.is-plain) { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
    .auth-aside {
        display: flex; flex-direction: column; justify-content: space-between;
        padding: 48px 56px; color: #fff; background: var(--green-ink);
        position: relative; overflow: hidden;
    }
    .auth-aside .brand { color: #fff; }
    .auth-aside .brand-mark { background: #fff; color: var(--green-ink); }
    .auth-quote {
        font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 3.4vw, 3.1rem); line-height: 1.08;
        letter-spacing: -.02em; font-variation-settings: "opsz" 72; max-width: 13ch; margin: 0 0 28px; text-wrap: balance;
    }
    .auth-quote em { font-style: italic; color: #F2C94C; }
    .auth-formula { display: grid; gap: 10px; max-width: 380px; margin: 0; padding: 20px 0 0; border-top: 1px solid rgba(255, 255, 255, .16); }
    .auth-formula div { display: flex; justify-content: space-between; gap: 16px; font-size: .86rem; }
    .auth-formula dt { color: rgba(255, 255, 255, .62); }
    .auth-formula dd { margin: 0; color: #fff; text-align: right; }
    .auth-main { padding: 48px; }
    .auth-main .auth-card > .brand { display: none; }
}

/* ---------- Misc ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--text-2); }
.kv .v { font-weight: 500; text-align: right; }
.kv.total { border-top: 1px solid var(--text); border-bottom: 0; margin-top: 6px; padding-top: 12px; align-items: baseline; }
.kv.total .k { color: var(--text); font-weight: 600; }
.kv.total .v {
    color: var(--green-ink); font-family: var(--serif); font-weight: 500; font-size: 1.3rem;
    font-variant-numeric: lining-nums tabular-nums;
}

.divider { height: 1px; background: var(--line); margin: 18px 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tip-list { margin: 0; padding-left: 18px; }
.tip-list li { margin-bottom: 8px; font-size: .9rem; }
.tip-list li::marker { color: var(--mustard-dark); }

.range { width: 100%; accent-color: var(--green); }
.sim-row { display: grid; grid-template-columns: 1fr 64px; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sim-row .name { font-size: .88rem; font-weight: 500; }
.sim-row .pct { text-align: right; font-weight: 600; font-size: .88rem; color: var(--mustard-dark); }
.sim-row input { grid-column: 1 / -1; }

.inline-form { display: inline; }

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

/* ---------- Print ---------- */
.print-only { display: none; }
@media print {
    @page { margin: 14mm; }
    body { font-size: 11px; background: #fff; }
    .topbar, .bottomnav, .no-print, .actions, .tabs, .flash-stack { display: none !important; }
    .print-only { display: block; }
    .container { max-width: none; padding: 0; }
    .card { box-shadow: none; break-inside: avoid; padding: 10px; margin-bottom: 10px; }
    .tab-panel { display: block !important; animation: none; }
    .table-wrap { overflow: visible; margin: 0; padding: 0; }
    a { color: inherit; }
    .hero-number { background: #fff !important; color: var(--text); border: 1px solid var(--green); box-shadow: none; }
    .hero-number .label, .hero-number .hint { color: var(--text-2); }
}

/* =========================================================
   Login Google, notifikasi, berbagi grup, link publik
   ========================================================= */
.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; }
.field-label { display: block; font-size: .84rem; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.link-like { color: var(--green); font-weight: 500; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; background: var(--muted-bg); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; }

/* Avatar & lonceng notifikasi */
.avatar-link { display: inline-flex; border-radius: 50%; }
.avatar-link:hover { text-decoration: none; }
.avatar-link:hover .avatar { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.avatar { flex-shrink: 0; overflow: hidden; }
.avatar.has-photo { padding: 0; background: var(--muted-bg); }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 36px; height: 36px; font-size: .84rem; }
.avatar-xs { width: 24px; height: 24px; font-size: .68rem; border-width: 2px; border-color: var(--surface); }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-ghost { background: var(--muted-bg); color: var(--text-2); border-style: dashed; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar + .avatar { margin-left: -7px; }

.bell {
    position: relative; width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center; color: var(--text-2);
    transition: background .2s var(--ease), color .2s var(--ease);
}
.bell svg { width: 21px; height: 21px; }
.bell:hover, .bell.is-active { background: var(--muted-bg); color: var(--text); text-decoration: none; }
.bell-count {
    position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: var(--red); color: #fff; font-size: .66rem; font-weight: 700;
    display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--bg);
}

/* Tombol Google */
.btn-google {
    gap: 10px; min-height: 48px; background: var(--surface); color: #1F1F1F;
    border: 1px solid #C9C6BD; font-weight: 600; font-size: .95rem;
}
.btn-google:hover { background: #FBFAF7; border-color: #9F9B90; }
.btn-google .g-logo { flex-shrink: 0; }
.kv .v .g-logo { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }

/* Daftar grup */
.group-section { margin-bottom: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-head h2 { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; margin: 0; font-variation-settings: "opsz" 36; }
.group-card { color: inherit; text-decoration: none; margin: 0; display: block; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.group-card:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.invite-banner { display: block; color: #2C3B4B; margin-bottom: 20px; }
.invite-banner:hover { text-decoration: none; border-color: #C9D2DC; }
.empty-inline { padding: 14px 16px; }
.share-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: -8px 0 14px; }

/* Undang anggota */
.invite-input { display: flex; gap: 8px; }
.invite-input .input { flex: 1; min-width: 0; }
.invite-input .btn { flex-shrink: 0; }
.invite-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.invite-chips:empty { display: none; }
.invite-chip {
    display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
    padding: 3px 4px 3px 10px; border-radius: 999px; font-size: .84rem;
    background: var(--green-soft); color: var(--green-ink); border: 1px solid var(--green-line);
}
.invite-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-chip button {
    width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: inherit;
    font-size: 1rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.invite-chip button:hover { background: rgba(0, 112, 74, .12); }
.invite-error { color: var(--red); font-size: .8rem; margin-top: 6px; }

.member-row { align-items: flex-start; gap: 12px; }
.member-row .li-title { white-space: normal; }
.member-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { flex: 1; min-width: 0; font-size: .84rem; background: var(--muted-bg); }
.copy-field .btn { flex-shrink: 0; }

/* Notifikasi */
.notif { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center; background: var(--muted-bg); color: var(--text-2);
}
.notif-icon.type-invite { background: var(--mustard-soft); color: var(--mustard-dark); }
.notif-icon.type-invite_accepted { background: var(--green-soft); color: var(--green); }
.notif-icon.type-invite_declined, .notif-icon.type-member_removed, .notif-icon.type-group_deleted { background: var(--red-soft); color: var(--red); }
.notif-title { font-weight: 500; line-height: 1.4; }
.notif-title a { color: var(--text); }
.notif.is-unread .notif-title { font-weight: 600; }
.notif .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-left: 6px; vertical-align: 2px; }

/* Profil */
.profile-id { display: flex; align-items: center; gap: 14px; }
.profile-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; line-height: 1.2; }

/* Halaman undangan (layout auth) */
.eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--mustard-dark); margin: 0 0 6px; }
.invite-title { overflow-wrap: anywhere; }

/* ---------- Ringkasan HPP publik ---------- */
.public-body { background: var(--bg); }
.pub-wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.pub-hero { background: var(--green-ink); color: #fff; padding: 18px 0 30px; border-bottom: 4px solid var(--mustard); }
.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.pub-hero .brand { color: #fff; }
.pub-hero .brand-mark { background: #fff; color: var(--green-ink); }
.pub-print { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .28); }
.pub-print:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .5); }
.pub-eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #F2C94C; margin: 0 0 8px; }
.pub-hero h1 { color: #fff; font-size: clamp(1.9rem, 6vw, 2.8rem); margin: 0 0 8px; overflow-wrap: anywhere; }
.pub-desc { color: rgba(255, 255, 255, .82); max-width: 60ch; margin: 0 0 8px; }
.pub-meta { color: rgba(255, 255, 255, .62); font-size: .84rem; margin: 0; }
.pub-main { padding-top: 20px; padding-bottom: 32px; }
.pub-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: -44px 0 16px; position: relative; }
.pub-stats .stat { box-shadow: var(--shadow-lift); }
.pub-stats .stat .value { font-size: 1.35rem; }
@media (min-width: 760px) { .pub-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } .pub-stats .stat .value { font-size: 1.6rem; } }
.pub-sub { margin: 18px 0 8px; font-size: .88rem; color: var(--text-2); font-weight: 500; }
.pub-table { display: none; }
.pub-cards { display: grid; gap: 10px; }
.pub-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--bg); }
.pub-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pub-card-head h3 { margin: 0; font-size: .98rem; overflow-wrap: anywhere; }
.pub-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.pub-card-grid div { display: flex; flex-direction: column; min-width: 0; }
.pub-card-grid .wide { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; border-top: 1px dashed var(--line-strong); padding-top: 8px; }
.pub-card-grid span { font-size: .74rem; color: var(--text-3); }
.pub-card-grid strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.pub-card-grid em { font-style: normal; font-size: .74rem; color: var(--text-3); }
@media (min-width: 760px) { .pub-table { display: block; } .pub-cards { display: none; } }
.pub-notes h2 { margin-bottom: 12px; }
.pub-foot { border-top: 1px solid var(--line); padding: 18px 0 calc(22px + env(safe-area-inset-bottom)); color: var(--text-3); font-size: .8rem; }

@media print {
    .public-body { background: #fff; }
    .pub-hero { background: #fff !important; color: var(--text); border-bottom: 2px solid var(--green); padding: 0 0 10px; }
    .pub-hero h1, .pub-hero .brand { color: var(--text); }
    .pub-hero .brand-mark { background: var(--green-ink); color: #fff; }
    .pub-eyebrow { color: var(--mustard-dark); }
    .pub-desc, .pub-meta { color: var(--text-2); }
    .pub-stats { margin: 12px 0; grid-template-columns: repeat(4, 1fr); }
    .pub-stats .stat { box-shadow: none; }
    .pub-table { display: block !important; }
    .pub-cards { display: none !important; }
    .pub-wrap { max-width: none; padding: 0; }
}
.pub-table .table { table-layout: fixed; width: 100%; }
.pub-table th:nth-child(1) { width: 27%; }
.pub-table th:nth-child(2), .pub-table th:nth-child(3), .pub-table th:nth-child(4) { width: 13%; }
.pub-table th:nth-child(5), .pub-table th:nth-child(6) { width: 10%; }
.pub-table th:nth-child(7) { width: 14%; }
.pub-table td:first-child strong { overflow-wrap: anywhere; }

/* ---------- Tautan legal, bantuan, persetujuan ---------- */
.help-link { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); transition: background .2s var(--ease), color .2s var(--ease); }
.help-link svg { width: 21px; height: 21px; }
.help-link:hover { background: var(--muted-bg); color: var(--text); text-decoration: none; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; }
.legal-links a { color: var(--text-3); }
.legal-links a:hover { color: var(--text); }
.auth-card .legal-links { margin-top: 14px; }
.app-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
.pub-foot .legal-links { margin-top: 8px; }

.google-form { display: grid; gap: 14px; }
.consent-check { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; line-height: 1.5; color: var(--text-2); cursor: pointer; margin: 0; font-weight: 400; }
.consent-check input { width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--green); }
.consent-check a { font-weight: 500; }
.consent-docs { display: grid; gap: 8px; margin-bottom: 18px; }
.consent-doc { display: flex; flex-direction: column; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.consent-doc:hover { text-decoration: none; border-color: var(--green); }
.consent-doc strong { font-weight: 600; }
.consent-doc strong::after { content: " ↗"; color: var(--green); font-weight: 400; }
.consent-doc span { font-size: .8rem; color: var(--text-3); }

/* ---------- Halaman dokumen (panduan, S&K, privasi) ---------- */
.docs-body { background: var(--bg); }
.docs-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.docs-topbar { gap: 8px; }
.docs-nav { display: none; gap: 2px; margin-left: 20px; align-self: stretch; }
.docs-nav a { position: relative; display: flex; align-items: center; padding: 0 12px; color: var(--text-2); font-weight: 500; font-size: .9rem; }
.docs-nav a:hover { color: var(--text); text-decoration: none; }
.docs-nav a.is-active { color: var(--text); }
.docs-nav a.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--green); border-radius: 2px 2px 0 0; }
@media (min-width: 820px) { .docs-nav { display: flex; } }
.docs-hero { padding: 28px 0 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.docs-hero h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-bottom: 8px; }
.docs-lead { color: var(--text-2); max-width: 62ch; margin: 0; }
.docs-version { margin: 10px 0 0; font-size: .82rem; color: var(--text-3); }
.docs-hero .eyebrow { margin-bottom: 8px; }
.docs-layout { display: grid; gap: 18px; padding-top: 20px; padding-bottom: 40px; }
@media (min-width: 960px) {
    .docs-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 40px; padding-top: 32px; }
    .docs-toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; }
}
.toc-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.toc-box summary { padding: 12px 14px; font-weight: 600; font-size: .9rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.toc-box summary::-webkit-details-marker { display: none; }
.toc-box summary::after { content: "▾"; color: var(--text-3); transition: transform .2s var(--ease); }
.toc-box[open] summary::after { transform: rotate(180deg); }
.toc-box ol { list-style: none; margin: 0; padding: 0 8px 10px; }
.toc-box li a { display: block; padding: 6px 8px; border-radius: 6px; font-size: .84rem; line-height: 1.35; color: var(--text-2); }
.toc-box li a:hover { background: var(--muted-bg); color: var(--text); text-decoration: none; }
.toc-box li a.is-current { background: var(--green-soft); color: var(--green-ink); font-weight: 500; }
@media (min-width: 960px) { .toc-box { border: 0; background: transparent; } .toc-box summary { padding: 0 8px 10px; cursor: default; } .toc-box summary::after { display: none; } .toc-box ol { padding: 0; } }

.doc { max-width: 76ch; min-width: 0; font-size: .97rem; line-height: 1.7; }
.doc-section { scroll-margin-top: 80px; padding-bottom: 8px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.doc-section:last-child { border-bottom: 0; }
.doc h2 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; line-height: 1.25; margin: 0 0 12px; font-variation-settings: "opsz" 36; }
.doc h3 { font-size: 1.02rem; margin: 20px 0 8px; }
.doc p, .doc ul, .doc ol { margin: 0 0 12px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--text-3); }
.doc strong { font-weight: 600; }
.doc a { text-decoration: underline; text-decoration-color: var(--green-line); }
.doc a:hover { text-decoration-color: var(--green); }
.doc-meta { font-size: .84rem; color: var(--text-3); }
.doc .table-wrap { margin: 0 0 14px; padding: 0; }
.doc .table { font-size: .88rem; }
.doc .ui { display: inline-block; padding: 0 6px; border-radius: 5px; background: var(--muted-bg); border: 1px solid var(--line); font-size: .86em; font-weight: 500; white-space: nowrap; color: var(--text); line-height: 1.5; }
.doc ol.steps { list-style: none; counter-reset: step; padding-left: 0; }
.doc ol.steps > li { counter-increment: step; position: relative; padding-left: 40px; margin-bottom: 12px; }
.doc ol.steps > li::before {
    content: counter(step); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
    background: var(--green-ink); color: #fff; font-size: .8rem; font-weight: 600; display: grid; place-items: center;
    box-shadow: inset 0 -2px 0 var(--mustard);
}
.callout { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 14px; background: var(--surface); }
.callout > :last-child { margin-bottom: 0; }
.callout-info { border-color: #DDE3EA; border-left-color: #4A5B6D; background: var(--blue-soft); }
.callout-warning { border-color: var(--mustard-line); border-left-color: var(--mustard); background: var(--mustard-soft); }
.callout-tip { border-color: var(--green-line); border-left-color: var(--green); background: var(--green-soft); }
.formula {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; line-height: 1.6;
    background: var(--green-ink); color: #EAF3EE; border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 14px;
    overflow-x: auto; white-space: pre-wrap;
}
.faq { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 8px; }
.faq summary { padding: 12px 40px 12px 14px; font-weight: 500; cursor: pointer; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 14px; top: 9px; font-size: 1.2rem; color: var(--green); }
.faq[open] summary::after { content: "−"; }
.faq > div { padding: 0 14px 4px; color: var(--text-2); }
.defs { display: grid; gap: 0; margin: 0 0 14px; }
.defs dt { font-weight: 600; padding-top: 10px; }
.defs dd { margin: 2px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--text-2); }
@media (min-width: 700px) { .defs { grid-template-columns: 200px 1fr; } .defs dt, .defs dd { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; } .defs dt { padding-right: 16px; } }
.docs-foot { border-top: 1px solid var(--line); padding: 18px 0 calc(24px + env(safe-area-inset-bottom)); font-size: .8rem; color: var(--text-3); }
.docs-foot .docs-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
@media print {
    .docs-topbar, .docs-toc, .docs-foot { display: none !important; }
    .docs-layout { display: block; padding: 0; }
    .doc { max-width: none; }
    .faq { break-inside: avoid; }
    .faq > div { display: block; }
}
.docs-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.docs-tabs::-webkit-scrollbar { display: none; }
.docs-tabs a { padding: 11px 10px; font-size: .88rem; font-weight: 500; color: var(--text-2); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.docs-tabs a:hover { text-decoration: none; color: var(--text); }
.docs-tabs a.is-active { color: var(--text); border-color: var(--green); }
@media (min-width: 820px) { .docs-tabs { display: none; } }
@media print { .docs-tabs { display: none; } }

/* ---------- Tombol outline berwarna sesuai fungsi ----------
   .btn-line-green  = tambah / simpan / setujui / duplikat
   .btn-line-blue   = lihat / buka / navigasi / cetak / export
   .btn-line-amber  = ubah / pengaturan / kirim ulang / ganti link
   .btn-line-slate  = batal / kembali (netral)
   .btn-danger      = hapus / keluarkan / tolak / nonaktifkan (merah) */
.btn-line-green { background: var(--surface); color: var(--green-dark); border-color: #8CC2A9; }
.btn-line-green:hover { background: var(--green-soft); border-color: var(--green); color: var(--green-ink); }
.btn-line-blue { background: var(--surface); color: #2F5B85; border-color: #A9C1DA; }
.btn-line-blue:hover { background: #EEF4FA; border-color: #2F5B85; color: #22476B; }
.btn-line-amber { background: var(--surface); color: var(--mustard-dark); border-color: #E2C25C; }
.btn-line-amber:hover { background: var(--mustard-soft); border-color: var(--mustard); color: #6E5500; }
.btn-line-slate { background: var(--surface); color: #4A5B6D; border-color: #B9C3CE; }
.btn-line-slate:hover { background: var(--blue-soft); border-color: #4A5B6D; color: #2C3B4B; }
.btn-danger { border-color: #E3A9A2; }
.btn-danger:hover { border-color: var(--red); }
.btn-line-green svg, .btn-line-blue svg, .btn-line-amber svg, .btn-line-slate svg { flex-shrink: 0; }

/* Input + tombol sejajar (update harga bahan, harga jual sendiri) */
.inline-action { margin: 0; }
.inline-action-row { display: flex; gap: 10px; align-items: stretch; }
.inline-action-row .input-group { flex: 1 1 auto; min-width: 0; }
.inline-action-row .btn { flex: 0 0 auto; min-height: 0; }
@media (max-width: 420px) { .inline-action-row { flex-direction: column; } .inline-action-row .btn { min-height: 44px; } }

/* ---------- Pilih template HPP (popup) ---------- */
.template-link { margin: 12px 0 0; color: var(--text-2); }
.template-link .link-btn { font-size: inherit; }
.modal-box.modal-wide { max-width: 760px; }
.template-modal { display: flex; flex-direction: column; padding: 0; overflow: hidden; max-height: 92vh; }
.template-modal-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.template-cats { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; scrollbar-width: none; }
.template-cats::-webkit-scrollbar { display: none; }
.tcat { flex-shrink: 0; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .8rem; font-weight: 500; cursor: pointer; }
.tcat:hover { border-color: var(--green); color: var(--green-ink); }
.tcat.is-active { background: var(--green-ink); border-color: var(--green-ink); color: #fff; }
.template-modal-body { overflow-y: auto; padding: 4px 18px 8px; -webkit-overflow-scrolling: touch; }
.template-group h3 { position: sticky; top: 0; z-index: 1; margin: 0; padding: 12px 0 6px; background: var(--surface); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--mustard-dark); }
.template-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.template-group:last-of-type .template-row:last-child { border-bottom: 0; }
.template-name { font-weight: 600; }
.template-est { font-size: .78rem; color: var(--text-3); margin-top: 3px; }
.template-est strong { color: var(--green-dark); font-weight: 600; }
.template-row .btn { flex-shrink: 0; }
.template-note { margin: 0; padding: 10px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); flex-shrink: 0; }
.template-empty { padding: 20px 0; text-align: center; }
@media (min-width: 600px) { .template-modal { padding: 0; } .template-modal-head { padding: 22px 24px 14px; } .template-modal-body { padding: 4px 24px 10px; } .template-note { padding: 10px 24px 14px; } }
.template-note { font-size: .74rem; line-height: 1.45; }
.template-est strong { white-space: nowrap; }

/* Bahan baku standar */
.starter-check { padding: 2px 0; }
.starter-check strong { color: var(--text); }
.starter-banner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
    padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--green-line); border-left: 4px solid var(--green);
    border-radius: var(--radius-sm); background: var(--green-soft); font-size: .88rem;
}
.starter-banner form { flex-shrink: 0; }

/* ---------- Kotak cari bahan (autocomplete) di form HPP ---------- */
.combo { position: relative; }
.combo-input { padding-right: 36px; }
.combo-native { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; border: 0 !important; opacity: 0; pointer-events: none; }
.combo-clear {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%;
    border: 0; background: transparent; color: var(--text-3); font-size: 1.15rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.combo-clear:hover { background: var(--muted-bg); color: var(--text); }
.combo-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 25; margin: 0; padding: 4px; list-style: none;
    max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lift);
}
.combo-list [role=option] { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: baseline; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.combo-list [role=option]:hover, .combo-list [role=option].is-active { background: var(--green-soft); }
.combo-list [role=option].is-current .combo-name::after { content: " ✓"; color: var(--green); font-weight: 600; }
.combo-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-name mark { background: #fbe7a6; color: inherit; border-radius: 2px; padding: 0 1px; }
.combo-meta { grid-column: 2; grid-row: 1; font-size: .74rem; color: var(--text-3); white-space: nowrap; }
.combo-alias { grid-column: 1 / -1; font-size: .74rem; color: var(--mustard-dark); }
.combo-empty { padding: 10px; font-size: .86rem; color: var(--text-2); }
.combo-empty .link-btn { display: inline; }
@media (max-width: 520px) { .combo-list [role=option] { grid-template-columns: 1fr; } .combo-meta { grid-column: 1; grid-row: auto; } }

/* ---------- Developer: kunci API & dokumentasi API ---------- */
.input.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.code-block { margin: 0 0 14px; padding: 12px 14px; background: #18211D; color: #E8EFEA; border-radius: var(--radius-sm); overflow-x: auto; font-size: .8rem; line-height: 1.6; -webkit-overflow-scrolling: touch; }
.code-block code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; white-space: pre; }
.key-row.is-off .li-title { color: var(--text-3); text-decoration: line-through; }
.new-key .copy-field .input { font-size: .86rem; background: var(--surface); }
.doc-wide { max-width: 92ch; }
.doc .code-block { font-size: .82rem; }
.endpoint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 22px 0 8px; padding: 9px 12px; background: var(--muted-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); scroll-margin-top: 80px; }
.endpoint code { background: none; border: 0; padding: 0; font-size: .9rem; font-weight: 600; color: var(--text); word-break: break-all; }
.endpoint .scope { margin-left: auto; font-size: .76rem; color: var(--text-3); }
.method { display: inline-block; min-width: 58px; text-align: center; padding: 1px 8px; border-radius: 6px; font: 700 .72rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .03em; color: #fff; }
.method-get { background: #2F6F9F; }
.method-post { background: var(--green); }
.method-patch { background: #B8860B; }
.method-delete { background: #B3261E; }
.doc .table td code, .doc .table th code { white-space: nowrap; }
.doc .ep-index td:first-child { white-space: nowrap; }
