/* =========================================================================
   Unique Mini Mart POS — Design System.
   Palette taken from the client logo: deep navy (structure/primary
   actions) + logo red (brand accent, used sparingly for stripes/glow/
   highlights) + green for success states. Navigation lives in a single
   top header (no sidebar) with a horizontally-scrollable tab strip.
   ========================================================================= */

:root {
    --navy-950: #080d24;
    --navy-900: #0d1530;
    --navy-800: #13204a;
    --navy-700: #1b2c63;
    --navy-600: #26397f;
    --bg-app: #f5f6fa;
    --bg-card: #ffffff;
    --border-subtle: #e3e6ef;
    --text-primary: #171a2b;
    --text-secondary: #565b73;
    --text-muted: #71768c;

    --brand-600: #1e3a8a;
    --brand-500: #2f52b8;
    --brand-50: #eef1fb;

    --brandred-600: #d32029;
    --brandred-500: #e8434b;
    --brandred-50: #fdecec;

    --green-600: #16a34a;
    --green-50: #f0fdf4;
    --red-600: #dc2626;
    --red-50: #fef2f2;
    --amber-600: #d97706;
    --amber-50: #fffbeb;
    --blue-600: #2563eb;
    --blue-50: #eff6ff;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);

    --font-sans: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --topnav-height: 64px;
    --tabnav-height: 48px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    background: var(--bg-app);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, .brand-name, .card-title, .topnav-title {
    font-family: var(--font-sans);
    letter-spacing: -0.02em;
}

/* ---------------------------------------------------------------------
   App shell / layout — a single top header, tabs below it, content
   below that. No left/right sidebar.
   --------------------------------------------------------------------- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.topnav {
    background: linear-gradient(100deg, var(--navy-900), var(--navy-800), var(--navy-950));
    background-size: 200% 200%;
    animation: sidebarSheen 18s ease infinite;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-md);
}
.topnav-row {
    height: var(--topnav-height);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
}
.topnav::after {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(90deg, var(--brandred-600), var(--brand-500), var(--brandred-600));
    background-size: 200% 100%;
    animation: sidebarSheen 6s linear infinite;
}

.topnav-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
    position: relative;
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
}
.brand-mark::after {
    content: '';
    position: absolute; inset: -6px;
    border-radius: inherit;
    background: var(--brandred-600);
    filter: blur(10px);
    opacity: 0.55;
    z-index: -1;
    animation: glowPulse 3s ease-in-out infinite;
}
.brand-name { font-weight: 800; font-size: 16px; color: #fff; white-space: nowrap; }

.topnav-title { font-size: 15px; font-weight: 700; color: #e4e8f5; flex: 1; min-width: 0; }

.mobile-menu-btn { display: none; background: none; border: none; font-size: 20px; color: #fff; }

.topnav-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-role-badge {
    background: rgba(255,255,255,0.12); color: #fff;
    padding: 4px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.03em;
}
.user-name { font-weight: 600; color: #e4e8f5; font-size: 13px; white-space: nowrap; }
.topnav-icon-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    color: #cbd5e1; transition: background 0.15s ease, color 0.15s ease;
}
.topnav-icon-link:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Horizontal tab strip — every nav item as a top-level tab, scrolls
   sideways on narrow screens instead of collapsing into a hamburger. */
.main-nav {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: var(--tabnav-height);
    padding: 0 12px;
    background: rgba(0,0,0,0.18);
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.main-nav::-webkit-scrollbar { height: 4px; }
.main-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.nav-item {
    display: flex; align-items: center; gap: 8px;
    margin: 6px 1px 0;
    padding: 0 14px;
    height: calc(var(--tabnav-height) - 6px);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    color: #b6c0d6;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    transition: background 0.25s cubic-bezier(0.4,0,0.2,1), color 0.25s cubic-bezier(0.4,0,0.2,1), transform 0.2s cubic-bezier(0.4,0,0.2,1);
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; transform: translateY(-1px); }
.nav-item:active { transform: translateY(0) scale(0.97); }
.nav-item:hover .nav-icon { transform: scale(1.15); opacity: 1; }
.nav-item.active {
    color: #fff;
    background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-item.active::after {
    content: '';
    position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, var(--brandred-600), var(--brand-500));
    transform-origin: center;
    animation: tabUnderlineIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
    box-shadow: 0 0 10px -1px var(--brandred-500);
}
.nav-item::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.18), transparent 70%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.nav-item:hover::before { opacity: 1; }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; background: currentColor; opacity: 0.75; mask-size: contain; -webkit-mask-size: contain; mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat; mask-position: center; -webkit-mask-position: center; transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s ease; }
.nav-icon-grid { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22/%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22/%3E%3Crect%20x%3D%2214%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22/%3E%3Crect%20x%3D%223%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22/%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22/%3E%3Crect%20x%3D%2214%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22/%3E%3Crect%20x%3D%223%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22/%3E%3C/svg%3E"); }
.nav-icon-box { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%208a2%202%200%200%200-1-1.73l-7-4a2%202%200%200%200-2%200l-7%204A2%202%200%200%200%203%208v8a2%202%200%200%200%201%201.73l7%204a2%202%200%200%200%202%200l7-4A2%202%200%200%200%2021%2016z%22/%3E%3Cpolyline%20points%3D%223.27%206.96%2012%2012.01%2020.73%206.96%22/%3E%3Cline%20x1%3D%2212%22%20y1%3D%2222.08%22%20x2%3D%2212%22%20y2%3D%2212%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%208a2%202%200%200%200-1-1.73l-7-4a2%202%200%200%200-2%200l-7%204A2%202%200%200%200%203%208v8a2%202%200%200%200%201%201.73l7%204a2%202%200%200%200%202%200l7-4A2%202%200%200%200%2021%2016z%22/%3E%3Cpolyline%20points%3D%223.27%206.96%2012%2012.01%2020.73%206.96%22/%3E%3Cline%20x1%3D%2212%22%20y1%3D%2222.08%22%20x2%3D%2212%22%20y2%3D%2212%22/%3E%3C/svg%3E"); }
.nav-icon-truck { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%221%22%20y%3D%223%22%20width%3D%2215%22%20height%3D%2213%22/%3E%3Cpolygon%20points%3D%2216%208%2020%208%2023%2011%2023%2016%2016%2016%2016%208%22/%3E%3Ccircle%20cx%3D%225.5%22%20cy%3D%2218.5%22%20r%3D%222.5%22/%3E%3Ccircle%20cx%3D%2218.5%22%20cy%3D%2218.5%22%20r%3D%222.5%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%221%22%20y%3D%223%22%20width%3D%2215%22%20height%3D%2213%22/%3E%3Cpolygon%20points%3D%2216%208%2020%208%2023%2011%2023%2016%2016%2016%2016%208%22/%3E%3Ccircle%20cx%3D%225.5%22%20cy%3D%2218.5%22%20r%3D%222.5%22/%3E%3Ccircle%20cx%3D%2218.5%22%20cy%3D%2218.5%22%20r%3D%222.5%22/%3E%3C/svg%3E"); }
.nav-icon-sales { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2221%22%20r%3D%221%22/%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2221%22%20r%3D%221%22/%3E%3Cpath%20d%3D%22M1%201h4l2.68%2013.39a2%202%200%200%200%202%201.61h9.72a2%202%200%200%200%202-1.61L23%206H6%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2221%22%20r%3D%221%22/%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2221%22%20r%3D%221%22/%3E%3Cpath%20d%3D%22M1%201h4l2.68%2013.39a2%202%200%200%200%202%201.61h9.72a2%202%200%200%200%202-1.61L23%206H6%22/%3E%3C/svg%3E"); }
.nav-icon-layers { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolygon%20points%3D%2212%202%202%207%2012%2012%2022%207%2012%202%22/%3E%3Cpolyline%20points%3D%222%2017%2012%2022%2022%2017%22/%3E%3Cpolyline%20points%3D%222%2012%2012%2017%2022%2012%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolygon%20points%3D%2212%202%202%207%2012%2012%2022%207%2012%202%22/%3E%3Cpolyline%20points%3D%222%2017%2012%2022%2022%2017%22/%3E%3Cpolyline%20points%3D%222%2012%2012%2017%2022%2012%22/%3E%3C/svg%3E"); }
.nav-icon-users { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M17%2021v-2a4%204%200%200%200-4-4H5a4%204%200%200%200-4%204v2%22/%3E%3Ccircle%20cx%3D%229%22%20cy%3D%227%22%20r%3D%224%22/%3E%3Cpath%20d%3D%22M23%2021v-2a4%204%200%200%200-3-3.87%22/%3E%3Cpath%20d%3D%22M16%203.13a4%204%200%200%201%200%207.75%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M17%2021v-2a4%204%200%200%200-4-4H5a4%204%200%200%200-4%204v2%22/%3E%3Ccircle%20cx%3D%229%22%20cy%3D%227%22%20r%3D%224%22/%3E%3Cpath%20d%3D%22M23%2021v-2a4%204%200%200%200-3-3.87%22/%3E%3Cpath%20d%3D%22M16%203.13a4%204%200%200%201%200%207.75%22/%3E%3C/svg%3E"); }
.nav-icon-wallet { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%2012V7H5a2%202%200%200%201%200-4h14v4%22/%3E%3Cpath%20d%3D%22M3%205v14a2%202%200%200%200%202%202h16v-5%22/%3E%3Cpath%20d%3D%22M18%2012a2%202%200%200%200%200%204h4v-4Z%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%2012V7H5a2%202%200%200%201%200-4h14v4%22/%3E%3Cpath%20d%3D%22M3%205v14a2%202%200%200%200%202%202h16v-5%22/%3E%3Cpath%20d%3D%22M18%2012a2%202%200%200%200%200%204h4v-4Z%22/%3E%3C/svg%3E"); }
.nav-icon-card { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2220%22%20height%3D%2214%22%20x%3D%222%22%20y%3D%225%22%20rx%3D%222%22/%3E%3Cline%20x1%3D%222%22%20x2%3D%2222%22%20y1%3D%2210%22%20y2%3D%2210%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2220%22%20height%3D%2214%22%20x%3D%222%22%20y%3D%225%22%20rx%3D%222%22/%3E%3Cline%20x1%3D%222%22%20x2%3D%2222%22%20y1%3D%2210%22%20y2%3D%2210%22/%3E%3C/svg%3E"); }
.nav-icon-money { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cline%20x1%3D%2212%22%20y1%3D%221%22%20x2%3D%2212%22%20y2%3D%2223%22/%3E%3Cpath%20d%3D%22M17%205H9.5a3.5%203.5%200%200%200%200%207h5a3.5%203.5%200%200%201%200%207H6%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cline%20x1%3D%2212%22%20y1%3D%221%22%20x2%3D%2212%22%20y2%3D%2223%22/%3E%3Cpath%20d%3D%22M17%205H9.5a3.5%203.5%200%200%200%200%207h5a3.5%203.5%200%200%201%200%207H6%22/%3E%3C/svg%3E"); }
.nav-icon-trend { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%2223%206%2013.5%2015.5%208.5%2010.5%201%2018%22/%3E%3Cpolyline%20points%3D%2217%206%2023%206%2023%2012%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%2223%206%2013.5%2015.5%208.5%2010.5%201%2018%22/%3E%3Cpolyline%20points%3D%2217%206%2023%206%2023%2012%22/%3E%3C/svg%3E"); }
.nav-icon-expense { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V8z%22/%3E%3Cpolyline%20points%3D%2214%202%2014%208%2020%208%22/%3E%3Cline%20x1%3D%229%22%20y1%3D%2215%22%20x2%3D%2215%22%20y2%3D%2215%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V8z%22/%3E%3Cpolyline%20points%3D%2214%202%2014%208%2020%208%22/%3E%3Cline%20x1%3D%229%22%20y1%3D%2215%22%20x2%3D%2215%22%20y2%3D%2215%22/%3E%3C/svg%3E"); }
.nav-icon-chart { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cline%20x1%3D%2218%22%20y1%3D%2220%22%20x2%3D%2218%22%20y2%3D%2210%22/%3E%3Cline%20x1%3D%2212%22%20y1%3D%2220%22%20x2%3D%2212%22%20y2%3D%224%22/%3E%3Cline%20x1%3D%226%22%20y1%3D%2220%22%20x2%3D%226%22%20y2%3D%2214%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cline%20x1%3D%2218%22%20y1%3D%2220%22%20x2%3D%2218%22%20y2%3D%2210%22/%3E%3Cline%20x1%3D%2212%22%20y1%3D%2220%22%20x2%3D%2212%22%20y2%3D%224%22/%3E%3Cline%20x1%3D%226%22%20y1%3D%2220%22%20x2%3D%226%22%20y2%3D%2214%22/%3E%3C/svg%3E"); }
.nav-icon-history { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%203v5h5%22/%3E%3Cpath%20d%3D%22M3.05%2013A9%209%200%201%200%206%205.3L3%208%22/%3E%3Cpath%20d%3D%22M12%207v5l4%202%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%203v5h5%22/%3E%3Cpath%20d%3D%22M3.05%2013A9%209%200%201%200%206%205.3L3%208%22/%3E%3Cpath%20d%3D%22M12%207v5l4%202%22/%3E%3C/svg%3E"); }
.nav-icon-gear { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22/%3E%3Cpath%20d%3D%22M19.4%2015a1.65%201.65%200%200%200%20.33%201.82l.06.06a2%202%200%201%201-2.83%202.83l-.06-.06a1.65%201.65%200%200%200-1.82-.33%201.65%201.65%200%200%200-1%201.51V21a2%202%200%200%201-4%200v-.09A1.65%201.65%200%200%200%209%2019.4a1.65%201.65%200%200%200-1.82.33l-.06.06a2%202%200%201%201-2.83-2.83l.06-.06a1.65%201.65%200%200%200%20.33-1.82%201.65%201.65%200%200%200-1.51-1H3a2%202%200%200%201%200-4h.09A1.65%201.65%200%200%200%204.6%209a1.65%201.65%200%200%200-.33-1.82l-.06-.06a2%202%200%201%201%202.83-2.83l.06.06a1.65%201.65%200%200%200%201.82.33H9a1.65%201.65%200%200%200%201-1.51V3a2%202%200%200%201%204%200v.09a1.65%201.65%200%200%200%201%201.51%201.65%201.65%200%200%200%201.82-.33l.06-.06a2%202%200%201%201%202.83%202.83l-.06.06a1.65%201.65%200%200%200-.33%201.82V9a1.65%201.65%200%200%200%201.51%201H21a2%202%200%200%201%200%204h-.09a1.65%201.65%200%200%200-1.51%201z%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22/%3E%3Cpath%20d%3D%22M19.4%2015a1.65%201.65%200%200%200%20.33%201.82l.06.06a2%202%200%201%201-2.83%202.83l-.06-.06a1.65%201.65%200%200%200-1.82-.33%201.65%201.65%200%200%200-1%201.51V21a2%202%200%200%201-4%200v-.09A1.65%201.65%200%200%200%209%2019.4a1.65%201.65%200%200%200-1.82.33l-.06.06a2%202%200%201%201-2.83-2.83l.06-.06a1.65%201.65%200%200%200%20.33-1.82%201.65%201.65%200%200%200-1.51-1H3a2%202%200%200%201%200-4h.09A1.65%201.65%200%200%200%204.6%209a1.65%201.65%200%200%200-.33-1.82l-.06-.06a2%202%200%201%201%202.83-2.83l.06.06a1.65%201.65%200%200%200%201.82.33H9a1.65%201.65%200%200%200%201-1.51V3a2%202%200%200%201%204%200v.09a1.65%201.65%200%200%200%201%201.51%201.65%201.65%200%200%200%201.82-.33l.06-.06a2%202%200%201%201%202.83%202.83l-.06.06a1.65%201.65%200%200%200-.33%201.82V9a1.65%201.65%200%200%200%201.51%201H21a2%202%200%200%201%200%204h-.09a1.65%201.65%200%200%200-1.51%201z%22/%3E%3C/svg%3E"); }
.nav-icon-user { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%2021v-2a4%204%200%200%200-4-4H8a4%204%200%200%200-4%204v2%22/%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%227%22%20r%3D%224%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%2021v-2a4%204%200%200%200-4-4H8a4%204%200%200%200-4%204v2%22/%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%227%22%20r%3D%224%22/%3E%3C/svg%3E"); }
.nav-icon-logout { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M9%2021H5a2%202%200%200%201-2-2V5a2%202%200%200%201%202-2h4%22/%3E%3Cpolyline%20points%3D%2216%2017%2021%2012%2016%207%22/%3E%3Cline%20x1%3D%2221%22%20y1%3D%2212%22%20x2%3D%229%22%20y2%3D%2212%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M9%2021H5a2%202%200%200%201-2-2V5a2%202%200%200%201%202-2h4%22/%3E%3Cpolyline%20points%3D%2216%2017%2021%2012%2016%207%22/%3E%3Cline%20x1%3D%2221%22%20y1%3D%2212%22%20x2%3D%229%22%20y2%3D%2212%22/%3E%3C/svg%3E"); }

/* ---------------------------------------------------------------------
   Nav dropdown groups — the top strip groups related tabs (Catalog,
   Sales, Purchasing, Money, Admin) behind a toggle instead of listing
   every page flat, which was outgrowing the strip as features were added.
   The panel is position:fixed (not absolute) and JS-positioned from the
   toggle's own rect — .main-nav scrolls horizontally via overflow-x:auto,
   and per the CSS spec that forces overflow-y to compute as auto too,
   which would silently clip an absolutely-positioned dropdown. Fixed
   positioning sits outside that overflow context entirely.
   --------------------------------------------------------------------- */
.nav-group { position: relative; display: flex; flex-shrink: 0; }
.nav-group-toggle { background: none; border: none; cursor: pointer; font-family: inherit; }
.nav-group.active .nav-group-toggle {
    color: #fff;
    background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
}
.nav-group.active .nav-group-toggle .nav-icon { opacity: 1; }
.nav-group.active .nav-group-toggle::after {
    content: '';
    position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, var(--brandred-600), var(--brand-500));
    box-shadow: 0 0 10px -1px var(--brandred-500);
}
.nav-caret { width: 9px; height: 9px; flex-shrink: 0; margin-left: -2px; opacity: 0.65; transition: transform 0.2s cubic-bezier(0.4,0,0.2,1); }
.nav-caret svg { width: 100%; height: 100%; display: block; }
.nav-group.open .nav-caret, .nav-group-toggle[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

.nav-dropdown {
    position: fixed;
    display: none;
    flex-direction: column;
    min-width: 190px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 40px -8px rgba(15,23,42,0.4);
    padding: 6px;
    z-index: 90;
    animation: overlayFadeIn 0.15s ease both;
}
.nav-dropdown.open { display: flex; }
.nav-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-dropdown-item .nav-icon { background: var(--text-muted); opacity: 1; }
.nav-dropdown-item:hover { background: var(--brand-50); color: var(--brand-600); }
.nav-dropdown-item:hover .nav-icon { background: var(--brand-600); }
.nav-dropdown-item.active { background: var(--brand-50); color: var(--brand-600); }
.nav-dropdown-item.active .nav-icon { background: var(--brand-600); }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* overflow-x:hidden here (not on html/body) is the defensive backstop: no
   single element inside the page content (an unwrapped table, a long
   unbreakable string, etc.) can force the whole page wider than the
   viewport — that's what previously made entire pages render zoomed-out
   and cut off on phones. Scoped to .content, not html/body, specifically
   so it can never interfere with .topnav's position:sticky — putting
   overflow-x:hidden on an ancestor of a sticky element makes that
   ancestor's overflow-y compute to auto too (a CSS spec rule), which
   breaks sticky positioning; .content has no sticky descendants, so it's
   safe here. Elements that legitimately need horizontal scroll (tables)
   still get their own local overflow-x:auto via .table-wrap regardless. */
.content { padding: 24px; flex: 1; max-width: 1400px; width: 100%; margin: 0 auto; overflow-x: hidden; }

/* ---------------------------------------------------------------------
   Cards / KPI
   --------------------------------------------------------------------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    animation: fadeSlideUp 0.4s ease both;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 700; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    animation: fadeSlideUp 0.5s ease both;
}
.kpi-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--brand-600), var(--brand-500));
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.3s ease;
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.kpi-card:hover::before { transform: scaleX(1); }
.kpi-grid .kpi-card:nth-child(1) { animation-delay: 0.02s; }
.kpi-grid .kpi-card:nth-child(2) { animation-delay: 0.06s; }
.kpi-grid .kpi-card:nth-child(3) { animation-delay: 0.10s; }
.kpi-grid .kpi-card:nth-child(4) { animation-delay: 0.14s; }
.kpi-grid .kpi-card:nth-child(5) { animation-delay: 0.18s; }
.kpi-grid .kpi-card:nth-child(6) { animation-delay: 0.22s; }
.kpi-label { font-size: 12.5px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-value { font-size: 25px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }
.kpi-value.positive { color: var(--green-600); }
.kpi-value.negative { color: var(--red-600); }
.text-positive { color: var(--green-600); }
.text-negative { color: var(--red-600); }
.kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.kpi-alert-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--red-600); margin-right: 6px; vertical-align: 1px;
    animation: pulseUrgent 1.8s ease-in-out infinite;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: var(--radius-sm);
    border: 1px solid transparent; font-size: 13.5px; font-weight: 700;
    transition: background 0.18s ease, opacity 0.15s ease, transform 0.15s cubic-bezier(0.4,0,0.2,1), box-shadow 0.18s ease;
}
.btn:active:not(:disabled) { transform: scale(0.96); }
.btn-primary { position: relative; overflow: hidden; background: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-500); box-shadow: 0 4px 14px -4px var(--brand-600); }
.btn-primary::after {
    content: '';
    position: absolute; top: 0; left: 0; width: 40%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: translateX(-150%) skewX(-15deg);
    transition: transform 0.5s ease;
    pointer-events: none;
}
.btn-primary:hover::after { transform: translateX(280%) skewX(-15deg); }
.btn-secondary { background: #fff; border-color: var(--border-subtle); color: var(--text-primary); }
.btn-secondary:hover { background: #f8fafc; }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-accent { background: var(--brandred-600); color: #fff; }
.btn-accent:hover { background: var(--brandred-500); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.is-loading { opacity: 0.85; cursor: wait; }
.btn.is-loading::before {
    content: '';
    width: 12px; height: 12px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.btn-secondary.is-loading::before { border-color: rgba(26,34,51,0.25); border-top-color: var(--text-primary); }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--text-secondary); }
.form-group .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-group .error-text { font-size: 12px; color: var(--red-600); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], input[type=search], select, textarea {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
    font-size: 13.5px; color: var(--text-primary); background: #fff;
    font-family: var(--font-sans);
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-50);
}
input.invalid, select.invalid, textarea.invalid { border-color: var(--red-600); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.password-field { position: relative; }
.password-field input { padding-right: 40px; }
.password-toggle-btn {
    position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
    width: 32px; height: 32px; border: none; background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); border-radius: var(--radius-sm);
    transition: color 0.15s ease, background 0.15s ease;
}
.password-toggle-btn:hover { color: var(--navy-900); background: var(--brand-50); }
.password-toggle-btn svg { width: 18px; height: 18px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.checkbox-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--navy-800); cursor: pointer; }
.checkbox-row label { font-size: 13px; color: var(--text-secondary); cursor: pointer; margin: 0; font-weight: 600; }

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: #fff; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th {
    text-align: left; padding: 12px 16px; background: #fafbfc;
    font-weight: 700; color: var(--text-secondary); font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border-subtle);
}
table.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); transition: background 0.15s ease; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--brand-50); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }

/* ---------------------------------------------------------------------
   Badges
   --------------------------------------------------------------------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-success { background: var(--green-50); color: var(--green-600); }
.badge-danger  { background: var(--red-50); color: var(--red-600); }
.badge-warning { background: var(--amber-50); color: var(--amber-600); }
.badge-info    { background: var(--blue-50); color: var(--blue-600); }
.badge-neutral { background: #f1f5f9; color: var(--text-secondary); }
.badge-accent  { background: var(--brandred-50); color: var(--brandred-600); }

/* ---------------------------------------------------------------------
   Alerts
   --------------------------------------------------------------------- */
.alert { padding: 12px 16px; border-radius: var(--radius-md); font-size: 13.5px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--green-50); color: var(--green-600); border-color: #bbf7d0; }
.alert-danger  { background: var(--red-50); color: var(--red-600); border-color: #fecaca; }
.alert-warning { background: var(--amber-50); color: var(--amber-600); border-color: #fde68a; }
.alert-info    { background: var(--blue-50); color: var(--blue-600); border-color: #bfdbfe; }

/* ---------------------------------------------------------------------
   Modal
   --------------------------------------------------------------------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,0.5);
    display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.open { display: flex; animation: overlayFadeIn 0.2s ease both; }
.modal-box {
    background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 640px;
    max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px -12px rgba(15,23,42,0.35);
    animation: modalPopIn 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
}
.modal-header { padding: 18px 24px; border-bottom: 1px solid var(--border-subtle); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 16px; font-weight: 800; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-muted); transition: transform 0.2s ease, color 0.2s ease; border-radius: 50%; width: 28px; height: 28px; }
.modal-close:hover { color: var(--red-600); transform: rotate(90deg); background: var(--red-50); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-subtle); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------------------------------------------------------------------
   Filters bar / secondary tabs (e.g. Inventory's All/Low Stock/etc.)
   --------------------------------------------------------------------- */
.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters-bar select, .filters-bar input { width: auto; min-width: 140px; }
.filters-bar .search-input { min-width: 220px; flex: 1; }

.tab-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab-bar a {
    padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 700;
    background: #fff; border: 1px solid var(--border-subtle); color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}
.tab-bar a:hover { border-color: var(--navy-700); color: var(--navy-900); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.tab-bar a.active { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }

/* ---------------------------------------------------------------------
   Auth page
   --------------------------------------------------------------------- */
.auth-body {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background: var(--navy-950);
    overflow: hidden;
}
.auth-bg-svg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.auth-wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; margin: 0 auto; }
.auth-card { background: #fff; border-radius: var(--radius-lg); padding: 36px 32px; box-shadow: 0 25px 60px rgba(0,0,0,0.45); }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-logo { width: 84px; height: 84px; border-radius: var(--radius-md); object-fit: contain; display: block; margin: 0 auto 14px; box-shadow: 0 8px 24px -8px rgba(211,32,41,0.5); animation: logoFloat 3s ease-in-out infinite; background: #fff; }
.auth-brand h1 { font-size: 21px; margin: 0 0 4px; font-weight: 800; letter-spacing: -0.02em; }
.auth-brand p { color: var(--text-muted); font-size: 13px; margin: 0; }
.auth-demo-note { margin-top: 20px; padding: 14px; background: #fafbfc; border: 1px dashed var(--border-subtle); border-radius: var(--radius-md); font-size: 12px; color: var(--text-secondary); }
.auth-demo-note table { width: 100%; margin: 8px 0; }
.auth-demo-note td { padding: 2px 0; }

/* ---------------------------------------------------------------------
   Point of Sale (POS) screen — a two-column layout: product search +
   cart on the left, running total + checkout on the right, that also
   works stacked on a narrow screen.
   --------------------------------------------------------------------- */
.pos-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.pos-cart-table td, .pos-cart-table th { padding: 8px 10px; }
.pos-summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; color: var(--text-secondary); }
.pos-summary-row.total { font-size: 18px; font-weight: 800; color: var(--text-primary); border-top: 1px solid var(--border-subtle); margin-top: 8px; padding-top: 10px; }
.pos-search-results { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); margin-top: 6px; max-height: 260px; overflow-y: auto; background: #fff; }
.pos-search-item { padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); cursor: pointer; }
.pos-search-item:last-child { border-bottom: none; }
.pos-search-item:hover { background: var(--brand-50); }
.pos-search-item .name { font-weight: 700; font-size: 13.5px; }
.pos-search-item .meta { font-size: 11.5px; color: var(--text-muted); }

/* ---------------------------------------------------------------------
   Payment-mix bar (dashboard) — a single flex bar with one colored
   segment per payment method, widths set inline by the view.
   --------------------------------------------------------------------- */
.payment-mix-bar { display: flex; height: 10px; border-radius: 20px; overflow: hidden; background: #f1f5f9; margin-bottom: 12px; }
.payment-mix-bar span { height: 100%; }
.payment-mix-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--text-secondary); }
.payment-mix-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* ---------------------------------------------------------------------
   Printable receipt — narrow, thermal-style layout. On screen it sits in
   a normal card; @media print strips everything else off the page so a
   browser print (Ctrl+P) on any printer, thermal or A4, produces a clean
   receipt with no header/nav/buttons. The receipt itself intentionally
   keeps a monospace font regardless of the app's typeface, matching
   real thermal-printer output.
   --------------------------------------------------------------------- */
.receipt { max-width: 320px; margin: 0 auto; font-family: 'Courier New', monospace; font-size: 12.5px; color: #000; background: #fff; padding: 16px; letter-spacing: normal; }
.receipt-header { text-align: center; margin-bottom: 10px; }
.receipt-header .shop-name { font-size: 16px; font-weight: 700; }
.receipt-header .shop-meta { font-size: 11px; color: #444; }
.receipt hr { border: none; border-top: 1px dashed #999; margin: 8px 0; }
.receipt-row { display: flex; justify-content: space-between; }
.receipt-items table { width: 100%; border-collapse: collapse; font-size: 12px; }
.receipt-items th, .receipt-items td { text-align: left; padding: 2px 0; }
.receipt-items th:last-child, .receipt-items td:last-child { text-align: right; }
.receipt-totals .receipt-row.grand { font-weight: 700; font-size: 14px; }
.receipt-footer { text-align: center; margin-top: 10px; font-size: 11px; color: #444; }

/* ---------------------------------------------------------------------
   Pagination
   --------------------------------------------------------------------- */
.pagination { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); font-size: 13px; transition: all 0.15s ease; }
.pagination a:hover { border-color: var(--brand-500); color: var(--brand-600); transform: translateY(-1px); }
.pagination .current { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
    .topnav-title { display: none; }
    .user-name { display: none; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .pos-layout { grid-template-columns: 1fr; }
    .content { padding: 16px; }
}

@media print {
    .topnav, .filters-bar, .btn, .pagination { display: none !important; }
    .content { padding: 0; }
    body { background: #fff; }
}

/* ---------------------------------------------------------------------
   Motion
   --------------------------------------------------------------------- */
@keyframes sidebarSheen {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}
@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes logoFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(-2deg); }
}
@keyframes cartRowIn {
    from { opacity: 0; transform: translateX(-10px); background: var(--brand-50); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulseUrgent {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.35); }
    50% { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}
@keyframes checkPop {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}
@keyframes tabUnderlineIn {
    from { transform: scaleX(0); opacity: 0; }
    to { transform: scaleX(1); opacity: 1; }
}
@keyframes modalPopIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cart-row-new { animation: cartRowIn 0.35s ease both; }
.badge-danger.badge-urgent { animation: pulseUrgent 1.8s ease-in-out infinite; }
.sale-success-check { animation: checkPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

a:focus-visible, button:focus-visible, .nav-item:focus-visible,
.btn:focus-visible, .pagination a:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .topnav, .topnav::after, .brand-mark::after,
    .kpi-card, .card, .btn-primary::after, .btn.is-loading::before,
    .auth-logo, .cart-row-new, .badge-urgent, .kpi-alert-dot, .sale-success-check,
    .nav-item, .nav-item::after, .nav-icon, .btn, .tab-bar a, .pagination a,
    .modal-overlay.open, .modal-box, .modal-close, table.data-table td,
    .nav-dropdown, .nav-caret {
        animation: none !important;
        transition: none !important;
    }
}
