/* ============================================================
   Components — buttons, forms, chips, pills, receipt, QR, steps.
   Built only from tokens.css variables, so rebranding stays in one file.
   ============================================================ */

/* --- Alerts --- */
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}
.alert-error {
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

/* --- Forms --- */
form { text-align: left; margin-top: 14px; }
/* Fintech micro-labels: small, uppercase, tracked — reads as a
   professional checkout instead of a plain web form. Scoped to
   direct form labels so currency tiles keep their own styling. */
form > label, .fieldset legend {
    display: block;
    margin: 14px 0 var(--space-2);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.fieldset { border: 0; margin: 0; padding: 0; }
.fieldset legend { padding: 0; }
.optional { font-weight: 400; color: var(--color-text-faint); }

input[type="number"], input[type="text"], select {
    width: 100%;
    padding: 11px 14px;
    font-size: var(--font-size-base);
    font-family: inherit;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: var(--font-size-base);
    font-family: inherit;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="color"] {
    width: 56px;
    height: 42px;
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border-strong);
    background: var(--color-surface);
    cursor: pointer;
}
/* Dashboard forms: label + control pairs, optionally two per row. */
.field label {
    display: block;
    margin: 14px 0 var(--space-2);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .field { min-width: 0; }
@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
}
input:focus, select:focus, textarea:focus {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 4px var(--color-brand-soft);
}
/* Money fields: tabular figures so amounts line up, and no clunky
   browser spinner arrows on the number field. */
.amount-wrap input { font-variant-numeric: tabular-nums; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
/* Honeypot: hidden from humans AND assistive tech, visible to bots. */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.amount-wrap { position: relative; }
.amount-wrap input { padding-right: 64px; font-size: var(--font-size-xl); font-weight: 700; }
.amount-currency {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-faint);
    font-weight: 700;
}

/* --- Quick amount chips --- */
.chips { display: flex; gap: var(--space-2); margin-top: var(--space-2); flex-wrap: wrap; }
.chip {
    flex: 1;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface-muted);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.chip:hover { border-color: var(--color-text); }
.chip.active { background: var(--color-brand); color: var(--color-text-inverse); border-color: var(--color-brand); }

/* --- Currency tiles (a real selector grid, not wrapping pills) --- */
.coin-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-2); margin-top: 2px; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 2px 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    background: var(--color-surface-muted);
    border: 1.5px solid var(--color-border);
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.tile:hover span { transform: translateY(-2px); border-color: var(--color-brand); }
.tile input:checked + span {
    background: var(--color-brand);
    color: var(--color-text-inverse);
    border-color: var(--color-brand);
    box-shadow: 0 8px 20px rgba(240, 185, 11, 0.30);
}
.tile input:focus-visible + span { box-shadow: 0 0 0 4px var(--color-brand-soft); }
.tile .coin { width: 38px; height: 38px; transition: transform 0.2s ease; }
.tile:hover .coin { transform: scale(1.12) rotate(-6deg); }
@keyframes coinPop {
    0% { transform: scale(0.6) rotate(-14deg); }
    60% { transform: scale(1.25) rotate(6deg); }
    100% { transform: scale(1) rotate(0deg); }
}
.tile input:checked + span .coin { animation: coinPop 0.45s ease; }

/* --- Live order summary --- */
.summary {
    margin: 12px 0 0;
    padding: 10px 13px;
    text-align: center;
    font-weight: 500;
    color: var(--color-text-faint);
    background: var(--color-surface-muted);
    border-radius: var(--radius-md);
}
.summary.ready { color: var(--color-text); }
.summary strong { color: var(--color-success); }

/* --- Primary button --- */
.paybtn {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 13px;
    font-size: var(--font-size-base);
    font-weight: 700;
    font-family: inherit;
    text-align: center;
    color: var(--color-text-inverse);
    background: var(--color-brand);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 24px rgba(240, 185, 11, 0.28);
    transition: filter 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}
.paybtn:hover { filter: brightness(1.04); box-shadow: 0 12px 28px rgba(240, 185, 11, 0.35); }
.paybtn:active { transform: scale(0.99); }
.paybtn:disabled { opacity: 0.65; cursor: wait; }
/* Binance-style shine sweep across the button on hover. */
.paybtn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -70%;
    width: 45%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
    pointer-events: none;
}
.paybtn:hover::after { left: 130%; }
.paybtn .btn-text { position: relative; z-index: 1; }
/* Secondary button (e.g. "I've sent the payment"). */
.paybtn-secondary { background: var(--color-surface-muted); border: 1.5px solid var(--color-border); }
.paybtn-secondary:hover { filter: none; border-color: var(--color-text); }

/* --- Orders admin --- */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.totals { display: flex; gap: var(--space-2); margin: 14px 0 4px; flex-wrap: wrap; }
.total-box { flex: 1; min-width: 120px; background: var(--color-surface-muted); border-radius: var(--radius-md); padding: 12px 8px; text-align: center; }
.total-box span { display: block; color: var(--color-text-faint); font-size: var(--font-size-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.total-box strong { display: block; font-size: 22px; margin-top: 2px; }
.filterbar { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: 14px 0; }
.filterbar a { padding: 8px 14px; border-radius: var(--radius-pill); background: var(--color-surface-muted); color: var(--color-text); text-decoration: none; font-size: 14px; font-weight: 600; }
.filterbar a.active { background: var(--color-brand); color: var(--color-text-inverse); }
/* --- Dashboard tabs: a real tab bar, not filter pills. Only one
       panel is visible at a time; the active tab carries the gold
       underline so the structure is obvious at a glance. --- */
.admintabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--color-border); margin: 16px 0 20px; overflow-x: auto; }
.admintabs a { padding: 10px 16px; color: var(--color-text-muted); text-decoration: none; font-weight: 700; font-size: 14px; border-bottom: 3px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.admintabs a:hover { color: var(--color-text); }
.admintabs a.active { color: var(--color-brand); border-bottom-color: var(--color-brand); }
.admin-actions form { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.orders-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.orders-table th { color: var(--color-text-faint); font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.08em; padding: 8px 10px; border-bottom: 1.5px solid var(--color-border); white-space: nowrap; }
.orders-table td { padding: 10px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.orders-table tbody tr:nth-child(even) { background: var(--color-surface-muted); }
.orders-table td form { margin: 0; }
.admin-actions { display: flex; gap: var(--space-2); justify-content: center; margin: 6px 0 0; }
.admin-search { display: flex; gap: var(--space-2); margin: 14px 0 0; }
.admin-search input[type="search"] { flex: 1; }
.mini-btn-link { text-decoration: none; display: inline-block; }
.mini-btn { padding: 6px 12px; font-size: 13px; font-weight: 600; font-family: inherit; background: var(--color-surface); color: var(--color-text); border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; }
.mini-btn:hover { border-color: var(--color-text); }
.status-awaiting { color: var(--color-warning); background: var(--color-warning-bg); border-radius: var(--radius-pill); padding: 3px 10px; font-size: var(--font-size-sm); font-weight: 600; white-space: nowrap; }
.status-claimed { color: #fcd34d; background: rgba(251, 191, 36, 0.14); border-radius: var(--radius-pill); padding: 3px 10px; font-size: var(--font-size-sm); font-weight: 600; white-space: nowrap; }
.status-paid { color: var(--color-success); background: var(--color-success-bg); border-radius: var(--radius-pill); padding: 3px 10px; font-size: var(--font-size-sm); font-weight: 600; white-space: nowrap; }
.status-expired { color: var(--color-danger); background: rgba(248, 113, 113, 0.14); border-radius: var(--radius-pill); padding: 3px 10px; font-size: var(--font-size-sm); font-weight: 600; white-space: nowrap; }
.pay-deadline { border: 1.5px solid var(--color-warning); background: var(--color-warning-bg); border-radius: var(--radius-md); padding: 12px 14px; margin: 16px 0; }

/* --- Result page --- */
@keyframes popIn {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: scale(1); }
}
.success-badge {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-success-bg);
    color: var(--color-success);
    font-size: 26px;
    font-weight: 800;
    animation: popIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.amount {
    font-size: var(--font-size-amount);
    font-weight: 800;
    margin: 12px 0 12px;
    letter-spacing: -0.01em;
    animation: fadeUp 0.4s 0.08s ease both;
}
/* Large coin on the result page: 3D flip-in, then a gentle float. */
.coin-hero { display: flex; justify-content: center; margin: 2px 0 0; animation: floatY 4s ease-in-out 0.9s infinite; }
.coin-large { width: 56px; height: 56px; animation: coinFlipIn 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) both; }
@keyframes coinFlipIn {
    from { opacity: 0; transform: rotateY(90deg) scale(0.7); }
    to { opacity: 1; transform: rotateY(0deg) scale(1); }
}
@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.receipt {
    margin: 4px 0 12px;
    padding: 12px 16px;
    background: var(--color-surface-muted);
    border-radius: var(--radius-md);
    font-size: 14px;
    text-align: left;
}
.receipt div {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 5px 0;
}
.receipt div + div { border-top: 1px solid var(--color-border); }
.receipt dt { color: var(--color-text-faint); }
.receipt dd { margin: 0; font-weight: 600; text-align: right; word-break: break-word; }
.status-pending {
    color: var(--color-warning);
    background: var(--color-warning-bg);
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    font-size: var(--font-size-sm);
}
.qr {
    width: 200px;
    height: 200px;
    margin: 4px auto 8px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 10px;
    box-shadow: var(--shadow-qr);
    animation: fadeUp 0.45s 0.12s ease both;
}
.steps {
    text-align: left;
    margin: 12px auto 6px;
    padding-left: 24px;
    color: var(--color-text-muted);
    line-height: 1.65;
    font-size: var(--font-size-base);
}
.steps strong { color: var(--color-text); }
.linkbox { display: flex; gap: var(--space-2); margin-top: 10px; }
.linkbox input { flex: 1; font-size: var(--font-size-sm); }
.linkbox button {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    background: var(--color-brand);
    color: var(--color-text-inverse);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    white-space: nowrap;
}
.linkbox button:hover { filter: brightness(1.15); }
.copied { color: var(--color-success); font-weight: 600; }
.trust { color: var(--color-text-muted); font-size: var(--font-size-sm); line-height: 1.5; margin-top: 12px; text-align: center; }

@media (max-width: 420px) {
    .qr { width: 200px; height: 200px; }
    /* Phones: the coin grid MUST stay 5-across — small tiles, never stacked. */
    .coin-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
    .tile span { padding: 8px 2px 6px; font-size: 10px; gap: 4px; }
    .tile .coin { width: 26px; height: 26px; }
}

/* Short laptop screens: smaller QR so the result page still fits. */
@media (max-height: 720px) and (min-width: 481px) {
    .qr { width: 160px; height: 160px; }
    .amount { font-size: 30px; margin: 8px 0; }
    .steps { line-height: 1.5; }
}

/* Respect users who prefer no motion: instant state changes only. */
@media (prefers-reduced-motion: reduce) {
    .paybtn, .chip, .tile span, input { transition: none; }
    .paybtn::after { display: none; }
    .success-badge, .qr, .amount { animation: none; }
    .coin, .coin-large, .coin-hero { animation: none; transition: none; }
}

/* ============================================================
   Admin dashboard v2 — KPI cards, sales chart, badges, toasts,
   sticky tabs, mobile card tables. Midnight Bazaar theme kept:
   dark surfaces, gold accents, no inline styles anywhere.
   ============================================================ */

/* --- Sticky tab bar (sticks below the sticky site header:
       the header is 54px tall, 50px on small phones) --- */
.admintabs { position: sticky; top: 54px; z-index: 40; background: var(--color-bg); padding-top: 6px; }
@media (max-width: 420px) {
    .admintabs { top: 50px; }
}

/* --- Toasts: server-rendered flash messages, fixed at the top so
       they read on any tab; admin.js dismisses them. --- */
.toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 100; width: max-content; max-width: min(92vw, 560px); margin: 0; padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; line-height: 1.45; text-align: left; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); }
.toast-success { color: var(--color-success); background: #12261f; border: 1px solid rgba(52, 211, 153, 0.45); }
.toast-error { color: #fca5a5; background: #2b1414; border: 1px solid rgba(248, 113, 113, 0.45); }
.toast-close { float: right; margin-left: 12px; padding: 0 2px; background: none; border: none; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; }

/* --- KPI cards --- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0 4px; }
.kpi-card { background: var(--color-surface-muted); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px 16px; }
.kpi-label { display: block; color: var(--color-text-faint); font-size: var(--font-size-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.kpi-value { display: block; font-size: 26px; font-weight: 800; margin-top: 4px; }
.kpi-sub { display: block; color: var(--color-text-muted); font-size: var(--font-size-sm); margin-top: 2px; }
.kpi-gold .kpi-value { color: var(--color-brand); }
.kpi-warn .kpi-value { color: var(--color-warning); }
@media (max-width: 820px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Sales chart (server-rendered SVG, no JS needed) --- */
.chart-wrap { background: var(--color-surface-muted); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px; margin: 12px 0; }
.sales-chart { width: 100%; height: auto; display: block; }
.sales-chart rect { fill: var(--color-brand); }
.sales-chart text { fill: var(--color-text-muted); font-size: 10px; font-family: inherit; }
.sales-chart line { stroke: var(--color-border); stroke-width: 1; }

/* --- Top products --- */
.top-list { margin: 12px 0; padding: 0; list-style: none; }
.top-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.top-meta { color: var(--color-text-muted); font-size: var(--font-size-sm); white-space: nowrap; }

/* --- Alerts + empty states --- */
.alert-box { padding: 14px 16px; border-radius: var(--radius-md); margin: 12px 0; }
.alert-box-warning { background: var(--color-warning-bg); border: 1px solid rgba(251, 191, 36, 0.4); }
.lowstock-list { margin: 10px 0 0; padding: 0; list-style: none; }
.lowstock-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 0; }
.lowstock-list li + li { border-top: 1px solid rgba(251, 191, 36, 0.2); }
.empty-state { text-align: center; color: var(--color-text-muted); background: var(--color-surface-muted); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md); padding: 28px 16px; margin: 16px 0; line-height: 1.6; }

/* --- Stock + tag badges --- */
.stock-badge, .tag-badge { border-radius: var(--radius-pill); padding: 3px 10px; font-size: var(--font-size-sm); font-weight: 600; white-space: nowrap; }
.stock-ok { color: var(--color-success); background: var(--color-success-bg); }
.stock-low { color: var(--color-warning); background: var(--color-warning-bg); }
.stock-out { color: var(--color-danger); background: rgba(248, 113, 113, 0.14); }
.tag-badge { color: var(--color-brand); background: var(--color-brand-soft); }

/* --- Product list: covers, filters, row actions --- */
.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; align-items: center; }
.admin-filters input[type="search"] { flex: 1 1 200px; }
.admin-filters select { flex: 1 1 150px; }
.cover-thumb svg { width: 72px; height: auto; display: block; border-radius: 8px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-actions form { margin: 0; }
.stock-form { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.stock-form input[type="number"] { width: 76px; padding: 7px 8px; }

/* --- Product cover editor (Products → Edit) --- */
.cover-editor { margin: 18px 0 6px; }
.cover-editor legend { font-weight: 700; margin-bottom: 10px; }
.cover-editor-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.cover-modes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cover-modes label { display: flex; gap: 7px; align-items: center; border: 1.5px solid var(--color-border-strong); border-radius: var(--radius-pill); padding: 8px 14px; font-weight: 600; cursor: pointer; }
.cover-modes label:has(input:checked) { border-color: var(--color-brand); color: var(--color-brand); background: var(--color-brand-soft); }
.svg-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; white-space: pre; }
.cover-preview-wrap { min-width: 0; }
.cover-preview-label { display: block; font-weight: 700; font-size: var(--font-size-sm); margin-bottom: 8px; color: var(--color-text-muted); }
.cover-preview { border: 1px solid var(--color-border); border-radius: 14px; overflow: hidden; background: var(--color-surface); }
.cover-preview svg { width: 100%; height: auto; display: block; }
@media (max-width: 720px) {
    .cover-editor-grid { grid-template-columns: 1fr; }
}

/* --- Status history --- */
.history { list-style: none; margin: 12px 0; padding: 0; }
.history li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--color-border); }
.history time { margin-left: auto; color: var(--color-text-faint); font-size: var(--font-size-sm); white-space: nowrap; }

/* --- Buttons + inputs: clearer, roomier, consistent.
       Search, date, and password inputs were unstyled before. --- */
.mini-btn { padding: 8px 14px; font-size: 14px; }
.mini-btn:disabled { opacity: 0.6; cursor: wait; }
form.is-loading button[type="submit"] { opacity: 0.65; cursor: wait; }
input[type="search"], input[type="date"], input[type="password"] { width: 100%; padding: 11px 14px; font-size: var(--font-size-base); font-family: inherit; border-radius: var(--radius-md); border: 1.5px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text); outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
input[type="search"]:focus, input[type="date"]:focus, input[type="password"]:focus { border-color: var(--color-brand); box-shadow: 0 0 0 4px var(--color-brand-soft); }
.admin-search input[type="date"] { flex: 0 1 150px; }
.adminpanel .hint { color: var(--color-text-muted); }

/* --- Mobile: tables become readable cards --- */
@media (max-width: 640px) {
    .table-wrap { overflow-x: visible; margin: 0; }
    .orders-table, .orders-table tbody, .orders-table tr, .orders-table td { display: block; width: 100%; }
    .orders-table thead { display: none; }
    .orders-table tr { border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 12px; padding: 6px 12px; background: var(--color-surface); }
    .orders-table tbody tr:nth-child(even) { background: var(--color-surface); }
    .orders-table td { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--color-border); padding: 9px 0; text-align: right; }
    .orders-table td:last-child { border-bottom: none; }
    .orders-table td::before { content: attr(data-label); color: var(--color-text-faint); font-size: var(--font-size-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; text-align: left; flex-shrink: 0; }
    .orders-table td .row-actions { justify-content: flex-end; }
    .admin-search { flex-wrap: wrap; }
    .admin-search input[type="date"] { flex: 1 1 140px; }
}

/* ============================================================
   Midnight Bazaar 2.0 — components layer (2026-11-01):
   gradient primary buttons with lift, glass inputs with a
   warmer focus glow, gold payment amount, richer QR stage.
   ============================================================ */

/* Primary button: the diagonal melt + a gentle lift on hover.
   The shine sweep (::after) from the base layer still applies. */
.paybtn {
    background: var(--color-brand-grad-135);
    box-shadow: var(--glow-btn);
    transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) ease, filter 0.15s ease;
}
@media (hover: hover) {
    .paybtn:hover { transform: translateY(-1px); box-shadow: var(--glow-btn-hover); filter: none; }
}
.paybtn-secondary {
    background: var(--color-surface-muted);
    border-color: var(--color-border-strong);
    color: var(--color-text);
    box-shadow: none;
}
@media (hover: hover) {
    .paybtn-secondary:hover { transform: none; box-shadow: none; border-color: var(--color-gold-line); }
}

/* Inputs: faint glass tint; focus adds a soft gold halo under
   the existing ring. Applies to the dashboard input set too. */
input[type="number"], input[type="text"], input[type="search"], input[type="date"], input[type="password"], select, textarea {
    background: var(--glass-tint), var(--color-surface);
}
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 4px var(--color-brand-soft), 0 6px 18px rgba(240, 185, 11, 0.10);
}

/* Selected currency tile + active quick chip: gradient, not flat. */
.tile input:checked + span { background: var(--color-brand-grad-135); }
.chip.active { background: var(--color-brand-grad-135); border-color: transparent; }

/* The payment amount is the hero number — gold gradient text. */
.amount {
    background: var(--color-brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* QR stage: gold-tinted frame, deeper shadow. */
.qr { border-color: rgba(240, 185, 11, 0.35); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(240, 185, 11, 0.10); }

/* Receipt + summary: glass tint and a defined edge. */
.receipt { background: var(--glass-tint), var(--color-surface-muted); border: 1px solid var(--color-border); }
.success-badge { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.08), 0 8px 20px rgba(0, 0, 0, 0.35); }

/* Admin tables: a whisper of hover feedback on desktop rows. */
@media (hover: hover) {
    .orders-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
}

/* Motion off means off — including every 2.0 transition. */
@media (prefers-reduced-motion: reduce) {
    .paybtn { transition: none; }
    .paybtn:hover { transform: none; }
}

/* ============================================================
   IVORY LIGHT — components layer: state colors re-graded for
   light backgrounds, softer shadows, gold-dark text accents.
   ============================================================ */
.alert-error { color: #b91c1c; background: rgba(220, 38, 38, 0.07); border-color: rgba(220, 38, 38, 0.30); }
.toast-success { color: #047857; background: #ecfdf5; border-color: rgba(4, 120, 87, 0.35); }
.toast-error { color: #b91c1c; background: #fef2f2; border-color: rgba(220, 38, 38, 0.35); }
.status-claimed { color: #b45309; background: rgba(217, 119, 6, 0.13); }
.status-expired { background: rgba(220, 38, 38, 0.09); }
.stock-out { background: rgba(220, 38, 38, 0.09); }
.tag-badge { color: var(--color-brand-text); }
.kpi-gold .kpi-value { color: var(--color-brand-text); }
.admintabs a.active { color: var(--color-brand-text); }

.qr { box-shadow: 0 14px 30px rgba(87, 70, 28, 0.16), 0 0 0 1px rgba(161, 98, 7, 0.12); }
.success-badge { box-shadow: 0 0 0 6px rgba(4, 120, 87, 0.08), 0 8px 20px rgba(87, 70, 28, 0.15); }

@media (hover: hover) {
    .orders-table tbody tr:hover { background: rgba(28, 25, 23, 0.035); }
}

.toast { box-shadow: 0 16px 40px rgba(87, 70, 28, 0.22); }


/* ============================================================
   ADMIN BULK EDIT (appended layer)
   Selection bar above the products table + row checkboxes.
   Delete/import keep the admin's warm light surfaces.
   ============================================================ */
.bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 14px;
    padding: 10px 12px;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
}
.bulk-bar.has-selection { border-color: var(--color-brand-line); background: var(--color-brand-soft); }
.bulk-count { font-weight: 700; font-size: 0.88rem; color: var(--color-text); white-space: nowrap; }
.bulk-bar select,
.bulk-bar input[type="text"],
.bulk-bar input[type="number"] {
    min-height: 38px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-line);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 0.9rem;
}
.bulk-bar input[type="text"], .bulk-bar input[type="number"] { width: 190px; max-width: 60vw; }
.bulk-bar .mini-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.orders-table input.row-check,
.orders-table #selectAll,
#selectAll { width: 19px; height: 19px; accent-color: var(--color-brand); cursor: pointer; }

/* Phase 2 order statuses (appended): delivered reads as a calm
   success-blue, cancelled as a quiet muted red-grey. */
.status-delivered { color: #0369a1; background: rgba(2, 132, 199, 0.12); border-radius: var(--radius-pill); padding: 3px 10px; font-size: var(--font-size-sm); font-weight: 600; white-space: nowrap; }
.status-cancelled { color: #78716c; background: rgba(120, 113, 108, 0.14); border-radius: var(--radius-pill); padding: 3px 10px; font-size: var(--font-size-sm); font-weight: 600; white-space: nowrap; }
