@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Brand palette */
    --primary:        #4f6ef7;
    --primary-strong: #3b54d4;
    --primary-soft:   rgba(79, 110, 247, 0.10);
    --accent:         #f43f5e;
    --ok:             #10b981;
    --warning:        #f59e0b;

    /* Surface */
    --bg:       #f1f5f9;
    --panel:    #ffffff;
    --surface:  #f8fafc;

    /* Ink */
    --ink:      #0f172a;
    --sub:      #334155;
    --muted:    #64748b;

    /* Sidebar (dark) */
    --sb-bg:       #0f172a;
    --sb-surface:  #1e293b;
    --sb-border:   rgba(255,255,255,0.06);
    --sb-text:     #94a3b8;
    --sb-active:   #ffffff;

    /* Lines & shadows */
    --line:        rgba(15, 23, 42, 0.08);
    --shadow-sm:   0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.06);
    --shadow-md:   0 4px 16px rgba(15,23,42,0.10), 0 2px 6px rgba(15,23,42,0.06);
    --shadow-lg:   0 12px 40px rgba(15,23,42,0.14), 0 4px 12px rgba(15,23,42,0.06);

    /* Radii */
    --r-sm:  8px;
    --r-md:  12px;
    --r-lg:  16px;
    --r-xl:  20px;
}

/* ─── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-width: 320px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-size: 15px;
    line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

/* ─── Layout ─────────────────────────────────────── */
.app  { display: flex; min-height: 100vh; }

/* ─── Sidebar ────────────────────────────────────── */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--sb-bg);
    border-right: 1px solid var(--sb-border);
    padding: 18px 14px 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.brand {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    margin-bottom: 24px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.3px;
    box-shadow: 0 4px 16px rgba(79,110,247,0.38);
}

.brand small {
    display: block;
    margin-top: 3px;
    color: rgba(255,255,255,0.65);
    font-weight: 500;
    font-size: 11.5px;
    letter-spacing: 0.02em;
}

.sidebar nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar nav a,
.logout {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border-radius: var(--r-sm);
    color: var(--sb-text);
    font-weight: 600;
    font-size: 14px;
    transition: background 0.18s, color 0.18s;
    position: relative;
}

.sidebar nav a svg,
.logout svg { width: 17px; height: 17px; flex-shrink: 0; }

.sidebar nav a:hover {
    background: var(--sb-surface);
    color: #e2e8f0;
}

.sidebar nav a.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79,110,247,0.35);
}

.sidebar nav a.active svg { color: #fff; }

.logout {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--sb-border);
    color: #f43f5e;
    font-weight: 600;
    font-size: 14px;
}

.logout:hover { background: rgba(244,63,94,0.10); color: #f43f5e; }

/* ─── Content ────────────────────────────────────── */
.content {
    flex: 1;
    min-width: 0;
    padding: 28px 32px;
}

/* ─── Topbar ─────────────────────────────────────── */
.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.topbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.page-kicker {
    display: block;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--ink);
    line-height: 1.15;
}

/* ─── Panel / Card ───────────────────────────────── */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.panel h2 {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--ink);
}

.panel + .panel { margin-top: 16px; }

.surface {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 16px;
}

/* ─── Grid ───────────────────────────────────────── */
.grid   { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

/* ─── Metric cards ───────────────────────────────── */
.metric {
    min-height: 128px;
    position: relative;
    overflow: hidden;
    border-top: 3px solid var(--primary);
}

.dashboard-metrics .metric:nth-child(1) { border-top-color: var(--primary); }
.dashboard-metrics .metric:nth-child(2) { border-top-color: var(--ok); }
.dashboard-metrics .metric:nth-child(3) { border-top-color: var(--warning); }
.dashboard-metrics .metric:nth-child(4) { border-top-color: var(--accent); }

.metric span.muted {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.metric strong {
    display: block;
    font-size: 30px;
    font-weight: 800;
    margin-top: 10px;
    letter-spacing: -0.5px;
    color: var(--ink);
}

.metric small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
}

.muted { color: var(--muted); }

/* ─── Forms ──────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.form-row.compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-wide { grid-column: span 2; }

.toolbar {
    display: flex;
    gap: 8px;
    align-items: end;
    flex-wrap: wrap;
}
.toolbar input, .toolbar select { width: auto; min-width: 180px; }

.checkline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 28px 0 0;
    color: var(--ink);
}
.checkline input { width: auto; }

label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--sub);
    letter-spacing: 0.01em;
}

input, select, textarea {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--r-sm);
    padding: 11px 13px;
    font-size: 14.5px;
    font-family: inherit;
    background: var(--panel);
    color: var(--ink);
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,0.15);
}

input::placeholder, textarea::placeholder { color: #94a3b8; }

/* ─── Buttons ────────────────────────────────────── */
button, .btn {
    border: 0;
    border-radius: var(--r-sm);
    padding: 11px 18px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.18s, transform 0.16s, box-shadow 0.16s;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

button:hover, .btn:hover {
    background: var(--primary-strong);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79,110,247,0.30);
}

button:active, .btn:active { transform: translateY(0); }

.btn-secondary {
    background: var(--panel);
    color: var(--sub);
    border: 1.5px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
    background: var(--surface);
    color: var(--ink);
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.btn-danger { background: var(--accent); }
.btn-danger:hover { background: #e11d48; box-shadow: 0 6px 20px rgba(244,63,94,0.30); }

.btn-xs { padding: 4px 10px; font-size: 12px; gap: 4px; min-height: unset; }

/* ─── Badge / Pill ───────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    margin-left: 6px;
}
.badge.danger { background: rgba(244,63,94,0.10); color: var(--accent); }

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}
.pill.alt { background: #f1f5f9; color: var(--muted); }

/* ─── Table ──────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.table th {
    text-align: left;
    padding: 9px 14px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1.5px solid var(--line);
    background: transparent;
    white-space: nowrap;
}

.table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    color: var(--sub);
}

.table tbody tr:hover td { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: 0; }

/* ─── Login ──────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

.login-box {
    width: min(420px, 100%);
    background: var(--panel);
    border-radius: var(--r-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
}

.login-box h1 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

/* ─── Dashboard Hero ─────────────────────────────── */
.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 170px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #4f6ef7 0%, #6d28d9 100%);
    border: 0;
    color: #fff;
    border-radius: var(--r-xl);
    box-shadow: 0 8px 32px rgba(79,110,247,0.30);
}

.dashboard-hero .page-kicker { color: rgba(255,255,255,0.70); }

.dashboard-hero h2 {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
}

.dashboard-hero p {
    max-width: 600px;
    margin: 10px 0 0;
    color: rgba(255,255,255,0.75);
    font-size: 15px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-hero .btn {
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255,255,255,0.30);
    color: #fff;
}

.dashboard-hero .btn:hover {
    background: rgba(255,255,255,0.28);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.dashboard-hero .btn-secondary {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.20);
    color: rgba(255,255,255,0.90);
    box-shadow: none;
}

/* ─── Dashboard grid ─────────────────────────────── */
.dashboard-metrics { margin-bottom: 16px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) 360px;
    gap: 16px;
    align-items: start;
    margin-top: 16px;
}

.dashboard-main { min-height: 420px; }
.dashboard-side  { display: grid; gap: 16px; }
.dashboard-lists { margin-top: 16px; }

/* ─── Section head ───────────────────────────────── */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.section-head h2 { margin: 0; }

.dashboard-card { min-height: 200px; }

/* ─── Stack rows ─────────────────────────────────── */
.stack-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}
.stack-row:last-child { border-bottom: 0; padding-bottom: 0; }
.stack-row span, .stack-row small { display: block; }
.stack-row span  { font-weight: 700; color: var(--ink); }
.stack-row small { margin-top: 3px; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.stack-row strong { white-space: nowrap; font-weight: 800; }
.warning-row strong { color: var(--accent); }

/* ─── Quick actions ──────────────────────────────── */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
}

.quick-actions a {
    min-height: 88px;
    padding: 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--r-md);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--sub);
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s;
}

.quick-actions a:hover {
    border-color: var(--primary);
    background: var(--panel);
    box-shadow: 0 4px 16px rgba(79,110,247,0.12);
    transform: translateY(-2px);
    color: var(--ink);
}

.quick-actions svg { width: 20px; height: 20px; color: var(--primary); }

/* ─── POS layout ─────────────────────────────────── */
.pos-layout {
    display: grid;
    grid-template-columns: minmax(680px,1fr) minmax(400px,480px);
    gap: 24px;
    align-items: start;
}

.pos-products  { min-height: calc(100vh - 110px); }

.checkout-panel {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.checkout-panel h2 { margin-bottom: 0; }

.pos-workspace {
    display: grid;
    grid-template-columns: 196px minmax(0,1fr);
    gap: 20px;
    align-items: start;
}

.category-rail {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: sticky;
    top: 20px;
}

.category-filter {
    width: 100%;
    justify-content: flex-start;
    background: var(--panel);
    color: var(--sub);
    border: 1.5px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
    min-height: 44px;
    padding-left: 14px;
    font-size: 13.5px;
}

.category-filter:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(79,110,247,0.30);
    box-shadow: none;
    transform: none;
}

.category-filter.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(79,110,247,0.28);
}

.product-area { min-width: 0; }

.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(200px,1fr));
    gap: 14px;
    margin-top: 16px;
}

.product-tile {
    border: 1.5px solid #e2e8f0;
    border-radius: var(--r-lg);
    padding: 14px;
    background: var(--panel);
    cursor: pointer;
    min-height: 240px;
    text-align: left;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    overflow: hidden;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.product-tile:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 28px rgba(79,110,247,0.16);
    transform: translateY(-2px);
}

.product-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--r-sm);
    background: var(--surface);
    margin-bottom: 12px;
}

.product-image.placeholder {
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 32px;
    font-weight: 800;
    background: var(--primary-soft);
}

.product-tile strong { display: block; margin-bottom: 6px; font-size: 14.5px; font-weight: 700; line-height: 1.3; }

.product-price {
    display: block;
    color: var(--primary);
    font-size: 20px;
    font-weight: 800;
    margin-top: 10px;
    letter-spacing: -0.3px;
}

.product-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

/* ─── Cart / Checkout ────────────────────────────── */
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 26px;
    font-weight: 800;
    margin: 14px 0;
    padding: 16px 20px;
    border-radius: var(--r-md);
    background: var(--ink);
    color: #fff;
    letter-spacing: -0.3px;
}

.checkout-section {
    padding: 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--r-md);
    background: var(--surface);
}

.checkout-section h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--sub); }

#cartTable {
    border-spacing: 0;
    margin-top: 4px;
}
#cartTable thead { display: none; }
#cartTable tbody { display: grid; gap: 10px; }

#cartTable tr {
    display: grid;
    grid-template-columns: 1fr 78px 92px 92px 106px auto;
    gap: 10px;
    align-items: end;
    padding: 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--r-md);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}

#cartTable td {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}
#cartTable td:first-child, #cartTable td:last-child { border: 0; border-radius: 0; }
#cartTable tr:hover td { background: transparent; box-shadow: none; }

#cartTable .cart-name { align-self: center; font-weight: 700; line-height: 1.3; font-size: 14px; }

#cartTable .cart-input label,
#cartTable .cart-line-total label {
    display: block;
    margin-bottom: 4px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}

#cartTable .cart-input input { min-width: 0; padding: 8px; }

#cartTable .cart-line-total strong {
    display: block;
    min-height: 38px;
    padding: 9px 8px;
    border-radius: var(--r-sm);
    background: var(--primary-soft);
    color: var(--primary-strong);
    white-space: nowrap;
    font-weight: 800;
}

#cartTable .cart-remove button {
    min-height: 38px;
    padding: 8px 10px;
    background: rgba(244,63,94,0.10);
    color: var(--accent);
    box-shadow: none;
}
#cartTable .cart-remove button:hover { background: var(--accent); color: #fff; transform: none; box-shadow: none; }

.checkout-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 10px;
    margin-top: 8px;
}
.checkout-actions button { width: 100%; min-height: 46px; }

.summary {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
    margin: 12px 0;
}
.summary div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    font-size: 14px;
}

.payment-tabs {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 8px;
}

.payment-tabs button {
    background: var(--panel);
    color: var(--sub);
    border: 1.5px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
    min-height: 48px;
    font-size: 13px;
}

.payment-tabs button:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(79,110,247,0.30);
    box-shadow: none;
    transform: none;
}

.payment-builder {
    margin: 12px 0;
    padding: 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--r-md);
    background: var(--surface);
}

.payment-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }

.payment-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.payment-chip {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    background: var(--panel);
    border: 1.5px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
}

.payment-chip span { font-weight: 700; font-size: 14px; }

.payment-chip button {
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(244,63,94,0.10);
    color: var(--accent);
    box-shadow: none;
    border-radius: var(--r-sm);
}
.payment-chip button:hover { background: var(--accent); color: #fff; transform: none; box-shadow: none; }

/* ─── Products page ──────────────────────────────── */
.thumb {
    width: 58px;
    height: 46px;
    object-fit: cover;
    border-radius: var(--r-sm);
    border: 1.5px solid #e2e8f0;
    background: var(--surface);
    display: inline-grid;
    place-items: center;
    color: var(--muted);
    font-size: 11px;
}

.product-editor {
    display: grid;
    grid-template-columns: minmax(0,1fr) 320px;
    gap: 20px;
    align-items: start;
}

.product-form-main { display: grid; gap: 14px; }

.form-section {
    padding: 20px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--r-md);
    background: var(--panel);
}

.form-section h3,
.product-form-side h3 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.1px;
}

.product-form-side {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--r-md);
    background: var(--panel);
    position: sticky;
    top: 24px;
}

.image-preview-box {
    min-height: 220px;
    border: 2px dashed #cbd5e1;
    border-radius: var(--r-md);
    background: var(--surface);
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--muted);
    font-weight: 600;
    transition: border-color 0.18s, background 0.18s;
}

.image-preview-box:hover { border-color: var(--primary); background: var(--primary-soft); }

.image-preview-box img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; }

.product-save-btn { min-height: 50px; }

.product-cell { display: flex; gap: 12px; align-items: center; min-width: 240px; }
.product-cell strong, .product-cell small { display: block; }
.product-cell small { color: var(--muted); margin-top: 2px; font-size: 12.5px; }

.product-editor-panel > .topbar { padding-bottom: 16px; border-bottom: 1.5px solid #e2e8f0; }

.variant-editor { display: grid; gap: 10px; }

.variant-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 80px 100px 90px 32px;
    gap: 8px;
    align-items: center;
}

.variant-row input, .variant-row select { min-width: 0; }

.variant-head {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.variant-head span { padding: 0 4px; }

.misc-product-box {
    padding: 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--r-md);
    background: var(--panel);
}

.misc-product-box h3 { margin: 0; font-size: 15px; font-weight: 700; }

.misc-product-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) 86px 110px auto;
    gap: 8px;
}

/* ─── Reports / Sales ────────────────────────────── */
.module-form-panel { margin-top: 16px; }
.module-form-panel .form-row { align-items: end; }

.report-filter { background: var(--panel); }

.report-metrics .metric:nth-child(1) { border-top-color: var(--primary); }
.report-metrics .metric:nth-child(2) { border-top-color: var(--ok); }
.report-metrics .metric:nth-child(3) { border-top-color: var(--accent); }
.report-metrics .metric:nth-child(4) { border-top-color: var(--warning); }

.report-card { min-height: 260px; }
.report-card h2 { padding-bottom: 10px; border-bottom: 1.5px solid var(--line); }

.daily-report { margin-top: 16px; }

.daily-report-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.daily-report-head h2 { margin-bottom: 0; }

.daily-tools {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.daily-date-form {
    display: grid;
    grid-template-columns: minmax(160px,210px) auto;
    gap: 8px;
    align-items: end;
}

.daily-date-form label { grid-column: 1 / -1; }

.daily-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 14px;
}

.daily-card {
    min-height: 128px;
    padding: 18px;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: var(--panel);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.daily-card span {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.daily-card strong {
    display: block;
    margin-top: 8px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--ink);
}

.daily-card small { margin-top: 6px; color: var(--muted); font-size: 12.5px; }

.daily-detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.daily-box {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--panel);
    padding: 18px;
    min-height: 240px;
    box-shadow: var(--shadow-sm);
}

.daily-box h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }

.empty-state {
    margin: 0;
    padding: 16px;
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

/* ─── Hour bars ──────────────────────────────────── */
.hour-bars { display: grid; gap: 12px; }

.hour-row {
    display: grid;
    grid-template-columns: 52px minmax(120px,1fr) 116px 64px;
    gap: 12px;
    align-items: center;
    font-size: 13px;
}

.hour-row span, .hour-row small { color: var(--muted); white-space: nowrap; }
.hour-row strong { text-align: right; white-space: nowrap; }

.bar-track {
    height: 8px;
    overflow: hidden;
    border-radius: 20px;
    background: #e2e8f0;
}

.bar-fill {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, var(--primary), #6d28d9);
}

.compact-table { margin-top: 0; }

/* ─── Notice ─────────────────────────────────────── */
.notice {
    padding: 12px 16px;
    border-radius: var(--r-sm);
    background: var(--primary-soft);
    color: var(--primary-strong);
    margin-bottom: 14px;
    border: 1.5px solid rgba(79,110,247,0.20);
    font-size: 14px;
    font-weight: 600;
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 1320px) {
    .pos-layout { grid-template-columns: 1fr; }
    .checkout-panel { position: static; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-side { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 900px) {
    .app { display: block; }
    .sidebar { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; gap: 10px; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .brand { margin-bottom: 0; }
    .content { padding: 16px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .grid-2, .grid-3, .grid-4, .form-row, .form-row.compact, .pos-layout, .product-editor { grid-template-columns: 1fr; }
    .dashboard-hero, .section-head { align-items: stretch; flex-direction: column; }
    .dashboard-hero h2 { font-size: 26px; }
    .hero-actions, .section-head .btn { justify-content: flex-start; }
    .dashboard-side, .quick-actions { grid-template-columns: 1fr; }
    .product-form-side { position: static; }
    .pos-workspace { grid-template-columns: 1fr; }
    .category-rail { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
    .category-filter { width: auto; white-space: nowrap; }
    .checkout-panel { position: static; }
    .field-wide { grid-column: auto; }
    .toolbar, .toolbar input, .toolbar select { width: 100%; }
    .payment-row, .payment-tabs { grid-template-columns: 1fr; }
    .variant-row, .misc-product-grid { grid-template-columns: 1fr; }
    .variant-head { display: none; }
    #cartTable tr { grid-template-columns: 1fr 1fr; }
    #cartTable .cart-name, #cartTable .cart-remove { grid-column: 1 / -1; }
    .checkout-actions { grid-template-columns: 1fr; }
    .daily-report-head { align-items: stretch; flex-direction: column; }
    .daily-tools { align-items: stretch; flex-direction: column; justify-content: flex-start; }
    .daily-date-form, .daily-grid, .daily-detail-grid { grid-template-columns: 1fr; }
    .hour-row { grid-template-columns: 44px 1fr; }
    .hour-row strong, .hour-row small { text-align: left; grid-column: 2; }
}
