.desk-body { background: #f6f1e8; }
.sample-note {
    margin: 0;
    padding: 0.45rem 1.2rem;
    background: #efe4d2;
    color: #6a5438;
    font-size: 0.85rem;
}
.phead {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.75rem 1.2rem;
    background: rgba(246, 241, 232, 0.94);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 3;
}
.pnav { display: flex; gap: 0.35rem; margin-right: auto; overflow-x: auto; }
.pnav a, .side nav a {
    text-decoration: none; color: var(--muted);
    padding: 0.35rem 0.7rem; border-radius: 999px; white-space: nowrap;
}
.pnav a.is-on { background: var(--leaf-2); color: white; }
.who { font-weight: 700; font-size: 0.92rem; }
.leave { color: var(--muted); font-size: 0.92rem; }
.stage { padding: 1.6rem 1.2rem 3rem; }
.stage.narrow { width: min(1040px, 100%); margin-inline: auto; }
.stage h1 { font-size: clamp(2rem, 4vw, 3.1rem); }
.tiles { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
.shell .tiles { grid-template-columns: repeat(3, 1fr); }
.tiles a, .door {
    display: block; text-decoration: none; background: var(--paper-2);
    border: 1px solid var(--line); border-radius: 1.1rem; padding: 1rem 1rem 0.8rem;
    min-height: 9rem;
}
.tiles a:hover, .door:hover { border-color: var(--leaf); }
.tiles h2, .door h2 { font-size: 1.7rem; }
.kind { color: var(--clay); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.sheet { width: 100%; border-collapse: collapse; background: white; border-radius: 1rem; overflow: hidden; }
.sheet th, .sheet td { text-align: left; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); }
.sheet th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.badge { display: inline-block; border-radius: 999px; padding: 0.15rem 0.55rem; font-size: 0.8rem; font-weight: 700; }
.badge.ok { background: #e5f2ea; color: #14603a; }
.badge.wait { background: #f6e7c8; color: #7a4e10; }
.badge.off { background: #f6e4dc; color: #8a3d22; }
.pay-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 1rem; align-items: start; }
.qris { background: white; border-radius: 1.1rem; padding: 1rem; border: 1px solid var(--line); }
.amount { font-family: var(--serif); font-size: 2rem; margin: 0.2rem 0 0.8rem; }
.qr {
    width: 180px; height: 180px; margin: 0 auto 0.8rem;
    background:
        linear-gradient(#17241c 0 0) 12px 12px / 28px 28px no-repeat,
        linear-gradient(#17241c 0 0) 140px 12px / 28px 28px no-repeat,
        linear-gradient(#17241c 0 0) 12px 140px / 28px 28px no-repeat,
        repeating-linear-gradient(90deg, #17241c 0 8px, transparent 8px 16px),
        repeating-linear-gradient(#17241c 0 8px, #fff 8px 16px);
    border-radius: 0.6rem; display: grid; place-items: center;
}
.qr span { background: white; padding: 0.2rem 0.45rem; font-weight: 800; letter-spacing: 0.08em; }
.usage { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.usage li { display: grid; grid-template-columns: 9rem 1fr auto; gap: 0.7rem; align-items: center; margin: 0.45rem 0; }
.head-row { display: flex; justify-content: space-between; gap: 1rem; align-items: end; }
.letter { display: grid; gap: 0.8rem; max-width: 36rem; }
select, textarea {
    width: 100%; font: 500 1rem var(--sans); color: var(--ink);
    border: 1px solid var(--line); background: white; border-radius: 0.7rem; padding: 0.65rem 0.7rem;
}
.cams { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.cams li { background: white; border-radius: 1rem; overflow: hidden; border: 1px solid var(--line); }
.cams img, .cam-off { width: 100%; height: 180px; object-fit: cover; }
.cam-off { display: grid; place-items: center; background: #1c2420; color: #d9d0c3; }
.cams div { padding: 0.8rem 0.9rem 1rem; }
.cams h2 { font-size: 1.25rem; }
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--leaf-2); color: #f4ecdf; padding: 1rem 0.8rem; display: flex; flex-direction: column; gap: 1rem; }
.side-brand { display: flex; gap: 0.6rem; align-items: center; color: white; text-decoration: none; padding: 0.3rem 0.4rem; }
.side-brand strong, .side-brand small { display: block; }
.side-brand small { color: #c9d5cb; font-size: 0.78rem; }
.side nav { display: grid; gap: 0.2rem; }
.side nav a { color: #d7e2da; }
.side nav a.is-on { background: rgba(255,255,255,0.12); color: white; }
.side-out { margin-top: auto; color: #c9d5cb; font-size: 0.9rem; padding: 0.4rem; }
.shell .stage { background: #f6f1e8; }
.shell .sample-note { margin: -1.6rem -1.2rem 1.2rem; }
.doors { display: block; padding-top: 3rem; }
.door-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin-top: 1.2rem; }
.door { min-height: 12rem; }
@media (max-width: 860px) {
    .phead { flex-wrap: wrap; }
    .pnav { order: 3; width: 100%; }
    .tiles, .shell .tiles, .pay-grid, .cams, .door-grid, .shell { grid-template-columns: 1fr; }
    .side { position: sticky; top: 0; z-index: 3; }
    .side nav { display: flex; overflow-x: auto; }
    .side-out { margin-top: 0; }
    .usage li { grid-template-columns: 1fr; }
    .head-row { flex-direction: column; align-items: start; }
}

.desk-form { display: grid; gap: 0.85rem; max-width: 36rem; }
.desk-form label { display: grid; gap: 0.35rem; font-weight: 600; }
.desk-form input[type="text"],
.desk-form input[type="number"],
.desk-form input[type="month"],
.desk-form input[type="date"],
.desk-form select,
.desk-form textarea {
    width: 100%; font: 500 1rem var(--sans); color: var(--ink);
    border: 1px solid var(--line); background: white; border-radius: 0.7rem; padding: 0.65rem 0.7rem;
}
.desk-form .check { display: flex; align-items: center; gap: 0.55rem; font-weight: 600; }
.desk-form .check input { width: 1.1rem; height: 1.1rem; }
.row-actions { display: flex; gap: 0.75rem; align-items: center; white-space: nowrap; }
.row-actions form { margin: 0; }
.row-actions a, .row-actions button {
    background: none; border: 0; padding: 0; cursor: pointer;
    font: 600 0.92rem var(--sans); color: var(--leaf); text-decoration: underline;
}
.row-actions button { color: var(--clay); }
.block { margin-top: 2.5rem; }
.hint { color: var(--muted); font-size: 0.92rem; }

.o-pager { display: flex; justify-content: flex-end; align-items: center; gap: 0.4rem; margin: 0 0 0.55rem; font-size: 13px; }
.o-pager a, .o-pager span.is-off { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; border: 1px solid #dee2e6; border-radius: 4px; background: white; color: inherit; text-decoration: none; }
.o-pager span.is-off { opacity: 0.4; }
.o-pager-count { color: #6c757d; }
.o-list th a, .sheet th a { color: inherit; text-decoration: none; }
.o-list th.is-asc a::after, .sheet th.is-asc a::after { content: " \2191"; }
.o-list th.is-desc a::after, .sheet th.is-desc a::after { content: " \2193"; }

/* ---- Responsive tidy-up ---- */
.head-row { flex-wrap: wrap; margin-bottom: 0.6rem; }
.head-row .btn { white-space: nowrap; }
.stage > .lede { margin-top: 0.4rem; }
.letter textarea, .letter select, .letter input { width: 100%; }
@media (max-width: 860px) {
    .stage { padding: 1.2rem 1rem 2.5rem; }
    .phead { padding: 0.6rem 1rem; gap: 0.5rem 1rem; }
    .phead .brand { margin-right: auto; }
    .head-row { gap: 0.75rem; }
    .usage li { grid-template-columns: 1fr auto; gap: 0.25rem 0.7rem; }
    .usage li .track { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 640px) {
    .sample-note { padding: 0.45rem 1rem; }
    .stage h1 { font-size: 1.85rem; }
    table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
    table.stack { background: transparent; border-radius: 0; overflow: visible; }
    table.stack thead { display: none; }
    table.stack tr {
        background: white; border: 1px solid var(--line); border-radius: 0.9rem;
        margin: 0 0 0.6rem; padding: 0.45rem 0.9rem;
    }
    table.stack td {
        display: flex; justify-content: space-between; align-items: center; gap: 1rem;
        border: 0; padding: 0.35rem 0; text-align: right;
    }
    table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; text-align: left; }
    table.stack td[data-label=""]::before { content: none; }
    table.stack td[colspan] { display: block; text-align: left; }
}
