:root {
    --ink: #14161a;
    --ink-soft: #62666f;
    --paper: #f2f3f5;
    --card: #ffffff;
    --line: #e3e5e9;
    --indigo: #3b3f9e;
    --indigo-soft: #ecebf9;
    --gold: #b8891f;
    --danger: #b3261e;
    --mono: 'IBM Plex Mono', monospace;
    --serif: 'Fraunces', serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 48px 24px 90px;
}

.eyebrow {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--indigo);
    margin: 0 0 8px;
}
h1 {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}
.subhead {
    color: var(--ink-soft);
    margin: 0 0 32px;
    font-size: 0.95rem;
    max-width: 62ch;
    line-height: 1.55;
}

/* ---------- Toolbar ---------- */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.search-field { position: relative; flex: 1; min-width: 220px; max-width: 320px; }
.search-field input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    font-size: 0.9rem;
    font-family: inherit;
}
.search-field input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
.search-field svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); }

.page-size { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--ink-soft); }
.page-size select {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 10px;
    background: var(--card);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.page-size select:focus { outline: none; border-color: var(--indigo); }

/* ---------- Table Card ---------- */
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th {
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-soft);
    font-weight: 600;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    background: #fafafb;
    white-space: nowrap;
}
tbody td { padding: 13px 20px; border-bottom: 1px solid var(--line); font-size: 0.87rem; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafb; }
.order-id { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-soft); }
.cust-name { font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.badge-completed { background: var(--indigo-soft); color: var(--indigo); }
.badge-completed::before { background: var(--indigo); }
.badge-preparing { background: #fbf1de; color: #8a6414; }
.badge-preparing::before { background: var(--gold); }
.badge-pending { background: #f1f1f4; color: #565a66; }
.badge-pending::before { background: #9296a3; }
.badge-cancelled { background: #fbe9e8; color: var(--danger); }
.badge-cancelled::before { background: var(--danger); }
.total-cell { font-family: var(--mono); font-weight: 500; }
.empty-row td { text-align: center; padding: 48px 20px; color: var(--ink-soft); }

/* =====================================================
   SCRUBBER PAGINATION — the signature element
   ===================================================== */
.scrub-zone {
    border-top: 1px solid var(--line);
    padding: 22px 28px 24px;
    background: linear-gradient(180deg, #fcfcfd 0%, #fafafb 100%);
}

.scrub-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
}

.scrub-readout {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-family: var(--serif);
}
.scrub-readout .cur-page {
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    min-width: 1.4ch;
    text-align: right;
    display: inline-block;
}
.scrub-readout .divider { font-size: 1.1rem; color: var(--ink-soft); }
.scrub-readout .total-page { font-size: 1.1rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.result-count { font-size: 0.82rem; color: var(--ink-soft); }
.result-count strong { color: var(--ink); font-weight: 600; }

.scrub-row { display: flex; align-items: center; gap: 14px; }

.scrub-arrow {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.scrub-arrow:hover:not(:disabled) { border-color: var(--indigo); color: var(--indigo); }
.scrub-arrow:active:not(:disabled) { transform: scale(0.94); }
.scrub-arrow:disabled { opacity: 0.35; cursor: not-allowed; }
.scrub-arrow:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

.scrub-track-outer {
    position: relative;
    flex: 1;
    padding: 16px 4px 22px;
    cursor: pointer;
}
.scrub-track-outer:focus-visible { outline: none; }
.scrub-track-outer:focus-visible .scrub-track { box-shadow: 0 0 0 3px var(--indigo-soft); }

.scrub-track {
    position: relative;
    height: 5px;
    border-radius: 999px;
    background: var(--line);
    border-radius: 999px;
}

.scrub-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--indigo) 0%, #5a5ecf 100%);
    transition: width 0.28s cubic-bezier(.22,.68,0,1.01);
}
.scrub-track-outer.dragging .scrub-fill { transition: none; }

.scrub-ticks { position: absolute; inset: 0; }
.scrub-tick {
    position: absolute;
    top: 50%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #c7cad2;
    transform: translate(-50%, -50%);
    transition: background 0.2s ease, transform 0.2s ease;
}
.scrub-tick.passed { background: rgba(255,255,255,0.75); }
.scrub-tick.active-tick { background: var(--gold); width: 5px; height: 5px; }

.scrub-puck {
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--card);
    border: 3px solid var(--indigo);
    transform: translate(-50%, -50%);
    transition: left 0.28s cubic-bezier(.22,.68,0,1.01), box-shadow 0.15s ease, transform 0.15s ease;
    box-shadow: 0 1px 3px rgba(20,22,26,0.15);
    cursor: grab;
}
.scrub-track-outer.dragging .scrub-puck {
    transition: box-shadow 0.15s ease;
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 3px 10px rgba(59,63,158,0.35);
}

.scrub-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    background: var(--ink);
    color: #fff;
    font-family: var(--mono);
    font-size: 0.72rem;
    padding: 5px 9px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, bottom 0.15s ease;
}
.scrub-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--ink);
}
.scrub-track-outer.dragging .scrub-tooltip,
.scrub-track-outer:hover .scrub-tooltip {
    opacity: 1;
    bottom: calc(100% + 12px);
}

.scrub-hint {
    margin-top: 10px;
    font-size: 0.74rem;
    color: var(--ink-soft);
    text-align: center;
}
.scrub-hint kbd {
    font-family: var(--mono);
    background: #eceef1;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.7rem;
}

@media (max-width: 640px) {
    thead { display: none; }
    table, tbody, tr, td { display: block; width: 100%; }
    tbody tr { border-bottom: 1px solid var(--line); padding: 14px 20px; }
    tbody td { border: none; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; }
    tbody td::before {
        content: attr(data-label);
        font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
        color: var(--ink-soft); font-weight: 600;
    }
    .scrub-zone { padding: 20px 18px 22px; }
    .scrub-header { align-items: flex-start; flex-direction: column; gap: 6px; }
}
