﻿:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --sidebar: #0f172a;
    --sidebar-soft: #16233b;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-soft: #d1fae5;
    --accent: #0ea5e9;
    --danger: #ef4444;
    --danger-soft: #fee2e2;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --info: #3b82f6;
    --info-soft: #dbeafe;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
    --sidebar-width: 252px;
}

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

html, body { height: 100%; }

body {
    font-family: "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; }
img { max-width: 100%; }

html { scrollbar-gutter: stable; }
* { scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, .32) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .32); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, .5); background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }

.app-shell { min-height: 100vh; }

/* ------------------------------------------------------------------ */
/* Sidebar                                                             */
/* ------------------------------------------------------------------ */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--sidebar);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    z-index: 60;
    transition: transform .25s ease, width .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, .15);
}

.sidebar-brand .brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    color: #fff;
    font-size: 18px;
    flex: 0 0 auto;
}

.sidebar-brand strong {
    display: block;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.sidebar-brand span {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-top: 2px;
}
.sidebar-brand > div > span { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark.has-logo, .shop-logo-mark.has-logo { background: #fff; padding: 3px; overflow: hidden; }
.brand-mark.has-logo img, .shop-logo-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; display: block; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .22) transparent;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .38); border-radius: 999px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, .58); }

.nav-group { margin-bottom: 18px; }

.nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #64748b;
    padding: 0 10px;
    margin-bottom: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border-radius: 10px;
    color: #cbd5e1;
    font-weight: 500;
    font-size: 13.5px;
    transition: background .15s, color .15s;
    position: relative;
}

.nav-link:hover { background: rgba(148, 163, 184, .1); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--primary); color: #06281d; font-weight: 600; }
.nav-link i { width: 18px; text-align: center; font-size: 14px; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 999px; display: inline-grid; place-items: center; padding: 0 5px; }
.nav-link.active .nav-badge { background: #06281d; color: #fff; }

.sidebar-foot {
    display: flex;
    justify-content: space-between;
    padding: 14px 18px;
    font-size: 11px;
    color: #64748b;
    border-top: 1px solid rgba(148, 163, 184, .15);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 55;
}

@media (min-width: 901px) {
    html.sidebar-collapsed .sidebar { width: 78px; }
    html.sidebar-collapsed .main-area { margin-left: 78px; }
    html.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 18px 0; }
    html.sidebar-collapsed .sidebar-brand > div { display: none; }
    html.sidebar-collapsed .sidebar-nav { padding: 14px 10px; }
    html.sidebar-collapsed .nav-label { display: none; }
    html.sidebar-collapsed .nav-group { margin-bottom: 10px; }
    html.sidebar-collapsed .nav-link { justify-content: center; gap: 0; padding: 11px 0; }
    html.sidebar-collapsed .nav-link > span:not(.nav-badge) { display: none; }
    html.sidebar-collapsed .nav-link i { width: auto; font-size: 15px; }
    html.sidebar-collapsed .nav-badge {
        position: absolute;
        top: 5px;
        right: 9px;
        min-width: 8px;
        height: 8px;
        padding: 0;
        border: 2px solid var(--sidebar);
        font-size: 0;
    }
    html.sidebar-collapsed .sidebar-foot { display: none; }
    html.sidebar-collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }
}

/* ------------------------------------------------------------------ */
/* Main / topbar                                                       */
/* ------------------------------------------------------------------ */

.main-area {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease;
}

.topbar {
    height: 58px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar h1 { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-left p { font-size: 11px; color: var(--muted); margin-top: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-sale { padding: 8px 12px; }

.icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    font-size: 13px;
    transition: .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-soft); text-decoration: none; }
#sidebarToggle { display: none; }
.sidebar-collapse-btn { display: inline-grid; }

.user-chip { display: flex; align-items: center; gap: 7px; padding-left: 0; }
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
}
.user-meta strong { display: block; font-size: 12px; }
.user-meta span { display: block; font-size: 10px; color: var(--muted); }

.content { padding: 26px; flex: 1; }
.content > *:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    transition: .15s;
    white-space: nowrap;
    text-decoration: none;
    background: var(--surface);
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #043025; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--sidebar); color: #fff; }
.btn-secondary:hover { background: #1e293b; color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-outline:hover { border-color: #cbd5e1; background: var(--surface-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-warning { background: var(--warning); color: #3b2500; }
.btn-warning:hover { background: #d97706; color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-soft); color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 14px 20px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: 7px 9px; }

/* ------------------------------------------------------------------ */
/* Cards / page head                                                   */
/* ------------------------------------------------------------------ */

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.page-head h2 { font-size: 22px; font-weight: 700; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 4px; max-width: 640px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
    overflow: hidden;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-soft); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }

/* ------------------------------------------------------------------ */
/* Alerts                                                              */
/* ------------------------------------------------------------------ */

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 11px;
    margin-bottom: 18px;
    font-size: 13.5px;
    border: 1px solid transparent;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-close { margin-left: auto; background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* ------------------------------------------------------------------ */
/* Forms                                                               */
/* ------------------------------------------------------------------ */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 6px; color: #334155; }
label .req { color: var(--danger); }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.checkbox-label { display: flex; align-items: center; gap: 9px; font-weight: 500; margin: 0; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--primary); }
.toggle-switch { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; cursor: pointer; margin: 0; }
.toggle-switch input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-switch-track { width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .2s; flex: none; }
.toggle-switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.25); transition: transform .2s; }
.toggle-switch input:checked + .toggle-switch-track { background: var(--primary); }
.toggle-switch input:checked + .toggle-switch-track .toggle-switch-thumb { transform: translateX(18px); }
.toggle-switch input:focus-visible + .toggle-switch-track { box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.branding-upload { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-soft); }
.branding-preview { width: 88px; height: 88px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 24px; flex: none; }
.branding-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.branding-fields { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.slide-editor { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; }
.slide-editor summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.slide-editor summary::-webkit-details-marker { display: none; }
.slide-editor[open] summary { border-bottom: 1px solid var(--line); }
.slide-editor-thumb { width: 56px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--surface-soft); display: grid; place-items: center; color: var(--muted); flex: none; }
.slide-editor-thumb img { width: 100%; height: 100%; object-fit: cover; }
.slide-editor-title { flex: 1; min-width: 0; }
.slide-editor-title strong { display: block; font-size: 12.5px; }
.slide-editor-title small { display: block; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-editor-body { padding: 0 12px 12px; }
.slide-editor-body .form-grid { margin-top: 12px; }
.error-text { font-size: 12px; color: var(--danger); margin-top: 5px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="datetime-local"], input[type="search"], input[type="tel"],
select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .15);
}
textarea { min-height: 88px; resize: vertical; }
select { cursor: pointer; }

.check-row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #334155; }
.check-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

input[type="file"] { font-size: 12.5px; color: var(--muted); }
.image-preview { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.image-preview img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.gallery-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.gallery-admin-item { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.gallery-admin-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.gallery-admin-item .check-row { font-size: 11.5px; }

.search-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search-form input[type="search"] { min-width: 220px; flex: 1; max-width: 360px; }

.filter-bar {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 20px;
}
.filter-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.filter-field label { margin: 0; font-size: 11px; font-weight: 600; color: var(--muted); }
.filter-field input,
.filter-field select { width: 100%; max-width: none; }
.filter-actions { display: flex; align-items: center; gap: 8px; }
.table-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; padding: 16px 20px 20px; }
.page-link { min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #475569; background: #fff; }
.page-link:hover { border-color: var(--primary); color: var(--primary-dark); text-decoration: none; }
.page-link.active { background: var(--sidebar); border-color: var(--sidebar); color: #fff; }
.page-gap { min-width: 24px; height: 34px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }

@media (max-width: 800px) {
    .filter-bar { grid-template-columns: 1fr; }
}
.movement-filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(160px, 1fr) minmax(135px, .85fr) minmax(135px, .85fr) auto;
    gap: 10px;
    align-items: end;
}
.movement-filter-form .filter-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.movement-filter-form .filter-field label { margin: 0; font-size: 11px; font-weight: 600; color: var(--muted); }
.movement-filter-form input,
.movement-filter-form select { width: 100%; max-width: none; }
.movement-filter-form .filter-actions { display: flex; align-items: center; gap: 8px; }
@media (max-width: 1280px) {
    .filter-bar {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 20px;
}
.filter-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.filter-field label { margin: 0; font-size: 11px; font-weight: 600; color: var(--muted); }
.filter-field input,
.filter-field select { width: 100%; max-width: none; }
.filter-actions { display: flex; align-items: center; gap: 8px; }
.table-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; padding: 16px 20px 20px; }
.page-link { min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #475569; background: #fff; }
.page-link:hover { border-color: var(--primary); color: var(--primary-dark); text-decoration: none; }
.page-link.active { background: var(--sidebar); border-color: var(--sidebar); color: #fff; }
.page-gap { min-width: 24px; height: 34px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }

@media (max-width: 800px) {
    .filter-bar { grid-template-columns: 1fr; }
}
.movement-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .filter-bar {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 20px;
}
.filter-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.filter-field label { margin: 0; font-size: 11px; font-weight: 600; color: var(--muted); }
.filter-field input,
.filter-field select { width: 100%; max-width: none; }
.filter-actions { display: flex; align-items: center; gap: 8px; }
.table-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; padding: 16px 20px 20px; }
.page-link { min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #475569; background: #fff; }
.page-link:hover { border-color: var(--primary); color: var(--primary-dark); text-decoration: none; }
.page-link.active { background: var(--sidebar); border-color: var(--sidebar); color: #fff; }
.page-gap { min-width: 24px; height: 34px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }

@media (max-width: 800px) {
    .filter-bar { grid-template-columns: 1fr; }
}
.movement-filter-form { grid-template-columns: 1fr; }
    .movement-filter-form .filter-actions { justify-content: flex-start; }
}
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .form-group { margin-bottom: 0; }

.input-icon { position: relative; }
.input-icon i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.input-icon input { padding-left: 34px; }

/* ------------------------------------------------------------------ */
/* Tables                                                              */
/* ------------------------------------------------------------------ */

.table-wrap { overflow-x: auto; scrollbar-gutter: stable; }
.pos-grid, .pos-cart, .cart-items, .dialog-backdrop { scrollbar-gutter: stable; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.subcategory-row td { background: #fbfdff; }
.subcategory-row td:first-child { padding-left: 38px; }
.subcategory-icon { color: var(--primary); margin-right: 4px; font-size: 11px; }
.table th { background: var(--surface-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; }
.table .strong { font-weight: 600; }
.table .muted { color: var(--muted); }
.table tfoot td { font-weight: 700; background: var(--surface-soft); border-top: 2px solid var(--line); }
.table-sm th, .table-sm td { padding: 9px 12px; }

.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-state i { font-size: 30px; color: #cbd5e1; margin-bottom: 12px; display: block; }
.empty-state h3 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty-state p { font-size: 13px; }

/* ------------------------------------------------------------------ */
/* Badges                                                              */
/* ------------------------------------------------------------------ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
    white-space: nowrap;
}
.badge-success { background: var(--primary-soft); color: #047857; }
.badge-warning { background: var(--warning-soft); color: #92400e; }
.badge-danger { background: var(--danger-soft); color: #b91c1c; }
.badge-info { background: var(--info-soft); color: #1d4ed8; }
.badge-neutral { background: #f1f5f9; color: #475569; }
.badge-dark { background: #e2e8f0; color: #0f172a; }

/* ------------------------------------------------------------------ */
/* Stats / dashboard                                                   */
/* ------------------------------------------------------------------ */

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 17px;
    flex: 0 0 auto;
    background: var(--primary-soft);
    color: var(--primary-dark);
}
.stat-icon.blue { background: var(--info-soft); color: #1d4ed8; }
.stat-icon.amber { background: var(--warning-soft); color: #b45309; }
.stat-icon.red { background: var(--danger-soft); color: #b91c1c; }
.stat-icon.violet { background: #ede9fe; color: #6d28d9; }
.stat-meta span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat-meta strong { display: block; font-size: 24px; font-weight: 700; margin-top: 3px; letter-spacing: -.5px; }
.stat-meta small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.chart-bars { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding-top: 12px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.chart-bar {
    width: 100%;
    max-width: 44px;
    background: linear-gradient(180deg, #34d399, var(--primary));
    border-radius: 7px 7px 3px 3px;
    min-height: 4px;
    position: relative;
    transition: opacity .15s;
}
.chart-bar:hover { opacity: .8; }
.chart-bar-wrap small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.chart-bar-wrap .bar-value { font-size: 10px; color: var(--muted); font-weight: 600; }

.list { list-style: none; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .grow span { font-size: 11.5px; color: var(--muted); }
.list-item .value { font-weight: 700; font-size: 13px; white-space: nowrap; }

.rank-badge {
    width: 26px; height: 26px; border-radius: 8px; background: var(--surface-soft);
    display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); flex: 0 0 auto;
}
.rank-badge.top { background: var(--primary-soft); color: var(--primary-dark); }

.progress { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }

/* ------------------------------------------------------------------ */
/* Dashboard                                                           */
/* ------------------------------------------------------------------ */

.dash-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
    gap: 24px;
    align-items: center;
    margin-bottom: 18px;
    padding: 28px 30px;
    border-radius: 20px;
    background:
        radial-gradient(600px 300px at 90% 5%, rgba(16, 185, 129, .3), transparent 65%),
        radial-gradient(520px 280px at 5% 100%, rgba(14, 165, 233, .22), transparent 62%),
        linear-gradient(135deg, #0b1220, #12233d);
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .14);
}
.dash-hero::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -110px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 44px solid rgba(255, 255, 255, .04);
    pointer-events: none;
}
.dash-hero-copy, .dash-hero-panel { position: relative; z-index: 1; }
.dash-hero-eyebrow { display: inline-flex; align-items: center; gap: 7px; color: #a7f3d0; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; margin-bottom: 10px; }
.dash-hero h2 { font-size: 30px; letter-spacing: -.9px; line-height: 1.15; }
.dash-hero p { color: #cbd5e1; font-size: 13.5px; margin-top: 8px; max-width: 620px; }
.dash-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.dash-hero-actions .btn-outline { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.dash-hero-actions .btn-outline:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.55); }
.dash-hero-notes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.dash-hero-notes a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.08); color: #e2e8f0; font-size: 11px; }
.dash-hero-notes a:hover { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.dash-hero-panel { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 20px; backdrop-filter: blur(10px); }
.dash-hero-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #cbd5e1; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.dash-trend { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.dash-trend.up { background: rgba(16, 185, 129, .18); color: #a7f3d0; }
.dash-trend.down { background: rgba(239, 68, 68, .18); color: #fecaca; }
.dash-hero-value { display: block; font-size: 34px; letter-spacing: -1px; margin-top: 8px; line-height: 1; }
.dash-hero-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.dash-hero-mini span { display: block; font-size: 9.5px; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.dash-hero-mini strong { display: block; font-size: 12.5px; margin-top: 3px; white-space: nowrap; }

.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.dash-kpi { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 17px; box-shadow: 0 1px 2px rgba(15,23,42,.03); overflow: hidden; }
.dash-kpi::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--primary); }
.dash-kpi.blue::before { background: #3b82f6; }
.dash-kpi.violet::before { background: #8b5cf6; }
.dash-kpi.amber::before { background: #f59e0b; }
.dash-kpi.green::before { background: var(--primary); }
.dash-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dash-kpi-label { font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .55px; }
.dash-kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-dark); font-size: 13px; flex: none; }
.dash-kpi.blue .dash-kpi-icon { background: var(--info-soft); color: #1d4ed8; }
.dash-kpi.violet .dash-kpi-icon { background: #ede9fe; color: #6d28d9; }
.dash-kpi.amber .dash-kpi-icon { background: var(--warning-soft); color: #b45309; }
.dash-kpi-value { display: block; font-size: 25px; font-weight: 800; letter-spacing: -.6px; margin-top: 10px; }
.dash-kpi-foot { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-kpi-foot i { font-size: 10px; }

.dash-main-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; align-items: stretch; }
.dash-lower-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; align-items: stretch; }
.dash-chart { height: 220px; padding-top: 16px; border-bottom: 1px solid var(--line); background-image: linear-gradient(to bottom, #eef2f7 1px, transparent 1px); background-size: 100% 25%; }
.dash-pulse-list { display: flex; flex-direction: column; }
.dash-pulse-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dash-pulse-row:first-child { padding-top: 0; }
.dash-pulse-row:last-child { border-bottom: 0; padding-bottom: 0; }
.dash-pulse-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; flex: none; }
.dash-pulse-icon.blue { background: var(--info-soft); color: #1d4ed8; }
.dash-pulse-icon.violet { background: #ede9fe; color: #6d28d9; }
.dash-pulse-icon.amber { background: var(--warning-soft); color: #b45309; }
.dash-pulse-meta { flex: 1; min-width: 0; }
.dash-pulse-meta strong { display: block; font-size: 12.5px; }
.dash-pulse-meta small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.dash-pulse-row b { font-size: 12.5px; white-space: nowrap; }

.dash-alert-list { display: flex; flex-direction: column; }
.dash-alert-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.dash-alert-row:last-child { border-bottom: 0; }
.dash-alert-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--warning-soft); color: #b45309; font-size: 13px; flex: none; }
.dash-alert-meta { flex: 1; min-width: 0; }
.dash-alert-meta strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-alert-meta small { display: block; color: var(--muted); font-size: 10.5px; }
.dash-alert-row > .badge { margin-left: auto; }
.dash-alert-reorder { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* ------------------------------------------------------------------ */
/* Register                                                            */
/* ------------------------------------------------------------------ */

.register-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 18px; border: 1px solid #d1fae5; background: radial-gradient(420px 200px at 90% 0%, rgba(14,165,233,.1), transparent 65%), linear-gradient(135deg, #ecfdf5, #f0f9ff); margin-bottom: 18px; }
.register-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; color: var(--primary-dark); }
.register-hero h2 { font-size: 24px; letter-spacing: -.5px; margin-top: 4px; }
.register-hero p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.register-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.register-meta span { display: inline-flex; align-items: center; gap: 6px; }
.register-report { margin-bottom: 18px; }
.register-report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.register-report-item { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: var(--surface-soft); }
.register-report-item span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.register-report-item strong { display: block; font-size: 15px; margin-top: 3px; }
.register-variance { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 12.5px; font-weight: 700; }
.register-variance.positive, .register-variance-preview.positive { background: var(--primary-soft); color: var(--primary-dark); }
.register-variance.negative, .register-variance-preview.negative { background: var(--danger-soft); color: var(--danger); }
.register-variance.even, .register-variance-preview.even { background: var(--surface-soft); color: var(--text); }
.register-variance-preview { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 13px; font-weight: 700; color: var(--text); }
.register-steps { display: flex; flex-direction: column; gap: 12px; }
.register-steps > div { display: flex; align-items: flex-start; gap: 10px; }
.register-steps > div > span { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; }
.register-steps strong { display: block; font-size: 12.5px; }
.register-steps small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }

/* ------------------------------------------------------------------ */
/* POS                                                                 */
/* ------------------------------------------------------------------ */

.pos-page .content { padding: 10px 14px 14px; }
.pos-page .pos-layout { gap: 12px; }

.pos-meta-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pos-meta-bar .pill-note { padding: 4px 9px; font-size: 10.5px; }
.pos-page .pos-meta-bar { gap: 5px; margin-bottom: 6px; }
.pos-page .pos-meta-bar .pill-note { padding: 3px 7px; font-size: 10px; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 16px; align-items: start; }
.pos-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(15,23,42,.04); overflow: hidden; }
.pos-toolbar { padding: 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.pos-search { position: relative; }
.pos-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pos-search input { padding: 11px 12px 11px 38px; font-size: 14px; border-radius: 9px; }
.category-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chip {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.chip:hover { border-color: #cbd5e1; color: var(--text); }
.chip.active { background: var(--sidebar); border-color: var(--sidebar); color: #fff; }
.chip span { font-size: 10.5px; opacity: .65; margin-left: 3px; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.filters input[type="search"] { min-width: 250px; }
.card-head .filters { margin-left: auto; }

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
    padding: 16px;
    max-height: calc(100vh - 285px);
    min-height: 320px;
    overflow-y: auto;
    align-content: start;
}
.pos-product {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    text-align: left;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    transition: .12s;
    display: flex;
    flex-direction: column;
    font-family: inherit;
    color: inherit;
}
.pos-product:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(16, 185, 129, .15); transform: translateY(-1px); }
.pos-product:active { transform: translateY(0); }
.pos-thumb {
    height: 78px;
    background: linear-gradient(135deg, #ecfdf5, #e0f2fe);
    display: grid;
    place-items: center;
    color: var(--primary-dark);
    font-size: 24px;
    position: relative;
    overflow: hidden;
}
.pos-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pos-thumb .stock-pill { position: absolute; top: 7px; right: 7px; z-index: 2; }
.pos-product .info { padding: 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pos-product .info strong { font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pos-product .info small { font-size: 10.5px; color: var(--muted); }
.pos-product .info .price { margin-top: auto; padding-top: 4px; font-weight: 700; color: var(--primary-dark); font-size: 13px; }

.stock-pill { font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--muted); }

.stock-pill.low { color: #b45309; background: #fef3c7; }
.stock-pill.out { color: #b91c1c; background: #fee2e2; }

.pos-cart {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .28) transparent;
}
.pos-cart::-webkit-scrollbar { width: 6px; }
.pos-cart::-webkit-scrollbar-track { background: transparent; }
.pos-cart::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .32); border-radius: 999px; }
.pos-cart::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, .52); }
.cart-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.cart-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.cart-head .count { background: var(--primary-soft); color: var(--primary-dark); font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.cart-customer { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.cart-customer label { margin: 0; font-size: 11px; }
.cart-customer-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.customer-add-btn { border: 0; background: transparent; color: var(--primary-dark); font: inherit; font-size: 10.5px; font-weight: 700; cursor: pointer; padding: 2px 4px; display: inline-flex; align-items: center; gap: 4px; }
.customer-add-btn:hover { text-decoration: underline; }
.cart-customer select { font-size: 12.5px; padding: 8px 10px; }
.customer-search-wrap { position: relative; }
.customer-search-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.customer-search-wrap input { padding: 8px 10px 8px 28px; font-size: 12.5px; }
.customer-search-hint { color: var(--warning); font-size: 10.5px; }
.cart-items { flex: 1; overflow-y: auto; padding: 6px 16px; min-height: 120px; }
.cart-line { display: flex; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line .grow { flex: 1; min-width: 0; }
.cart-line .grow strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-line .grow small { color: var(--muted); font-size: 11px; }
.qty-control { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.qty-control button { width: 25px; height: 26px; border: 0; background: var(--surface-soft); color: var(--text); cursor: pointer; font-size: 13px; }
.qty-control button:hover { background: #e2e8f0; }
.qty-control input { width: 34px; height: 26px; border: 0; text-align: center; font-size: 12px; padding: 0; -moz-appearance: textfield; }
.qty-control input::-webkit-outer-spin-button, .qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-line .line-total { width: 64px; text-align: right; font-weight: 700; font-size: 12.5px; flex: 0 0 auto; }
.cart-line .remove { border: 0; background: none; color: #cbd5e1; cursor: pointer; font-size: 13px; padding: 3px; }
.cart-line .remove:hover { color: var(--danger); }

.cart-empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: 12.5px; }
.cart-empty i { display: block; font-size: 26px; color: #cbd5e1; margin-bottom: 10px; }

.cart-summary { border-top: 1px solid var(--line); padding: 14px 16px; background: var(--surface-soft); }
.summary-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); padding: 3px 0; }
.summary-row.discount-row { align-items: center; gap: 10px; }
.summary-row.discount-row input { width: 92px; padding: 5px 8px; font-size: 12px; text-align: right; }
.summary-row.total { font-size: 18px; font-weight: 800; color: var(--text); padding-top: 9px; margin-top: 7px; border-top: 1px dashed var(--line); }
.cart-payment { padding: 0 16px 16px; background: var(--surface-soft); }
.payment-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 11px; }
.payment-option { position: relative; }
.payment-option input { position: absolute; opacity: 0; pointer-events: none; }
.payment-option span {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 6px; border: 1px solid var(--line); border-radius: 9px;
    font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; background: var(--surface);
}
.payment-option span i { font-size: 14px; }
.payment-option input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.cashback-box { border: 1px solid #fde68a; background: #fffbeb; border-radius: 9px; padding: 10px; margin-bottom: 11px; }
.cashback-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; }
.cashback-head label { margin: 0; font-size: 11.5px; font-weight: 700; color: #92400e; }
.cashback-head span { font-size: 10px; color: #a16207; }
.cashback-controls { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.cashback-controls input { width: 100px; padding: 7px 9px; font-size: 12px; }
.cashback-quick { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; }
.cashback-quick button { flex: 1; min-width: 44px; padding: 6px 5px; border: 1px solid #fcd34d; background: #fff; border-radius: 7px; font-size: 10.5px; font-weight: 600; color: #92400e; cursor: pointer; }
.cashback-quick button:hover { background: #fef3c7; }
.quick-cash { display: flex; gap: 6px; margin-bottom: 11px; flex-wrap: wrap; }
.quick-cash button { flex: 1; min-width: 48px; padding: 6px 4px; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; font-size: 11px; font-weight: 600; cursor: pointer; color: var(--text); }
.quick-cash button:hover { border-color: var(--primary); color: var(--primary-dark); }
.cash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 11px; }
.cash-row label { margin-bottom: 4px; }
.cash-row input { padding: 8px 10px; font-size: 13px; }
.checkout-btn { width: 100%; padding: 14px; font-size: 15px; border-radius: 11px; }
.pos-shortcuts { padding: 9px 16px; font-size: 10.5px; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface); display: flex; gap: 12px; flex-wrap: wrap; }
kbd { background: var(--surface-soft); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; font-size: 10px; font-family: inherit; }

.pos-products-panel .chip { padding: 5px 10px; font-size: 11px; }
.pos-products-panel .pos-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 12px; max-height: calc(100vh - 250px); min-height: 260px; }
.pos-products-panel .pos-product { border-radius: 10px; }
.pos-products-panel .pos-thumb { height: 64px; font-size: 20px; }
.pos-products-panel .pos-product .info { padding: 8px; gap: 2px; }
.pos-products-panel .pos-product .info strong { font-size: 12px; }
.pos-products-panel .pos-product .info small { font-size: 10px; }
.pos-products-panel .pos-product .info .price { font-size: 12.5px; padding-top: 3px; }
.pos-products-panel .stock-pill { font-size: 9px; padding: 2px 5px; }

.pos-cart { max-height: calc(100vh - 140px); }
.cart-head { padding: 12px 14px; }
.cart-head h3 { font-size: 14px; }
.cart-customer { padding: 10px 14px; gap: 5px; }
.cart-items { padding: 4px 12px; min-height: 90px; }
.cart-line { padding: 9px 0; gap: 8px; }
.cart-line .grow strong { font-size: 12px; }
.cart-line .grow small { font-size: 10.5px; }
.cart-summary { padding: 12px 14px; }
.summary-row { font-size: 12px; }
.summary-row.total { font-size: 16px; }
.cart-payment { padding: 0 14px 14px; }
.payment-methods { gap: 6px; margin-bottom: 9px; }
.payment-option span { padding: 7px 4px; font-size: 10.5px; }
.cashback-box { padding: 8px; margin-bottom: 9px; }
.quick-cash { gap: 5px; margin-bottom: 9px; }
.quick-cash button { padding: 5px 3px; font-size: 10.5px; }
.cash-row { gap: 8px; margin-bottom: 9px; }
.checkout-btn { padding: 12px; font-size: 14px; }
.pos-shortcuts { padding: 8px 14px; gap: 10px; font-size: 10px; }

/* Success modal */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
    display: none; align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--surface); border-radius: 18px; box-shadow: 0 24px 60px rgba(15,23,42,.3);
    width: 100%; max-width: 440px; overflow: hidden; animation: pop .16s ease-out;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-body { padding: 26px; text-align: center; }
.modal-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; font-size: 26px; margin: 0 auto 14px; }
.modal h3 { font-size: 19px; margin-bottom: 4px; }
.modal p.sub { color: var(--muted); font-size: 13px; }
.modal .big-total { font-size: 34px; font-weight: 800; letter-spacing: -.5px; margin: 14px 0 4px; }
.modal .change-line { display: inline-flex; gap: 8px; align-items: center; background: var(--surface-soft); border-radius: 9px; padding: 7px 14px; font-size: 13px; margin-top: 8px; }
.modal .change-line strong { color: var(--primary-dark); }
.modal-foot { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.modal-foot .btn { flex: 1; }

/* ------------------------------------------------------------------ */
/* Receipt                                                             */
/* ------------------------------------------------------------------ */

.receipt-wrap { max-width: 760px; margin: 0 auto; }
.receipt {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 34px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.receipt-head { text-align: center; padding-bottom: 18px; border-bottom: 2px dashed var(--line); }
.receipt-logo { max-height: 48px; max-width: 150px; object-fit: contain; margin-bottom: 7px; }
.receipt-head h2 { font-size: 24px; letter-spacing: -.3px; }
.receipt-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.receipt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.receipt-meta div span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; }
.receipt-meta div strong { font-weight: 600; }
.receipt table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.receipt table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 8px 4px; border-bottom: 1px solid var(--line); }
.receipt table td { padding: 9px 4px; border-bottom: 1px dashed #eef2f7; }
.receipt table .num { text-align: right; }
.totals-box { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.totals-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: var(--muted); }
.totals-row strong { color: var(--text); }
.totals-row.grand { border-top: 2px solid var(--text); margin-top: 8px; padding-top: 9px; font-size: 17px; font-weight: 800; color: var(--text); }
.info-list { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.info-list div { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.info-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.info-list span { color: var(--muted); }
.info-list strong { text-align: right; }
.receipt-totals { margin-left: auto; width: 100%; max-width: 300px; }
.receipt-totals .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: var(--muted); }
.receipt-totals .row strong { color: var(--text); }
.receipt-totals .grand { border-top: 2px solid var(--text); margin-top: 8px; padding-top: 9px; font-size: 18px; font-weight: 800; color: var(--text); }
.receipt-foot { text-align: center; margin-top: 22px; padding-top: 18px; border-top: 2px dashed var(--line); color: var(--muted); font-size: 12.5px; }
.refunded-stamp {
    position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
    font-size: 64px; font-weight: 900; color: rgba(239, 68, 68, .16);
    transform: rotate(-18deg); letter-spacing: 6px; text-transform: uppercase;
}
.receipt-actions { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 18px; }

/* Modal form */
.dialog-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: none; align-items: flex-start; justify-content: center; padding: 40px 20px; z-index: 100; overflow-y: auto; }
.dialog-backdrop.open { display: flex; }
.dialog { background: var(--surface); border-radius: 16px; width: 100%; max-width: 560px; box-shadow: 0 24px 60px rgba(15,23,42,.3); }
.dialog-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.dialog-head h3 { font-size: 16px; }
.dialog-body { padding: 22px; }
.dialog-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-soft); display: flex; justify-content: flex-end; gap: 10px; border-radius: 0 0 16px 16px; }

/* ------------------------------------------------------------------ */
/* Login                                                               */
/* ------------------------------------------------------------------ */

.login-body { background: #0b1220; }
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(900px 500px at 15% 0%, rgba(16, 185, 129, .22), transparent 60%),
        radial-gradient(800px 500px at 90% 100%, rgba(14, 165, 233, .2), transparent 55%),
        #0b1220;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, .98);
    border-radius: 20px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand .brand-mark { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), #0ea5e9); color: #fff; font-size: 20px; }
.login-brand .brand-mark.has-logo { background: #fff; padding: 3px; overflow: hidden; }
.login-brand .brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; display: block; }
.login-brand strong { display: block; font-size: 17px; }
.login-brand > div > span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login-card h1 { font-size: 23px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-card .btn { width: 100%; padding: 12px; font-size: 14px; margin-top: 4px; }
.login-foot { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 22px; }
.demo-box { margin-top: 18px; padding: 12px 14px; background: var(--surface-soft); border: 1px dashed var(--line); border-radius: 10px; font-size: 11.5px; color: var(--muted); }
.demo-box strong { color: var(--text); }

/* ------------------------------------------------------------------ */
/* Profit & Loss                                                       */
/* ------------------------------------------------------------------ */

.pl-statement { font-size: 13px; }
.pl-section { margin: 16px 0 7px; padding-bottom: 5px; border-bottom: 1px solid var(--line); font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 700; }
.pl-section:first-child { margin-top: 0; }
.pl-line { display: flex; justify-content: space-between; gap: 18px; padding: 5px 0; }
.pl-line span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-line.negative span:last-child { color: var(--danger); }
.pl-line.subtotal { margin-top: 5px; padding-top: 9px; border-top: 1px dashed var(--line); font-weight: 700; }
.pl-total { display: flex; justify-content: space-between; gap: 18px; margin-top: 16px; padding: 14px 16px; border-radius: 10px; font-size: 18px; font-weight: 800; }
.pl-total.profit { background: var(--primary-soft); color: var(--primary-dark); }
.pl-total.loss { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------------------------------------------ */
/* Utilities                                                           */
/* ------------------------------------------------------------------ */

.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--primary-dark); }
.text-warning { color: #b45309; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.pill-note { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; }
.pill-note i { color: var(--primary); }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1280px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-layout { grid-template-columns: minmax(0, 1fr) 370px; }
}

@media (max-width: 1080px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-main-grid, .dash-lower-grid { grid-template-columns: 1fr; }
    .dash-hero { grid-template-columns: 1fr; }
    .pos-layout { grid-template-columns: 1fr; }
    .pos-cart { position: static; max-height: none; }
    .pos-grid { max-height: none; }
    .receipt { padding: 24px; }
}

@media (max-width: 900px) {
    .page-head { flex-direction: column; align-items: stretch; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1 1 auto; justify-content: center; }
    .card-head { flex-wrap: wrap; align-items: flex-start; }
    .card-head .search-form { width: 100%; }
    .card-head > .muted { width: 100%; }
    .table-wrap { -webkit-overflow-scrolling: touch; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-area { margin-left: 0; }
    #sidebarToggle { display: inline-grid; }
    .sidebar-collapse-btn { display: none; }
    .content { padding: 18px; }
    .topbar { padding: 0 14px; height: 58px; }
    .topbar-sale { display: none; }
    .user-meta { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .dash-hero { padding: 24px; }
    .dash-hero h2 { font-size: 26px; }
    .register-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .content { padding: 14px; }
    .card-head { padding: 16px; }
    .card-body { padding: 16px; }
    .card-foot { padding: 12px 16px; }
    .table th, .table td { padding: 10px 12px; }
    .search-form { align-items: stretch; }
    .search-form input,
    .search-form select,
    .search-form .btn { flex: 1 1 100%; width: 100%; max-width: none; }
    .search-form input[type="search"] { flex: 1 1 100%; width: 100%; max-width: none; min-width: 0; }
    .page-actions .btn { width: 100%; }
    .stat-grid { grid-template-columns: 1fr; }
    .page-head h2 { font-size: 19px; }
    .topbar h1 { font-size: 17px; }
    .topbar-left p { display: none; }
    .receipt-meta { grid-template-columns: 1fr; }
    .receipt-actions { flex-wrap: wrap; }
    .search-form input[type="search"] { min-width: 0; }
    .pos-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
    .dash-kpis { grid-template-columns: 1fr; }
    .dash-hero { padding: 20px; border-radius: 16px; }
    .dash-hero h2 { font-size: 23px; }
    .dash-hero-value { font-size: 29px; }
    .dash-hero-mini { grid-template-columns: 1fr 1fr; }
    .dash-hero-actions .btn { flex: 1; justify-content: center; }
    .dash-chart { height: 190px; }
    .dash-alert-reorder { display: none; }
    .register-hero { align-items: flex-start; flex-direction: column; padding: 18px; }
    .register-report-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ */
/* Driver portal                                                       */
/* ------------------------------------------------------------------ */

.driver-body { background: #f1f5f9; color: var(--text); }
.driver-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    background: #0f172a;
    color: #fff;
}
.driver-topbar-label { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: #94a3b8; }
.driver-topbar strong { display: block; font-size: 15px; margin-top: 1px; }
.driver-topbar .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; }
.driver-topbar .btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.driver-content { width: 100%; max-width: 1100px; margin: 0 auto; padding: 22px 18px 40px; }
.driver-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.driver-stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(15,23,42,.03); }
.driver-stat span { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .55px; color: var(--muted); }
.driver-stat strong { display: block; font-size: 24px; letter-spacing: -.5px; margin-top: 6px; }
.driver-orders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.driver-order { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.driver-order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.driver-order-head > div:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.driver-order-head strong { font-size: 14px; }
.driver-order-head small { font-size: 11px; color: var(--muted); }
.driver-order-total { font-size: 20px; font-weight: 800; letter-spacing: -.4px; white-space: nowrap; }
.driver-order-body { padding: 14px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; flex: 1; }
.driver-detail span { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.driver-detail strong { display: block; font-size: 12.5px; margin-top: 2px; }
.driver-detail.full { grid-column: 1 / -1; }
.driver-order-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.driver-order-actions form { flex: 1 1 160px; display: flex; }
.driver-order-actions .btn { width: 100%; justify-content: center; }
.driver-order-actions .btn:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 800px) {
    .driver-orders { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .driver-content { padding: 16px 14px 32px; }
    .driver-stats { grid-template-columns: 1fr; }
    .driver-order-body { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ */
/* Print                                                               */
/* ------------------------------------------------------------------ */

@media print {
    body { background: #fff; }
    .sidebar, .topbar, .sidebar-overlay, .no-print, .alert { display: none !important; }
    .main-area { margin: 0; }
    .content { padding: 0; }
    .receipt-wrap { max-width: none; }
    .receipt { border: 0; box-shadow: none; border-radius: 0; padding: 10px 4px; }
    .refunded-stamp { color: rgba(239, 68, 68, .2); }
    @page { margin: 12mm; }
}







