/* ═══════════════════════════════════════════════════════════════════════════
   RetailPOS — Main Stylesheet
   Theme: Vivid Orange · Glassmorphism · Animated  (mirrors client-portal)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Colour tokens ──────────────────────────────────────────────────────── */
:root {
    --accent:        #F97316;   /* orange-500          */
    --accent-dark:   #EA580C;   /* orange-600          */
    --accent-light:  #FB923C;   /* orange-400          */
    --accent-deep:   #C2410C;   /* orange-700          */
    --accent-hover:  #EA580C;
    --accent-glow:   rgba(249,115,22,0.30);
    --accent-tint:   rgba(249,115,22,0.08);
    --accent-tint2:  rgba(249,115,22,0.14);

    /* Background */
    --bg:            #FFF7ED;
    --bg-grad1:      rgba(249,115,22,0.22);
    --bg-grad2:      rgba(251,191,36,0.16);
    --bg-grad3:      rgba(239,68,68,0.12);
    --bg-grad4:      rgba(249,115,22,0.10);

    /* Surfaces */
    --surface:       rgba(255,255,255,0.72);
    --surface-solid: #FFFFFF;
    --surface-border:rgba(255,255,255,0.55);

    /* Text */
    --text:          #1c1917;
    --text-muted:    #78716c;
    --text-faint:    #a8a29e;

    /* Semantic */
    --danger:        #EF4444;
    --warning:       #F59E0B;
    --success:       #10B981;
    --info:          #3B82F6;

    /* Borders */
    --border:        rgba(249,115,22,0.18);
    --border-solid:  #E8DDD5;

    /* Shape */
    --radius:        8px;
    --radius-md:     12px;
    --radius-lg:     18px;
    --shadow:        0 4px 14px rgba(124,45,18,0.10);
    --shadow-md:     0 8px 28px rgba(124,45,18,0.14);
    --shadow-glow:   0 8px 28px rgba(249,115,22,0.28);

    --sidebar-width: 240px;
    --topbar-h:      58px;
    --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

/* ── Keyframe library ───────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes popIn {
    0%   { opacity: 0; transform: scale(0.88); }
    70%  { transform: scale(1.03); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 4px 16px var(--accent-glow); }
    50%       { box-shadow: 0 6px 24px rgba(249,115,22,0.52); }
}
@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    40%       { transform: translateY(-4px); }
    70%       { transform: translateY(2px); }
}
@keyframes rowIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes topbarIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes loader-spin  { to { transform: rotate(360deg); } }
@keyframes loader-bounce {
    0%, 80%, 100% { transform: translateY(0);    opacity: .45; }
    40%            { transform: translateY(-8px); opacity: 1;   }
}
@keyframes loader-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes loader-card-in {
    from { opacity: 0; transform: translateY(-16px) scale(.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@keyframes cartItemIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Body ───────────────────────────────────────────────────────────────── */
body {
    font-family: var(--font);
    background-color: var(--bg);
    background-image:
        radial-gradient(at 0%   0%,   var(--bg-grad1) 0, transparent 55%),
        radial-gradient(at 100% 0%,   var(--bg-grad2) 0, transparent 55%),
        radial-gradient(at 100% 100%, var(--bg-grad3) 0, transparent 55%),
        radial-gradient(at 0%   100%, var(--bg-grad4) 0, transparent 55%);
    background-attachment: fixed;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

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

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left .28s cubic-bezier(.4,0,.2,1);
    min-width: 0;
}

.page-content {
    padding: 1.75rem;
    flex: 1;
}

/* ══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════════════════ */
#sidebar {
    width: var(--sidebar-width);
    background: rgba(255,248,240,0.80);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border-right: 1px solid rgba(255,255,255,0.55);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 2px 0 18px rgba(124,45,18,0.09);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    scrollbar-width: thin;
    scrollbar-color: rgba(249,115,22,0.25) transparent;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(249,115,22,0.28); border-radius: 4px; }

/* ── Sidebar collapse ──────────────────────────────────────────────────── */
html.sidebar-collapsed #sidebar { transform: translateX(-100%); }
html.sidebar-collapsed .main-content { margin-left: 0; }
.sidebar-toggle-btn i {
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    display: inline-block;
}
html.sidebar-collapsed .sidebar-toggle-btn i { transform: rotate(180deg); }

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.85rem 1.25rem;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid rgba(249,115,22,0.18);
    background: linear-gradient(90deg, rgba(249,115,22,0.12) 0%, rgba(251,191,36,0.07) 60%, transparent 100%);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-brand > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}
/* Shimmer sweep on brand */
.sidebar-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(249,115,22,0.13) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: shimmer 3.5s linear infinite;
    pointer-events: none;
}
.sidebar-brand i { color: var(--accent); font-size: 22px; }

/* Company */
.sidebar-company {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 1.25rem 0.85rem;
    color: var(--text-muted);
    font-size: 12px;
    border-bottom: 1px solid rgba(249,115,22,0.10);
}

/* Nav list */
.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0.625rem;
    flex: 1;
}
.sidebar-nav li { margin-bottom: 2px; }

/* Stagger entrance */
.sidebar-nav li:nth-child(1)  { animation: slideInLeft .32s ease both .04s; }
.sidebar-nav li:nth-child(2)  { animation: slideInLeft .32s ease both .08s; }
.sidebar-nav li:nth-child(3)  { animation: slideInLeft .32s ease both .12s; }
.sidebar-nav li:nth-child(4)  { animation: slideInLeft .32s ease both .16s; }
.sidebar-nav li:nth-child(5)  { animation: slideInLeft .32s ease both .20s; }
.sidebar-nav li:nth-child(6)  { animation: slideInLeft .32s ease both .24s; }
.sidebar-nav li:nth-child(7)  { animation: slideInLeft .32s ease both .28s; }
.sidebar-nav li:nth-child(8)  { animation: slideInLeft .32s ease both .32s; }
.sidebar-nav li:nth-child(9)  { animation: slideInLeft .32s ease both .36s; }
.sidebar-nav li:nth-child(10) { animation: slideInLeft .32s ease both .40s; }
.sidebar-nav li:nth-child(11) { animation: slideInLeft .32s ease both .44s; }
.sidebar-nav li:nth-child(12) { animation: slideInLeft .32s ease both .48s; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border-left: 3px solid transparent;
    transition:
        color         .18s ease,
        background    .18s ease,
        border-color  .18s ease,
        transform     .18s ease,
        box-shadow    .18s ease;
}
.sidebar-nav a i { font-size: 15px; width: 18px; flex-shrink: 0; }
.sidebar-nav a:hover {
    color: var(--accent-dark);
    background: var(--accent-tint2);
    transform: translateX(4px);
    border-left-color: var(--accent-light);
}
.sidebar-nav a:hover i { animation: iconBounce .45s ease; }
.sidebar-nav a.active {
    color: #fff;
    background: linear-gradient(95deg, var(--accent), var(--accent-dark));
    border-left-color: transparent;
    box-shadow: var(--shadow-glow);
    animation: glowPulse 2.4s ease-in-out infinite;
}
.sidebar-nav a.active i { color: rgba(255,255,255,0.92); }

/* Section labels */
.nav-section {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-faint);
    padding: 14px 12px 4px;
    pointer-events: none;
    user-select: none;
}

/* Footer */
.sidebar-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid rgba(249,115,22,0.14);
    flex-shrink: 0;
}
.btn-logout {
    width: 100%;
    background: none;
    border: 1px solid rgba(249,115,22,0.25);
    color: var(--text-muted);
    padding: 8px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background .18s, color .18s, transform .18s, border-color .18s;
}
.btn-logout:hover {
    background: rgba(239,68,68,0.08);
    color: #dc2626;
    border-color: rgba(239,68,68,0.4);
    transform: translateX(3px);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
    padding: 4px;
}
.sidebar-user i { font-size: 15px; color: var(--accent); }
.role-badge {
    background: var(--accent-tint);
    color: var(--accent-dark);
    border: 1px solid rgba(249,115,22,0.22);
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 7px;
    margin-left: auto;
}

/* ══════════════════════════════════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════════════════════════════════ */
.topbar {
    height: var(--topbar-h);
    background: rgba(255,248,240,0.72);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-bottom: 1px solid rgba(249,115,22,0.18);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 90;
    animation: topbarIn .35s ease both;
    box-shadow: 0 2px 12px rgba(124,45,18,0.07);
}

.sidebar-toggle-btn {
    background: none;
    border: 1px solid rgba(249,115,22,0.22);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 19px;
    color: var(--accent-dark);
    padding: 5px 7px;
    line-height: 1;
    transition: background .18s, transform .18s, box-shadow .18s;
}
.sidebar-toggle-btn:hover {
    background: var(--accent-tint2);
    transform: scale(1.06);
    box-shadow: 0 2px 8px rgba(249,115,22,0.18);
}

.topbar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* Animated orange underline on hover */
.topbar-title::after {
    content: '';
    position: absolute;
    left: 0; bottom: -14px;
    width: 0; height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: width .4s ease;
}
.topbar:hover .topbar-title::after { width: 100%; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--accent-tint);
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(249,115,22,0.18);
    transition: background .2s;
    white-space: nowrap;
}
.topbar-right:hover { background: var(--accent-tint2); }

/* ══════════════════════════════════════════════════════════════════════════
   PAGE LOADER  — thin top bar (navigation) + overlay (form submit)
   ══════════════════════════════════════════════════════════════════════════ */

/* ─ Thin top progress bar (navigation) ─ */
#page-loader-bar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-light), var(--accent), var(--accent-dark), #fbbf24);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
    z-index: 9999;
    opacity: 0;
    transition: width .4s ease, opacity .2s ease;
    border-radius: 0 3px 3px 0;
}
#page-loader-bar.active { width: 70%; opacity: 1; }

/* ─ Full-screen overlay (form submit) ─ */
#page-loader-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(28,14,5,0.60);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}
#page-loader-overlay.active {
    display: flex;
    animation: loader-fade-in .18s ease forwards;
}
#page-loader-card {
    background: rgba(255,248,240,0.96);
    border: 1px solid rgba(249,115,22,0.35);
    border-radius: var(--radius-lg);
    padding: 36px 48px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(124,45,18,0.30), 0 0 0 1px rgba(249,115,22,0.12);
    animation: loader-card-in .22s ease forwards;
    min-width: 220px;
}
#page-loader-icon {
    font-size: 36px;
    color: var(--accent);
    margin-bottom: 10px;
    display: block;
    line-height: 1;
}
#page-loader-icon i { animation: loader-spin 1.4s linear infinite; display: inline-block; }
#page-loader-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .02em;
    margin-bottom: 20px;
}
#page-loader-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-bottom: 14px;
}
#page-loader-dots span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: loader-bounce 1.2s ease-in-out infinite;
}
#page-loader-dots span:nth-child(2) { animation-delay: .18s; background: var(--accent-light); }
#page-loader-dots span:nth-child(3) { animation-delay: .36s; background: #fbbf24; }
#page-loader-msg { font-size: 12.5px; color: var(--text-muted); letter-spacing: .03em; }

/* ── Btn loading spinner ── */
.btn-loading { pointer-events: none !important; opacity: 0.75 !important; }
.btn-loading::after {
    content: '';
    display: inline-block;
    width: 0.8rem; height: 0.8rem;
    margin-left: 0.5rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    animation: btn-spin .6s linear infinite;
}

/* ══════════════════════════════════════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════════════════════════════════════ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg);
    background-image:
        radial-gradient(at 0%   0%,   var(--bg-grad1) 0, transparent 55%),
        radial-gradient(at 100% 0%,   var(--bg-grad2) 0, transparent 55%),
        radial-gradient(at 100% 100%, var(--bg-grad3) 0, transparent 55%),
        radial-gradient(at 0%   100%, var(--bg-grad4) 0, transparent 55%);
    background-attachment: fixed;
}
.auth-card {
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
    animation: fadeInUp .4s ease both;
}
.auth-card-wide { max-width: 640px; }
.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
}
.auth-brand i { font-size: 28px; }
.auth-card h2 { text-align: center; font-size: 20px; margin-bottom: 4px; }
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 24px; font-size: 13px; }
.auth-link { text-align: center; margin-top: 16px; color: var(--text-muted); font-size: 13px; }
.auth-link a { color: var(--accent); text-decoration: none; }
.auth-link a:hover { color: var(--accent-dark); }

/* ══════════════════════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════════════════════ */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 13px;
    border-left: 4px solid transparent;
    animation: fadeInUp .3s ease both;
}
.alert-success { background: #dcfce7; color: #15803d; border-left-color: #16a34a; }
.alert-danger   { background: #fee2e2; color: #991b1b; border-left-color: #dc2626; }
.alert-info     { background: #dbeafe; color: #1e40af; border-left-color: #2563eb; }

/* ══════════════════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════════════════ */
.form-group {
    margin-bottom: 16px;
    flex: 1;
}
.form-group label, .form-label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-solid);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: rgba(255,255,255,0.85);
    transition: border-color .18s, box-shadow .18s;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.18);
    background: var(--surface-solid);
}
.form-row {
    display: flex;
    gap: 16px;
}
.form-row .form-group { flex: 1; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check-input { accent-color: var(--accent); }
.form-check label { text-transform: none; letter-spacing: 0; font-size: 13.5px; }

.form-card {
    background: var(--surface);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    max-width: 860px;
    animation: fadeInUp .38s ease both .06s;
}
.form-card h3, .form-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-card-inner {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}
.form-card-inner h4 { font-size: 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }

.section-divider {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent-dark);
    margin: 22px 0 16px;
    font-weight: 700;
    padding-bottom: 7px;
    border-bottom: 2px solid rgba(249,115,22,0.18);
    position: relative;
}
.section-divider::before {
    content: '';
    position: absolute;
    left: 0; bottom: -2px;
    width: 32px; height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════ */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    box-shadow: 0 4px 12px var(--accent-glow);
    transition: background .18s, box-shadow .18s, transform .12s;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: #fff;
    box-shadow: 0 6px 20px rgba(249,115,22,0.42);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(1px) scale(.98); }

.btn-secondary {
    background: rgba(255,255,255,0.75);
    color: var(--text);
    border: 1px solid var(--border-solid);
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background .18s, border-color .18s, transform .12s;
}
.btn-secondary:hover {
    background: var(--accent-tint);
    border-color: var(--accent-light);
    color: var(--accent-dark);
}
.btn-secondary:active { transform: translateY(1px) scale(.98); }

.btn-danger {
    background: linear-gradient(135deg, #f87171, #dc2626);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(220,38,38,0.25);
    transition: box-shadow .18s, transform .12s;
}
.btn-danger:hover {
    box-shadow: 0 6px 18px rgba(220,38,38,0.38);
    transform: translateY(-1px);
    color: #fff;
}
.btn-danger:active { transform: translateY(1px) scale(.98); }

.btn-success {
    background: linear-gradient(135deg, #4ade80, #16a34a);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(22,163,74,0.25);
    transition: box-shadow .18s, transform .12s;
}
.btn-success:hover {
    box-shadow: 0 6px 18px rgba(22,163,74,0.38);
    transform: translateY(-1px);
    color: #fff;
}

.w-100 { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.btn-icon {
    background: rgba(255,255,255,0.80);
    border: 1px solid var(--border-solid);
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all .18s;
}
.btn-icon:hover {
    background: var(--accent-tint2);
    color: var(--accent-dark);
    border-color: var(--accent-light);
    transform: scale(1.05);
}
.btn-icon-danger:hover {
    background: #fee2e2;
    color: var(--danger);
    border-color: rgba(239,68,68,0.4);
}

/* ══════════════════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════════════════ */
.table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(249,115,22,0.16);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    background: var(--surface);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

/* Header — orange gradient */
.data-table thead tr { background: transparent; }
.data-table th {
    padding: 0.65rem 1.1rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent-dark);
    background: linear-gradient(90deg, rgba(249,115,22,0.09), rgba(251,191,36,0.05));
    border-bottom: 2px solid rgba(249,115,22,0.18);
    text-align: left;
    white-space: nowrap;
}
.data-table th.num { text-align: right; }

/* Rows */
.data-table tbody tr {
    transition: background-color .14s ease;
    animation: rowIn .25s ease both;
}
/* Stagger rows */
.data-table tbody tr:nth-child(1)  { animation-delay: .02s; }
.data-table tbody tr:nth-child(2)  { animation-delay: .05s; }
.data-table tbody tr:nth-child(3)  { animation-delay: .08s; }
.data-table tbody tr:nth-child(4)  { animation-delay: .11s; }
.data-table tbody tr:nth-child(5)  { animation-delay: .14s; }
.data-table tbody tr:nth-child(6)  { animation-delay: .17s; }
.data-table tbody tr:nth-child(7)  { animation-delay: .20s; }
.data-table tbody tr:nth-child(8)  { animation-delay: .23s; }
.data-table tbody tr:nth-child(9)  { animation-delay: .26s; }
.data-table tbody tr:nth-child(10) { animation-delay: .29s; }

.data-table tbody tr:nth-child(odd)  { background: rgba(255,255,255,0.60); }
.data-table tbody tr:nth-child(even) { background: rgba(249,115,22,0.04); }

.data-table td {
    padding: 0.72rem 1.1rem;
    border: none;
    border-bottom: 1px solid rgba(249,115,22,0.08);
    vertical-align: middle;
    color: var(--text);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(249,115,22,0.07) !important; }

/* Row status overrides */
.data-table tbody tr.row-danger  td { background: rgba(239,68,68,0.08)  !important; }
.data-table tbody tr.row-warning td { background: rgba(245,158,11,0.08) !important; }
.data-table tbody tr.row-danger:hover  td { background: rgba(239,68,68,0.14)  !important; }
.data-table tbody tr.row-warning:hover td { background: rgba(245,158,11,0.14) !important; }

/* ══════════════════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════════════════ */
.badge {
    display: inline-block;
    padding: 0.25em 0.72em;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .03em;
    transition: transform .15s;
}
.badge:hover { transform: scale(1.06); }
.badge-success   { background: #dcfce7; color: #15803d; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-info      { background: #dbeafe; color: #1e40af; }
.badge-primary   { background: rgba(249,115,22,0.12); color: var(--accent-dark); }
.badge-secondary { background: rgba(120,113,108,0.10); color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════════════════
   DASHBOARD — stat cards + quick actions
   ══════════════════════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-md);
    animation: popIn .42s cubic-bezier(.34,1.56,.64,1) both;
    transition: box-shadow .22s ease, transform .22s ease;
    position: relative;
    overflow: hidden;
    cursor: default;
}
/* Shimmer sweep */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(249,115,22,0.09), transparent);
    transition: left .5s ease;
    pointer-events: none;
}
.stat-card:hover::before { left: 140%; }
.stat-card:hover { box-shadow: var(--shadow-glow); transform: translateY(-4px); }

/* Pop-in stagger */
.stat-card:nth-child(1) { animation-delay: .05s; }
.stat-card:nth-child(2) { animation-delay: .12s; }
.stat-card:nth-child(3) { animation-delay: .19s; }
.stat-card:nth-child(4) { animation-delay: .26s; }
.stat-card:nth-child(5) { animation-delay: .33s; }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 6px 18px rgba(15,23,42,0.20);
    transition: transform .22s ease, box-shadow .22s ease;
}
.stat-card:hover .stat-icon {
    transform: scale(1.12) rotate(-4deg);
    box-shadow: 0 8px 22px rgba(15,23,42,0.28);
}
.stat-icon.blue   { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.stat-icon.green  { background: linear-gradient(135deg, #4ade80, #16a34a); }
.stat-icon.yellow { background: linear-gradient(135deg, var(--accent-light), var(--accent-dark)); }
.stat-icon.red    { background: linear-gradient(135deg, #f87171, #dc2626); }
.stat-icon.orange { background: linear-gradient(135deg, var(--accent-light), var(--accent)); }
.stat-icon.indigo { background: linear-gradient(135deg, #818cf8, #6366f1); }

.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-top: 3px; font-weight: 500; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

.section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.section-heading {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin: 20px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.qa-card {
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    transition: border-color .18s, box-shadow .18s, transform .18s;
    min-width: 110px;
    animation: popIn .4s ease both;
}
.qa-card i { font-size: 22px; color: var(--accent); transition: transform .22s; }
.qa-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
    color: var(--text);
}
.qa-card:hover i { transform: scale(1.18) rotate(-6deg); animation: iconBounce .45s ease; }

/* ══════════════════════════════════════════════════════════════════════════
   PANEL (glassmorphic card with header bar)
   ══════════════════════════════════════════════════════════════════════════ */
.panel {
    background: var(--surface);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    animation: fadeInUp .4s ease both .08s;
    transition: box-shadow .22s;
}
.panel:hover { box-shadow: 0 12px 36px rgba(124,45,18,0.16); }
.panel-header {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid rgba(249,115,22,0.14);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, var(--accent-tint), rgba(251,191,36,0.05));
    position: relative;
}
.panel-header::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--accent-light), var(--accent-dark));
}
.panel-body { padding: 0; overflow-x: auto; }
.panel .panel-body > form { padding: 1.5rem; }

/* ══════════════════════════════════════════════════════════════════════════
   TOOLBARS / FILTER BAR / PAGE ACTIONS
   ══════════════════════════════════════════════════════════════════════════ */
.page-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}
.page-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
    gap: 10px;
}
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}
.filter-bar .form-group { margin-bottom: 0; min-width: 160px; }

/* ══════════════════════════════════════════════════════════════════════════
   TABLE TOOLBAR (search + export)
   ══════════════════════════════════════════════════════════════════════════ */
.tbl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.tbl-search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 320px;
    height: 34px;
    padding: 0 10px;
    background: rgba(255,255,255,0.85);
    border: 1px solid var(--border-solid);
    border-radius: 6px;
    transition: border-color .18s, box-shadow .18s;
}
.tbl-search-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}
.tbl-search-icon { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.tbl-search-input {
    border: none; outline: none;
    background: transparent;
    font-size: 13px; color: var(--text);
    width: 100%; min-width: 0;
}
.tbl-search-input::placeholder { color: var(--text-muted); }
.tbl-search-clear {
    display: none;
    align-items: center; justify-content: center;
    background: none; border: none;
    cursor: pointer; color: var(--text-muted);
    padding: 0; font-size: 15px; line-height: 1; flex-shrink: 0;
}
.tbl-search-clear:hover { color: var(--danger); }

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    height: 32px;
    background: rgba(255,255,255,0.80);
    border: 1px solid var(--border-solid);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}
.btn-export:hover {
    background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
    color: #fff;
    border-color: var(--accent-dark);
    box-shadow: 0 3px 10px var(--accent-glow);
}

/* ── Pagination ─────────────────────────────────────────────────────────── */
.tbl-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 2px;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 38px;
}
.pager-info { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pager-buttons { display: flex; gap: 3px; flex-wrap: wrap; }
.pager-btn {
    min-width: 32px; height: 30px;
    padding: 0 7px;
    background: rgba(255,255,255,0.80);
    border: 1px solid var(--border-solid);
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text);
    transition: all .14s;
    display: inline-flex; align-items: center; justify-content: center;
}
.pager-btn:hover:not(:disabled) {
    background: var(--accent-tint2);
    color: var(--accent-dark);
    border-color: var(--accent-light);
    transform: scale(1.06);
}
.pager-btn-active, .pager-btn.pager-btn-active {
    background: linear-gradient(135deg, var(--accent-light), var(--accent-dark)) !important;
    color: #fff !important;
    border-color: var(--accent-dark) !important;
    font-weight: 700;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.pager-btn:disabled { opacity: .32; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════════════════
   SETTINGS TABS
   ══════════════════════════════════════════════════════════════════════════ */
.settings-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}
.settings-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .18s, border-color .18s;
    white-space: nowrap;
}
.settings-tab:hover  { color: var(--accent); }
.settings-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }

/* ══════════════════════════════════════════════════════════════════════════
   POS TERMINAL
   ══════════════════════════════════════════════════════════════════════════ */
.pos-main { overflow: hidden; }

.pos-body {
    display: flex;
    flex: 1;
    height: calc(100vh - var(--topbar-h));
    overflow: hidden;
}

.pos-products-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
    padding: 16px;
    gap: 12px;
    position: relative; /* anchor for scan toast */
}

.pos-search-bar {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.80);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius);
    padding: 8px 12px;
    gap: 8px;
    font-size: 16px;
    color: var(--text-muted);
    transition: border-color .18s, box-shadow .18s;
}
.pos-search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}
.pos-search-bar input {
    flex: 1; border: none; outline: none;
    font-size: 14px; color: var(--text); background: none;
}

.pos-product-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    align-content: start;
    padding-bottom: 8px;
}

.pos-loading {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.product-card {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 14px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color .18s, box-shadow .18s, transform .14s;
    user-select: none;
    animation: popIn .35s cubic-bezier(.34,1.56,.64,1) both;
}
.product-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}
.product-card:active { transform: scale(.96); }
.product-card.out-of-stock { opacity: .48; cursor: not-allowed; }
.product-card-icon { font-size: 22px; margin-bottom: 4px; }
.product-card-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.product-card-price {
    font-size: 14px; font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.product-card-stock { font-size: 11px; color: var(--text-muted); }

/* Cart pane */
.pos-cart-pane {
    width: 340px;
    flex-shrink: 0;
    background: rgba(255,248,240,0.80);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border-left: 1px solid rgba(249,115,22,0.18);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.cart-header {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid rgba(249,115,22,0.18);
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(90deg, var(--accent-tint), transparent);
}
.cart-header i { color: var(--accent); }
.btn-clear-cart {
    margin-left: auto;
    background: none; border: none;
    cursor: pointer; color: var(--text-muted);
    font-size: 15px; padding: 2px 6px;
    border-radius: 4px;
    transition: color .15s, background .15s;
}
.btn-clear-cart:hover { color: var(--danger); background: rgba(239,68,68,0.08); }

.cart-customer {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(249,115,22,0.12);
}
.cart-customer label {
    font-size: 11px; text-transform: uppercase;
    letter-spacing: .04em; color: var(--text-muted);
    display: block; margin-bottom: 4px;
}

/* ── Customer search widget ─────────────────────────────── */
.cs-wrap { position: relative; }

.cs-field {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-solid);
    border-radius: 7px;
    background: rgba(255,255,255,0.88);
    transition: border-color .15s, box-shadow .15s;
    overflow: hidden;
}
.cs-wrap:focus-within .cs-field,
.cs-wrap.cs-has-value  .cs-field {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.10);
}

.cs-search-icon {
    flex-shrink: 0;
    padding: 0 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.cs-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 8px 4px 8px 0;
    font-size: 13px;
    color: var(--text);
    min-width: 0;
}
.cs-input::placeholder { color: var(--text-faint); }

.cs-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 100%;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    padding: 0;
    transition: color .15s;
}
.cs-clear:hover { color: var(--danger); }

/* Dropdown list */
.cs-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--surface-solid);
    border: 1px solid var(--border-solid);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    max-height: 220px;
    overflow-y: auto;
    z-index: 200;
    animation: fadeInUp .14s ease both;
}

.cs-option {
    padding: 9px 12px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,.04);
    transition: background .1s;
    line-height: 1.35;
}
.cs-option:last-child { border-bottom: none; }
.cs-option:hover,
.cs-option.cs-active  { background: var(--accent-tint); color: var(--accent-dark); }

.cs-walk-in {
    color: var(--text-muted);
    font-style: italic;
    font-size: 12.5px;
}

.cs-option mark {
    background: rgba(249,115,22,0.22);
    color: var(--accent-dark);
    font-weight: 600;
    border-radius: 2px;
    padding: 0 1px;
}

.cs-no-result {
    padding: 12px;
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

.cart-items {
    max-height: calc(100vh - var(--topbar-h, 58px) - 370px);
    min-height: 60px;
    overflow-y: auto;
    padding: 8px 0;
}
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 8px;
    font-size: 13px;
    min-height: 80px;
    padding: 16px 0;
}
.cart-empty i { font-size: 28px; color: var(--text-faint); }

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(249,115,22,0.08);
    animation: cartItemIn .22s ease both;
}
.ci-name { flex: 1; font-size: 13px; font-weight: 500; }
.ci-price { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ci-qty-ctrl { display: flex; align-items: center; gap: 4px; }
.ci-qty-btn {
    width: 22px; height: 22px;
    border: 1px solid var(--border-solid);
    border-radius: 4px; background: none;
    cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.ci-qty-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.ci-qty { font-size: 13px; font-weight: 600; min-width: 20px; text-align: center; }
.ci-total { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }
.ci-remove { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 14px; transition: color .15s; }
.ci-remove:hover { color: var(--danger); }

.cart-totals {
    padding: 10px 14px;
    border-top: 1px solid rgba(249,115,22,0.12);
}
.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 0;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.total-row {
    font-size: 16px; font-weight: 700;
    color: var(--text);
    margin-top: 4px;
    padding-top: 6px;
    border-top: 2px solid rgba(249,115,22,0.18);
}

.cart-payment {
    padding: 12px 14px;
    border-top: 1px solid rgba(249,115,22,0.12);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.payment-methods { display: flex; gap: 6px; }
.pm-btn {
    flex: 1; padding: 7px 4px;
    border: 1px solid var(--border-solid);
    border-radius: 6px; background: rgba(255,255,255,0.75);
    cursor: pointer; font-size: 12px;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--text-muted);
    transition: all .18s;
}
.pm-btn i { font-size: 16px; }
.pm-btn.active { border-color: var(--accent); background: var(--accent-tint2); color: var(--accent-dark); box-shadow: 0 2px 8px var(--accent-glow); }
.pm-btn:hover  { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-tint); }

.cash-input label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); display: block; margin-bottom: 4px; }
.cash-input input {
    width: 100%; padding: 8px 10px;
    border: 1px solid var(--border-solid);
    border-radius: 6px;
    font-size: 15px; font-weight: 600;
    font-variant-numeric: tabular-nums;
    background: rgba(255,255,255,0.85);
    transition: border-color .15s;
}
.cash-input input:focus { border-color: var(--accent); outline: none; }

.change-due {
    background: linear-gradient(90deg, rgba(22,163,74,0.10), rgba(22,163,74,0.05));
    border: 1px solid rgba(22,163,74,0.25);
    color: #15803d;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
}

.btn-checkout {
    background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: var(--radius);
    font-size: 15px; font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px var(--accent-glow);
    transition: box-shadow .18s, transform .12s;
}
.btn-checkout:hover:not(:disabled) {
    box-shadow: 0 6px 22px rgba(249,115,22,0.44);
    transform: translateY(-1px);
}
.btn-checkout:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn-checkout:disabled { opacity: .45; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════════════════
   RECEIPT MODAL
   ══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28,14,5,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    animation: loader-fade-in .18s ease both;
}
.receipt-modal {
    background: var(--surface-solid);
    border-radius: var(--radius-lg);
    max-width: 420px; width: 100%;
    max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 64px rgba(124,45,18,0.30);
    overflow: hidden;
    animation: loader-card-in .22s ease both;
}
.receipt-header { text-align: center; margin-bottom: 16px; }
.receipt-header i { font-size: 32px; color: var(--accent); }
.receipt-header h3 { font-size: 16px; margin: 4px 0 2px; }
.receipt-header p  { font-size: 12px; color: var(--text-muted); }
.receipt-body {
    padding: 20px 20px 0;
    font-size: 13px;
    overflow-y: auto;
    flex: 1; min-height: 0;
}
.receipt-row { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.receipt-total-row { font-weight: 700; font-size: 15px; margin-top: 6px; border-top: 1px solid var(--border-solid); padding-top: 8px; }
.receipt-actions {
    display: flex; gap: 10px;
    flex-shrink: 0;
    padding: 14px 20px;
    border-top: 1px solid var(--border-solid);
    background: var(--surface-solid);
}
.receipt-actions button, .receipt-actions a { flex: 1; justify-content: center; }

/* Full receipt layout */
.rcp-company { text-align: center; padding-bottom: 8px; }
.rcp-company-name { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.rcp-company-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.rcp-hr { border: none; border-top: 1px dashed rgba(249,115,22,0.25); margin: 8px 0; }
.rcp-row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rcp-items { width: 100%; border-collapse: collapse; font-size: 12px; margin: 4px 0; }
.rcp-items th { text-align: left; font-weight: 600; padding: 2px 0 4px; border-bottom: 1px solid var(--border-solid); }
.rcp-items td { padding: 3px 0; vertical-align: top; }
.rcp-r { text-align: right !important; }
.rcp-totals { margin-top: 4px; }
.rcp-grand { font-size: 14px; font-weight: 700; border-top: 1px solid var(--border-solid); padding-top: 6px; margin-top: 4px; }
.rcp-efris { text-align: center; padding: 4px 0; }
.rcp-efris-title { font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.rcp-efris-detail { display: flex; justify-content: space-between; font-size: 11px; padding: 2px 0; }
.rcp-efris-msg { font-size: 10px; color: var(--text-muted); margin-top: 4px; font-style: italic; }
.rcp-efris-status { font-size: 11px; color: var(--text-muted); text-align: center; padding: 4px; }
.rcp-footer { text-align: center; font-size: 11px; color: var(--text-muted); padding: 8px 0 2px; font-style: italic; }

/* ══════════════════════════════════════════════════════════════════════════
   BARCODE SCANNER FEEDBACK
   ══════════════════════════════════════════════════════════════════════════ */
@keyframes scanToastIn {
    from { opacity: 0; transform: translateY(-12px) scale(.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes scanFlash {
    0%   { box-shadow: 0 0 0 0 rgba(22,163,74,0); transform: scale(1); }
    30%  { box-shadow: 0 0 0 6px rgba(22,163,74,0.45); transform: scale(1.04); }
    70%  { box-shadow: 0 0 0 10px rgba(22,163,74,0.15); transform: scale(1.01); }
    100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); transform: scale(1); }
}

/* Toast — shown inside .pos-products-pane; invisible by default */
.scan-toast {
    display: none;
    position: absolute;
    top: 14px; left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: var(--shadow-md);
}
.scan-toast-success {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(22,163,74,0.92), rgba(16,122,56,0.95));
    color: #fff;
    animation: scanToastIn .22s ease both;
}
.scan-toast-error {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(220,38,38,0.92), rgba(185,28,28,0.95));
    color: #fff;
    animation: scanToastIn .22s ease both;
}
/* Product card flash on successful scan */
.product-card.scan-flash {
    animation: scanFlash .7s ease forwards;
    border-color: #16a34a !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════════════════ */
.actions        { display: flex; gap: 6px; align-items: center; }
.actions-cell   { white-space: nowrap; text-align: right; }
.num            { font-variant-numeric: tabular-nums; text-align: right; }
.text-center    { text-align: center; }
.text-muted     { color: var(--text-muted); }
.text-danger    { color: var(--danger); }
.d-block        { display: block; }

.receipt-meta   { margin-bottom: 12px; font-size: 13.5px; }
.receipt-totals { margin-top: 4px; font-size: 13.5px; }

/* Global scrollbar — slim orange tint */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(249,115,22,0.28); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(249,115,22,0.50); }

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
        z-index: 110;
    }
    #sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}
@media (max-width: 768px) {
    .page-content { padding: 1rem; }
    .form-row { flex-direction: column; gap: 0; }
    .pos-cart-pane { width: 100%; }
}
@media (max-width: 575.98px) {
    .topbar { padding: 0 1rem; }
    .stat-value { font-size: 1.4rem; }
    .stat-card  { padding: 1rem; }
    .form-card  { padding: 1.1rem; }
}

/* ══════════════════════════════════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════════════════════════════════ */
@media print {

    /* ── Chrome always hidden on every page ─────────────────────────────── */
    #sidebar,
    .topbar,
    .license-banner,
    .sidebar-toggle-btn  { display: none !important; }
    .main-content        { margin-left: 0 !important; }
    .page-content        { padding: 6px !important; }

    /* ── POS receipt modal open (style contains "flex") ─────────────────── *
     * Scope the aggressive hide ONLY to the POS terminal while the receipt  *
     * modal is visible. All other pages keep .main-content visible so they  *
     * print their normal content (sales view popup, invoice A4 styles, …).  */
    body:has(.modal-overlay[style*="flex"]) > *:not(.modal-overlay) {
        display: none !important;
    }
    .modal-overlay[style*="flex"] {
        display: flex !important;
        position: static !important;
        background: none !important;
        backdrop-filter: none !important;
        overflow: visible !important;
        padding: 0 !important;
        animation: none !important;
    }
    .receipt-modal {
        box-shadow: none !important; border: none !important;
        max-width: 80mm !important; max-height: none !important;
        overflow: visible !important; display: block !important;
        padding: 0 !important; margin: 0 auto !important;
        animation: none !important;
    }
    .receipt-body    { overflow: visible !important; padding: 4px !important; }
    .receipt-actions { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   LICENSE BANNERS
   Shown by layout.html when the license is blocked or advisory-warning.
   ══════════════════════════════════════════════════════════════════════════ */
.license-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    border-bottom: 1px solid transparent;
    animation: fadeInUp .35s ease both;
}
.license-banner i { font-size: 16px; flex-shrink: 0; }
.license-banner span { flex: 1; }
.license-banner-link {
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    padding: 3px 10px;
    border-radius: 5px;
    flex-shrink: 0;
    transition: background .15s;
}

/* Block banner — license invalid */
.license-banner-block {
    background: rgba(239,68,68,0.10);
    color: #991b1b;
    border-color: rgba(239,68,68,0.25);
}
.license-banner-block i { color: #DC2626; }
.license-banner-block .license-banner-link {
    background: rgba(239,68,68,0.15);
    color: #991b1b;
}
.license-banner-block .license-banner-link:hover { background: rgba(239,68,68,0.25); }

/* Advisory banner — valid but expiring / offline grace */
.license-banner-warn {
    background: rgba(245,158,11,0.10);
    color: #92400e;
    border-color: rgba(245,158,11,0.28);
}
.license-banner-warn i { color: #D97706; }
.license-banner-warn .license-banner-link {
    background: rgba(245,158,11,0.15);
    color: #92400e;
}
.license-banner-warn .license-banner-link:hover { background: rgba(245,158,11,0.28); }

/* ══════════════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration:       0.01ms !important;
        animation-iteration-count: 1     !important;
        transition-duration:      0.01ms !important;
    }
}
