/* FILE: public_html/assets/css/style.css
   Warehouse Order Management — design system
   Palette: brass/antique-gold on warm parchment, with a dark charcoal
   rail for navigation. Slab serif for headings (stamped-crate feel),
   Inter for UI text, IBM Plex Mono for order codes and quantities.
*/

@import url('https://fonts.googleapis.com/css2?family=Bitter:wght@500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
    /* Brand palette */
    --charcoal-950: #171310;
    --charcoal-800: #2A241A;
    --charcoal-700: #3A3122;
    --gold-700: #96691E;
    --gold-600: #B8892B;
    --gold-500: #CC9B3C;
    --gold-400: #D9AA4F;
    --gold-100: #F4E4BC;
    --cream-50: #FBF7EE;
    --cream-100: #F3ECD9;
    --cream-200: #EADFC2;
    --line: #E3D8BC;
    --line-strong: #CBBB8E;
    --ink-900: #241F17;
    --ink-700: #423A28;
    --ink-600: #5B5142;
    --ink-400: #8A7F68;
    --success-bg: #E4EFDF;
    --success-fg: #34602F;
    --danger-bg: #F6E1DA;
    --danger-fg: #8A3420;
    --pending-bg: #FBE7CE;
    --pending-fg: #92551A;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --shadow-card: 0 1px 0 rgba(36, 31, 23, 0.04), 0 6px 16px -8px rgba(36, 31, 23, 0.18);
    --font-display: 'Bitter', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--cream-50);
    color: var(--ink-900);
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink-900);
    margin: 0 0 0.4em;
    line-height: 1.25;
}

a { color: var(--gold-700); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 2px solid var(--gold-600);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

p { margin: 0 0 1em; }
.muted { color: var(--ink-600); }
.mono { font-family: var(--font-mono); }

/* ---------------------------------------------------------------------
   App shell: dark sidebar + content area (admin/staff)
--------------------------------------------------------------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--charcoal-950), #1E1912 85%);
    color: var(--cream-100);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(217, 170, 79, 0.18);
}

.sidebar-brand .brand-mark {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    color: var(--gold-400);
    letter-spacing: 0.2px;
}

.sidebar-brand .brand-sub {
    display: block;
    font-size: 11.5px;
    color: var(--ink-400);
    margin-top: 3px;
}

.sidebar-nav {
    flex: 1;
    padding: 14px 12px;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: var(--radius-md);
    color: #D9CFB8;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease;
}

.sidebar-nav a:hover { background: rgba(217, 170, 79, 0.10); color: #FFF6E2; }

.sidebar-nav a.active {
    background: rgba(217, 170, 79, 0.16);
    color: var(--gold-400);
    box-shadow: inset 3px 0 0 var(--gold-500);
}

.sidebar-nav .nav-icon { width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-nav .badge-count {
    margin-left: auto;
    background: var(--gold-600);
    color: var(--charcoal-950);
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
}

.sidebar-footer {
    padding: 14px 16px 18px;
    border-top: 1px solid rgba(217, 170, 79, 0.18);
    font-size: 12.5px;
    color: var(--ink-400);
}

.sidebar-footer a { color: #D9CFB8; }

.content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid var(--line);
    background: var(--cream-50);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar h1 { font-size: 21px; margin: 0; }
.topbar .page-eyebrow { display: block; font-size: 12.5px; color: var(--ink-600); margin-bottom: 2px; }

.user-menu { display: flex; align-items: center; gap: 12px; }

.role-chip {
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--gold-100);
    color: var(--gold-700);
    border: 1px solid var(--line-strong);
}

.role-chip.staff { background: #E7E2F1; color: #4B3E85; border-color: #D3C9E8; }
.role-chip.retailer { background: var(--success-bg); color: var(--success-fg); border-color: #CFE2C7; }

.main {
    padding: 26px 28px 60px;
    flex: 1;
}

/* ---------------------------------------------------------------------
   Simple top nav shell (retailer portal — lighter, less "back office")
--------------------------------------------------------------------- */
.retailer-shell { min-height: 100vh; display: flex; flex-direction: column; }

.retailer-topnav {
    background: var(--charcoal-950);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
}

.retailer-topnav .brand-mark { color: var(--gold-400); font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.retailer-topnav .brand-mark .brand-sub { color: var(--ink-400); font-family: var(--font-body); font-weight: 400; font-size: 12px; margin-left: 8px; }

.retailer-nav-links { display: flex; gap: 4px; }

.retailer-nav-links a {
    color: #D9CFB8;
    font-size: 14px;
    font-weight: 500;
    padding: 9px 14px;
    border-radius: var(--radius-md);
}

.retailer-nav-links a:hover { background: rgba(217, 170, 79, 0.10); color: #FFF6E2; text-decoration: none; }
.retailer-nav-links a.active { background: rgba(217, 170, 79, 0.16); color: var(--gold-400); }

.retailer-main { max-width: 980px; margin: 0 auto; padding: 30px 24px 60px; width: 100%; }

/* ---------------------------------------------------------------------
   Cards / panels
--------------------------------------------------------------------- */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.card-pad { padding: 22px 24px; }

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 { font-size: 16.5px; margin: 0; }

/* Stat tiles ("brass plate") */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-tile {
    background: linear-gradient(180deg, #fff, var(--cream-100));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}

.stat-tile::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-300, var(--gold-400)));
}

.stat-tile .stat-value {
    font-family: var(--font-mono);
    font-size: 30px;
    font-weight: 600;
    color: var(--ink-900);
    display: block;
}

.stat-tile .stat-label {
    font-size: 13px;
    color: var(--ink-600);
    margin-top: 4px;
}

/* ---------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 120ms ease, border-color 120ms ease, transform 60ms ease;
    line-height: 1.2;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--gold-600); color: #1E1508; border-color: var(--gold-700); }
.btn-primary:hover { background: var(--gold-500); text-decoration: none; }

.btn-secondary { background: #fff; color: var(--ink-900); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--cream-100); text-decoration: none; }

.btn-danger { background: #fff; color: var(--danger-fg); border-color: #E2B7A6; }
.btn-danger:hover { background: var(--danger-bg); text-decoration: none; }

.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------------------------------------------------------------------
   Forms
--------------------------------------------------------------------- */
.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 6px;
}

.field .hint { font-size: 12.5px; color: var(--ink-600); margin-top: 5px; }

.input, select.input, textarea.input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14.5px;
    font-family: var(--font-body);
    color: var(--ink-900);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input:focus, select.input:focus, textarea.input:focus {
    outline: none;
    border-color: var(--gold-600);
    box-shadow: 0 0 0 3px rgba(184, 137, 43, 0.18);
}

.input.has-error { border-color: var(--danger-fg); }
.error-text { font-size: 12.5px; color: var(--danger-fg); margin-top: 5px; }

.checkbox-row { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.checkbox-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--gold-600); }
.checkbox-row label { margin: 0; font-weight: 500; font-size: 14px; color: var(--ink-900); }

.form-actions { display: flex; gap: 10px; margin-top: 22px; }

/* Line-item repeater (order form) */
.item-row {
    display: grid;
    grid-template-columns: 1fr 110px 40px;
    gap: 10px;
    margin-bottom: 10px;
    align-items: start;
}

.item-row-remove {
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--ink-600);
    height: 40px;
    cursor: pointer;
    font-size: 16px;
}

.item-row-remove:hover { background: var(--danger-bg); color: var(--danger-fg); border-color: #E2B7A6; }

/* ---------------------------------------------------------------------
   Tables
--------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; }

table.table th {
    text-align: left;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-600);
    padding: 10px 16px;
    border-bottom: 2px solid var(--line-strong);
    background: var(--cream-100);
    white-space: nowrap;
}

table.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

table.table tbody tr:hover { background: var(--cream-100); }
table.table td.num, table.table th.num { text-align: right; }

.order-code { font-family: var(--font-mono); font-weight: 600; color: var(--gold-700); letter-spacing: 0.2px; }

/* ---------------------------------------------------------------------
   Badges / alerts
--------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--cream-200);
    color: var(--ink-700);
}

.badge-confirmed { background: var(--success-bg); color: var(--success-fg); }
.badge-pending { background: var(--pending-bg); color: var(--pending-fg); }
.badge-cancelled { background: var(--danger-bg); color: var(--danger-fg); }

/* ---------------------------------------------------------------------
   Pick list (warehouse picking)
--------------------------------------------------------------------- */
.pick-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.pick-row:last-child { border-bottom: none; }

.pick-row-product { font-weight: 600; color: var(--ink-900); font-size: 14.5px; }
.pick-row-qty { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-600); margin-top: 2px; }

/* Qty-found stepper: a number input with +/- buttons plus a live
   "Full" / "Short N" tag, used on the staff pick-list screen so a
   picker can record exactly how many of an item they found instead of
   a plain picked/out-of-stock toggle. Degrades gracefully without JS —
   the <input type="number"> still has working min/max/value. */
.pick-qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pick-qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    background: #fff;
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
    color: var(--ink-700);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 120ms ease, border-color 120ms ease;
}
.pick-qty-btn:hover { background: var(--cream-200); border-color: var(--gold-500); }
.pick-qty-btn:active { background: var(--cream-300); }

.pick-qty-input {
    width: 58px;
    text-align: center;
    padding: 7px 4px;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    font-family: var(--font-mono);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink-900);
    -moz-appearance: textfield;
}
.pick-qty-input::-webkit-outer-spin-button,
.pick-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pick-qty-input:focus-visible { outline: 2px solid var(--gold-600); outline-offset: 2px; }

.pick-qty-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
}
.pick-qty-tag-full { background: var(--success-bg); color: var(--success-fg); border-color: #BFDAB5; }
.pick-qty-tag-short { background: var(--danger-bg); color: var(--danger-fg); border-color: #E2B7A6; }

.btn-secondary.active { background: var(--gold-100); border-color: var(--gold-500); color: var(--gold-700); }

.method-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--gold-100);
    color: var(--gold-700);
}

.alert {
    padding: 13px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success { background: var(--success-bg); color: var(--success-fg); border-color: #CFE2C7; }
.alert-error { background: var(--danger-bg); color: var(--danger-fg); border-color: #E2B7A6; }
.alert-info { background: var(--gold-100); color: var(--gold-700); border-color: var(--line-strong); }

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--ink-600);
}

.empty-state .empty-icon { font-size: 30px; margin-bottom: 10px; opacity: 0.7; }

/* ---------------------------------------------------------------------
   Auth / login pages
--------------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--cream-50);
    background-image:
        repeating-linear-gradient(45deg, rgba(184,137,43,0.035) 0, rgba(184,137,43,0.035) 2px, transparent 2px, transparent 14px);
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 34px 32px 30px;
}

.auth-brand { text-align: center; margin-bottom: 6px; }
.auth-brand .brand-mark { font-family: var(--font-display); font-size: 23px; font-weight: 700; color: var(--ink-900); }
.auth-brand .brand-mark span { color: var(--gold-600); }

.auth-portal-label {
    text-align: center;
    font-size: 13px;
    color: var(--ink-600);
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.auth-switch { text-align: center; margin-top: 20px; font-size: 13px; color: var(--ink-600); }

/* ---------------------------------------------------------------------
   Voice recorder
--------------------------------------------------------------------- */
.recorder {
    text-align: center;
    padding: 30px 20px;
    background: var(--cream-100);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.record-btn {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--gold-600);
    color: var(--gold-700);
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: background 120ms ease, border-color 120ms ease;
    animation: breathe-idle 2.6s ease-in-out infinite;
}

.record-btn-icon { font-size: 19px; line-height: 1; }
.record-btn-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
}

.record-btn:hover { background: var(--gold-100); }

.record-btn.is-recording {
    background: var(--danger-fg);
    border-color: var(--danger-fg);
    color: #fff;
    animation: breathe-recording 1.3s ease-in-out infinite;
}

/* "Breathing": a slow, soft scale + glow while idle, inviting a tap. */
@keyframes breathe-idle {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(184, 137, 43, 0.32); }
    50%      { transform: scale(1.06); box-shadow: 0 0 0 12px rgba(184, 137, 43, 0); }
}

/* Faster, more urgent breathing once recording is live. */
@keyframes breathe-recording {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(138, 52, 32, 0.45); }
    50%      { transform: scale(1.09); box-shadow: 0 0 0 14px rgba(138, 52, 32, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .record-btn,
    .record-btn.is-recording {
        animation: none;
    }
}

.record-status { margin-top: 14px; font-size: 13.5px; color: var(--ink-600); font-weight: 500; }
.record-timer { font-family: var(--font-mono); font-size: 22px; margin-top: 6px; color: var(--ink-900); }

.waveform { display: flex; align-items: center; justify-content: center; gap: 3px; height: 28px; margin-top: 14px; }
.waveform span {
    width: 3px;
    height: 6px;
    background: var(--gold-500);
    border-radius: 2px;
    animation: wave 1.1s ease-in-out infinite;
}
.waveform span:nth-child(2) { animation-delay: 0.1s; }
.waveform span:nth-child(3) { animation-delay: 0.2s; }
.waveform span:nth-child(4) { animation-delay: 0.3s; }
.waveform span:nth-child(5) { animation-delay: 0.4s; }
.waveform span:nth-child(6) { animation-delay: 0.3s; }
.waveform span:nth-child(7) { animation-delay: 0.2s; }
.waveform span:nth-child(8) { animation-delay: 0.1s; }
.is-idle .waveform span { animation-play-state: paused; height: 4px; }

@keyframes wave { 0%, 100% { height: 6px; } 50% { height: 24px; } }

audio.review-audio { width: 100%; margin-top: 16px; }

.method-tabs { display: flex; gap: 8px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.method-tabs a {
    padding: 10px 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-600);
    border-bottom: 2px solid transparent;
    margin-right: 18px;
}
.method-tabs a.active { color: var(--gold-700); border-bottom-color: var(--gold-600); text-decoration: none; }

/* ---------------------------------------------------------------------
   Utility
--------------------------------------------------------------------- */
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filters .input { width: auto; min-width: 160px; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* Count-up number animation on dashboard load (single orchestrated moment) */
@keyframes count-fade-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.stat-value { animation: count-fade-in 400ms ease-out; }

/* ---------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------- */
@media (max-width: 880px) {
    .sidebar { position: fixed; left: -232px; z-index: 20; transition: left 160ms ease; box-shadow: 8px 0 24px rgba(0,0,0,0.25); }
    .sidebar.is-open { left: 0; }
    .app-shell { display: block; }
    .content { width: 100%; }
    .topbar { padding: 14px 16px; }
    .main { padding: 18px 16px 48px; }
    .sidebar-toggle { display: inline-flex !important; }
    .retailer-topnav { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
    .retailer-nav-links { flex-wrap: wrap; }
    .item-row { grid-template-columns: 1fr 84px 36px; }
}

.sidebar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    cursor: pointer;
    font-size: 15px;
    margin-right: 10px;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(23, 19, 16, 0.4);
    z-index: 15;
}

.sidebar-backdrop.is-open { display: block; }