/* ── THEME DEFINITIONS ── */
/* ═══════════════════════════════════════════
   THEME PICKER
═══════════════════════════════════════════ */
.theme-picker {
    position: relative;
    flex-shrink: 0;
}

.theme-pick-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition:
        border-color 0.2s,
        background 0.4s;
    white-space: nowrap;
}
.theme-pick-btn:hover {
    border-color: var(--accent);
}
.theme-pick-btn svg {
    color: var(--accent);
}

.theme-palette {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    width: 280px;
    box-shadow:
        var(--shadow),
        0 8px 32px rgba(0, 0, 0, 0.15);
    transition: background 0.4s;
    z-index: 300;
}
.theme-palette.open {
    display: block;
    animation: fadeDown 0.18s ease;
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.palette-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.875rem;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.swatch {
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition:
        border-color 0.2s,
        background 0.2s;
    text-align: left;
}
.swatch:hover {
    border-color: var(--accent);
}
.swatch.active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.swatch-colors {
    display: flex;
    gap: 4px;
}
.swatch-colors i {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}
.swatch-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
}

[data-theme="parchment"] {
    --bg: #f5f2eb;
    --surface: #ffffff;
    --surface2: #ede9df;
    --border: #d5cfb9;
    --text: #1c1a16;
    --muted: #7a7469;
    --accent: #2c5f2e;
    --accent-soft: #dff0df;
    --accent-text: #2c5f2e;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.07);
    --font-display: "Playfair Display", serif;
    --font-body: "DM Sans", sans-serif;
}

[data-theme="midnight"] {
    --bg: #0d1117;
    --surface: #161b22;
    --surface2: #21262d;
    --border: #30363d;
    --text: #c9d1d9;
    --muted: #8b949e;
    --accent: #58a6ff;
    --accent-soft: #0d2040;
    --accent-text: #58a6ff;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
    --font-display: "Space Mono", monospace;
    --font-body: "DM Sans", sans-serif;
}

[data-theme="golden"] {
    --bg: #fffcf0; /* Warm, luminous cream */
    --surface: #ffffff; /* Pure white for clarity */
    --surface2: #fdf2d0; /* Soft champagne glow */
    --border: #e6c17a; /* Polished brass / light gold */
    --text: #4a3a05; /* Deep bronze-black for readability */
    --muted: #96834f; /* Antique gold / olive-brown */
    --accent: #d4af37; /* Classic Metallic Gold */
    --accent-soft: #fef5cc; /* Pale sun-lit yellow */
    --accent-text: #8c6d05; /* Dark ochre for contrast on light buttons */
    --shadow: 0 2px 14px rgba(212, 175, 55, 0.15);
    --font-display: "Crimson Pro", serif;
    --font-body: "DM Sans", sans-serif;
}

[data-theme="emerald"] {
    --bg: #f2faf5; /* Very faint mint wash */
    --surface: #ffffff; /* Clean white */
    --surface2: #e3f5eb; /* Soft sage/foam highlight */
    --border: #b8e2cb; /* Pale seafoam border */
    --text: #1a2e23; /* Deep forest green for high contrast */
    --muted: #6b8c7b; /* Dusty eucalyptus */
    --accent: #10b981; /* Vibrant emerald / spring green */
    --accent-soft: #dcfce7; /* Pale lime-tinted highlight */
    --accent-text: #065f46; /* Deep teal-green for buttons/links */
    --shadow: 0 2px 14px rgba(16, 185, 129, 0.12);
    --font-display: "Crimson Pro", serif;
    --font-body: "DM Sans", sans-serif;
}

[data-theme="azure"] {
    --bg: #f0f7ff; /* Very light ice-blue wash */
    --surface: #ffffff; /* Pure white */
    --surface2: #e0f0ff; /* Soft sky-blue highlight */
    --border: #b8d9f7; /* Gentle periwinkle border */
    --text: #0d1b2a; /* Deep midnight navy for readability */
    --muted: #627d98; /* Steel blue / slate grey */
    --accent: #0070f3; /* Electric "Vibrant Blue" */
    --accent-soft: #e1effe; /* Pale powder-blue background */
    --accent-text: #0056b3; /* Deep royal blue for links and buttons */
    --shadow: 0 2px 14px rgba(0, 112, 243, 0.12);
    --font-display: "Crimson Pro", serif;
    --font-body: "DM Sans", sans-serif;
}

[data-theme="rose"] {
    --bg: #fdf6f0;
    --surface: #ffffff;
    --surface2: #f8ede6;
    --border: #e8c9b8;
    --text: #3d2b1f;
    --muted: #9c7b6a;
    --accent: #c2715a;
    --accent-soft: #fdeae3;
    --accent-text: #a8503a;
    --shadow: 0 2px 14px rgba(194, 113, 90, 0.1);
    --font-display: "Crimson Pro", serif;
    --font-body: "DM Sans", sans-serif;
}

[data-theme="forest"] {
    --bg: #0e1a13;
    --surface: #152019;
    --surface2: #1c2b20;
    --border: #2d4a35;
    --text: #d8f3dc;
    --muted: #74a87e;
    --accent: #52b788;
    --accent-soft: #1a3d27;
    --accent-text: #52b788;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
    --font-display: "Playfair Display", serif;
    --font-body: "DM Sans", sans-serif;
}

[data-theme="slate"] {
    --bg: #1e2530;
    --surface: #252d3a;
    --surface2: #2d3748;
    --border: #3d4f63;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --accent: #94a3b8;
    --accent-soft: #2d3748;
    --accent-text: #cbd5e1;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    --font-display: "DM Sans", sans-serif;
    --font-body: "DM Sans", sans-serif;
}

[data-theme="amber"] {
    --bg: #1a1200;
    --surface: #221800;
    --surface2: #2e2100;
    --border: #4a3800;
    --text: #fef3c7;
    --muted: #b89a4a;
    --accent: #f59e0b;
    --accent-soft: #3a2a00;
    --accent-text: #f59e0b;
    --shadow: 0 2px 20px rgba(245, 158, 11, 0.15);
    --font-display: "Crimson Pro", serif;
    --font-body: "DM Sans", sans-serif;
}

[data-theme="lavender"] {
    --bg: #f5f3ff;
    --surface: #ffffff;
    --surface2: #ede9fe;
    --border: #c4b5fd;
    --text: #1e1b4b;
    --muted: #7c6ea4;
    --accent: #7c3aed;
    --accent-soft: #ede9fe;
    --accent-text: #6d28d9;
    --shadow: 0 2px 14px rgba(124, 58, 237, 0.1);
    --font-display: "Playfair Display", serif;
    --font-body: "DM Sans", sans-serif;
}

[data-theme="ocean"] {
    --bg: #0a1628;
    --surface: #0f2040;
    --surface2: #162952;
    --border: #1e3d6b;
    --text: #e0f2fe;
    --muted: #7ab8d4;
    --accent: #0ea5e9;
    --accent-soft: #0c2e4a;
    --accent-text: #38bdf8;
    --shadow: 0 2px 20px rgba(14, 165, 233, 0.15);
    --font-display: "Playfair Display", serif;
    --font-body: "DM Sans", sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── TOP BAR ── */
#topbar {
    background: linear-gradient(135deg, var(--navy), var(--muted));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    position: sticky;
    top: 0;
    z-index: 1000;
}

#menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

#topbar h1 {
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#topbar h1 span {
    background: linear-gradient(135deg, var(--surface), var(--surface2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 26px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shop-badge {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 600;
}

#logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}

#logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ── LAYOUT ── */
#app {
    display: flex;
    min-height: calc(100vh - 56px);
}

#sidebar {
    width: 240px;
    background: var(--card);
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    padding: 16px 0;
    transition: transform 0.3s ease;
}

#main {
    flex: 1;
    overflow: auto;
    padding: 24px;
}

/* ── NAV ── */
.nav-section {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    border-left: 3px solid transparent;
    transition: 0.15s;
}

.nav-item:hover {
    background: #fdf2d0;
    color: var(--navy2);
}

.nav-item.active {
    background: #fdf2d0;
    color: var(--navy2);
    border-left-color: var(--surface);
    font-weight: 600;
}

.nav-item .icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.cart-badge {
    background: var(--surface);
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    padding: 1px 7px;
    margin-left: auto;
    font-weight: 700;
}

/* ── PAGES ── */
.page {
    display: none;
}

.page.active {
    display: block;
}

.page-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
}

.page-sub {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 20px;
}

/* ── CARDS ── */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    border: 1px solid var(--border);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--navy), var(--navy2));
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--green), #1ab33a);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-warn {
    background: var(--warn);
    color: #fff;
}

.btn-outline {
    background: #fff;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--surface);
    color: var(--navy2);
}

.btn-surface {
    background: linear-gradient(135deg, var(--surface), var(--surface2));
    color: #fff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-icon {
    padding: 6px 8px;
    border-radius: 6px;
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
}

.btn-icon:hover {
    background: var(--bg);
}

/* ── FORMS ── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: 0.15s;
    background: #fff;
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--surface);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 70px;
}

/* ── TABLE ── */
.tbl-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #fdf2d0;
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 10px 14px;
    font-size: 14px;
    border-bottom: 1px solid #f0f4fa;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
}

/* ── SEARCH ── */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    width: 260px;
}

.search-bar input {
    border: none;
    outline: none;
    font-size: 14px;
    width: 100%;
}

/* ── ITEMS GRID ── */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.item-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
}

.item-card:hover {
    border-color: var(--surface);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.12);
    transform: translateY(-2px);
}

.item-card .category-tag {
    font-size: 10px;
    font-weight: 700;
    background: #fdf2d0;
    color: var(--navy2);
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.item-card .item-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
}

.item-card .item-hsn {
    font-size: 11px;
    color: var(--muted);
}

.item-card .item-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy2);
    margin: 6px 0 2px;
}

.item-card .item-gst {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
}

.item-card .item-stock {
    font-size: 11px;
    color: var(--success);
    font-weight: 600;
    margin-top: 4px;
}

.item-card .add-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--navy), var(--navy2));
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.item-card .add-btn:hover {
    transform: scale(1.05);
}

.item-card.in-cart {
    border-color: var(--success);
    background: #f0fff4;
}

.item-card.in-cart .add-btn {
    background: linear-gradient(135deg, var(--green), #1ab33a);
}

/* ── CART ── */
.cart-summary {
    background: linear-gradient(135deg, #fffcf0, #fdf2d0);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
}

.cart-total-row.grand {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    border-top: 2px solid var(--border);
    margin-top: 6px;
    padding-top: 10px;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-control button {
    width: 26px;
    height: 26px;
    border: 1.5px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
}

.qty-control button:hover {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

.qty-control input {
    width: 50px;
    text-align: center;
    padding: 4px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

/* ── BILL PRINT ── */
.bill-container {
    max-width: 800px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: var(--radius);
    padding: 28px;
    margin: 0 auto;
    font-size: 13px;
}

.bill-header {
    text-align: center;
    border-bottom: 2.5px solid var(--surface);
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.bill-header h2 {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--navy);
    font-weight: 700;
}

.bill-header p {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.bill-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 12px;
}

.bill-meta div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bill-meta strong {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
}

.bill-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 14px;
}

.bill-table th {
    background: #fdf2d0;
    padding: 7px 10px;
    border: 1px solid #dde;
    text-align: left;
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
}

.bill-table td {
    padding: 7px 10px;
    border: 1px solid #eef;
    vertical-align: middle;
}

.bill-table tr:nth-child(even) td {
    background: #fffcf0;
}

.bill-totals {
    margin-left: auto;
    width: 280px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.bill-totals .row {
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 13px;
    border-bottom: 1px solid #f0f4fa;
}

.bill-totals .row:last-child {
    border-bottom: none;
}

.bill-totals .grand-row {
    background: var(--navy);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.bill-footer {
    text-align: center;
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px dashed #ccc;
    font-size: 11px;
    color: var(--muted);
}

.gst-breakdown {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
}

.gst-breakdown th {
    background: #fdf2d0;
    color: var(--navy2);
    border-color: var(--border);
}

.gst-breakdown td {
    border-color: #f0f4fa;
}

/* ── TAGS ── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warn {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* ── FILTER TABS ── */
.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-tab {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: var(--muted);
    transition: 0.2s;
}

.filter-tab:hover,
.filter-tab.active {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

/* ── PAGINATION ── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    align-items: center;
}

.pagination-btn {
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: 0.2s;
}

.pagination-btn:hover {
    background: #fffcf0;
    border-color: var(--surface);
}

.pagination-btn.active {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── RESPONSIVE ── */
@media (max-width: 992px) {
    #sidebar {
        position: fixed;
        left: 0;
        top: 56px;
        bottom: 0;
        z-index: 999;
        transform: translateX(-100%);
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #menu-toggle {
        display: block;
    }

    #main {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar-right .shop-badge {
        display: none;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .bill-meta {
        grid-template-columns: 1fr;
    }

    .bill-totals {
        width: 100%;
    }

    .bill-container {
        padding: 15px;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .search-bar {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }
}

/* Sidebar Overlay */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

#sidebar-overlay.active {
    display: block;
}

/* ── LOGIN ── */
#login-page {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 36px 40px;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo h2 {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--navy);
    font-weight: 700;
}

.login-logo .flag-colors {
    display: flex;
    height: 5px;
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.login-logo .flag-colors div:nth-child(1) {
    flex: 1;
    background: var(--surface);
}

.login-logo .flag-colors div:nth-child(2) {
    flex: 1;
    background: #fff;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.login-logo .flag-colors div:nth-child(3) {
    flex: 1;
    background: var(--green);
}

.login-tabs {
    display: flex;
    background: #fdf2d0;
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 20px;
}

.login-tab {
    flex: 1;
    padding: 8px;
    text-align: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    transition: 0.2s;
}

.login-tab.active {
    background: #fff;
    color: var(--navy);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-form input {
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: 0.15s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--surface);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.login-form .btn {
    padding: 12px;
    justify-content: center;
    font-size: 16px;
}

.demo-hint {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
    background: #f8f9ff;
    padding: 8px;
    border-radius: 8px;
}

.demo-hint strong {
    color: var(--navy);
}

/* ── TOAST ── */
#toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1a2340;
    color: #fff;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 320px;
}

#toast.show {
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUp 0.3s ease;
}

#toast.success {
    border-left: 4px solid var(--success);
}

#toast.error {
    border-left: 4px solid var(--danger);
}

#toast.warn {
    border-left: 4px solid var(--warn);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── MODAL ── */
.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    backdrop-filter: blur(2px);
}

.modal {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    width: 560px;
    max-width: 95vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ── STATS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 18px;
    border: 1.5px solid var(--border);
    border-left-width: 4px;
    box-shadow: var(--shadow);
}

.stat-card .label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-card .value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
}

.stat-card .sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.stat-card.surface {
    border-left-color: var(--surface);
}

.stat-card.surface .value {
    color: var(--navy2);
}

.stat-card.green {
    border-left-color: var(--green);
}

.stat-card.green .value {
    color: var(--green);
}

.stat-card.navy {
    border-left-color: var(--navy);
}

.stat-card.navy .value {
    color: var(--navy);
}

.stat-card.warn {
    border-left-color: var(--warn);
}

.stat-card.warn .value {
    color: var(--warn);
}

/* The semi-transparent background */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* The popup box */
.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Close button (X) */
.close-btn {
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
    font-size: 24px;
}

/* Basic input styling */
input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.submit-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* ── PRINT ── */
@media print {
    #topbar,
    #sidebar,
    #main > *:not(#page-bill) {
        display: none !important;
    }

    #page-bill .card {
        display: none;
    }

    #page-bill .bill-container {
        border: none;
        padding: 0;
        max-width: 100%;
    }

    body {
        background: #fff;
    }

    .no-print {
        display: none !important;
    }
}

@media (max-width: 768px) {
    #sidebar {
        display: block;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

[data-theme="golden"] {
    --bg: #fffcf0;
    --surface: #ffffff;
    --surface2: #fdf2d0;
    --border: #e6c17a;
    --text: #4a3a05;
    --muted: #96834f;
    --accent: #d4af37;
    --accent-soft: #fef5cc;
    --accent-text: #8c6d05;
    --shadow: 0 2px 14px rgba(212, 175, 55, 0.15);
    --font-display: "Crimson Pro", serif;
    --font-body: "DM Sans", sans-serif;
    --radius: 10px;

    /* Semantic mapping for original status colors to fit the theme */
    --success: #2d9d4e;
    --danger: #e53e3e;
    --warn: #d97706;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── TOP BAR ── */
#topbar {
    background: linear-gradient(135deg, var(--text), var(--muted));
    color: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    box-shadow: 0 3px 12px rgba(74, 58, 5, 0.25);
    position: sticky;
    top: 0;
    z-index: 1000;
}

#topbar h1 {
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 1px;
}

#topbar h1 span {
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.shop-badge {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 600;
}

/* ── SIDEBAR & NAV ── */
#sidebar {
    width: 240px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    padding: 16px 0;
}

.nav-section {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
}

.nav-item {
    color: var(--text);
    border-left: 3px solid transparent;
    transition: 0.15s;
}

.nav-item:hover {
    background: var(--accent-soft);
    color: var(--accent-text);
}

.nav-item.active {
    background: var(--surface2);
    color: var(--accent-text);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* ── CARDS & PAGES ── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    border: 1px solid var(--border);
}

.page-title {
    font-family: var(--font-display);
    font-size: 26px;
    color: var(--text);
}

/* ── BUTTONS ── */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--muted));
    color: var(--surface);
}

.btn-surface {
    background: linear-gradient(135deg, var(--accent-text), var(--accent));
    color: var(--surface);
}

.btn-outline {
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent-text);
    background: var(--accent-soft);
}

/* ── FORMS & TABLES ── */
.form-group input,
.form-group select,
.form-group textarea {
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

th {
    background: var(--surface2);
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

td {
    border-bottom: 1px solid var(--surface2);
}

/* ── ITEMS GRID ── */
.item-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
}

.item-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.item-card .item-price {
    color: var(--accent-text);
}

.item-card .category-tag {
    background: var(--accent-soft);
    color: var(--accent-text);
}

/* ── BILL PRINT ── */
.bill-container {
    background: var(--surface);
    border: 1px solid var(--border);
}

.bill-header {
    border-bottom: 2.5px solid var(--accent);
}

.bill-header h2 {
    font-family: var(--font-display);
    color: var(--text);
}

.bill-totals .grand-row {
    background: var(--text);
    color: var(--surface);
}

/* ── LOGIN ── */

.login-box {
    background: var(--surface);
    box-shadow: 0 20px 60px rgba(74, 58, 5, 0.3);
}

.login-tab.active {
    color: var(--accent-text);
    border-bottom: 2px solid var(--accent);
}

/* ── STATS ── */
.stat-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-left-width: 4px;
}

.stat-card.surface {
    border-left-color: var(--accent);
}
.stat-card.surface .value {
    color: var(--accent-text);
}

.stat-card.navy {
    border-left-color: var(--muted);
}
.stat-card.navy .value {
    color: var(--text);
}
