@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");
:root {
    --bg: #0b1f1d;
    --bg-2: #12302c;
    --card: #ffffff;
    --ink: #13201f;
    --muted: #5f6f6c;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --accent-soft: #e6f4f1;
    --amber: #f59e0b;
    --green: #15803d;
    --red: #dc2626;
    --border: #e3e8e6;
    --page-bg: #f5f6f2;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(19,32,31,.05), 0 1px 3px rgba(19,32,31,.06);
    --shadow-md: 0 6px 24px -8px rgba(19,32,31,.18);
    --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--page-bg);
    color: var(--ink);
}

header.top {
    background: var(--bg);
    color: #fff;
    padding: 20px 24px;
}
.top-inner {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
}
.top-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}
.top-brand-icon {
    font-size: 26px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    flex-shrink: 0;
}
.top-brand h1 { margin: 0; font-size: 19px; }
.top-brand p { margin: 2px 0 0; color: #94a3b8; font-size: 12px; }

.nav-toggle {
    display: none;
    background: transparent;
    color: #fff;
    font-size: 22px;
    padding: 4px 8px;
    border-radius: 6px;
}
.nav-toggle:hover { background: rgba(255,255,255,0.1); }

.top-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    flex-wrap: wrap;
}
.nav-group { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-divider {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.15);
    margin: 0 8px;
}
.top-nav a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 8px;
    transition: background .12s ease, color .12s ease;
    white-space: nowrap;
}
.top-nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.top-nav a.nav-active { color: #fff; background: rgba(15,118,110,0.35); font-weight: 600; }

.nav-account { display: flex; align-items: center; gap: 10px; }
.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f766e, #0d9488);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}
.top-nav .who { color: #fff; font-weight: 600; white-space: nowrap; }
.nav-admin-tag {
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.nav-logout { color: #fca5a5 !important; }
.nav-logout:hover { color: #fecaca !important; background: rgba(220,38,38,0.15) !important; }

@media (max-width: 720px) {
    .nav-toggle { display: block; }
    .top-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        background: #1e293b;
        border-radius: 10px;
        padding: 12px;
        gap: 4px;
        margin-top: 8px;
    }
    .top-nav.open { display: flex; }
    .nav-group { flex-direction: column; align-items: stretch; }
    .nav-divider { width: 100%; height: 1px; margin: 6px 0; }
    .nav-account { flex-wrap: wrap; padding: 6px 12px; }
}

/* Auth pages */
.auth-body {
    background: linear-gradient(135deg, #0f766e 0%, #0f172a 55%, #1e293b 100%);
    min-height: 100vh;
}
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-card {
    background: rgba(255,255,255,0.98);
    border-radius: 16px;
    padding: 36px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(15,23,42,0.35), 0 0 0 1px rgba(255,255,255,0.08);
    animation: auth-rise .35s ease;
}
@keyframes auth-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.auth-logo {
    font-size: 34px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f766e, #0d9488);
    border-radius: 14px;
    margin: 0 auto 16px;
    box-shadow: 0 8px 20px rgba(15,118,110,0.35);
}
.auth-card h1 { margin: 0 0 6px; font-size: 22px; text-align: center; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; text-align: center; }
.auth-card a { color: var(--accent); font-weight: 600; }
.auth-submit { width: 100%; padding: 12px; font-size: 15px; margin-top: 6px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }

.password-field { position: relative; }
.password-field input { padding-right: 42px; }
.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    padding: 6px 8px;
    font-size: 16px;
    line-height: 1;
}
.password-toggle:hover { background: var(--page-bg); border-radius: 6px; }

/* Input with inline button (QR scan) */
.input-with-btn { display: flex; gap: 8px; align-items: flex-start; }
.input-with-btn input, .input-with-btn textarea { flex: 1; }
.btn-scan {
    background: #ccfbf1;
    color: var(--accent-dark);
    padding: 10px 14px;
    font-size: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-scan:hover { background: #99f6e4; }
.scan-icon { width: 18px; height: 18px; }

/* Status action bar (Search & Manage) */
.status-action-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--page-bg);
    border-radius: 8px;
    padding: 10px 14px;
    margin: 12px 0;
}
.stat-card { transition: box-shadow .15s ease, transform .1s ease; }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { box-shadow: 0 2px 10px rgba(15,23,42,0.12); transform: translateY(-1px); }
.stat-card.clickable:active { transform: translateY(0); }

.btn-lost { background: #fef3c7; color: #92400e; }
.btn-lost:hover { background: #fde68a; }
.btn-lost-final { background: #7f1d1d; color: #fecaca; }
.btn-lost-final:hover { background: #991b1b; }
.btn-recovered { background: #dbeafe; color: #1e40af; }
.btn-recovered:hover { background: #bfdbfe; }
.btn-delete-order { background: #dc2626; color: #fff; }
.btn-delete-order:hover { background: #b91c1c; }

/* QR scanner modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}
.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    max-width: 420px;
}
.modal-box h3 { margin: 0 0 8px; }
.batch-edit-box { max-width: 560px; max-height: 90vh; overflow-y: auto; }
#scanVideo {
    width: 100%;
    border-radius: 8px;
    background: #000;
    max-height: 320px;
    object-fit: cover;
}
.scanned-list {
    max-height: 100px;
    overflow-y: auto;
    margin-top: 10px;
    font-size: 12px;
}
.qr-pulse {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #cbd5e1;
    margin-right: 4px;
    transition: background .15s ease;
}
.qr-pulse-on { background: #22c55e; }
.scanned-item {
    padding: 4px 8px;
    background: var(--page-bg);
    border-radius: 6px;
    margin-bottom: 4px;
}

/* Daily Coverage Calendar */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 14px;
}
.calendar-legend span { display: flex; align-items: center; gap: 6px; }
.cal-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    border: 1px solid var(--border);
}
.cal-dot-dispatch { background: #16a34a; }
.cal-dot-return { background: #dc2626; }
.cal-dot-both { background: linear-gradient(135deg, #16a34a 50%, #dc2626 50%); }
.cal-dot-report { background: #2563eb; }
.cal-dot-none { background: #fff; }

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 14px;
}
.calendar-month-label { font-weight: 700; font-size: 15px; min-width: 140px; text-align: center; }

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    margin-bottom: 6px;
    font-weight: 700;
}
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    transition: transform .1s ease;
    position: relative;
}
.cal-report-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2563eb;
    border: 1px solid #fff;
}
.cal-cell:hover { transform: scale(1.06); }
.cal-cell-empty { border: none; cursor: default; visibility: hidden; }
.cal-cell-none { background: #fff; }
.cal-cell-dispatch { background: #dcfce7; color: #166534; border-color: #86efac; }
.cal-cell-return { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.cal-cell-both { background: linear-gradient(135deg, #dcfce7 50%, #fee2e2 50%); color: #1e293b; border-color: #cbd5e1; }
.cal-cell-today { outline: 2px solid var(--accent); outline-offset: 1px; }

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
    animation: card-rise .4s cubic-bezier(.22,.61,.36,1) backwards;
}
.stat-card .num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-card .label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    animation: card-rise .45s cubic-bezier(.22,.61,.36,1) backwards;
}
@keyframes card-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.card:nth-of-type(1) { animation-delay: .02s; }
.card:nth-of-type(2) { animation-delay: .06s; }
.card:nth-of-type(3) { animation-delay: .10s; }
.card:nth-of-type(4) { animation-delay: .14s; }
.card:nth-of-type(5) { animation-delay: .18s; }
.card h2 {
    margin: 0 0 4px;
    font-size: 16px;
}
.card .sub {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 16px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 640px) {
    .two-col { grid-template-columns: 1fr; }
}

.field-group { margin-bottom: 14px; }
label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink);
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, input[type="date"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15,118,110,0.15);
}
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15,118,110,0.15);
}
.button-row { display: flex; align-items: center; gap: 12px; }
.btn-clear {
    background: transparent;
    color: var(--muted);
    text-decoration: underline;
    padding: 6px 2px;
    font-weight: 500;
}
.btn-clear:hover { color: var(--ink); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    transition: background .15s ease;
}
.btn-return { background: #fee2e2; color: var(--red); }
.btn-return:hover { background: #fecaca; }
.btn-dispatch { background: #dcfce7; color: var(--green); }
.btn-dispatch:hover { background: #bbf7d0; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: #e2e8f0; color: var(--ink); }
.btn-secondary:hover { background: #cbd5e1; }

.checkbox-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; }

.msg {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}
.msg.success { background: #dcfce7; color: #166534; display: block; }
.msg.error { background: #fee2e2; color: #991b1b; display: block; }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 16px 0;
}
.summary-grid .box {
    background: var(--page-bg);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}
.summary-grid .box .n { font-weight: 700; font-size: 18px; }
.summary-grid .box .l { font-size: 11px; color: var(--muted); }

.serial-col { color: var(--muted); font-variant-numeric: tabular-nums; width: 1%; }

.histogram-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
.histogram-scroll svg { display: block; }

.export-csv-btn { margin: 8px 0 4px; }

/* Calendar day quick-action dial */
.day-dial {
    position: relative;
    width: 320px;
    height: 320px;
}
.day-dial-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(15,23,42,0.35);
    padding: 8px;
    line-height: 1.3;
    animation: dial-pop .3s cubic-bezier(.34,1.56,.64,1) backwards;
    z-index: 1;
}
.day-dial-center:hover { background: #1e293b; }
.day-dial-btn {
    position: absolute;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(15,23,42,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: dial-pop .35s cubic-bezier(.34,1.56,.64,1) backwards;
    transition: background .12s ease, color .12s ease;
}
.day-dial-btn:hover { background: var(--accent); color: #fff; }
/* 5 evenly-spaced points around the circle, starting at top, clockwise. */
.day-dial-n  { top: 4px;   left: 50%;  transform: translateX(-50%); animation-delay: .03s; }
.day-dial-ne { top: 26%;   right: 8px; transform: translateY(-50%); animation-delay: .07s; }
.day-dial-se { bottom: 8%; right: 32px; transform: translateY(50%); animation-delay: .11s; }
.day-dial-s  { bottom: 8%; left: 32px;  transform: translateY(50%); animation-delay: .15s; }
.day-dial-sw { top: 26%;   left: 8px;  transform: translateY(-50%); animation-delay: .19s; }
@keyframes dial-pop {
    from { opacity: 0; transform: scale(.4); }
    to { opacity: 1; transform: scale(1); }
}
@media (max-width: 420px) {
    .day-dial { width: 260px; height: 260px; }
    .day-dial-center { width: 82px; height: 82px; font-size: 11px; }
    .day-dial-btn { width: 62px; height: 62px; font-size: 11px; }
    .day-dial-se { right: 20px; }
    .day-dial-s { left: 20px; }
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}
th, td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
th { background: var(--page-bg); font-size: 11px; text-transform: uppercase; color: var(--muted); }
.table-wrap { overflow-x: auto; max-height: max(420px, calc(100vh - 200px)); overflow-y: auto; }
/* column headings stay put while the rows scroll */
.table-wrap th, .claim-table-wrap th { position: sticky; top: 0; z-index: 3; box-shadow: 0 1px 0 var(--border); }
.fbar-dir-btn { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 6px 9px; cursor: pointer; font: inherit; font-weight: 700; }
.fbar-dir-btn:hover { background: #f0fdfa; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.badge.Delivered { background: #dcfce7; color: #166534; }
.badge.ReturnClaimed { background: #fef3c7; color: #92400e; }
.badge.ReturnReceived { background: #dbeafe; color: #1e40af; }
.badge.DelayedDelivery { background: #fee2e2; color: #991b1b; }
.badge.DelayedReturn { background: #fecdd3; color: #9f1239; }
.badge.Dispatched { background: #ccfbf1; color: #134e4a; }
.badge.InTransit { background: #cffafe; color: #155e75; }
.badge.Lost { background: #450a0a; color: #fecaca; }

.hidden { display: none !important; }
.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid #cbd5e1;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Collapsible cards */
.card-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.card-chevron {
    display: inline-block;
    transition: transform .2s ease;
    font-size: 13px;
    color: var(--muted);
}
.card.collapsed .card-chevron { transform: rotate(-90deg); }
.card.collapsed .card-body { display: none; }
.card-body { margin-top: 12px; }

/* Comment marker on calendar cells */
.cal-comment-dot {
    position: absolute;
    bottom: 3px;
    left: 3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
    border: 1px solid #fff;
}

/* Claim-email marker on calendar cells: solid blue badge, top-right (red = returns bottom-right, green = dispatches top-left) */
.cal-mail { position: absolute; top: 2px; right: 2px; display: inline-flex; align-items: center; gap: 1px; background: #2563eb; color: #fff; font-size: 11px; font-weight: 800; line-height: 1; padding: 2px 4px; border-radius: 6px; font-family: system-ui, sans-serif; }
.cal-mail sup { font-size: 9px; vertical-align: baseline; }
.calendar-legend .cal-mail { position: static; display: inline-flex; vertical-align: middle; }

/* Scanning "laser" sweep animation on the camera preview */
.scan-video-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}
.scan-laser {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #22c55e, transparent);
    box-shadow: 0 0 8px 2px rgba(34,197,94,0.7);
    opacity: 0;
}
.scan-laser.scan-laser-active {
    opacity: 1;
    animation: scan-sweep 1.8s ease-in-out infinite;
}
@keyframes scan-sweep {
    0%   { top: 4%; }
    50%  { top: 94%; }
    100% { top: 4%; }
}

/* ---- v26: summary, range picker, trend, calendar corners, live counts ---- */
.section-title { font-size: 15px; margin: 4px 0 10px; color: var(--ink); }
.summary-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.summary-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.sum-tile { border-radius: 12px; padding: 14px 16px; border: 1px solid var(--border); background: #fff; border-left-width: 5px; }
.sum-num { font-size: 32px; font-weight: 800; line-height: 1.1; }
.sum-label { font-weight: 700; font-size: 14px; margin-top: 2px; }
.sum-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.sum-dispatch { border-left-color: #0f766e; } .sum-dispatch .sum-num { color: #0f766e; }
.sum-delivered { border-left-color: #16a34a; } .sum-delivered .sum-num { color: #16a34a; }
.sum-returned { border-left-color: #dc2626; } .sum-returned .sum-num { color: #dc2626; }
.sum-open { border-left-color: #d97706; } .sum-open .sum-num { color: #d97706; }
.sum-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin-top: 14px; background: #f1f5f9; }
.sum-bar span { display: block; min-width: 2px; }
.seg-del { background: #16a34a; } .seg-ret { background: #dc2626; } .seg-open { background: #f59e0b; } .seg-lost { background: #7f1d1d; }

.rp-root { position: relative; }
.rp-btn { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-weight: 600; cursor: pointer; font-size: 14px; }
.rp-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 12px; width: 296px; max-width: 92vw; }
.rp-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rp-preset { border: 1px solid var(--border); background: #f8fafc; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.rp-preset:hover { background: #f0fdfa; }
.rp-nav { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 6px; }
.rp-nav button { border: none; background: none; font-size: 22px; cursor: pointer; padding: 0 8px; }
.rp-week, .rp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.rp-week span { font-size: 11px; color: #94a3b8; }
.rp-day { border: none; background: none; padding: 7px 0; border-radius: 6px; cursor: pointer; font-size: 13px; }
.rp-day:hover { background: #f0fdfa; }
.rp-mid { background: #ccfbf1; border-radius: 0; }
.rp-start, .rp-end { background: #0f766e !important; color: #fff; font-weight: 700; }
.rp-today { outline: 1px solid #0f766e; }
.rp-hint { font-size: 11px; color: #64748b; margin-top: 8px; text-align: center; }

.trend-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin-bottom: 8px; }
.tl-sw { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.tl-faded { opacity: .55; }

.cal-cell { position: relative; }
.cal-dayno { font-size: 13px; }
.cal-n { position: absolute; font-size: 10px; font-weight: 800; line-height: 1; padding: 2px 4px; border-radius: 6px; }
.cal-n-ret { bottom: 2px; right: 2px; background: #dc2626; color: #fff; }
.cal-n-dis { top: 2px; left: 2px; background: #16a34a; color: #fff; }

.live-count { font-size: 13px; margin-top: 4px; color: #475569; transition: transform .15s ease; }
.live-count strong { font-size: 16px; color: #0f766e; }
.lc-pop { transform: scale(1.04); }
.lc-warn { color: #b45309; } .lc-bad { color: #b91c1c; font-weight: 700; }
@media (max-width: 600px) { .sum-num { font-size: 26px; } .rp-pop { right: auto; left: 0; } }
.lc-ok { color: #15803d; font-weight: 700; }
.btn-tidy { margin-left: 6px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.ms-root { position: relative; display: inline-block; }
.ms-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 50; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 8px; min-width: 220px; max-height: 280px; overflow: auto; }
.ms-pop label { display: flex; gap: 8px; align-items: center; font-weight: 400; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.ms-pop label:hover { background: #f0fdfa; }
.filter-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filter-row .field-group { margin-bottom: 0; }

/* month/year jump selects */
.calendar-month-label select, .rp-jump select { font: inherit; font-weight: 700; padding: 4px 6px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; }
.calendar-month-label { display: inline-flex; gap: 6px; }
.rp-jump { display: inline-flex; gap: 4px; }
.rp-jump select { font-size: 13px; padding: 3px 4px; }
.calendar-nav { flex-wrap: wrap; gap: 8px; }

/* courier columns, approve, origin */
.btn-approve { background: #16a34a; color: #fff; border: none; border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 12px; cursor: pointer; }
.btn-approve:hover { background: #15803d; }
#approveAllBtn { margin-left: 8px; padding: 8px 14px; font-size: 13px; }
.origin-badge { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #f0fdfa; color: #115e59; font-size: 10px; font-weight: 700; vertical-align: middle; }
.origin-sel { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; margin: 10px 0 14px; align-items: end; }
.filter-grid .field-group { margin-bottom: 0; }
.filter-check { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; }

/* claim / inquiry window */
.btn-claim { background: #0ea5e9; color: #fff; }
.btn-claim:hover { background: #0284c7; }
.claim-box { max-width: 920px; max-height: 92vh; overflow-y: auto; }
.claim-box .claim-table-wrap { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; margin: 8px 0; }
.claim-box table { font-size: 13px; }
.claim-box td input[type=text] { width: 100%; min-width: 120px; padding: 4px 6px; font-size: 12px; }
.claim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; }
.claim-grid .field-group { margin-bottom: 6px; }
.claim-totals { font-weight: 700; margin: 4px 0 10px; }

.cl-files { margin-top: 4px; }
.cl-chip { font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cl-chip-name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cl-chip-x { border: none; background: none; color: #b91c1c; font-size: 16px; cursor: pointer; line-height: 1; }
.msg-error-text { color: #b91c1c; }

/* ---- v36 ---- */
.field-group select, .claim-grid select, .filter-grid select { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; font-family: inherit; }
.claim-grid > *, .filter-grid > * { min-width: 0; }
.claim-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); align-items: start; }
.claim-box textarea { min-height: 60px; font-family: inherit; }
.claim-box { overflow-x: hidden; }

/* calendar comment count */
.cal-comment-dot { width: auto; min-width: 14px; height: 14px; border-radius: 999px; padding: 0 4px; box-sizing: border-box; font-size: 10px; font-weight: 700; line-height: 12px; color: #fff; text-align: center; background: #f59e0b; border: 1px solid #fff; }
.calendar-legend .cal-comment-dot { position: static; display: inline-block; vertical-align: middle; }
.note-item { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.note-item:last-child { border-bottom: none; }
.note-list { margin-top: 8px; text-align: left; }
#dayNotesList { max-height: 40vh; overflow-y: auto; margin: 8px 0; }

/* delayed histogram age picker */
.hist-age { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; font-size: 14px; }
.hist-age select, .hist-age input { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.hist-age input { width: 76px; }
.age-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; font-size: 14px; }
.age-row select, .age-row input { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.age-row input { width: 76px; }

/* trend scrubber */
.trend-wrap { position: relative; }
.trend-tip { position: absolute; z-index: 5; pointer-events: none; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 4px 16px rgba(15,23,42,.18); padding: 8px 10px; font-size: 13px; min-width: 150px; }
.trend-tip .tip-prev { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 12px; }
.trend-tip .tl-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }

/* collapsible headings */
.card-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.card-toggle { margin-bottom: 0; }
.card.collapsible:not(.collapsed) > .card-toggle { margin-bottom: 4px; }
.filter-grid .age-row select, .age-row select { width: auto; max-width: 100%; }
.filter-grid .age-row input { width: 76px; }
.gate-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 10px 0; }
.gate-row select { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.filter-sentence { font-size: 14px; margin: 6px 0 10px; padding: 8px 10px; background: #f8fafc; border: 1px dashed var(--border); border-radius: 8px; }
.gate-word { display: inline-block; padding: 0 6px; border-radius: 6px; font-weight: 800; }
.gate-and { background: #dbeafe; color: #1d4ed8; }
.gate-or { background: #fef3c7; color: #b45309; }

/* v38.3: ticked orders kept across filter changes */
.row-kept td { background: #fffbeb; }
.kept-badge { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #fde68a; color: #92400e; font-size: 11px; font-weight: 600; }
.kept-note { margin: 8px 0; padding: 8px 12px; border: 1px solid #fcd34d; background: #fffbeb; border-radius: 8px; font-size: 13px; color: #78350f; }

/* v39: editable claim fields with a small state tag */
.claim-box .cl-cell input { display: block; width: 100%; min-width: 96px; padding: 4px 6px; font-size: 13px; box-sizing: border-box; }
.claim-box .cl-cell:nth-child(6) input { min-width: 140px; }
.claim-box .cl-cell .cl-tag { display: block; width: max-content; }
.cl-tag { display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 600; line-height: 16px; }
.cl-prefilled { background: #e2e8f0; color: #475569; }
.cl-edited { background: #fde68a; color: #92400e; }
.cl-added { background: #bfdbfe; color: #1e3a8a; }
.cl-missing { background: #fee2e2; color: #991b1b; }

/* Attachment library */
.at-item { border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.at-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.at-btns { margin-left: auto; display: inline-flex; gap: 6px; }
.at-btns button { padding: 4px 10px; font-size: 12px; }
.at-link { word-break: break-all; margin: 2px 0 4px; }
.at-uses { margin: 4px 0 0 18px; padding: 0; font-size: 13px; }

/* trend readout: sits above the chart, never covers it */
.trend-readout { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-height: 40px; padding: 6px 10px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: 10px; background: rgba(248,250,252,.9); font-size: 13px; }
.trend-readout.on { background: rgba(238,242,255,.9); }
.trend-readout .tl-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }
.trend-readout .tip-prev { color: var(--muted); font-size: 12px; flex-basis: 100%; }
#trendHit { touch-action: pan-y; }

/* calendar marker corners + tick row */
.cal-corner { position: absolute; display: flex; align-items: center; gap: 2px; }
.cal-corner.c-tl { top: 2px; left: 2px; } .cal-corner.c-tr { top: 2px; right: 2px; }
.cal-corner.c-bl { bottom: 2px; left: 2px; } .cal-corner.c-br { bottom: 2px; right: 2px; }
.cal-corner .cal-n, .cal-corner .cal-mail, .cal-corner .cal-comment-dot, .cal-corner .cal-report-dot { position: static; }
.cal-report-dot { background: #0d9488; }
.cal-dot-cpr { background: #0d9488; }
.cal-markers { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.cal-mk { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }

/* claim badge on order rows */
.claim-badge { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; text-decoration: none; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; white-space: nowrap; }
.claim-badge.claim-done { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; }

.hist-confirm td { color: #64748b; background: #f8fafc; font-size: 13px; }

/* ---- Shopify-style filter bar ---- */
.fbar { position: relative; margin-bottom: 10px; }
.fbar-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.fbar-search { flex: 1 1 260px; min-width: 0; }
.fbar-search textarea, .fbar-search input { width: 100%; box-sizing: border-box; min-height: 38px; resize: none; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; }
.fbar-search textarea:focus, .fbar-search input:focus { outline: 2px solid #99f6e4; border-color: #14b8a6; }
.fbar-row > button { height: 38px; white-space: nowrap; }
.fbar-row .on { background: #ccfbf1; border-color: #14b8a6; }
.fbar-pop { position: absolute; z-index: 70; top: 44px; left: 0; width: min(440px, 100%); max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(15,23,42,.18); padding: 6px; }
.fbar-pop.hidden { display: none; }
.fbar-pop-sort { left: auto; right: 0; width: min(280px, 100%); }
.fcat { border-bottom: 1px solid #f1f5f9; }
.fcat:last-of-type { border-bottom: none; }
.fcat-h { width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: none; padding: 10px 8px; font: inherit; font-weight: 600; cursor: pointer; text-align: left; color: var(--ink); }
.fcat-h:hover { background: #f8fafc; border-radius: 8px; }
.fcat-t { flex: 1; }
.fcat-n { color: #14b8a6; font-size: 12px; }
.fcat-c { color: var(--muted); transition: transform .15s; }
.fcat.open .fcat-c { transform: rotate(180deg); }
.fcat-b { padding: 4px 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.fcat-b.hidden { display: none; }
.fcat-b select, .fcat-b input[type="text"], .fcat-b input[type="number"], .fcat-b input[type="date"] { width: 100%; box-sizing: border-box; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.fcat-checks { display: flex; flex-direction: column; gap: 6px; }
.fcat-checks label, .fcat-b > label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.fcat-checks input, .fcat-b > label input { width: auto; }
.fcat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fcat-pair label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.fpop-foot { display: flex; justify-content: space-between; gap: 8px; padding: 8px; position: sticky; bottom: 0; background: #fff; border-top: 1px solid #f1f5f9; }
.fbar-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fbar-chips:empty { display: none; }
.fchip { display: inline-flex; align-items: center; background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 999px; font-size: 13px; overflow: hidden; }
.fchip-b { background: none; border: none; padding: 4px 4px 4px 10px; font: inherit; cursor: pointer; color: #134e4a; text-align: left; }
.fchip-x { background: none; border: none; padding: 4px 9px 4px 4px; font-size: 16px; line-height: 1; cursor: pointer; color: #14b8a6; }
.fchip-x:hover { color: #dc2626; }
.fchip-all { background: none; border: none; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; padding: 4px 6px; }
.spop-h { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 8px 4px; }
.spop-opt { display: block; width: 100%; text-align: left; background: none; border: none; padding: 7px 10px; border-radius: 8px; font: inherit; cursor: pointer; color: var(--ink); }
.spop-opt:hover { background: #f8fafc; }
.spop-opt.on { background: #ccfbf1; font-weight: 600; }
.spop-dir { display: flex; gap: 6px; padding: 0 8px 8px; }
.spop-d { flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.spop-d.on { background: #ccfbf1; border-color: #14b8a6; font-weight: 600; }
th.th-sort { cursor: pointer; user-select: none; }
th.th-sort:hover { background: #f0fdfa; }
@media (max-width: 640px) {
    .fbar-pop, .fbar-pop-sort { position: fixed; left: 8px; right: 8px; top: 72px; width: auto; max-height: calc(100vh - 90px); }
    .fbar-row > button { flex: 1; }
}

.fcat-not { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: #fef2f2; border: 1px dashed #fecaca; border-radius: 8px; font-size: 12px; font-weight: 400; color: #991b1b; }
.fcat-not input { width: auto; }
.fcat-scroll { max-height: 180px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.fcat-b textarea { width: 100%; box-sizing: border-box; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; resize: vertical; }
.gate-not { background: #fee2e2; color: #991b1b; }
.fcat.active .fcat-t { color: #134e4a; }

/* ---- nav dropdowns (v54) ---- */
.nav-dd { position: relative; }
.nav-dd-btn { background: none; border: 0; color: #cbd5e1; font: inherit; font-size: 14px; padding: 8px 12px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.nav-dd-btn:hover, .nav-dd.open > .nav-dd-btn { color: #fff; background: rgba(255,255,255,0.1); }
.nav-dd-btn.nav-active { color: #fff; background: rgba(15,118,110,0.35); font-weight: 600; }
.nav-dd-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 210px; margin-top: 6px; background: #1e293b; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 6px; box-shadow: 0 10px 28px rgba(0,0,0,0.35); z-index: 200; flex-direction: column; }
.nav-dd-menu.nav-dd-right { left: auto; right: 0; }
.nav-dd.open > .nav-dd-menu { display: flex; }
.nav-dd-menu a { display: block; padding: 9px 12px; }
@media (max-width: 720px) {
  .nav-dd-menu { position: static; display: none; margin: 2px 0 6px 12px; box-shadow: none; }
  .nav-dd-btn { width: 100%; justify-content: space-between; }
}

.kept-jump { cursor: pointer; text-decoration: underline; }
@keyframes rowflash { 0%, 60% { background: #fde68a; } 100% { background: transparent; } }
tr.row-flash > td { animation: rowflash 2.2s ease-out 1; }

/* Actions drop-down (Search & Manage) */
.status-action-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.act-dd { position: relative; }
.act-menu { position: absolute; z-index: 80; top: 100%; left: 0; margin-top: 6px; min-width: 240px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(15,23,42,.18); padding: 6px; max-height: 70vh; overflow: auto; }
.act-menu.hidden { display: none; }
.act-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; border-radius: 8px; font: inherit; cursor: pointer; color: var(--ink); }
.act-menu button:hover { background: #f0fdfa; }
.act-menu .act-danger { color: #b91c1c; }
.act-menu .act-danger:hover { background: #fee2e2; }
.act-h { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 12px 2px; }

/* ---- comments & tags (v55) ---- */
.collab-cell { white-space: normal; min-width: 130px; }
.cmt-btn { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 2px 9px; font: inherit; font-size: 12px; cursor: pointer; margin: 0 4px 2px 0; }
.cmt-btn.has { background: #f0fdfa; border-color: #5eead4; font-weight: 600; }
.cmt-btn:hover { background: #ccfbf1; }
.tag-chip { display: inline-block; padding: 1px 8px; margin: 0 4px 2px 0; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.cmt-box { max-width: 560px; width: 94vw; max-height: 90vh; display: flex; flex-direction: column; }
.cmt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cmt-head h3 { margin: 0 0 8px; font-size: 16px; word-break: break-word; }
.cmt-x { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.cmt-list { overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; max-height: 48vh; }
.cmt-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.cmt-card.mine { border-color: #99f6e4; background: #f8faff; }
.cmt-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cmt-meta strong { color: var(--ink); }
.cmt-you { background: #ccfbf1; color: #134e4a; border-radius: 999px; padding: 0 7px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.cmt-body { font-size: 14px; word-break: break-word; }
.cmt-body textarea, .cmt-add textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.cmt-actions { display: flex; gap: 10px; margin-top: 8px; }
.cmt-actions button { background: none; border: 0; color: #0f766e; cursor: pointer; font: inherit; font-size: 12px; padding: 0; }
.cmt-actions button.btn-primary, .cmt-actions button.btn-secondary { padding: 5px 12px; color: inherit; }
.cmt-actions .cmt-del, .cmt-actions .note-del { color: #b91c1c; }
.cmt-add { border-top: 1px solid var(--border); padding-top: 10px; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag-opt { border: 2px solid transparent; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; font-weight: 600; }
.tag-opt.on { border-color: #0f766e; }

/* courier badge next to a tracking number */
.courier-badge { display:inline-block; padding:0 6px; margin-left:4px; border-radius:999px; font-size:10px; font-weight:700; vertical-align:middle; background:#ccfbf1; color:#134e4a; }
.courier-badge.courier-tcs { background:#fee2e2; color:#b91c1c; }

/* ==========================================================
   v59 theme & polish layer
   ========================================================== */
body { -webkit-font-smoothing: antialiased; line-height: 1.5; }
button, input, select, textarea { font-family: inherit; }
::selection { background: #99f6e4; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

header.top {
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    padding: 14px 24px;
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 8px 24px -12px rgba(0,0,0,.4);
}
.top-brand h1 { font-weight: 800; letter-spacing: -.01em; }
.top-brand-icon { background: linear-gradient(135deg, var(--accent), #14b8a6); box-shadow: 0 4px 14px rgba(20,184,166,.35); }
.top-nav a.nav-active, .nav-dd-btn.nav-active { background: rgba(45,212,191,.18) !important; color: #fff; box-shadow: inset 0 0 0 1px rgba(45,212,191,.35); }
.nav-avatar { background: linear-gradient(135deg, var(--amber), #ea580c); }

.card, .stat-card { border-color: var(--border); box-shadow: var(--shadow-sm); border-radius: var(--radius); }
.card h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.stat-card .num { color: var(--ink); font-weight: 800; }
.stat-card .label { text-transform: uppercase; letter-spacing: .05em; font-size: 11px; font-weight: 600; }

input[type="text"], input[type="password"], input[type="email"], input[type="date"],
input[type="number"], input[type="search"], input[type="tel"], select, textarea {
    border-radius: 10px; border: 1px solid #d6dedb; transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #b9c6c2; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(15,118,110,.15) !important; }

button { border-radius: 10px; transition: background .15s ease, transform .08s ease, box-shadow .15s ease; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); box-shadow: 0 1px 2px rgba(15,118,110,.3), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 6px 16px -6px rgba(15,118,110,.55); }
.btn-secondary { background: #e9eeec; }
.btn-secondary:hover { background: #dbe3e0; }
.msg { border-radius: 10px; font-size: 13.5px; }
.msg.error { border: 1px solid #fecaca; }
.msg.success { border: 1px solid #bbf7d0; }
table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table tbody tr { transition: background .1s ease; }
table tbody tr:hover { background: #f7faf9; }
.modal-box { border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
.modal-overlay { backdrop-filter: blur(3px); }

/* ---------- Auth pages (split layout) ---------- */
.auth-body { background: var(--page-bg); min-height: 100vh; }
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-aside {
    position: relative; overflow: hidden; color: #e6f4f1; padding: 48px 56px;
    background: radial-gradient(1200px 500px at -10% 110%, rgba(245,158,11,.22), transparent 60%),
                radial-gradient(800px 500px at 110% -10%, rgba(45,212,191,.25), transparent 60%),
                linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
    display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth-aside::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 32px 32px; mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; color: #fff; text-decoration: none; }
.auth-brand-mark { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; background: linear-gradient(135deg, var(--accent), #14b8a6); box-shadow: 0 6px 20px rgba(20,184,166,.4); }
.auth-pitch h2 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.1; letter-spacing: -.025em; margin: 0 0 16px; color: #fff; font-weight: 800; }
.auth-pitch h2 em { font-style: normal; color: var(--amber); }
.auth-pitch p { margin: 0; max-width: 440px; color: #a7c4be; font-size: 15px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: #d3e6e2; }
.auth-points li span { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); font-size: 14px; }
.auth-foot { font-size: 12px; color: #7fa39c; }
.auth-foot a { color: #a7c4be; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { background: transparent; box-shadow: none; padding: 0; max-width: 420px; border-radius: 0; }
.auth-card .auth-logo { display: none; }
.auth-card h1 { text-align: left; font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-card .sub { text-align: left; font-size: 14px; margin-bottom: 26px; }
.auth-card label { font-size: 13px; }
.auth-card input[type="text"], .auth-card input[type="password"], .auth-card input[type="email"] { padding: 12px 14px; font-size: 15px; background: #fff; }
.auth-card .hint { display: block; }
.auth-submit { padding: 13px; font-size: 15px; margin-top: 8px; position: relative; }
.auth-submit.is-loading { color: transparent !important; pointer-events: none; }
.auth-submit.is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: auth-spin .7s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-switch { text-align: left; line-height: 1.8; padding-top: 18px; border-top: 1px solid var(--border); margin-top: 24px; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-details { margin: 0 0 14px; border: 1px dashed #cfd8d5; border-radius: 10px; padding: 0 14px; }
.auth-details summary { cursor: pointer; padding: 11px 0; font-size: 13px; font-weight: 600; color: var(--muted); list-style: none; }
.auth-details summary::-webkit-details-marker { display: none; }
.auth-details summary::before { content: "+ "; color: var(--accent); }
.auth-details[open] summary::before { content: "– "; }
.auth-details[open] { padding-bottom: 4px; }
.pw-meter { height: 4px; border-radius: 4px; background: #e3e8e6; margin-top: 8px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s ease, background .2s ease; }
.password-toggle { color: var(--muted); font-size: 12px !important; font-weight: 600; }
@media (max-width: 900px) {
    .auth-split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-aside { padding: 22px 24px; gap: 0; }
    .auth-pitch, .auth-foot { display: none; }
    .auth-main { padding: 28px 20px 48px; align-items: flex-start; }
    .auth-card h1 { font-size: 24px; }
}
@media (max-width: 420px) { .auth-row { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
input:not([type]), input[type="number"], input[type="search"], input[type="tel"], input[type="url"] {
    width: 100%; padding: 10px 12px; border: 1px solid #d6dedb; border-radius: 10px; font-size: 14px; background: #fff; box-sizing: border-box;
}
.auth-card input:not([type]) { padding: 12px 14px; font-size: 15px; }
@media (min-width: 901px) { .auth-aside { position: sticky; top: 0; height: 100vh; } }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label-row label { margin-bottom: 6px; }
.auth-card a.label-link { font-size: 12.5px; font-weight: 600; }
.check-line { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; color: var(--muted) !important; margin: 4px 0 6px; cursor: pointer; }
.check-line input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.auth-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--accent-soft); margin-bottom: 18px; }
.msg.info { display: block; background: var(--accent-soft); color: #134e4a; border: 1px solid #b7e1d8; }
.btn-link { display: block; text-align: center; text-decoration: none; border-radius: 10px; color: #fff !important; }
.cron-box { margin-top: 18px; padding: 14px; border-radius: 10px; background: var(--page-bg); border: 1px solid var(--border); }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.copy-row button { padding: 8px 12px; font-size: 12px; flex-shrink: 0; }
.backup-hero { display: grid; grid-template-columns: 1fr 1fr auto; gap: 18px; align-items: center; padding: 18px; border-radius: 12px; background: var(--accent-soft); border: 1px solid #c7e6df; }
.backup-num { font-size: 30px; font-weight: 800; color: var(--accent-dark); line-height: 1.1; }
.backup-last { font-size: 17px; font-weight: 700; }
.backup-form button { padding: 12px 20px; font-size: 15px; }
@media (max-width: 640px) { .backup-hero { grid-template-columns: 1fr; } .backup-form button { width: 100%; } }

/* ---------- v60 Dashboard & pages redesign ---------- */
.container, .top-inner { max-width: 1180px; }
.container { padding: 28px 20px 72px; }
.card { padding: 22px 24px; }
.card > h2:first-child { display: flex; align-items: center; gap: 8px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 12px; }

/* Summary tiles */
#summaryCard { background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%); }
.summary-tiles { gap: 14px; }
.sum-tile { border: 1px solid var(--border); border-left-width: 1px; border-radius: 14px; padding: 16px 18px 14px; position: relative; overflow: hidden; background: #fff; transition: transform .15s ease, box-shadow .15s ease; }
.sum-tile::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: currentColor; opacity: .9; }
.sum-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sum-dispatch { color: #0f766e; } .sum-delivered { color: #15803d; } .sum-returned { color: #dc2626; } .sum-open { color: #d97706; }
.sum-tile .sum-label { color: var(--ink); }
.sum-tile .sum-sub { color: var(--muted); }
.sum-num { font-size: 34px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sum-bar { height: 12px; border-radius: 999px; background: #eef1f0; margin-top: 18px; }

/* Status cards: colour per status */
.stats-row { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat-card { text-align: left; padding: 14px 16px; position: relative; border-radius: 12px; }
.stat-card::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--sc, #cbd5d1); }
.stat-card .num { font-size: 26px; }
.stat-card .label { margin-top: 4px; }
.stat-card[data-status="Dispatched"]       { --sc: #0f766e; }
.stat-card[data-status="In Transit"]       { --sc: #0891b2; }
.stat-card[data-status="Delivered"]        { --sc: #15803d; }
.stat-card[data-status="Return Claimed"]   { --sc: #dc2626; }
.stat-card[data-status="Return Received"]  { --sc: #2563eb; }
.stat-card[data-status="Delayed Delivery"] { --sc: #d97706; }
.stat-card[data-status="Delayed Return"]   { --sc: #be123c; }
.stat-card[data-status="Lost"]             { --sc: #450a0a; }
.stat-card[data-status=""]                 { --sc: var(--ink); background: var(--bg); border-color: var(--bg); }
.stat-card[data-status=""] .num { color: #fff; }
.stat-card[data-status=""] .label { color: #a7c4be; }
.stat-card.clickable:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Tables */
table { border-radius: 10px; }
th { background: #f3f6f4; }
th, td { border-color: #edf1ef; }
.table-wrap, .claim-table-wrap { border: 1px solid var(--border); border-radius: 12px; }
.badge { border-radius: 999px; font-weight: 700; letter-spacing: .01em; }

/* Selects */
select { border-radius: 10px; border: 1px solid #d6dedb; padding: 9px 12px; background-color: #fff; font-size: 14px; }

/* Nav dropdowns */
.nav-dd-menu { border-radius: 12px !important; box-shadow: 0 18px 50px -12px rgba(0,0,0,.45) !important; }

/* Mobile */
@media (max-width: 720px) {
    header.top { padding: 12px 16px; }
    .container { padding: 18px 12px 60px; }
    .card { padding: 18px 16px; border-radius: 14px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .summary-tiles { grid-template-columns: repeat(2, 1fr); }
    .sum-num { font-size: 26px; }
    .button-row { flex-wrap: wrap; }
    .button-row button { flex: 1 1 auto; }
    .top-nav { background: var(--bg-2) !important; }
}

/* Grouped Settings menu (v61) */
.nav-dd-menu.nav-dd-grouped { min-width: 240px; }
.nav-dd-head { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(203,213,225,.6); padding: 10px 12px 4px; }
.nav-dd-head:first-child { padding-top: 4px; }

/* ---------- Sign-in slider: glimpses of the app (v61) ---------- */
.gl-slider { max-width: 480px; }
.gl-track { display: grid; }
.gl-slide { grid-area: 1 / 1; opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; pointer-events: none; }
.gl-slide.is-on { opacity: 1; transform: none; pointer-events: auto; }
.gl-slide h2 { font-size: clamp(26px, 2.8vw, 38px); line-height: 1.1; letter-spacing: -.025em; margin: 26px 0 12px; color: #fff; font-weight: 800; }
.gl-slide h2 em { font-style: normal; color: var(--amber); }
.gl-slide p { margin: 0; max-width: 440px; color: #a7c4be; font-size: 15px; line-height: 1.55; }
.gl-card { background: #fbfdfc; color: var(--ink); border-radius: 16px; padding: 14px 16px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08); font-size: 12.5px; transform: rotate(-1deg); }
.gl-slide:nth-child(even) .gl-card { transform: rotate(1deg); }
.gl-bar { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.gl-pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #eef2f1; color: var(--muted); }
.gl-pill-on { background: var(--accent-soft); color: var(--accent); } .gl-pill-ok { background: #dcfce7; color: #166534; } .gl-pill-warn { background: #fef3c7; color: #92400e; }
.gl-row { display: grid; grid-template-columns: 1fr 1fr .8fr .9fr; gap: 6px; padding: 7px 2px; border-bottom: 1px dashed #e6ebe9; align-items: center; }
.gl-row.gl-head { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; border-bottom-style: solid; }
.gl-c { justify-self: start; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.gl-c.px { background: #e0f2fe; color: #075985; } .gl-c.tcs { background: #fee2e2; color: #b91c1c; }
.gl-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; gap: 10px; }
.gl-hint { color: var(--muted); font-size: 11.5px; }
.gl-btn { background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.gl-btn-ghost { background: var(--accent-soft); color: var(--accent); }
.gl-label { padding: 0; overflow: hidden; }
.gl-lab-top { display: flex; justify-content: space-between; align-items: center; background: #13201f; color: #fff; padding: 10px 14px; }
.gl-lab-top b { font-size: 17px; letter-spacing: .02em; } .gl-lab-top span { font-weight: 700; font-size: 12px; }
.gl-lab-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; padding: 12px 14px 6px; }
.gl-lab-body div { display: flex; flex-direction: column; gap: 2px; } .gl-lab-body small { font-size: 9.5px; color: var(--muted); font-weight: 700; letter-spacing: .06em; }
.gl-lab-body b { font-size: 15px; }
.gl-cod { border: 1.5px solid #13201f; border-radius: 6px; padding: 6px 8px; align-items: center; text-align: center; }
.gl-cod b { font-size: 18px; }
.gl-barcode { display: block; width: 62%; height: 34px; margin: 4px 14px; fill: #13201f; }
.gl-lab-foot { display: flex; justify-content: space-between; padding: 6px 14px 12px; font-size: 11px; color: var(--muted); }
.gl-steps { list-style: none; margin: 6px 0 0; padding: 0; }
.gl-steps li { position: relative; padding: 4px 0 10px 24px; display: flex; flex-direction: column; }
.gl-steps li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #cbd5d1; background: #fff; }
.gl-steps li.done::before { background: var(--accent); border-color: var(--accent); }
.gl-steps li:not(:last-child)::after { content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: #e3e8e6; }
.gl-steps b { font-size: 12.5px; } .gl-steps span { color: var(--muted); font-size: 11.5px; }
.gl-tag { font-style: normal; font-size: 10.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent); padding: 1px 7px; border-radius: 999px; }
.gl-claim { display: flex; gap: 12px; padding: 6px 0 4px; align-items: center; }
.gl-claim > div:last-child { display: flex; flex-direction: column; gap: 2px; } .gl-claim span { color: var(--muted); font-size: 11.5px; }
.gl-thumbs { display: grid; grid-template-columns: repeat(3, 34px); gap: 4px; }
.gl-thumbs span { height: 34px; border-radius: 6px; background: linear-gradient(135deg, #d6e4e1, #b8cfca); }
.gl-thumbs span:nth-child(2) { background: linear-gradient(135deg, #f3e3c2, #e5c98f); } .gl-thumbs span:nth-child(3) { background: linear-gradient(135deg, #e2e8f0, #cbd5e1); }
.gl-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 10px; }
.gl-kpis div { background: #f3f6f5; border-radius: 10px; padding: 8px; display: flex; flex-direction: column; }
.gl-kpis small { font-size: 10px; color: var(--muted); font-weight: 600; } .gl-kpis b { font-size: 18px; }
.gl-kpis .warn { background: #fef3c7; } .gl-kpis .warn b { color: #92400e; }
.gl-bars { display: flex; align-items: flex-end; gap: 8px; height: 64px; padding: 0 4px; }
.gl-bars i { flex: 1; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #14b8a6, var(--accent)); }
.gl-nav { display: flex; align-items: center; gap: 12px; margin-top: 26px; }
.gl-dots { display: flex; gap: 8px; }
.gl-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.25); cursor: pointer; transition: width .3s ease, background .3s ease; }
.gl-dots button[aria-selected="true"] { width: 26px; background: var(--amber); }
.gl-arrow { width: 30px; height: 30px; padding: 0 0 2px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.gl-arrow:hover { background: rgba(255,255,255,.14); }
.gl-count { margin: 22px 0 0; color: #a7c4be; font-size: 14px; } .gl-count b { color: #fff; font-size: 18px; }
@media (prefers-reduced-motion: reduce) { .gl-slide { transition: none; } }

/* ---------- Help centre (v62) ---------- */
.help-wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 32px; align-items: start; }
.help-side { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; padding-right: 6px; }
.help-home-link { display: block; font-weight: 800; font-size: 16px; color: var(--ink); text-decoration: none; margin: 4px 0 12px; }
.help-search input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 14px; background: #fff; box-sizing: border-box; }
.help-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.help-toc { margin-top: 14px; display: flex; flex-direction: column; }
.help-toc-sec { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.help-toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.35; }
.help-toc a:hover { background: #eef2f0; }
.help-toc a.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.help-main { min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 32px 40px 40px; box-shadow: var(--shadow-sm); }
.help-crumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; } .help-crumb a { color: var(--accent); }
.help-title { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 8px; }
.help-who { display: inline-block; font-size: 12px; font-weight: 700; color: #92400e; background: #fef3c7; padding: 3px 10px; border-radius: 999px; margin-bottom: 6px; }
.help-lead { font-size: 17px; color: var(--muted); margin: 6px 0 24px; line-height: 1.5; max-width: 760px; }
.help-article { font-size: 15.5px; line-height: 1.7; max-width: 780px; }
.help-article h2 { font-size: 20px; margin: 32px 0 10px; letter-spacing: -.01em; }
.help-article p { margin: 0 0 14px; }
.help-article ul, .help-article ol { padding-left: 22px; margin: 0 0 16px; } .help-article li { margin: 6px 0; }
.help-article code { background: #f1f5f4; padding: 1px 6px; border-radius: 5px; font-size: 13.5px; }
.help-article a { color: var(--accent); font-weight: 600; }
.help-steps { counter-reset: st; list-style: none; padding-left: 0 !important; }
.help-steps > li { counter-increment: st; position: relative; padding-left: 42px; margin: 12px 0 !important; }
.help-steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.help-fig { margin: 22px 0 26px; }
.help-zoom { display: block; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #f8faf9; cursor: zoom-in; width: 100%; box-shadow: 0 10px 30px -18px rgba(19,32,31,.45); }
.help-zoom img { display: block; width: 100%; height: auto; }
.help-fig figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center; }
.help-note { display: flex; gap: 12px; padding: 12px 16px; border-radius: 12px; margin: 18px 0; font-size: 14.5px; line-height: 1.55; }
.help-note b { flex-shrink: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.help-tip { background: #ecfdf5; border: 1px solid #a7f3d0; } .help-tip b { color: #047857; }
.help-warn { background: #fffbeb; border: 1px solid #fde68a; } .help-warn b { color: #b45309; }
.help-table { border-collapse: collapse; width: 100%; margin: 8px 0 18px; font-size: 14.5px; }
.help-table th, .help-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.help-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.help-faq dt { font-weight: 700; margin-top: 18px; } .help-faq dd { margin: 4px 0 0; color: #33423f; }
.help-pn { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); }
.help-pn a { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); font-weight: 700; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; max-width: 48%; }
.help-pn a:hover { border-color: var(--accent); }
.help-pn small { font-weight: 500; color: var(--muted); font-size: 12px; } .help-pn-next { margin-left: auto; text-align: right; }
.help-hero h1 { font-size: 34px; letter-spacing: -.02em; margin: 0 0 8px; } .help-hero > p { color: var(--muted); font-size: 16px; margin: 0 0 20px; }
.help-start { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.help-start a { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; border-radius: 14px; text-decoration: none; color: var(--ink); background: linear-gradient(160deg, var(--accent-soft), #fff); border: 1px solid #cfe7e2; }
.help-start a:hover { border-color: var(--accent); } .help-start b { font-size: 15px; } .help-start span { color: var(--muted); font-size: 13.5px; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.help-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.help-card h2 { font-size: 16px; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.help-card ul { list-style: none; padding: 0; margin: 0; } .help-card li { padding: 7px 0; border-top: 1px dashed #e5ebe9; } .help-card li:first-child { border-top: 0; }
.help-card a { color: var(--accent); font-weight: 700; text-decoration: none; } .help-card small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.help-res-h { font-size: 18px; margin: 0 0 14px; }
.help-hit { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; text-decoration: none; color: var(--ink); }
.help-hit:hover { border-color: var(--accent); } .help-hit small { display: block; color: var(--muted); font-size: 12px; } .help-hit b { display: block; font-size: 16px; color: var(--accent); margin: 2px 0 4px; } .help-hit span { font-size: 14px; color: #33423f; }
.help-hit mark { background: #fef08a; padding: 0 2px; border-radius: 3px; }
.help-lightbox { position: fixed; inset: 0; background: rgba(8,20,18,.82); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 24px; cursor: zoom-out; }
.help-lightbox[hidden] { display: none; }
.help-lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #fff; }
.help-lightbox button { position: absolute; top: 16px; right: 20px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 26px; cursor: pointer; }
@media (max-width: 900px) {
    .help-wrap { grid-template-columns: 1fr; padding: 16px 12px 40px; gap: 16px; }
    .help-side { position: static; max-height: none; }
    .help-toc { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; padding: 4px 8px 10px; background: #fff; }
    .help-main { padding: 22px 18px 28px; }
    .help-title { font-size: 24px; } .help-start, .help-grid { grid-template-columns: 1fr; }
    .help-pn { flex-direction: column; } .help-pn a { max-width: none; }
}
/* the "Help" link in the top menu */
.nav-help { opacity: .9; }

/* Platform console (v63) */
.console-fs { border: 1px solid var(--border); border-radius: 12px; padding: 4px 16px 6px; margin: 0 0 16px; }
.console-fs legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 6px; text-transform: uppercase; letter-spacing: .05em; }
.console-body .c-tab[hidden] { display: none; }
.auth-console .auth-aside { background: radial-gradient(900px 500px at 110% -10%, rgba(245,158,11,.22), transparent 60%), linear-gradient(160deg, #111827 0%, #1f2937 100%); }

/* Subscription notice (v64) */
.bill-banner { padding: 10px 20px; font-size: 14px; text-align: center; border-bottom: 1px solid transparent; }
.bill-banner a { font-weight: 700; margin-left: 6px; color: inherit; text-decoration: underline; }
.bill-info { background: #ecfeff; color: #155e75; border-color: #a5f3fc; }
.bill-warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.bill-bad { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.modal-overlay[hidden] { display: none !important; }
/* Plans & billing (v64) */
.st-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #eef2f1; color: var(--muted); vertical-align: middle; }
.st-ok { background: #dcfce7; color: #166534; } .st-info { background: #e0f2fe; color: #075985; } .st-warn { background: #fef3c7; color: #92400e; } .st-bad { background: #fee2e2; color: #991b1b; }
.cur-plan { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin: 4px 0 14px; }
.cur-name { font-size: 22px; font-weight: 800; letter-spacing: -.01em; } .cur-when { color: var(--muted); font-size: 14px; } .cur-when b { color: var(--ink); }
.use-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 8px 0 12px; }
.use-row { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.use-top { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; } .use-top b { color: var(--ink); }
.use-bar { height: 8px; background: #eef2f1; border-radius: 999px; overflow: hidden; } .use-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.use-bar i.near { background: var(--amber); } .use-bar i.full { background: var(--red); }
.feat-list { display: flex; flex-wrap: wrap; gap: 8px; } .feat-list span { font-size: 13px; padding: 3px 10px; border-radius: 8px; background: #f1f5f4; } .feat-list .no { color: #9aa8a5; text-decoration: line-through; }
.cycle-toggle { display: inline-flex; background: #eef2f1; border-radius: 10px; padding: 3px; margin: 4px 0 14px; }
.cycle-toggle button { border: 0; background: transparent; padding: 7px 16px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.cycle-toggle button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.plan-card { position: relative; border: 1px solid var(--border); border-radius: 16px; padding: 20px 18px 18px; display: flex; flex-direction: column; background: #fff; }
.plan-card.popular { border: 2px solid var(--accent); box-shadow: 0 16px 40px -24px rgba(15,118,110,.6); }
.plan-card.current { background: linear-gradient(180deg, var(--accent-soft), #fff 60%); }
.plan-badge { position: absolute; top: -11px; left: 18px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.plan-card h3 { margin: 0 0 4px; font-size: 18px; } .plan-desc { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; min-height: 2.6em; }
.plan-price { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 12px; } .plan-price small { font-size: 13px; color: var(--muted); font-weight: 600; }
.plan-card ul { list-style: none; padding: 0; margin: 0 0 16px; flex: 1; } .plan-card li { font-size: 13.5px; padding: 4px 0 4px 22px; position: relative; } .plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.plan-card button { width: 100%; }
.pay-instr { background: #f6faf9; border: 1px dashed #b9d8d1; border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-size: 14px; line-height: 1.55; }
/* Pricing page (v64) */
.pricing-wrap { max-width: 1160px; margin: 0 auto; padding: 36px 20px 70px; }
.pricing-hero { text-align: center; margin-bottom: 28px; } .pricing-hero h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.025em; margin: 0 0 10px; }
.pricing-hero p { color: var(--muted); font-size: 17px; max-width: 680px; margin: 0 auto 18px; }
.pricing-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.plan-cta { display: block; text-align: center; text-decoration: none; padding: 11px 14px; border-radius: 10px; }
.pricing-faq { max-width: 760px; margin: 48px auto 0; } .pricing-faq h2 { text-align: center; }
.nav-cta { background: var(--accent); color: #fff !important; border-radius: 8px; padding: 8px 14px !important; font-weight: 700; }
.pp-m[hidden], .pp-y[hidden] { display: none; }

/* ===== v66: Settings shell (left tab list, Shopify style) ===== */
.settings-wrap { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-side { position: sticky; top: 16px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 10px; box-shadow: var(--shadow-sm); }
.settings-side-h { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 8px; }
.settings-side nav { display: flex; flex-direction: column; gap: 2px; }
.settings-side a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.settings-side a span { width: 20px; text-align: center; }
.settings-side a:hover { background: #f1f4f3; }
.settings-side a.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.settings-main { min-width: 0; }
.settings-title { font-size: 22px; margin: 2px 0 14px; }
.settings-subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.settings-subtabs a { padding: 6px 14px; border-radius: 999px; background: #eef2f1; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; }
.settings-subtabs a.on { background: var(--accent); color: #fff; }
@media (max-width: 860px) {
    .settings-wrap { grid-template-columns: 1fr; gap: 12px; }
    .settings-side { position: static; padding: 6px; }
    .settings-side-h { display: none; }
    .settings-side nav { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: thin; }
    .settings-side a { white-space: nowrap; padding: 8px 12px; }
}

/* ===== v66: couriers & sales channels ===== */
.cn-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.cn-list { display: grid; gap: 12px; }
.cn-card { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.cn-card.off { opacity: .62; }
.cn-ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--cn, #0f766e); background: color-mix(in srgb, var(--cn, #0f766e) 14%, #fff); border: 1px solid color-mix(in srgb, var(--cn, #0f766e) 30%, #fff); }
.cn-name { font-weight: 700; font-size: 15.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cn-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.cn-meta code { font-size: 12px; background: #f1f4f3; padding: 1px 6px; border-radius: 6px; }
.cn-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.cn-actions .btn-primary, .cn-actions .btn-secondary { padding: 6px 14px; text-decoration: none; font-size: 13px; }
.lvl { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .02em; }
.lvl-1 { background: #f1f5f9; color: #475569; } .lvl-2 { background: #e0f2fe; color: #075985; } .lvl-3 { background: #dcfce7; color: #166534; }
.cn-def { font-size: 11px; font-weight: 700; color: #92400e; background: #fef3c7; padding: 2px 8px; border-radius: 999px; }
.cn-warn { font-size: 12px; font-weight: 600; color: #92400e; }
.cn-test-ok { color: var(--green); font-weight: 600; } .cn-test-bad { color: var(--red); font-weight: 600; }
.cn-empty { text-align: center; padding: 34px 16px; border: 2px dashed var(--border); border-radius: 14px; background: #fff; }
.cn-empty .big { font-size: 34px; }
.cn-menu { position: relative; }
.cn-menu > button { padding: 6px 10px; }
.cn-menu-list { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); min-width: 190px; z-index: 20; padding: 6px; display: none; }
.cn-menu.open .cn-menu-list { display: block; }
.cn-menu-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 7px; font: inherit; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.cn-menu-list button:hover { background: #f1f4f3; } .cn-menu-list button.danger { color: var(--red); }
.tpl-search { width: 100%; margin: 4px 0 12px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; max-height: 56vh; overflow: auto; padding: 2px; }
.tpl-card { text-align: left; border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: #fff; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 6px; }
.tpl-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tpl-card.locked { opacity: .7; }
.tpl-card .tpl-top { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.tpl-card .tpl-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.tpl-card.tpl-new { border-style: dashed; background: #fbfcfb; }
.modal-box.wide { max-width: 760px; max-height: 92vh; overflow: auto; }
.cn-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 0 0 16px; overflow-x: auto; }
.cn-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; border-radius: 0; }
.cn-tabs button.on { color: var(--accent-dark); border-bottom-color: var(--accent); }
.cn-pane[hidden] { display: none; }
.cn-hero { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.cn-hero .cn-ico { width: 54px; height: 54px; font-size: 26px; }
.cn-hero h1 { margin: 0; font-size: 22px; }
.copy-row { display: flex; gap: 6px; } .copy-row input { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.saved-pill { display: inline-block; font-size: 11.5px; font-weight: 600; color: #166534; background: #dcfce7; border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.trk-try { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.trk-res { font-weight: 600; } .trk-res.ok { color: var(--green); } .trk-res.bad { color: var(--red); }
.test-step { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.test-step h3 { margin: 0 0 4px; font-size: 15.5px; display: flex; gap: 8px; align-items: center; }
.test-step .num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; }
.test-out { margin-top: 10px; display: none; }
.test-out.show { display: block; }
.test-out .res { padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.test-out .res.ok { background: #dcfce7; color: #166534; } .test-out .res.bad { background: #fee2e2; color: #991b1b; }
.test-out details { margin-top: 8px; } .test-out pre { background: #f6f8f7; border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.fmt-table td { padding: 4px 8px; font-size: 13px; }
.log-list { font-size: 13px; } .log-list li { margin: 4px 0; } .log-list .bad { color: var(--red); }
.cbadge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--cb, #64748b); vertical-align: middle; white-space: nowrap; }
.cbadge.outline { background: #fff; color: var(--cb, #64748b); border: 1px solid var(--cb, #64748b); }
/* Log orders: courier switch + live split */
.lo-courier { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 12px; background: #f8faf9; border: 1px solid var(--border); border-radius: 12px; }
.lo-courier label { font-weight: 700; font-size: 13.5px; margin: 0; }
.lo-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.lo-chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.lo-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cb, #64748b); }
.lo-chip.on { background: var(--cb, var(--accent)); border-color: var(--cb, var(--accent)); color: #fff; }
.lo-chip.on .dot { background: #fff; }
.lo-split { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; }
.lo-split .cbadge { font-weight: 600; }
.lo-conflict { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: #92400e; background: #fef3c7; border-radius: 8px; padding: 6px 10px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.perm-group { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: #fff; }
.perm-group h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.perm-group label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 13.5px; margin: 4px 0; }
.perm-group label.from-role { color: var(--muted); }
.req-card { border: 1px solid #fde68a; background: #fffbeb; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.team-table td { vertical-align: middle; }
.role-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); }
.role-pill.owner { background: #fef3c7; color: #92400e; }
.scope-pill { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #f1f5f9; color: #475569; margin-left: 4px; }
.lock-note { font-size: 12px; font-weight: 600; color: #92400e; }
.by-courier { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 13.5px; }
.by-courier th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.by-courier td { padding: 7px 8px; border-bottom: 1px solid #f1f4f3; }
.by-courier tbody tr { cursor: pointer; } .by-courier tbody tr:hover { background: #f8faf9; } .by-courier tbody tr.on { background: var(--accent-soft); }
.launch-pill { display: inline-block; margin-top: 10px; padding: 8px 16px; border-radius: 999px; background: #ecfdf5; color: #065f46; font-weight: 600; font-size: 14px; }
.help-code { background:#f6f8f7; border:1px solid var(--border); border-radius:10px; padding:12px 14px; font-size:12.5px; overflow:auto; white-space:pre; }

/* ---------- v67: label preview, designer, printing ---------- */
.lbl-canvas { position: relative; background: #fff; color: #000; font-family: Helvetica, Arial, sans-serif; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.18); user-select: none; -webkit-user-select: none; flex: none; }
.lbl-canvas.lbl-frame { outline: 1px dashed #b8b8b8; outline-offset: -1px; }
.lbl-b { position: absolute; display: flex; flex-direction: column; overflow: hidden; }
.lbl-t { overflow: visible; }   /* like the PDF, a single line may reach a little past its box */
.lbl-tx { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.lbl-bcw { align-items: center; justify-content: center; }
.lbl-bc { display: block; }
.lbl-bc rect { fill: #000; }
.lbl-line i { position: absolute; display: block; }
.lbl-blank { display: block; border-bottom: 1px solid #8c8c8c; margin-bottom: 2px; }
.lbl-ph { color: #98a2a0; font-size: 11px; font-style: italic; line-height: 1.2; }
.lbl-edit .lbl-b { cursor: move; touch-action: none; }
.lbl-edit .lbl-b:hover { outline: 1px dashed rgba(15,118,110,.55); }
.lbl-edit .lbl-b.sel { outline: 2px solid var(--accent); z-index: 5; overflow: visible; }
.le-handle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); cursor: nwse-resize; touch-action: none; z-index: 6; }
.le-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.le-back { color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; }
.le-name { flex: 1 1 220px; }
.le-name input { width: 100%; font-size: 18px; font-weight: 700; padding: 8px 10px; }
.le-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.le-bar { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.le-bar label { display: flex; gap: 6px; align-items: center; font-weight: 600; font-size: 14px; margin: 0; }
.le-bar select { max-width: 260px; }
.le-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.le-stage-wrap { min-width: 0; }
.le-add { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.le-add button, .le-add select { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink); }
.le-add button:hover { border-color: var(--accent); color: var(--accent); }
.le-add button:disabled { opacity: .45; cursor: default; }
.le-sp { flex: 1; }
.le-stage { background: repeating-conic-gradient(#eceeea 0% 25%, #f6f7f4 0% 50%) 0 0 / 18px 18px; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; justify-content: center; overflow: hidden; }
.le-tip { margin-top: 8px; }
.le-panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.le-ph { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.le-ph span { display: flex; gap: 4px; }
.le-mini { padding: 4px 9px !important; font-size: 13px; min-height: 0; }
.le-f { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 13px; font-weight: 600; min-width: 0; }
.le-f > span { color: var(--muted); font-size: 12px; }
.le-f input, .le-f select, .le-f textarea { width: 100%; }
.le-f textarea { font-family: inherit; resize: vertical; }
.le-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.le-row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.le-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; }
.le-c { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 500; margin: 0 0 8px; }
.le-seg { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.le-seg button { flex: 1; border: 0; background: var(--card); padding: 7px 4px; font-size: 12px; cursor: pointer; color: var(--ink); }
.le-seg button + button { border-left: 1px solid var(--border); }
.le-seg button.on { background: var(--accent); color: #fff; }
.le-pos, .le-help { margin-top: 6px; font-size: 13px; }
.le-pos summary, .le-help summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 4px 0; }
.le-help ul { padding-left: 16px; margin: 6px 0; }
.le-help li { margin: 2px 0; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.lb-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--card); }
.lb-thumb { display: flex; justify-content: center; align-items: flex-start; background: #f1f3ef; border-radius: 8px; padding: 10px; min-height: 120px; overflow: hidden; }
.lb-mini { pointer-events: none; }
.lb-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-btns > * { padding: 6px 12px !important; font-size: 13px; text-decoration: none; }
.lb-ctable select { width: 100%; max-width: 420px; }
.lb-way { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-top: 10px; }
.lb-way summary { cursor: pointer; padding: 4px 0; }
.lb-way ol { padding-left: 20px; }
.lb-way li { margin: 6px 0; }
.lb-code { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.lb-code .hint { flex-basis: 100%; }
.lb-code code { flex: 1 1 260px; background: #0f172a; color: #e2e8f0; padding: 8px 10px; border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: nowrap; }
.lb-starters { display: grid; gap: 10px; margin: 12px 0; }
.lb-starter { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--ink); }
.lb-starter:hover { border-color: var(--accent); background: var(--accent-soft); }
.lb-starter span { color: var(--muted); font-size: 13px; }
.lbl-prev-wrap { background: #f1f3ef; border-radius: 8px; padding: 12px; display: flex; justify-content: center; margin-bottom: 8px; overflow: hidden; }
.bk-print { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; padding: 12px; margin-bottom: 8px; background: var(--accent-soft); border-radius: var(--radius); }
.bk-print .bk-printall { font-size: 16px; padding: 12px 20px; }
.bk-print .msg { flex-basis: 100%; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) {
    .le-grid { grid-template-columns: 1fr; }
    .le-panel { position: static; max-height: none; }
    .le-stage { padding: 10px; }
}

/* =====================================================================
   v67: mobile-first layer. Phones are the main screen for staff:
   compact header, bottom tab bar, settings strip, tables as cards,
   thumb-sized controls, sheets instead of pop-ups.
   ===================================================================== */
.settings-wrap > * { min-width: 0; }
.ot-tabbar { display: none; }
.nav-version { display: block; padding: 8px 12px 4px; font-size: 11.5px; color: #94a3b8; border-top: 1px solid rgba(255,255,255,.08); margin-top: 4px; }
.ot-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 12px 26px; }
.auth-ver { opacity: .75; }
.ot-more { background: none; border: 0; padding: 0; margin: -4px 0 10px; color: var(--accent); font-weight: 700; font-size: 13px; cursor: pointer; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

@media (max-width: 760px) {
    html { -webkit-text-size-adjust: 100%; }
    body { font-size: 15px; }
    body.has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
    .container { padding: 12px 12px 20px; }
    .card { padding: 16px 14px; border-radius: 14px; margin-bottom: 12px; }
    .card h2 { font-size: 16.5px; }
    h1.settings-title, .settings-title { font-size: 20px; }

    /* header: one slim row; the menu opens below it */
    header.top { padding: 8px 12px; position: relative; }
    .top-brand-icon { width: 34px !important; height: 34px !important; font-size: 18px !important; border-radius: 10px !important; }
    .top-brand h1 { font-size: 17px !important; }
    .top-brand p { font-size: 12px !important; }
    .nav-toggle { font-size: 22px; padding: 6px 10px; }
    .top-nav { max-height: calc(100vh - 140px); overflow-y: auto; }
    .top-nav a, .top-nav .nav-dd-btn { padding: 12px 14px !important; font-size: 15px; }
    .nav-dd-menu { position: static !important; box-shadow: none !important; background: rgba(255,255,255,.04) !important; margin: 2px 0 6px 12px; }

    /* bottom tab bar */
    .ot-tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
        background: rgba(255,255,255,.97); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid var(--border); box-shadow: 0 -6px 20px -12px rgba(19,32,31,.3); padding-bottom: env(safe-area-inset-bottom, 0px); }
    .ot-tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 600; -webkit-tap-highlight-color: transparent; }
    .ot-tabbar .ot-ti { font-size: 21px; line-height: 1; filter: grayscale(.6); opacity: .85; }
    .ot-tabbar a.on { color: var(--accent); }
    .ot-tabbar a.on .ot-ti { filter: none; opacity: 1; }
    .ot-tabbar a.on::before { content: ''; position: absolute; top: 0; width: 34px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
    .ot-tabbar a { position: relative; }
    .ot-foot { padding-bottom: 8px; }

    /* settings: a swipeable strip of sections */
    .settings-wrap { display: block; }
    .settings-side { position: sticky; top: 0; z-index: 20; margin: -12px -12px 12px; padding: 8px 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--border); background: rgba(245,246,242,.96); backdrop-filter: blur(8px); box-shadow: none; }
    .settings-side-h { display: none; }
    .settings-side nav { flex-direction: row; overflow-x: auto; gap: 6px; padding: 0 12px; scrollbar-width: none; scroll-snap-type: x proximity; }
    .settings-side nav::-webkit-scrollbar { display: none; }
    .settings-side a { white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: 13.5px; scroll-snap-align: center; }
    .settings-side a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
    .settings-side a span { width: auto; }
    .settings-subtabs { overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none; }
    .settings-subtabs a { white-space: nowrap; }

    /* forms: 16px text stops iPhones zooming in; thumb-sized controls */
    input[type="text"], input[type="password"], input[type="email"], input[type="date"], input[type="number"],
    input[type="search"], input[type="tel"], input[type="url"], select, textarea { font-size: 16px !important; min-height: 44px; }
    textarea { min-height: 88px; }
    input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
    .btn-primary, .btn-secondary, .btn-danger, button.btn-primary, button.btn-secondary { min-height: 44px; }
    .button-row { gap: 8px; }
    .button-row > .btn-primary, .button-row > .btn-secondary, .button-row > .btn-danger, .button-row > a.btn-primary, .button-row > a.btn-secondary { flex: 1 1 140px; justify-content: center; text-align: center; }
    .filter-grid, .le-row { grid-template-columns: 1fr !important; }
    .field-group { margin-bottom: 12px; }
    .cn-head { flex-direction: column; align-items: stretch; }
    .cn-head > .btn-primary { width: 100%; }

    /* long intros: 3 lines + More */
    p.sub.ot-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin-bottom: 6px; }
    p.sub.ot-clamp.ot-open { display: block; }

    /* tables become cards */
    table.ot-stack, table.ot-stack tbody, table.ot-stack tr, table.ot-stack td { display: block; width: 100%; }
    table.ot-stack thead { display: none; }
    .table-wrap:has(> table.ot-stack), .claim-table-wrap:has(> table.ot-stack) { overflow: visible; border: 0; }
    table.ot-stack tr { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
    table.ot-stack tbody tr:hover { background: #fff; }
    table.ot-stack td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0 !important; border: 0 !important; border-bottom: 1px solid #eef1f0 !important; text-align: right; min-height: 34px; word-break: break-word; }
    table.ot-stack td:last-child { border-bottom: 0 !important; }
    table.ot-stack { min-width: 0 !important; table-layout: auto !important; }
    table.ot-stack td { flex-wrap: wrap; white-space: normal !important; }
    table.ot-stack td > * { max-width: 100%; min-width: 0; white-space: normal !important; }
    table.ot-stack td::before { content: attr(data-label); flex: 0 0 auto; max-width: 45%; text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
    table.ot-stack td[data-label=""]::before, table.ot-stack td.ot-full::before { display: none; }
    table.ot-stack td[data-label=""], table.ot-stack td.ot-full { justify-content: flex-start; text-align: left; }
    table.ot-stack td > input[type="text"], table.ot-stack td > select { max-width: 62%; }
    table.ot-stack td .btn-secondary, table.ot-stack td .btn-danger, table.ot-stack td .btn-primary { min-height: 38px; }
    table.ot-stack td:has(> button), table.ot-stack td:has(> .btn-secondary) { flex-wrap: wrap; justify-content: flex-end; }

    /* pop-ups become bottom sheets */
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal-box, .modal-box.wide { max-width: none !important; width: 100%; border-radius: 18px 18px 0 0 !important; max-height: 92vh; overflow-y: auto; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); animation: ot-sheet .22s ease; }
    @keyframes ot-sheet { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }

    /* page specifics */
    .stat-grid, .sum-grid { gap: 10px !important; }
    .cn-card { grid-template-columns: 40px minmax(0, 1fr); padding: 12px; }
    .cn-ico { width: 40px; height: 40px; font-size: 19px; }
    .cn-actions { grid-column: 1 / -1; justify-content: stretch; }
    .cn-actions > * { flex: 1 1 auto; text-align: center; }
    .cn-actions > a, .cn-actions > button, a.btn-primary, a.btn-secondary { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
    .cn-actions > :last-child:not(:first-child) { flex: 0 0 52px; }
    .cn-tabs { overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none; }
    .cn-tabs button { white-space: nowrap; }
    .bk-print { flex-direction: column; align-items: stretch; }
    .bk-print .bk-printall, .bk-print .bk-send { width: 100%; }
    .bk-files { display: flex; flex-direction: column; gap: 6px; }
    .bk-files > a { text-align: center; }
    .lb-grid { grid-template-columns: 1fr; }
    .le-top { flex-direction: column; align-items: stretch; }
    .le-name { flex: none; }
    .le-bar label:has(> input[type="checkbox"]) { justify-content: flex-start; }
    .le-add select { width: auto; min-height: 40px !important; font-size: 14px !important; }
    .le-add button { min-height: 40px; }
    .le-actions > * { flex: 1 1 auto; }
    .le-bar { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
    .le-bar label { justify-content: space-between; min-width: 0; }
    .le-bar select { min-width: 0; flex: 1 1 auto; }
    .le-bar select { max-width: 62%; }
    .le-add { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .le-add > * { flex: none; }
    .le-handle { width: 26px; height: 26px; right: -13px; bottom: -13px; }
    .le-row4 { grid-template-columns: repeat(2, 1fr); }
    .help-table, .help-article table { display: block; overflow-x: auto; }
    .pricing-grid, .plan-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 380px) {
    .ot-tabbar .ot-tl { font-size: 10.5px; }
    .container { padding-left: 10px; padding-right: 10px; }
}
