:root {
    --bg: #fbf5f8;
    --surface: #ffffff;
    --surface-soft: #fdf6f9;
    --ink: #3a2b33;
    --muted: #9a8791;
    --line: #f0e3ea;
    --rose: #d9648a;
    --rose-dark: #b8466b;
    --rose-soft: #f6c8d8;
    --blush: #fbe7f0;
    --gold: #c9a86a;
    --primary: #d9648a;
    --primary-dark: #b8466b;
    --sidebar-bg: #3a2230;
    --sidebar-bg-2: #4d2f40;
    /* alias lama supaya referensi var(--teal)/var(--sage) tetap aman */
    --teal: #b8466b;
    --teal-dark: #9c3a5b;
    --sage: #fbe7f0;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 12px 34px rgba(58, 27, 41, .10);
    --shadow-sm: 0 4px 14px rgba(58, 27, 41, .07);
    --sidebar-w: 266px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--rose-dark); font-weight: 700; text-decoration: none; }
a:hover { color: var(--rose); }

/* ---------- App shell ---------- */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns .2s ease;
}
.app-shell.is-collapsed { --sidebar-w: 78px; }

/* ---------- Sidebar ---------- */
.sidebar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 18%),
        linear-gradient(180deg, #3a1d2e 0%, #4a2a3b 48%, #2b1824 100%);
    color: #f3e6ee;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px 12px;
    position: sticky;
    top: 0;
}

.sidebar-head { align-items: center; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); display: flex; gap: 10px; justify-content: space-between; padding: 10px; }
.brand { align-items: center; display: flex; gap: 12px; min-width: 0; }
.brand-mark {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(20, 8, 14, .22);
    color: #fff;
    display: flex;
    flex: 0 0 42px;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    max-height: 42px;
    max-width: 42px;
    overflow: hidden;
    padding: 6px;
    position: relative;
    width: 42px;
}
.brand-mark img { display: block; height: auto; left: 50%; max-height: 28px; max-width: 28px; object-fit: contain; position: absolute; top: 50%; transform: translate(-50%, -50%); width: auto; }
.brand-text { min-width: 0; }
.brand-text strong { color: #fff; display: block; font-size: 14px; line-height: 1.18; white-space: normal; }
.brand-text span { color: #d6b6c6; display: block; font-size: 11px; white-space: nowrap; }

.sidebar-collapse {
    background: rgba(255, 255, 255, .11);
    border: 0;
    border-radius: 10px;
    color: #e6cdd9;
    cursor: pointer;
    flex: 0 0 auto;
    height: 34px;
    line-height: 1;
    min-height: 0;
    padding: 0;
    width: 34px;
}
.sidebar-collapse:hover { background: rgba(255, 255, 255, .16); color: #fff; }

.sidebar-role { color: #f4c8d9; font-size: 10.5px; font-weight: 800; letter-spacing: .13em; margin: 4px 0 2px; padding: 0 12px; text-transform: uppercase; }

.sidebar-nav { display: grid; gap: 7px; }
.nav-link { align-items: center; border: 1px solid transparent; border-radius: 13px; color: #f0dce6; display: flex; gap: 12px; padding: 10px 11px; position: relative; transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
.nav-link:hover { background: rgba(255, 255, 255, .10); border-color: rgba(255, 255, 255, .10); color: #fff; transform: translateX(2px); }
.nav-link.active { background: linear-gradient(135deg, #e27499, var(--rose-dark)); border-color: rgba(255, 255, 255, .18); color: #fff; box-shadow: 0 12px 26px rgba(184, 70, 107, .34); }
.nav-link.active::after { background: #fff; border-radius: 999px; content: ""; height: 22px; position: absolute; right: -2px; top: 50%; transform: translateY(-50%); width: 4px; }
.nav-ico { align-items: center; background: rgba(255, 255, 255, .09); border-radius: 10px; display: inline-flex; flex: 0 0 28px; height: 28px; justify-content: center; }
.nav-ico svg { height: 17px; width: 17px; }
.nav-link.active .nav-ico, .nav-group-summary.active .nav-ico { background: rgba(255, 255, 255, .18); }
.nav-label { display: grid; line-height: 1.25; min-width: 0; }
.nav-label .nav-title { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.nav-label small { color: #c6a3b5; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link.active .nav-label small { color: #f3d6e2; }
.nav-group { background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .10); border-radius: 15px; overflow: hidden; }
.nav-group[open] { background: rgba(255, 255, 255, .075); border-color: rgba(255, 255, 255, .18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.nav-group-summary { align-items: center; border-left: 3px solid transparent; border-radius: 14px; color: #ecd9e3; cursor: pointer; display: flex; gap: 10px; list-style: none; padding: 10px 9px; }
.nav-group-summary::-webkit-details-marker { display: none; }
.nav-group-summary:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.nav-group-summary.active { background: linear-gradient(135deg, rgba(217, 100, 138, .34), rgba(255, 255, 255, .08)); border-left-color: #f4b3c6; color: #fff; }
.nav-group-summary .nav-label .nav-title { font-size: 13.5px; font-weight: 800; }
.nav-group-summary .nav-label small { color: #d7becb; white-space: normal; }
.nav-group-count { align-items: center; background: rgba(255, 255, 255, .15); border-radius: 999px; color: #fff; display: inline-flex; flex: 0 0 auto; font-size: 10.5px; font-weight: 800; height: 22px; justify-content: center; min-width: 22px; padding: 0 7px; }
.nav-group-caret { align-items: center; color: #f4d8e5; display: inline-flex; flex: 0 0 18px; font-size: 15px; font-weight: 900; justify-content: center; line-height: 1; transform: rotate(0deg); transition: transform .15s ease; }
.nav-group[open] .nav-group-caret { transform: rotate(90deg); }
.nav-group-items { border-left: 1px solid rgba(255, 255, 255, .18); display: grid; gap: 3px; margin: 2px 0 9px 22px; max-height: 0; opacity: 0; overflow: hidden; padding: 0 5px 0 8px; transform: translateY(-5px); transition: max-height .28s ease, opacity .2s ease, padding .24s ease, transform .28s ease; }
.nav-group[open] .nav-group-items { max-height: 760px; opacity: 1; padding: 5px 5px 2px 8px; transform: translateY(0); }
.nav-group.is-closing .nav-group-items { max-height: 0; opacity: 0; padding-bottom: 0; padding-top: 0; transform: translateY(-5px); }
.nav-sub-link { border-radius: 11px; padding: 8px 9px; }
.nav-sub-link .nav-ico { flex-basis: 18px; height: 18px; }
.nav-sub-link .nav-ico { background: transparent; }
.nav-sub-link .nav-ico svg { height: 15px; width: 15px; }
.nav-sub-link .nav-label .nav-title { font-size: 12.5px; }
.nav-sub-link .nav-label small { font-size: 10.5px; }

.sidebar-foot { align-items: center; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .11); border-radius: 15px; display: flex; gap: 10px; margin-top: auto; padding: 10px; }
.sidebar-user-avatar { align-items: center; background: linear-gradient(135deg, #f0a5bc, var(--rose)); border-radius: 12px; color: #fff; display: inline-flex; flex: 0 0 36px; font-size: 13px; font-weight: 900; height: 36px; justify-content: center; }
.sidebar-foot .who { min-width: 0; }
.sidebar-foot .who strong { color: #fff; display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .who span { color: #d8bdca; display: block; font-size: 11px; white-space: nowrap; }
.logout-link { align-items: center; background: rgba(255, 255, 255, .12); border-radius: 11px; color: #fff; display: inline-flex; height: 36px; justify-content: center; margin-left: auto; width: 36px; }
.logout-link:hover { background: var(--rose); color: #fff; }
.logout-link svg { height: 18px; width: 18px; }

/* Collapsed (desktop icon-only) */
.is-collapsed .brand,
.is-collapsed .brand-text,
.is-collapsed .sidebar-role,
.is-collapsed .nav-label,
.is-collapsed .nav-group-count,
.is-collapsed .nav-group-caret,
.is-collapsed .sidebar-user-avatar,
.is-collapsed .sidebar-foot .who { display: none; }
.is-collapsed .nav-link { justify-content: center; padding: 11px; }
.is-collapsed .nav-group-summary { justify-content: center; padding: 11px; }
.is-collapsed .nav-group-items { display: none; }
.is-collapsed .sidebar-head { justify-content: center; padding: 10px 6px; }
.is-collapsed .sidebar-foot { justify-content: center; }
.is-collapsed .logout-link { margin: 0; }

/* ---------- Main ---------- */
.main-shell { min-width: 0; padding: 22px 24px 30px; }

.topbar { align-items: center; display: flex; gap: 14px; justify-content: space-between; margin: 0 auto 18px; max-width: 1240px; }
.topbar-left { align-items: center; display: flex; gap: 12px; min-width: 0; }
.nav-toggle { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); cursor: pointer; display: none; flex: 0 0 auto; height: 42px; line-height: 1; min-height: 0; padding: 0; width: 42px; }
.nav-toggle:hover { background: var(--blush); }
.nav-toggle svg { height: 20px; width: 20px; }

.eyebrow { color: var(--rose-dark); font-weight: 800; letter-spacing: .04em; margin: 0 0 2px; text-transform: uppercase; font-size: 11px; }
.topbar h1 { font-size: 24px; line-height: 1.15; margin: 0; }
.content-panel > h1 { display: none; }

.user-chip { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); display: flex; flex: 0 0 auto; gap: 10px; padding: 8px 12px; }
.user-chip .avatar { align-items: center; background: linear-gradient(135deg, var(--rose), var(--rose-dark)); border-radius: 50%; color: #fff; display: flex; flex: 0 0 34px; font-weight: 800; height: 34px; justify-content: center; }
.user-chip span { display: block; font-size: 13px; font-weight: 700; }
.user-chip small { color: var(--muted); display: block; font-size: 11px; }

.topbar-right { align-items: center; display: flex; flex: 0 0 auto; gap: 10px; }
.notif { position: relative; }
.notif-btn { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); color: var(--rose-dark); cursor: pointer; display: flex; height: 42px; justify-content: center; padding: 0; position: relative; width: 42px; }
.notif-btn svg { height: 20px; width: 20px; }
.notif-btn:hover { border-color: var(--rose); }
.notif-badge { align-items: center; background: #e23a5e; border: 2px solid var(--surface); border-radius: 999px; color: #fff; display: flex; font-size: 11px; font-weight: 800; height: 20px; justify-content: center; line-height: 1; min-width: 20px; padding: 0 4px; position: absolute; right: -4px; top: -5px; }
.notif-pop { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(58, 34, 48, .22); overflow: hidden; position: absolute; right: 0; top: calc(100% + 8px); width: 340px; z-index: 60; }
.notif-pop[hidden] { display: none; }
.notif-pop-head { align-items: baseline; background: linear-gradient(135deg, var(--rose), var(--rose-dark)); color: #fff; display: flex; gap: 8px; justify-content: space-between; padding: 12px 14px; }
.notif-pop-head strong { font-size: 14px; }
.notif-pop-head span { font-size: 11px; opacity: .9; }
.notif-pop-body { max-height: 360px; overflow-y: auto; }
.notif-empty { color: var(--muted); font-size: 13px; margin: 0; padding: 18px 14px; text-align: center; }
.notif-item { align-items: flex-start; border-bottom: 1px solid var(--line); color: inherit; display: flex; gap: 10px; padding: 12px 14px; text-decoration: none; transition: background .15s; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--blush, #fdeef3); }
.notif-ico { align-items: center; background: var(--blush, #fdeef3); border-radius: 8px; color: var(--rose-dark); display: flex; flex: 0 0 30px; height: 30px; justify-content: center; }
.notif-ico svg { height: 16px; width: 16px; }
.notif-text { font-size: 12.5px; line-height: 1.45; }
.notif-text small { color: #e23a5e; display: block; font-weight: 700; margin-top: 3px; }

.content-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 auto; max-width: 1240px; padding: 24px; }
.app-footer { color: var(--muted); margin: 14px auto 0; max-width: 1240px; font-size: 12px; }

.sidebar-overlay { background: rgba(40, 18, 28, .5); inset: 0; opacity: 0; pointer-events: none; position: fixed; transition: opacity .2s ease; z-index: 80; }

/* ---------- Typography ---------- */
h2 { border-top: 1px solid var(--line); font-size: 19px; margin: 26px 0 14px; padding-top: 20px; }
h3 { color: var(--rose-dark); font-size: 16px; margin: 18px 0 10px; }
h4 { font-size: 14px; margin: 14px 0 8px; }
p { margin: 0 0 14px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

p:has(> strong:only-child) {
    background: var(--blush);
    border: 1px solid var(--rose-soft);
    border-left: 4px solid var(--rose);
    border-radius: var(--radius-sm);
    color: #8a3357;
    padding: 11px 14px;
}

/* ---------- Forms ---------- */
form { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 10px 16px; margin: 0 0 20px; padding: 18px; }
label { color: var(--muted); font-size: 13px; font-weight: 700; }
input, select, textarea { background: #fff; border: 1px solid #e3d2db; border-radius: var(--radius-sm); color: var(--ink); font: inherit; margin-top: 6px; min-height: 42px; padding: 9px 12px; width: 100%; }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(217, 100, 138, .16); outline: 0; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--rose); margin-top: 0; min-height: auto; width: auto; }
input[type="file"] { padding: 8px; }
[hidden] { display: none !important; }
fieldset { border: 1px solid #efd9e2; border-radius: var(--radius-sm); margin: 0; padding: 14px; }
legend { color: var(--rose-dark); font-weight: 800; padding: 0 8px; }

button { background: var(--primary); border: 0; border-radius: var(--radius-sm); color: #fff; cursor: pointer; font: inherit; font-weight: 700; min-height: 42px; padding: 10px 18px; transition: background .15s ease, transform .05s ease; width: fit-content; }
button:hover { background: var(--primary-dark); }
button:active { transform: translateY(1px); }

/* ---------- Cards / stats ---------- */
.stats-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 16px 0 24px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); display: grid; gap: 6px; min-height: 92px; padding: 16px; }
.stat-card span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.stat-card strong { color: var(--ink); font-size: 22px; line-height: 1.2; }

.sale-item-row { align-items: end; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); display: grid; gap: 10px 14px; grid-template-columns: minmax(200px, 1fr) 130px auto; margin: 0 0 10px; padding: 12px; }
.sale-item-row p { margin: 0; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; }
table { background: #fff; border: 1px solid var(--line) !important; border-collapse: separate; border-radius: var(--radius-sm); border-spacing: 0; margin: 0 0 20px; overflow: hidden; width: 100%; }
th, td { border: 0 !important; border-bottom: 1px solid var(--line) !important; padding: 10px 12px !important; text-align: left; vertical-align: top; }
th { background: var(--blush) !important; color: #8a3357; font-size: 11.5px; letter-spacing: .02em; text-transform: uppercase; }
tbody tr:hover td { background: #fdf6f9; }
tr:last-child td { border-bottom: 0 !important; }
td form { background: transparent; border: 0; display: inline; margin: 0; padding: 0; }
td button { background: #f5e6ec; color: var(--rose-dark); min-height: 32px; padding: 6px 11px; }
td button:hover { background: var(--blush); }

/* ---------- Auth ---------- */
.auth-body {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .16)),
        linear-gradient(145deg, #fff7fa 0%, #f7edf2 48%, #fffaf0 100%);
    min-height: 100vh;
}
.auth-main {
    align-items: center;
    display: flex;
    justify-content: center;
    margin: 0;
    min-height: 100vh;
    padding: 28px;
}
.login-page {
    display: grid;
    max-width: 1040px;
    min-height: min(720px, calc(100vh - 56px));
    place-items: center;
    width: 100%;
}
.login-card {
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(240, 227, 234, .9);
    border-radius: 26px;
    box-shadow: 0 26px 70px rgba(58, 34, 48, .16);
    overflow: hidden;
    padding: 34px;
    position: relative;
    width: min(100%, 460px);
}
.login-card::before {
    background: linear-gradient(90deg, var(--rose), #eeb2c4, var(--gold));
    content: "";
    height: 5px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}
.login-brand {
    align-items: center;
    display: flex;
    gap: 14px;
    margin-bottom: 30px;
}
.login-logo {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(184, 70, 107, .14);
    display: inline-flex;
    flex: 0 0 74px;
    height: 74px;
    justify-content: center;
    max-height: 74px;
    max-width: 74px;
    padding: 10px;
    overflow: hidden;
    position: relative;
    width: 74px;
}
.login-logo img {
    display: block;
    height: auto;
    left: 50%;
    max-height: 52px;
    max-width: 52px;
    object-fit: contain;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: auto;
}

/* Kunci ukuran logo agar file gambar besar tidak meluber di mobile/browser tertentu. */
.brand .brand-mark,
.sidebar .brand-mark {
    flex: 0 0 42px !important;
    height: 42px !important;
    max-height: 42px !important;
    max-width: 42px !important;
    min-height: 42px !important;
    min-width: 42px !important;
    width: 42px !important;
}
.brand .brand-mark img,
.sidebar .brand-mark img {
    display: block !important;
    height: auto !important;
    left: 50% !important;
    max-height: 28px !important;
    max-width: 28px !important;
    object-fit: contain !important;
    position: absolute !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: auto !important;
}
.login-logo {
    flex: 0 0 74px !important;
    height: 74px !important;
    max-height: 74px !important;
    max-width: 74px !important;
    min-height: 74px !important;
    min-width: 74px !important;
    width: 74px !important;
}
.login-logo img {
    display: block !important;
    height: auto !important;
    left: 50% !important;
    max-height: 52px !important;
    max-width: 52px !important;
    object-fit: contain !important;
    position: absolute !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: auto !important;
}
.login-brand h1 {
    color: var(--rose-dark);
    font-size: 23px;
    line-height: 1.12;
    margin: 0 0 4px;
}
.login-brand p {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
}
.login-copy { margin-bottom: 22px; }
.login-copy span {
    color: var(--gold);
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.login-copy h2 {
    border: 0;
    color: var(--ink);
    font-size: 30px;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0 0 8px;
    padding: 0;
}
.login-copy p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}
.login-alert {
    background: #fff1f3;
    border: 1px solid #ffd2dc;
    border-radius: 12px;
    color: #b42345;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
    padding: 11px 13px;
}
.login-form {
    background: transparent;
    border: 0;
    box-shadow: none;
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
}
.login-field label {
    color: var(--ink);
    display: block;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 7px;
}
.login-field select,
.login-field input {
    background: #fff;
    border: 1px solid #ecd9e3;
    border-radius: 14px;
    color: var(--ink);
    font-size: 14px;
    min-height: 50px;
    outline: none;
    padding: 0 14px;
    transition: border-color .16s ease, box-shadow .16s ease;
    width: 100%;
}
.login-field select:focus,
.login-field input:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 4px rgba(217, 100, 138, .14);
}
.login-submit {
    align-items: center;
    background: linear-gradient(135deg, var(--rose), var(--rose-dark));
    border: 0;
    border-radius: 14px;
    box-shadow: 0 16px 30px rgba(184, 70, 107, .26);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 15px;
    font-weight: 800;
    justify-content: center;
    margin-top: 2px;
    min-height: 52px;
    width: 100%;
}
.login-submit:hover {
    background: linear-gradient(135deg, #e17297, var(--rose-dark));
    color: #fff;
    transform: translateY(-1px);
}

.invoice-print { background: #fff; }

/* ---------- Photo viewer ---------- */
.photo-view-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.view-photo-btn { background: var(--rose); border: 0; border-radius: 8px; color: #fff; cursor: pointer; font-size: 13px; min-height: 34px; padding: 6px 12px; }
.view-photo-btn:hover { background: var(--rose-dark); }
.photo-modal { align-items: center; background: rgba(0, 0, 0, .8); display: none; inset: 0; justify-content: center; position: fixed; z-index: 1000; }
.photo-modal.open { display: flex; }
.photo-modal img { background: #fff; border-radius: 8px; max-height: 90vh; max-width: 90vw; padding: 6px; }
.photo-modal-close { color: #fff; cursor: pointer; font-size: 34px; line-height: 1; position: absolute; right: 24px; top: 14px; }

/* ---------- Collapsible toggle ---------- */
.toggle-block { margin: 10px 0; }
.toggle-block > summary { background: var(--rose); border-radius: 8px; color: #fff; cursor: pointer; display: inline-block; font-weight: 600; list-style: none; padding: 8px 14px; }
.toggle-block > summary::-webkit-details-marker { display: none; }
.toggle-block > summary::before { content: "+ "; }
.toggle-block[open] > summary::before { content: "− "; }
.toggle-block[open] > summary { background: var(--rose-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .app-shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { bottom: 0; height: 100vh; left: 0; position: fixed; top: 0; transform: translateX(-100%); transition: transform .22s ease; width: 270px; z-index: 90; }
    .sidebar-head { align-items: center; min-height: 64px; }
    .brand { max-width: 100%; min-width: 0; }
    .brand-mark { flex-basis: 40px; height: 40px; max-height: 40px; max-width: 40px; width: 40px; }
    .sidebar .brand-mark {
        flex-basis: 40px !important;
        height: 40px !important;
        max-height: 40px !important;
        max-width: 40px !important;
        min-height: 40px !important;
        min-width: 40px !important;
        width: 40px !important;
    }
    .sidebar .brand-mark img {
        max-height: 28px !important;
        max-width: 28px !important;
    }
    .brand-text { min-width: 0; }
    .brand-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .app-shell.is-collapsed { --sidebar-w: 266px; }
    .is-collapsed .brand-text, .is-collapsed .sidebar-role, .is-collapsed .nav-label, .is-collapsed .nav-group-count, .is-collapsed .nav-group-caret, .is-collapsed .sidebar-user-avatar, .is-collapsed .sidebar-foot .who { display: revert; }
    .is-collapsed .brand { display: flex; }
    .is-collapsed .nav-link { justify-content: flex-start; padding: 10px 12px; }
    .is-collapsed .nav-group-summary { justify-content: flex-start; padding: 10px 12px; }
    .is-collapsed .nav-group-items { display: grid; }
    .sidebar-collapse { display: none; }
    .app-shell.is-open .sidebar { transform: translateX(0); }
    .app-shell.is-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .main-shell { padding: 16px; }
    .topbar h1 { font-size: 20px; }
    .content-panel { padding: 16px; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
    form { padding: 14px; }
    .sale-item-row { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
    .user-chip .chip-text { display: none; }
    .auth-main { margin: 0; padding: 16px; }
    .login-page { min-height: calc(100vh - 32px); }
    .login-card { border-radius: 20px; padding: 24px 20px; }
    .login-brand { align-items: flex-start; gap: 12px; margin-bottom: 24px; }
    .login-logo { border-radius: 16px; flex-basis: 56px; height: 56px; max-height: 56px; max-width: 56px; padding: 8px; width: 56px; }
    .login-logo {
        flex-basis: 56px !important;
        height: 56px !important;
        max-height: 56px !important;
        max-width: 56px !important;
        min-height: 56px !important;
        min-width: 56px !important;
        width: 56px !important;
    }
    .login-logo img {
        max-height: 38px !important;
        max-width: 38px !important;
    }
    .login-brand h1 { font-size: 19px; }
    .login-copy h2 { font-size: 24px; }
    .topbar { gap: 8px; }
    .notif-pop { position: fixed; right: 12px; left: 12px; top: 70px; width: auto; }
}

/* ====================================================================
   Notifikasi toast (sukses/gagal) — global
   ==================================================================== */
.app-toast-wrap { display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 32px); position: fixed; right: 18px; top: 18px; width: 360px; z-index: 4000; }
.app-toast { align-items: flex-start; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--rose); border-radius: 12px; box-shadow: 0 16px 40px rgba(40, 18, 28, .22); display: flex; gap: 11px; opacity: 0; padding: 13px 14px; transform: translateX(20px); transition: opacity .25s ease, transform .25s ease; }
.app-toast.show { opacity: 1; transform: translateX(0); }
.app-toast.is-ok { border-left-color: #2e9e5b; }
.app-toast.is-err { border-left-color: #e23a5e; }
.app-toast-ico { align-items: center; border-radius: 50%; color: #fff; display: flex; flex: 0 0 24px; font-weight: 800; height: 24px; justify-content: center; margin-top: 1px; }
.app-toast.is-ok .app-toast-ico { background: #2e9e5b; }
.app-toast.is-err .app-toast-ico { background: #e23a5e; }
.app-toast-msg { color: var(--ink); flex: 1; font-size: 13.5px; line-height: 1.45; min-width: 0; }
.app-toast-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1; min-height: 0; padding: 0 2px; width: auto; }
.app-toast-x:hover { background: none; color: var(--ink); }
@media (max-width: 540px) {
    .app-toast-wrap { left: 12px; right: 12px; top: 12px; width: auto; }
}

/* ====================================================================
   Halaman Dokter — layout dashboard modern (scoped ke .dok-page)
   ==================================================================== */
.content-panel:has(.dok-page), .content-panel:has(.fo-page) { background: var(--bg); border: 0; box-shadow: none; padding: 4px; }
.dok-page, .fo-page { color: var(--ink); }
.dok-page h1, .dok-page h2, .dok-page h3, .dok-page h4,
.fo-page h1, .fo-page h2, .fo-page h3, .fo-page h4 { border: 0; margin: 0; padding: 0; }
.dok-page p, .fo-page p { margin: 0; }

.dok-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; }

/* Hero sambutan */
/* Ukuran default icon inline agar SVG tanpa width/height tidak render raksasa (300x150). Aturan spesifik di bawah menimpanya. */
.dok-page svg, .fo-page svg { height: 18px; width: 18px; }
.dok-hero { align-items: center; background: linear-gradient(120deg, var(--blush), #fff 70%); border: 1px solid var(--line); border-radius: var(--radius); display: flex; gap: 16px; margin-bottom: 16px; padding: 18px 22px; }
.dok-hero-ico { align-items: center; background: linear-gradient(135deg, var(--rose), #f4a9c2); border-radius: 14px; box-shadow: 0 8px 18px rgba(217, 100, 138, .35); color: #fff; display: flex; flex: 0 0 54px; height: 54px; justify-content: center; }
.dok-hero-ico svg { height: 28px; width: 28px; }
.dok-hero h2 { font-size: 22px; }
.dok-hero p { color: var(--muted); margin-top: 4px; }

/* Alert */
.dok-alert { border-radius: var(--radius-sm); font-weight: 600; margin-bottom: 14px; padding: 12px 16px; }
.dok-alert.is-ok { background: #e8f7ee; border: 1px solid #b6e4c6; color: #1f7a44; }
.dok-alert.is-err { background: #fdeaea; border: 1px solid #f2bcbc; color: #b3261e; }

/* Grid dua kolom */
.dok-grid { align-items: start; display: grid; gap: 16px; grid-template-columns: 340px minmax(0, 1fr); }

/* Kartu antrean (kiri) */
.dok-queue-head { align-items: center; display: flex; gap: 10px; margin-bottom: 14px; }
.dok-queue-head h3 { font-size: 17px; }
.dok-count { background: var(--blush); border-radius: 999px; color: var(--rose-dark); font-size: 12px; font-weight: 800; margin-left: auto; padding: 2px 10px; }
.dok-queue-list { display: grid; gap: 8px; }
.dok-queue-item { align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); color: inherit; display: flex; gap: 12px; padding: 11px 12px; transition: background .15s, border-color .15s; }
.dok-queue-item:hover { background: var(--surface-soft); border-color: var(--rose-soft); }
.dok-queue-item.active { background: linear-gradient(135deg, var(--blush), #fff); border-color: var(--rose); box-shadow: var(--shadow-sm); }
.dok-q-no { color: var(--rose-dark); flex: 0 0 auto; font-size: 17px; font-weight: 800; min-width: 36px; }
.dok-queue-item.active .dok-q-no { color: var(--rose); }
.dok-q-info { flex: 1; min-width: 0; }
.dok-q-info strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.dok-q-info small { color: var(--muted); display: block; font-size: 12px; overflow-wrap: anywhere; }
.dok-q-time { color: var(--muted); flex: 0 0 auto; font-size: 11px; font-weight: 700; text-align: right; white-space: nowrap; }
.dok-q-go { align-items: center; background: var(--rose); border-radius: 50%; color: #fff; display: flex; flex: 0 0 26px; height: 26px; justify-content: center; }
.dok-q-go svg { height: 15px; width: 15px; }
.dok-queue-item:not(.active) .dok-q-go { background: #f0e3ea; color: var(--rose-dark); }
/* Pill/tag di kartu antrean boleh turun baris agar isi kartu tidak meluber ke panel kanan. */
.dok-q-info .dok-pill, .dok-q-info .dok-q-tag { max-width: 100%; white-space: normal; }
/* Waktu kunjungan sebagai baris kecil di dalam info (bukan kolom terpisah) agar tidak menyempitkan nama. */
.dok-q-when { color: var(--muted); display: block; font-size: 11px; font-weight: 600; margin-top: 2px; }
.dok-queue-empty { color: var(--muted); font-size: 13px; padding: 18px 4px; text-align: center; }
.dok-keterangan { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 14px; padding: 12px 14px; }
.dok-keterangan strong { align-items: center; color: var(--rose-dark); display: flex; font-size: 13px; gap: 6px; margin-bottom: 4px; }
.dok-keterangan strong svg { flex: 0 0 16px; height: 16px; width: 16px; }
.dok-keterangan p { color: var(--muted); font-size: 12px; }

/* Kolom detail (kanan) */
.dok-detail { display: grid; gap: 16px; }
.dok-empty { align-items: center; background: #fff; border: 1px dashed var(--rose-soft); border-radius: var(--radius); color: var(--muted); display: flex; flex-direction: column; gap: 10px; justify-content: center; min-height: 340px; padding: 30px; text-align: center; }
.dok-empty svg { color: var(--rose-soft); height: 48px; width: 48px; }

.dok-toolbar { align-items: center; display: flex; justify-content: space-between; }
.dok-back { align-items: center; color: var(--rose-dark); display: inline-flex; font-size: 14px; font-weight: 700; gap: 6px; }
.dok-back svg { height: 17px; width: 17px; }
.dok-refresh { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--rose-dark); display: inline-flex; font-size: 13px; font-weight: 700; gap: 7px; min-height: 0; padding: 8px 14px; width: auto; }
.dok-refresh:hover { background: var(--blush); }
.dok-refresh svg { height: 15px; width: 15px; }

/* Kartu pasien */
.dok-patient { align-items: center; display: flex; flex-wrap: wrap; gap: 16px; }
.dok-avatar { align-items: center; background: linear-gradient(135deg, var(--rose-soft), var(--blush)); border-radius: 50%; color: var(--rose-dark); display: flex; flex: 0 0 76px; height: 76px; justify-content: center; }
.dok-avatar svg { height: 42px; width: 42px; }
.dok-patient-main { min-width: 0; }
.dok-patient-name { align-items: center; display: flex; flex-wrap: wrap; gap: 9px; }
.dok-patient-name strong { font-size: 20px; }
.dok-patient-meta { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 13px; gap: 6px 16px; margin-top: 7px; }
.dok-patient-meta span { align-items: center; display: inline-flex; gap: 5px; }
.dok-patient-meta svg { color: var(--rose); height: 14px; stroke-width: 2; width: 14px; }
.dok-patient-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.dok-chip { align-items: center; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); display: flex; gap: 9px; min-width: 130px; padding: 9px 13px; }
.dok-chip-ico { align-items: center; background: #fff; border-radius: 9px; color: var(--rose-dark); display: flex; flex: 0 0 32px; height: 32px; justify-content: center; }
.dok-chip-ico svg { height: 17px; width: 17px; stroke-width: 2; }
.dok-chip-ico.is-c1 { background: #ede7f6; color: #6a4caf; }
.dok-chip-ico.is-c2 { background: #e3f0fd; color: #1769aa; }
.dok-chip-ico.is-c3 { background: #def3ef; color: #138f7d; }
.dok-chip small { color: var(--muted); display: block; font-size: 11px; }
.dok-chip strong { font-size: 14px; }

/* Badge gender */
.dok-badge { border-radius: 999px; font-size: 11px; font-weight: 800; padding: 3px 10px; }
.dok-badge.is-f { background: #fce4ef; color: #c2185b; }
.dok-badge.is-m { background: #e3f0fd; color: #1769aa; }

/* Tanda vital */
.dok-vitals-title { align-items: center; color: var(--rose-dark); display: flex; font-size: 14px; font-weight: 800; gap: 8px; margin-bottom: 16px; }
.dok-vitals-title svg { height: 18px; width: 18px; }
.dok-vitals-title small { color: var(--muted); font-weight: 600; }
.dok-vitals { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.dok-vital { align-items: center; display: flex; gap: 11px; }
.dok-vital-ico { align-items: center; background: var(--blush); border-radius: 12px; color: var(--rose-dark); display: flex; flex: 0 0 42px; height: 42px; justify-content: center; transition: transform .15s ease, box-shadow .15s ease; }
.dok-vital-ico svg { height: 21px; width: 21px; stroke-width: 2; }
.dok-vital:hover .dok-vital-ico { transform: translateY(-2px) scale(1.06); }
.dok-vital small { color: var(--muted); display: block; font-size: 11px; }
.dok-vital strong { font-size: 15px; }
/* Warna ikon vital — tiap tanda vital punya identitas warna sendiri */
.dok-vital-ico.is-bp { background: #fde7ec; color: #e23a5e; box-shadow: 0 6px 14px rgba(226, 58, 94, .22); }
.dok-vital-ico.is-temp { background: #fcefdc; color: #e0801f; box-shadow: 0 6px 14px rgba(224, 128, 31, .22); }
.dok-vital-ico.is-weight { background: #fdf3d4; color: #bf8b00; box-shadow: 0 6px 14px rgba(191, 139, 0, .2); }
.dok-vital-ico.is-height { background: #def3ef; color: #138f7d; box-shadow: 0 6px 14px rgba(19, 143, 125, .2); }

/* Header bagian + tabel modern */
.dok-section-head { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-bottom: 12px; }
.dok-section-head h3 { align-items: center; display: flex; font-size: 16px; gap: 8px; }
.dok-section-head h3 svg { color: var(--rose-dark); height: 18px; width: 18px; }
.dok-hint { align-items: center; color: var(--muted); display: inline-flex; font-size: 12px; gap: 6px; }
.dok-hint svg { color: var(--rose-dark); height: 15px; width: 15px; }
.dok-hint b { color: var(--rose-dark); font-weight: 700; }
.dok-table-wrap { overflow-x: auto; }
.dok-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.dok-table th { background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--line) !important; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 8px 10px !important; text-align: left; text-transform: uppercase; white-space: nowrap; }
.dok-table td { border: 0 !important; border-bottom: 1px solid var(--line) !important; font-size: 13.5px; padding: 11px 10px !important; vertical-align: middle; }
.dok-table tr:last-child td { border-bottom: 0 !important; }
.dok-table tbody tr:hover td { background: var(--surface-soft); }
.dok-table .dok-empty-row td { color: var(--muted); text-align: center; }

/* Kotak pencarian (filter tabel) */
.dok-search { margin-bottom: 12px; position: relative; }
.dok-search input { margin-top: 0; padding-left: 38px; }
.dok-search-ico { align-items: center; color: var(--muted); display: inline-flex; left: 12px; pointer-events: none; position: absolute; top: 50%; transform: translateY(-50%); }
.dok-search-ico svg { height: 17px; width: 17px; }
.dok-no-result { display: none; }
.dok-no-result td { color: var(--muted); text-align: center; }

/* Pill status */
.dok-pill { border-radius: 999px; display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 11px; white-space: nowrap; }
.dok-pill.is-info { background: #ede7f6; color: #5e35b1; }
.dok-pill.is-green { background: #e7f6ec; color: #2e7d44; }
.dok-pill.is-warn { background: #fff4e0; color: #b06f00; }
.dok-pill.is-muted { background: #f0eef2; color: #7c6f78; }
.dok-pill.is-blue { background: #e3f0fd; color: #1769aa; }

/* Tombol kecil di tabel */
.dok-btn { align-items: center; background: var(--primary); border: 0; border-radius: var(--radius-sm); color: #fff; cursor: pointer; display: inline-flex; font-size: 13px; font-weight: 700; gap: 6px; min-height: 0; padding: 8px 14px; width: auto; }
.dok-btn:hover { background: var(--primary-dark); }
.dok-btn svg { height: 14px; width: 14px; }
.dok-btn.is-ghost { background: #f0eef2; color: var(--muted); cursor: default; }
.dok-btn.is-ghost:hover { background: #f0eef2; }

/* Tab */
.dok-tabs { border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 18px; }
.dok-tab { align-items: center; background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); cursor: pointer; display: inline-flex; font-size: 13.5px; font-weight: 700; gap: 7px; min-height: 0; padding: 11px 14px; width: auto; }
.dok-tab:hover { background: transparent; color: var(--rose-dark); }
.dok-tab.active { border-bottom-color: var(--rose); color: var(--rose); }
.dok-tab svg { height: 16px; width: 16px; }
.dok-panel { display: none; }
.dok-panel.active { display: block; }

/* Form di dalam detail (override box default) */
.dok-page form.dok-form { background: transparent; border: 0; margin: 0; padding: 0; }
.dok-soap { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dok-field { margin-bottom: 14px; }
.dok-field > label { color: var(--ink); display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.dok-field textarea, .dok-field input { margin-top: 0; }
.dok-field textarea { min-height: 110px; }
.dok-locked { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); font-size: 13.5px; padding: 11px 14px; }

/* Baris checkbox "tandai treatment" (Ners/Terapis) + pilihan pelaksana */
.svc-check { align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-bottom: 8px; padding: 11px 13px; }
.svc-check:hover { background: var(--surface-soft); border-color: var(--rose-soft); }
.svc-check-main { align-items: center; cursor: pointer; display: flex; flex: 1 1 auto; gap: 11px; min-width: 0; }
.svc-check-main input { flex: 0 0 auto; margin: 0; min-height: 0; width: auto; }
.svc-check-main span { font-size: 13.5px; }
.svc-performer { flex: 0 0 auto; margin: 0; min-height: 0; padding: 6px 10px; width: auto; }

/* Filter tanggal pada daftar antrean */
.dok-datefilter { align-items: center; background: transparent; border: 0; display: flex; gap: 10px; margin: 0 0 12px; padding: 0; }
.dok-datefilter input[type="date"] { margin: 0; min-height: 38px; padding: 6px 10px; width: auto; }
.dok-datefilter a { font-size: 12.5px; font-weight: 700; white-space: nowrap; }

/* Penanda pasien belum diisi SOAP/ICD (daftar antrean dokter) */
.dok-q-tag { background: #fff4e0; border-radius: 999px; color: #b06f00; display: inline-block; font-size: 10.5px; font-weight: 700; margin-top: 3px; padding: 2px 8px; }

/* Definition list (detail identitas pasien) */
.cp-deflist { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cp-deflist > div { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 13px; }
.cp-deflist small { color: var(--muted); display: block; font-size: 11px; margin-bottom: 2px; }
.cp-deflist span { font-size: 14px; font-weight: 600; }

/* Dropzone foto */
.dok-drop { align-items: center; background: var(--surface-soft); border: 2px dashed var(--rose-soft); border-radius: var(--radius); color: var(--muted); cursor: pointer; display: flex; flex-direction: column; gap: 6px; justify-content: center; padding: 26px 18px; text-align: center; transition: border-color .15s, background .15s; }
.dok-drop:hover { background: var(--blush); border-color: var(--rose); }
.dok-drop svg { color: var(--rose); height: 34px; width: 34px; }
.dok-drop small { font-size: 11px; }
.dok-drop input[type="file"] { display: none; }
.dok-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dok-thumb { align-items: center; background: var(--blush); border: 1px solid var(--line); border-radius: 10px; color: var(--rose-dark); display: flex; font-size: 12px; font-weight: 800; height: 58px; justify-content: center; overflow: hidden; position: relative; width: 58px; }
.dok-thumb img { height: 100%; object-fit: cover; width: 100%; }
.dok-thumb-x { align-items: center; background: rgba(178, 59, 59, .92); border: 0; border-radius: 50%; color: #fff; cursor: pointer; display: flex; font-size: 14px; height: 18px; justify-content: center; line-height: 1; padding: 0; position: absolute; right: 2px; top: 2px; width: 18px; }
.dok-thumb-x:hover { background: #932f2f; }

/* Footer aksi form */
.dok-form-foot { align-items: center; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 22px; padding-top: 16px; }
.dok-form-foot .dok-clear { align-items: center; background: #fff; border: 1px solid var(--line); color: var(--muted); display: inline-flex; gap: 7px; min-height: 0; padding: 10px 18px; width: auto; }
.dok-form-foot .dok-clear:hover { background: var(--surface-soft); }
.dok-submit { align-items: center; display: inline-flex; gap: 8px; min-height: 0; padding: 11px 22px; width: auto; }
.dok-submit svg { height: 16px; width: 16px; }

/* ====================================================================
   Halaman Pendaftaran Antrian FO (scoped ke .fo-page)
   ==================================================================== */
.fo-grid { align-items: start; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 360px; }
.fo-side { display: grid; gap: 16px; }
.fo-form { background: transparent; border: 0; margin: 0; padding: 0; }

.fo-card-head { align-items: center; display: flex; gap: 11px; margin-bottom: 18px; }
.fo-card-head h3 { font-size: 17px; }
.fo-card-ico { align-items: center; border-radius: 11px; display: flex; flex: 0 0 42px; height: 42px; justify-content: center; }
.fo-card-ico svg { height: 22px; stroke-width: 2; width: 22px; }
.fo-card-ico.is-purple { background: #ede7f6; color: #6a4caf; }
.fo-card-ico.is-pink { background: #f3e7fb; color: #d6409f; }

.fo-field-grid { display: grid; gap: 14px 16px; grid-template-columns: 1fr 1fr; }
.fo-field > label { color: var(--ink); display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.fo-field input, .fo-field select { margin-top: 0; }

/* Combobox pencarian pasien */
.fo-combo { position: relative; }
.fo-combo-field { position: relative; }
.fo-combo-ico { align-items: center; color: var(--muted); display: inline-flex; left: 12px; pointer-events: none; position: absolute; top: 50%; transform: translateY(-50%); }
.fo-combo-ico svg { height: 17px; width: 17px; }
.fo-combo-field input { margin-top: 0; padding-left: 38px; padding-right: 34px; }
.fo-combo-caret { align-items: center; color: var(--muted); display: inline-flex; pointer-events: none; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.fo-combo-caret svg { height: 16px; width: 16px; }
.fo-combo.is-invalid .fo-combo-field input { border-color: #e23a5e; box-shadow: 0 0 0 3px rgba(226, 58, 94, .14); }
.fo-combo-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); left: 0; max-height: 264px; overflow-y: auto; padding: 6px; position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; }
.fo-combo-list[hidden] { display: none; }
.fo-combo-opt { align-items: flex-start; background: transparent; border: 0; border-radius: 8px; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; gap: 1px; min-height: 0; padding: 9px 10px; text-align: left; width: 100%; }
.fo-combo-opt[hidden] { display: none; }
.fo-combo-opt:hover { background: var(--surface-soft); }
.fo-combo-opt strong { font-size: 13.5px; font-weight: 700; }
.fo-combo-opt small { color: var(--muted); font-size: 12px; }
.fo-combo-hint, .fo-combo-empty { color: var(--muted); font-size: 12.5px; margin: 0; padding: 11px 10px; text-align: center; }
.fo-combo-hint[hidden], .fo-combo-empty[hidden] { display: none; }
.fo-combo-error { color: #e23a5e; display: block; font-size: 12px; font-weight: 600; margin-top: 5px; }
.fo-combo-error[hidden] { display: none; }
.fo-input-unit { position: relative; }
.fo-input-unit input { padding-right: 42px; }
.fo-input-unit span { color: var(--muted); font-size: 13px; font-weight: 700; position: absolute; right: 13px; top: 50%; transform: translateY(-50%); }

.fo-picks { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; margin-top: 18px; }
.fo-picklist { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.fo-pick-title { font-size: 13px; font-weight: 700; margin-bottom: 10px !important; }
.fo-pick-list { display: grid; gap: 2px; max-height: 184px; overflow-y: auto; }
.fo-pick-list.is-expanded { max-height: none; }
.fo-pick-item { align-items: center; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; padding: 8px 7px; }
.fo-pick-item:hover { background: var(--surface-soft); }
.fo-pick-item input[type="checkbox"] { flex: 0 0 auto; margin-top: 0; min-height: 0; width: auto; }
.fo-pick-code { color: var(--muted); flex: 0 0 auto; font-size: 12px; font-weight: 700; min-width: 48px; }
.fo-pick-name { font-size: 13.5px; min-width: 0; }
.fo-pick-name small { color: var(--muted); font-size: 11px; }
.fo-pick-price { color: var(--ink); font-size: 13px; font-weight: 600; margin-left: auto; white-space: nowrap; }
.fo-pick-empty { color: var(--muted); display: none; font-size: 13px; padding: 12px; text-align: center; }
.fo-picklist-foot { align-items: center; border-top: 1px solid var(--line); display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; }
.fo-pick-count { color: var(--muted); font-size: 12.5px; }
.fo-pick-count b { color: var(--rose-dark); }
.fo-lihat { background: transparent; border: 0; color: var(--rose-dark); cursor: pointer; font-size: 12.5px; font-weight: 700; min-height: 0; padding: 0; width: auto; }
.fo-lihat:hover { background: transparent; color: var(--rose); text-decoration: underline; }

.fo-note { align-items: flex-start; background: #f4eefc; border: 1px solid #e2d4f4; border-radius: var(--radius-sm); color: #5e35b1; display: flex; font-size: 12.5px; gap: 8px; margin-top: 16px; padding: 11px 13px; }
.fo-note svg { flex: 0 0 16px; height: 16px; margin-top: 1px; width: 16px; }

.fo-submit { justify-content: center; width: 100%; }

/* Laporan finance */
.finance-report-page { display: grid; gap: 24px; }
.finance-report-toolbar, .finance-report-filter, .finance-print-sheet { background: #fff; border: 1px solid #e5eef0; border-radius: 8px; box-shadow: 0 14px 34px rgba(38, 59, 64, .08); }
.finance-report-toolbar { align-items: center; display: flex; gap: 18px; justify-content: space-between; padding: 22px 30px; }
.finance-report-title h1 { color: #27272f; font-size: 24px; font-weight: 600; line-height: 1.2; margin: 0; }
.finance-report-title p { color: var(--muted); font-size: 13px; margin: 5px 0 0; }
.finance-report-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.finance-report-actions .dok-btn { border-radius: 10px; font-size: 15px; min-height: 44px; padding: 10px 18px; }
.dok-btn.is-green { background: #32c63a; }
.dok-btn.is-green:hover { background: #27a930; }
.finance-report-filter { padding: 28px 30px; }
.finance-report-filter .fo-fee-filter { align-items: end; display: grid; gap: 16px 24px; grid-template-columns: minmax(170px, .8fr) minmax(170px, .8fr) minmax(240px, 1.2fr) minmax(240px, 1.2fr) minmax(130px, .6fr) auto; margin: 0; }
.finance-report-filter .fo-field label { color: var(--muted); font-size: 12px; }
.finance-report-filter input, .finance-report-filter select { border-color: #d5dce0; border-radius: 8px; font-size: 15px; min-height: 48px; padding-left: 14px; }
.finance-report-filter .dok-btn { align-self: end; border-radius: 24px; font-size: 15px; min-height: 48px; padding: 10px 25px; }
.finance-standard-filter { background: #fff; border: 1px solid #e5eef0 !important; border-radius: 8px; box-shadow: 0 14px 34px rgba(38, 59, 64, .08); display: grid !important; gap: 16px 20px !important; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); padding: 22px !important; }
.finance-standard-filter .fo-field label { color: var(--muted); font-size: 12px; }
.finance-standard-filter input, .finance-standard-filter select { border-color: #d5dce0; border-radius: 8px; font-size: 14px; min-height: 46px; }
.finance-standard-filter .dok-btn { align-self: end; border-radius: 24px; justify-content: center; min-height: 46px; }
.finance-standard-filter .dok-refresh { align-self: end; justify-content: center; min-height: 46px; }
.finance-print-sheet { padding: 66px 30px 40px; }
.finance-report-heading { align-items: center; color: #111116; display: flex; flex-direction: column; font-size: 17px; gap: 6px; margin-bottom: 32px; text-align: center; }
.finance-report-heading strong { font-size: 18px; }
.finance-report-count { color: var(--muted); font-size: 13px; margin: -16px 0 14px; text-align: right; }
.finance-report-table { border-collapse: collapse; min-width: 1080px; }
.finance-report-table th { background: #f3f3f3; border-bottom: 2px solid #d7d7d7; color: #202026; font-size: 15px; padding: 19px 16px; text-align: center; }
.finance-report-table td { border-bottom: 1px solid #dedede; color: #26262d; font-size: 14px; line-height: 1.7; padding: 20px 16px; text-align: center; vertical-align: middle; }
.finance-report-table td:nth-child(3), .finance-report-table td:nth-child(4) { max-width: 210px; white-space: normal; }
.finance-report-table td:nth-child(7), .finance-report-table td:nth-child(9), .finance-report-table td:nth-child(10) { text-align: right; }

/* Filter Data Fee */
.fo-fee-filter { align-items: flex-end; background: transparent; border: 0; display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; }
.fo-fee-filter .fo-field { margin: 0; }
.fo-fee-filter .dok-btn { min-height: 42px; }
.fo-fee-filter .dok-refresh { align-self: center; }
.fo-fee-total { margin-left: auto; text-align: right; }
.fo-fee-total small { color: var(--muted); display: block; font-size: 11px; }
.fo-fee-total strong { color: var(--rose-dark); font-size: 20px; }

.fo-q-no { align-items: center; background: var(--blush); border-radius: 8px; color: var(--rose-dark); display: inline-flex; font-weight: 800; justify-content: center; min-width: 40px; padding: 4px 8px; }
.fo-vital-cell strong { display: block; font-size: 13px; }
.fo-vital-cell small { color: var(--muted); font-size: 11.5px; }
.fo-eye { align-items: center; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; color: var(--rose-dark); display: inline-flex; height: 34px; justify-content: center; width: 34px; }
.fo-eye:hover { background: var(--blush); border-color: var(--rose-soft); color: var(--rose); }
.fo-eye svg { height: 17px; width: 17px; }

@media (max-width: 980px) {
    .fo-grid { grid-template-columns: 1fr; }
    .fo-picks { grid-template-columns: 1fr; }
    .finance-report-toolbar { align-items: flex-start; flex-direction: column; padding: 18px; }
    .finance-report-actions { justify-content: flex-start; }
    .finance-report-filter { padding: 18px; }
    .finance-report-filter .fo-fee-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .finance-report-filter .dok-btn { justify-content: center; width: 100%; }
    .finance-print-sheet { padding: 34px 18px 22px; }
}
@media (max-width: 540px) {
    .fo-field-grid { grid-template-columns: 1fr; }
    .finance-report-filter .fo-fee-filter { grid-template-columns: 1fr; }
    .finance-report-actions .dok-btn { justify-content: center; width: 100%; }
    .finance-report-heading { font-size: 15px; margin-bottom: 22px; }
}

@media print {
    .sidebar, .topbar, .app-footer, .finance-report-toolbar, .finance-report-filter, .finance-standard-filter, .finance-report-count { display: none !important; }
    .main-shell, .content-panel { display: block; margin: 0; padding: 0; width: 100%; }
    .finance-report-page, .finance-print-sheet { display: block; }
    .finance-print-sheet { border: 0; box-shadow: none; padding: 24px 0 0; }
    .dok-table-wrap { overflow: visible; }
    .finance-report-table { display: table; min-width: 0; width: 100%; }
    .finance-report-table thead { position: static; }
    .finance-report-table tr { display: table-row; }
    .finance-report-table th, .finance-report-table td { display: table-cell; font-size: 11px; padding: 8px 6px; }
    .finance-report-table td::before { content: none !important; }
}

/* Modal konfirmasi */
.dok-modal { align-items: center; background: rgba(40, 18, 28, .5); display: flex; inset: 0; justify-content: center; padding: 20px; position: fixed; z-index: 200; }
.dok-modal[hidden] { display: none; }
.dok-modal-box { background: #fff; border-radius: var(--radius); box-shadow: 0 24px 60px rgba(40, 18, 28, .35); max-width: 420px; padding: 26px; text-align: center; width: 100%; }
.dok-modal-ico { align-items: center; background: var(--blush); border-radius: 50%; color: var(--rose-dark); display: inline-flex; height: 54px; justify-content: center; margin-bottom: 12px; width: 54px; }
.dok-modal-ico svg { height: 28px; width: 28px; }
.dok-modal-box h3 { font-size: 18px; margin-bottom: 8px; }
.dok-modal-box p { color: var(--ink); font-size: 14px; margin-bottom: 6px; }
.dok-modal-note { background: #fff8e1; border: 1px solid #f3d98a; border-radius: var(--radius-sm); color: #8a6d00 !important; font-size: 12.5px; margin-top: 10px !important; padding: 9px 12px; }
.dok-modal-note[hidden] { display: none; }
.dok-modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.dok-modal-actions .dok-clear { align-items: center; background: #fff; border: 1px solid var(--line); color: var(--muted); display: inline-flex; min-height: 0; padding: 10px 18px; width: auto; }
.dok-modal-actions .dok-clear:hover { background: var(--surface-soft); }
.dok-modal-actions .dok-submit { min-height: 0; padding: 10px 18px; }

@media (max-width: 980px) {
    .dok-grid { grid-template-columns: 1fr; }
    .dok-soap { grid-template-columns: 1fr; }
    .dok-patient-chips { margin-left: 0; width: 100%; }
    .dok-chip { flex: 1; }
}

/* ====================================================================
   Responsif mobile/HP untuk halaman Dokter (.dok-page) & Antrian FO (.fo-page)
   ==================================================================== */
/* Cegah konten meluber: izinkan kontainer menyusut di bawah lebar kontennya */
.dok-page, .fo-page { max-width: 100%; overflow-x: clip; }
.dok-grid, .fo-grid { min-width: 0; }
.dok-grid > *, .fo-grid > *, .dok-detail, .dok-card, .fo-side { min-width: 0; }
.dok-table-wrap { max-width: 100%; }

/* Tablet (641–980px): tabel tetap utuh, digeser horizontal di dalam kartunya */
@media (max-width: 980px) and (min-width: 641px) {
    .dok-table { display: table; min-width: max-content; white-space: nowrap; }
    .dok-table-wrap { -webkit-overflow-scrolling: touch; overflow-x: auto; }
}

@media (max-width: 760px) {
    /* Tab dokter: geser horizontal, tidak menumpuk jadi beberapa baris */
    .dok-tabs { flex-wrap: nowrap; gap: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .dok-tabs::-webkit-scrollbar { display: none; }
    .dok-tab { white-space: nowrap; }
    .dok-vitals { grid-template-columns: 1fr 1fr; }
}

/* HP (≤640px): tabel berubah jadi kartu bertumpuk — tiap baris satu kartu dengan label kolom */
@media (max-width: 640px) {
    .dok-table-wrap { overflow-x: visible; }
    .dok-table { border: 0 !important; display: block; min-width: 0; overflow: visible; width: 100%; }
    .dok-table thead { left: -9999px; position: absolute; }
    .dok-table tbody, .dok-table tr, .dok-table td { display: block; width: 100%; }
    .dok-table tr { background: #fff; border: 1px solid var(--line) !important; border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
    .dok-table tbody tr:hover td { background: transparent; }
    .dok-table td { align-items: center; border: 0 !important; border-bottom: 1px solid var(--line) !important; display: flex; gap: 14px; justify-content: space-between; padding: 9px 12px !important; text-align: right; white-space: normal; }
    .dok-table tr td:last-child { border-bottom: 0 !important; }
    .dok-table td::before { color: var(--muted); content: attr(data-label); flex: 0 0 38%; font-size: 11px; font-weight: 700; letter-spacing: .02em; text-align: left; text-transform: uppercase; }
    .dok-table td[colspan] { justify-content: center; text-align: center; }
    .dok-table td[colspan]::before { content: ""; display: none; }
    .dok-table td input[type="number"] { width: 90px; }

    /* Hero lebih ringkas */
    .dok-hero { gap: 12px; padding: 14px 16px; }
    .dok-hero-ico { flex: 0 0 46px; height: 46px; }
    .dok-hero-ico svg { height: 24px; width: 24px; }
    .dok-hero h2 { font-size: 18px; }
    .dok-hero p { font-size: 12.5px; }

    .dok-card { padding: 15px; }
    .dok-toolbar { flex-wrap: wrap; gap: 8px; }

    /* Kartu pasien lebih padat; chip menumpuk penuh */
    .dok-patient { gap: 12px; }
    .dok-avatar { flex: 0 0 60px; height: 60px; }
    .dok-avatar svg { height: 34px; width: 34px; }
    .dok-patient-name strong { font-size: 18px; }
    .dok-patient-meta { gap: 4px 12px; }
    .dok-patient-chips { gap: 8px; width: 100%; }
    .dok-chip { flex: 1 1 100%; }
    .dok-vitals { gap: 12px; }

    /* Tombol form jadi full-width & enak ditekan */
    .dok-form-foot { gap: 8px; }
    .dok-form-foot > button { flex: 1 1 auto; justify-content: center; }

    /* Modal konfirmasi */
    .dok-modal { padding: 14px; }
    .dok-modal-box { padding: 20px; }
    .dok-modal-actions { flex-direction: column-reverse; }
    .dok-modal-actions .dok-clear, .dok-modal-actions .dok-submit { justify-content: center; width: 100%; }

    /* Antrian FO: field, kepala kartu, pick-list lebih ringkas */
    .fo-field-grid { grid-template-columns: 1fr; }
    .fo-card-head { gap: 10px; margin-bottom: 14px; }
    .fo-card-head h3 { font-size: 15px; }
    .fo-card-ico { flex: 0 0 38px; height: 38px; }
    .fo-card-ico svg { height: 20px; width: 20px; }
    .fo-pick-list { max-height: 240px; }
    .fo-pick-name { flex: 1; }
    .fo-q-no { min-width: 0; }
}

@media (max-width: 380px) {
    /* Layar sangat kecil */
    .dok-vitals { grid-template-columns: 1fr; }
    .dok-tab { font-size: 13px; padding: 10px 11px; }
    .dok-hero h2 { font-size: 16.5px; }
    .dok-table td::before { flex-basis: 44%; }
}
