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

/* ═══════════════════════════════════════════
   DESIGN TOKENS — Light Theme
═══════════════════════════════════════════ */
:root {
    --primary:       #1e40af;
    --primary-light: #3b82f6;
    --primary-soft:  #dbeafe;
    --primary-glow:  rgba(59, 130, 246, 0.15);
    --secondary:     #64748b;
    --success:       #10b981;
    --success-soft:  #d1fae5;
    --danger:        #ef4444;
    --danger-soft:   #fee2e2;
    --warning:       #f59e0b;
    --warning-soft:  #fef3c7;
    --info:          #0ea5e9;

    --bg-main:       #f1f5f9;
    --bg-card:       #ffffff;
    --bg-sidebar:    #ffffff;
    --bg-input:      #f8fafc;

    --text-main:     #0f172a;
    --text-muted:    #64748b;
    --text-light:    #94a3b8;

    --border:        #e2e8f0;
    --border-focus:  #3b82f6;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;
    --radius-xl:  20px;
    --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
    --shadow-md:  0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
    --shadow-lg:  0 10px 30px rgba(0,0,0,.10);
    --shadow-xl:  0 20px 50px rgba(0,0,0,.15);

    --sidebar-width:  260px;
    --header-height:  72px;
    --transition:     0.2s ease;
}

/* ── Dark Mode ─────────────────────────── */
[data-theme="dark"] {
    --bg-main:      #0a0f1e;
    --bg-card:      #111827;
    --bg-sidebar:   #0d1525;
    --bg-input:     #1a2235;
    --text-main:    #f1f5f9;
    --text-muted:   #94a3b8;
    --text-light:   #475569;
    --border:       #1e2d45;
    --border-focus: #3b82f6;
    --primary-soft: rgba(59,130,246,0.12);
    --success-soft: rgba(16,185,129,0.12);
    --danger-soft:  rgba(239,68,68,0.12);
    --warning-soft: rgba(245,158,11,0.12);
    --shadow-sm:    0 1px 3px rgba(0,0,0,.3);
    --shadow-md:    0 4px 12px rgba(0,0,0,.3);
    --shadow-lg:    0 10px 30px rgba(0,0,0,.4);
}

/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ═══════════════════════════════════════════
   LAYOUT SHELL
═══════════════════════════════════════════ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 200;
    transition: background var(--transition), border-color var(--transition);
    overflow-y: auto;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(30,64,175,0.35);
    flex-shrink: 0;
}

.brand-name h3 { font-size: 1rem; font-weight: 700; color: var(--primary); }
.brand-name p  { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }

/* Nav */
.nav-menu { padding: 16px 12px; flex-grow: 1; }
.nav-section-label {
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em;
    color: var(--text-light); text-transform: uppercase;
    padding: 8px 8px 6px; margin-bottom: 4px;
}
.nav-item { margin-bottom: 2px; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    text-decoration: none; color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    font-weight: 500; font-size: 0.88rem;
    position: relative;
}
.nav-link i { width: 18px; text-align: center; font-size: 0.85rem; }
.nav-link:hover { background: var(--primary-soft); color: var(--primary); }
.nav-link.active {
    background: linear-gradient(135deg, var(--primary-soft), rgba(59,130,246,0.08));
    color: var(--primary); font-weight: 600;
}
.nav-link.active::before {
    content: ''; position: absolute; left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%; background: var(--primary);
    border-radius: 0 3px 3px 0;
}

/* Sidebar footer */
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }

.theme-toggle {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-main); border-radius: var(--radius-md);
    cursor: pointer; margin-bottom: 8px;
    font-size: 0.85rem; color: var(--text-muted); font-weight: 500;
    transition: background var(--transition);
}
.theme-toggle:hover { background: var(--primary-soft); color: var(--primary); }
.theme-toggle-left { display: flex; align-items: center; gap: 10px; }

.logout-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-md);
    color: var(--danger); text-decoration: none;
    font-weight: 500; font-size: 0.85rem;
    transition: background var(--transition);
}
.logout-btn:hover { background: var(--danger-soft); }

/* ═══════════════════════════════════════════
   MAIN WRAPPER
═══════════════════════════════════════════ */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Header ─────────────────────────────── */
.header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px;
    position: sticky; top: 0; z-index: 100;
    transition: background var(--transition);
    box-shadow: var(--shadow-sm);
}

.header-left h2 { font-size: 1.15rem; font-weight: 700; }
.header-left p  { font-size: 0.78rem; color: var(--text-muted); margin-top: 1px;}

.header-right { display: flex; align-items: center; gap: 16px; }

.search-bar {
    position: relative;
    width: 280px;
}
.search-bar input {
    width: 100%;
    padding: 9px 16px 9px 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.search-bar i {
    position: absolute; left: 13px; top: 50%;
    transform: translateY(-50%); color: var(--text-light); font-size: 0.8rem;
}

.header-tools { display: flex; align-items: center; gap: 10px; }

.tool-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); cursor: pointer; font-size: 0.8rem;
    transition: all var(--transition); position: relative;
}
.tool-btn:hover { border-color: var(--primary); color: var(--primary); }

.badge-dot {
    position: absolute; top: 6px; right: 6px;
    width: 8px; height: 8px; background: var(--danger);
    border-radius: 50%; border: 2px solid var(--bg-card);
}

.clock-chip {
    background: var(--bg-input); border: 1.5px solid var(--border);
    padding: 6px 14px; border-radius: var(--radius-xl);
    font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.user-profile {
    display: flex; align-items: center; gap: 10px;
    padding-left: 14px; border-left: 1.5px solid var(--border);
}
.user-info h4 { font-size: 0.85rem; font-weight: 600; }
.user-info p  { font-size: 0.72rem; color: var(--text-muted); }
.user-img {
    width: 38px; height: 38px; border-radius: var(--radius-md);
    object-fit: cover; border: 2px solid var(--primary-soft);
}

/* ═══════════════════════════════════════════
   CONTENT AREA
═══════════════════════════════════════════ */
.content {
    flex-grow: 1; padding: 28px;
    display: flex; gap: 28px;
}
.view-main { flex-grow: 1; min-width: 0; }
.view-side  { width: 420px; flex-shrink: 0; }
body.auth-screen {
    background: var(--bg-main);
}
body.auth-screen .app-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
body.auth-screen .sidebar,
body.auth-screen .header,
body.auth-screen .sidebar-footer {
    display: none !important;
}
body.auth-screen .main-wrapper {
    margin-left: 0;
    min-height: 100vh;
}
body.auth-screen .content {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
}
body.auth-screen .login-card {
    width: min(520px, calc(100vw - 40px));
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    overflow: hidden;
}
body.auth-screen .login-card-header {
    padding: 32px 32px 18px;
}
body.auth-screen .login-card-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}
body.auth-screen .login-brand-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.4rem;
}
body.auth-screen .login-card-header h2 {
    margin-bottom: 8px;
}
body.auth-screen .login-card-body {
    padding: 0 32px 24px;
}
body.auth-screen .login-splash {
    margin-bottom: 24px;
    padding: 22px;
    border-radius: var(--radius-lg);
    background: var(--bg-main);
    text-align: center;
}
body.auth-screen .login-splash-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    margin: 0 auto 14px;
}
body.auth-screen .login-splash h3 {
    margin-bottom: 8px;
    font-size: 1.05rem;
}
body.auth-screen .login-splash p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}
body.auth-screen .login-card-footer {
    padding: 22px 32px 32px;
    display: flex;
    justify-content: flex-end;
    background: transparent;
}
/* ═══════════════════════════════════════════
   COMMON CARD
═══════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition), border-color var(--transition);
}

/* ═══════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════ */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 20px;}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex; flex-direction: column; gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card-icon {
    width: 40px; height: 40px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.stat-card-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.stat-card-value { font-size: 1.4rem; font-weight: 700; }
.stat-card-sub   { font-size: 0.72rem; color: var(--text-light); }

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-weight: 600; font-size: 0.85rem;
    cursor: pointer; border: none;
    font-family: inherit;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-light); box-shadow: 0 4px 12px rgba(59,130,246,0.35); transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline {
    background: transparent; border: 1.5px solid var(--border);
    color: var(--text-main);
}
.btn-outline:hover:not(:disabled) { background: var(--bg-main); border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-main); color: var(--text-main); }
.btn-icon { padding: 9px; border-radius: var(--radius-md); }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* ═══════════════════════════════════════════
   FORMS
═══════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; color: var(--text-main); }
.form-control {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input); color: var(--text-main);
    font-size: 0.875rem; font-family: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
select.form-control { cursor: pointer; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.settings-tabs {
    display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;
}
.settings-tab {
    border: 1px solid transparent; background: transparent;
    color: var(--text-muted); padding: 10px 16px; border-radius: 999px;
    cursor: pointer; font-weight: 600; transition: all var(--transition);
}
.settings-tab.active {
    background: var(--bg-main); color: var(--text-main); border-color: var(--border);
}
.settings-panel { display: none; }
.settings-panel.active { display: block; }

/* ═══════════════════════════════════════════
   TABLE
═══════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 2px solid var(--border); }
thead th {
    padding: 12px 14px; text-align: left;
    font-size: 0.75rem; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
    white-space: nowrap;
}
tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
tbody tr:hover { background: var(--bg-main); }
tbody td { padding: 13px 14px; font-size: 0.88rem; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ═══════════════════════════════════════════
   BADGE / PILL
═══════════════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: #065f46; }
.badge-danger  { background: var(--danger-soft); color: #991b1b; }
.badge-warning { background: var(--warning-soft); color: #92400e; }
.badge-gray    { background: var(--bg-main); color: var(--text-muted); border: 1px solid var(--border); }
[data-theme="dark"] .badge-success { color: var(--success); }
[data-theme="dark"] .badge-danger  { color: var(--danger); }
[data-theme="dark"] .badge-warning { color: var(--warning); }

/* ═══════════════════════════════════════════
   PRODUCT GRID (Cashier)
═══════════════════════════════════════════ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    position: relative;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}
.product-card.out-of-stock { opacity: .6; cursor: not-allowed; }
.product-card-img {
    width: 100%; height: 120px; object-fit: cover;
    background: var(--bg-main);
}
.product-card-body { padding: 12px; }
.product-card-cat  {
    position: absolute; top: 8px; left: 8px;
    background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
    padding: 2px 8px; border-radius: 12px;
    font-size: 0.65rem; font-weight: 700; color: var(--primary);
}
[data-theme="dark"] .product-card-cat { background: rgba(17,24,39,.85); }
.product-card-name  { font-size: 0.85rem; font-weight: 600; margin-bottom: 2px; }
.product-card-code  { font-size: 0.72rem; color: var(--text-light); margin-bottom: 10px; }
.product-card-footer { display: flex; justify-content: space-between; align-items: flex-end; }
.product-price  { font-size: 0.95rem; font-weight: 700; color: var(--primary); }
.product-stock  { font-size: 0.7rem; color: var(--text-light); }
.product-stock.low { color: var(--danger); font-weight: 600; }
.product-add-btn {
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--primary); color: #fff; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.85rem;
    transition: all var(--transition);
}
.product-add-btn:hover { background: var(--primary-light); transform: scale(1.1); }

/* Category filter pills */
.cat-filter { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.cat-pill {
    flex-shrink: 0; padding: 6px 16px;
    border-radius: var(--radius-xl); font-size: 0.82rem; font-weight: 600;
    cursor: pointer; border: 1.5px solid var(--border);
    background: transparent; color: var(--text-muted);
    transition: all var(--transition); font-family: inherit;
}
.cat-pill:hover, .cat-pill.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ═══════════════════════════════════════════
   CART PANEL
═══════════════════════════════════════════ */
.cart-panel { position: sticky; top: calc(var(--header-height) + 28px); }

.cart-header-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.cart-title { font-size: 1rem; font-weight: 700; }
.cart-count {
    background: var(--primary); color: #fff;
    padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700;
}

.cart-empty {
    min-height: 180px; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--text-light); gap: 10px;
}
.cart-empty i { font-size: 36px; }
.cart-empty p { font-size: 0.85rem; }

.cart-items-list { display: flex; flex-direction: column; gap: 10px; max-height: 280px; overflow-y: auto; margin-bottom:16px; }

.cart-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: var(--bg-main);
    border-radius: var(--radius-md); border: 1px solid var(--border);
    transition: background var(--transition);
}
.cart-item-img { width: 42px; height: 42px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink:0; }
.cart-item-info { flex-grow: 1; min-width: 0; }
.cart-item-name { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 0.75rem; color: var(--text-muted); }
.cart-item-qty {
    display: flex; align-items: center; gap: 6px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; padding: 2px;
}
.qty-btn {
    width: 24px; height: 24px; border-radius: 6px;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
    background: transparent; color: var(--text-main);
    transition: background var(--transition);
}
.qty-btn:hover { background: var(--primary-soft); color: var(--primary); }
.qty-btn.remove { color: var(--danger); }
.qty-value { font-size: 0.85rem; font-weight: 700; min-width: 22px; text-align: center; }

.cart-divider { border: none; border-top: 1px dashed var(--border); margin: 14px 0; }

.cart-summary-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; font-size: 0.85rem;
}
.cart-summary-label { color: var(--text-muted); }
.cart-summary-value { font-weight: 600; }
.cart-total-row {
    display: flex; justify-content: space-between; align-items: baseline;
    margin: 14px 0;
}
.cart-total-label { font-size: 0.85rem; color: var(--text-muted); }
.cart-total-value { font-size: 1.6rem; font-weight: 800; color: var(--primary); }

.payment-methods { display: flex; gap: 8px; margin: 12px 0; }
.pay-method-btn {
    flex: 1; padding: 8px; border-radius: var(--radius-md);
    border: 1.5px solid var(--border); background: var(--bg-input);
    color: var(--text-muted); cursor: pointer; font-family: inherit;
    font-size: 0.78rem; font-weight: 600; text-align: center;
    transition: all var(--transition);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.pay-method-btn:hover { border-color: var(--primary); color: var(--primary); }
.pay-method-btn.active {
    border-color: var(--primary); background: var(--primary-soft); color: var(--primary);
}
.pay-method-btn i { font-size: 1rem; }

.disc-row { display: flex; gap: 8px; align-items: center; }
.disc-type { width: 60px; }
.disc-value { flex: 1; }

/* ═══════════════════════════════════════════
   MODALS
═══════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
    z-index: 1000; display: flex; align-items: center; justify-content: center;
    animation: fadeOverlay .2s ease;
}
@keyframes fadeOverlay { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    width: 100%; max-height: 90vh; overflow-y: auto;
    animation: slideUp .25s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.modal-sm { max-width: 420px; }
.modal-md { max-width: 580px; }
.modal-lg { max-width: 780px; }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px; border-radius: 8px;
    border: none; background: var(--bg-main); color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; transition: all var(--transition);
}
.modal-close:hover { background: var(--danger-soft); color: var(--danger); }
.modal-body    { padding: 24px; }
.modal-footer  {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 24px; border-top: 1px solid var(--border);
}

/* Payment modal specifics */
.payment-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.payment-info-row:last-child { border: none; }
.payment-total-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 14px 0;
}
.change-display {
    background: var(--success-soft); border-radius: var(--radius-md);
    padding: 16px; text-align: center; margin-top: 12px;
}
.change-amount { font-size: 2rem; font-weight: 800; color: var(--success); }

/* Receipt */
.receipt {
    background: #fff; color: #000;
    border-radius: var(--radius-md); padding: 24px;
    font-family: monospace; font-size: 0.8rem; line-height: 1.8;
    border: 2px dashed #ddd;
}
.receipt-title { text-align: center; font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.receipt-divider { border: none; border-top: 1px dashed #ccc; margin: 8px 0; }
.receipt-row { display: flex; justify-content: space-between; }
.receipt-total { font-size: 1rem; font-weight: 700; }
.receipt-center { text-align: center; }

/* ═══════════════════════════════════════════
   REPORTS  
═══════════════════════════════════════════ */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.chart-wrapper { position: relative; height: 240px; }

/* ═══════════════════════════════════════════
   DATE RANGE FILTER BAR
═══════════════════════════════════════════ */
.filter-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 20px;
}
.filter-bar .form-control {
    max-width: 160px; padding: 8px 12px; font-size: 0.82rem;
}

/* ═══════════════════════════════════════════
   ALERTS / BANNERS
═══════════════════════════════════════════ */
.alert {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-md);
    font-size: 0.85rem; font-weight: 500;
}
.alert-warning { background: var(--warning-soft); color: #92400e; border-left: 3px solid var(--warning); }
.alert-danger  { background: var(--danger-soft);  color: #991b1b; border-left: 3px solid var(--danger); }
.alert-success { background: var(--success-soft); color: #065f46; border-left: 3px solid var(--success); }
[data-theme="dark"] .alert-warning { color: var(--warning); }
[data-theme="dark"] .alert-danger  { color: var(--danger); }
[data-theme="dark"] .alert-success { color: var(--success); }

/* ═══════════════════════════════════════════
   PAGE TITLE BAR
═══════════════════════════════════════════ */
.page-actions {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-actions-left  { display: flex; align-items: center; gap: 10px; }
.page-actions-right { display: flex; align-items: center; gap: 10px; }

/* ═══════════════════════════════════════════
   LOADING / EMPTY
═══════════════════════════════════════════ */
.loading {
    text-align: center; padding: 60px 20px;
    color: var(--text-muted); font-size: 0.9rem;
}
.loading i { font-size: 2rem; margin-bottom: 12px; animation: spin 1s linear infinite; display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--text-light);
}
.empty-state i    { font-size: 3rem; margin-bottom: 12px; display: block; }
.empty-state h3   { font-size: 1rem; margin-bottom: 6px; color: var(--text-muted); }
.empty-state p    { font-size: 0.85rem; }

/* ═══════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════ */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 16px; }
.page-info  { font-size: 0.82rem; color: var(--text-muted); flex-grow: 1; }

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════ */
#toast-container {
    position: fixed; bottom: 24px; right: 24px;
    z-index: 9999; display: flex; flex-direction: column; gap: 10px;
}
.toast {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; border-radius: var(--radius-md);
    background: var(--bg-card); border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem; font-weight: 500;
    min-width: 280px; max-width: 380px;
    animation: toastIn .3s ease;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error   { border-left: 3px solid var(--danger); }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast i { font-size: 1.1rem; }
.toast-success i { color: var(--success); }
.toast-error   i { color: var(--danger); }
.toast-warning i { color: var(--warning); }

/* ═══════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════ */
.fade-in {
    animation: fadeIn .35s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 1100px) {
    .view-side { width: 360px; }
}
@media (max-width: 900px) {
    .view-side { display: none; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
}
@media (max-width: 640px) {
    .sidebar { transform: translateX(-100%); }
    .main-wrapper { margin-left: 0; }
    .report-grid { grid-template-columns: 1fr; }
}
