/* ═══════════════════════════════════════════
   HYBRIDPOS — Premium Design System
   ═══════════════════════════════════════════ */

/* Variables */
:root {
    --bg-primary:    #0f172a;
    --bg-secondary:  #1e293b;
    --bg-tertiary:   #334155;
    --bg-card:       #1e293b;
    --bg-input:      #0f172a;
    --border:        #334155;
    --border-light:  #475569;
    --text-primary:  #f1f5f9;
    --text-secondary:#94a3b8;
    --text-muted:    #64748b;
    --accent:        #6366f1;
    --accent-hover:  #4f46e5;
    --accent-light:  rgba(99,102,241,0.12);
    --success:       #10b981;
    --success-light: rgba(16,185,129,0.12);
    --warning:       #f59e0b;
    --warning-light: rgba(245,158,11,0.12);
    --danger:        #ef4444;
    --danger-light:  rgba(239,68,68,0.12);
    --info:          #3b82f6;
    --info-light:    rgba(59,130,246,0.12);
    --sidebar-w:     260px;
    --topbar-h:      64px;
    --radius:        12px;
    --radius-sm:     8px;
    --radius-lg:     16px;
    --shadow:        0 4px 24px rgba(0,0,0,0.3);
    --shadow-lg:     0 8px 40px rgba(0,0,0,0.4);
    --transition:    all 0.2s ease;
}

[data-theme="light"] {
    --bg-primary:    #f1f5f9;
    --bg-secondary:  #ffffff;
    --bg-tertiary:   #e2e8f0;
    --bg-card:       #ffffff;
    --bg-input:      #f8fafc;
    --border:        #e2e8f0;
    --border-light:  #cbd5e1;
    --text-primary:  #0f172a;
    --text-secondary:#475569;
    --text-muted:    #94a3b8;
    --accent-light:  rgba(99,102,241,0.08);
    --shadow:        0 4px 24px rgba(0,0,0,0.08);
    --shadow-lg:     0 8px 40px rgba(0,0,0,0.12);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }

/* ══════════════════════════════════════════
   AUTH SCREEN
══════════════════════════════════════════ */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

.auth-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.orb-1 {
    width: 600px; height: 600px;
    background: var(--accent);
    top: -200px; left: -200px;
    animation: float 8s ease-in-out infinite;
}

.orb-2 {
    width: 400px; height: 400px;
    background: var(--info);
    bottom: -100px; right: -100px;
    animation: float 10s ease-in-out infinite reverse;
}

.orb-3 {
    width: 300px; height: 300px;
    background: var(--success);
    top: 50%; left: 60%;
    animation: float 12s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}

.auth-logo {
    text-align: center;
    margin-bottom: 36px;
}

.logo-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--accent), var(--info));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: white;
    box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}

.logo-icon.sm {
    width: 36px; height: 36px;
    font-size: 16px;
    border-radius: var(--radius-sm);
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon > i:first-child {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
    z-index: 1;
}

.input-icon input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.input-icon input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.toggle-password {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    padding: 4px;
    transition: var(--transition);
}
.toggle-password:hover { color: var(--text-primary); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--border-light); }

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(16,185,129,0.4); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}
.btn-danger:hover { transform: translateY(-1px); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }

.btn-icon {
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 15px;
}
.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-loader { display: inline-flex; align-items: center; }

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

.online-badge { display: flex; align-items: center; gap: 6px; }
.online-badge i { font-size: 8px; color: var(--success); }
.online-badge.offline i { color: var(--danger); }

/* ══════════════════════════════════════════
   MAIN APP LAYOUT
══════════════════════════════════════════ */
#main-app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s ease;
    overflow: hidden;
    z-index: 100;
}

.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span:not(.nav-badge),
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar.collapsed .user-card { justify-content: center; }
.sidebar.collapsed .user-avatar { margin: 0; }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
    min-height: var(--topbar-h);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-section { margin-bottom: 24px; }

.nav-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 8px;
    display: block;
    margin-bottom: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.nav-item i { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 99px;
    min-width: 18px;
    text-align: center;
}

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

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--info));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name {
    font-size: 13px;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* ── Main Content ── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* ── Topbar ── */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

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

.page-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-menu-btn { display: none; }

.sync-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--success);
    background: var(--success-light);
    padding: 5px 12px;
    border-radius: 99px;
}
.sync-status.offline { color: var(--warning); background: var(--warning-light); }
.sync-status.syncing { color: var(--info); background: var(--info-light); }

.topbar-time {
    font-size: 13px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 60px;
    text-align: right;
}

/* ── Page Content ── */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ══════════════════════════════════════════
   CARDS & COMPONENTS
══════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
}

.card-body { padding: 24px; }

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.purple { background: var(--accent-light); color: var(--accent); }
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-icon.blue   { background: var(--info-light);    color: var(--info); }
.stat-icon.red    { background: var(--danger-light);  color: var(--danger); }

.stat-info { flex: 1; }
.stat-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}
.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Tables ── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead tr {
    background: var(--bg-tertiary);
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-tertiary); }

tbody td {
    padding: 14px 16px;
    color: var(--text-primary);
    vertical-align: middle;
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info); }
.badge-purple  { background: var(--accent-light);  color: var(--accent); }

/* ── Search & Filters ── */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

.search-box input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

select {
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* ══════════════════════════════════════════
   MODALS
══════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s ease;
}

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-body { padding: 0 24px; }
.modal-footer {
    padding: 20px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    margin-top: 24px;
}

/* ── Form inputs inside modals ── */
.modal input,
.modal textarea,
.modal select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.modal input:focus,
.modal textarea:focus,
.modal select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.modal textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ══════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════ */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 380px;
    animation: slideUp 0.3s ease;
    font-size: 13px;
}

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-message { flex: 1; font-weight: 500; }
.toast-close { color: var(--text-muted); padding: 2px; }

.toast.success { border-left: 3px solid var(--success); }
.toast.success .toast-icon { color: var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }
.toast.info    .toast-icon { color: var(--info); }

/* ══════════════════════════════════════════
   POS PAGE
══════════════════════════════════════════ */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    height: calc(100vh - var(--topbar-h) - 48px);
}

.pos-products { display: flex; flex-direction: column; gap: 16px; overflow: hidden; }

.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-shrink: 0;
}

.category-tabs::-webkit-scrollbar { height: 3px; }

.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg-card);
    transition: var(--transition);
}

.cat-tab:hover { border-color: var(--accent); color: var(--accent); }
.cat-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    overflow-y: auto;
    padding-right: 4px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
    /* overflow: hidden; */
}

.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent), var(--info));
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.2);
}

.product-card:hover::before { opacity: 0.04; }
.product-card:active { transform: scale(0.97); }

.product-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0 auto 10px;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--accent);
}

.product-stock {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Cart ── */
.pos-cart {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-count {
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
}

.cart-items { flex: 1; overflow-y: auto; padding: 12px; }

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    gap: 12px;
}

.cart-empty i { font-size: 40px; opacity: 0.3; }
.cart-empty p { font-size: 14px; }

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    margin-bottom: 4px;
}

.cart-item:hover { background: var(--bg-tertiary); }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-price { font-size: 12px; color: var(--text-muted); }

.qty-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.qty-btn {
    width: 26px; height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.qty-btn:hover { background: var(--accent); color: white; }
.qty-value {
    min-width: 24px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.cart-item-total {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    min-width: 60px;
    text-align: right;
}

.cart-item-remove {
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}
.cart-item-remove:hover { color: var(--danger); background: var(--danger-light); }

/* Cart Summary */
.cart-summary {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.summary-row.total span:last-child { color: var(--accent); }

.discount-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.discount-row input {
    flex: 1;
    padding: 7px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

/* Payment buttons */
.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.pay-method-btn {
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pay-method-btn.active {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.checkout-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(16,185,129,0.3);
    transition: var(--transition);
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16,185,129,0.4);
}

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

/* ══════════════════════════════════════════
   EMPTY STATES
══════════════════════════════════════════ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
    gap: 12px;
}

.empty-state i { font-size: 48px; opacity: 0.2; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); font-weight: 600; }
.empty-state p { font-size: 13px; }

/* ══════════════════════════════════════════
   LOADING SKELETON
══════════════════════════════════════════ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-light) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .pos-layout { grid-template-columns: 1fr 340px; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -var(--sidebar-w);
        top: 0; bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .mobile-menu-btn { display: flex !important; }
    .pos-layout { grid-template-columns: 1fr; }
    .pos-cart { position: fixed; bottom: 0; left: 0; right: 0; max-height: 50vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .page-content { padding: 16px; }
    .form-row { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   SETTINGS PAGE
══════════════════════════════════════════ */
#settings-content .card {
    margin-bottom: 0;
}

#settings-content .form-group {
    margin-bottom: 16px;
}

#settings-content .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

#settings-content input[type="text"],
#settings-content input[type="email"],
#settings-content input[type="number"],
#settings-content input[type="password"],
#settings-content input[type="tel"],
#settings-content input[type="color"],
#settings-content select,
#settings-content textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

#settings-content input:focus,
#settings-content select:focus,
#settings-content textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

#settings-content textarea {
    resize: vertical;
    min-height: 80px;
}

#settings-content input[type="color"] {
    height: 42px;
    padding: 4px 8px;
    cursor: pointer;
}

#settings-content .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    #settings-content .form-row {
        grid-template-columns: 1fr;
    }
}


/* Scrollable category tabs for 100+ categories */
.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-shrink: 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar { height: 4px; }
.category-tabs::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 99px;
}



/* ══════════════════════════════════════════
   STOCK & GENERAL PAGE FORMS
══════════════════════════════════════════ */
#stock-content input,
#stock-content select,
#stock-content textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

#stock-content input:focus,
#stock-content select:focus,
#stock-content textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

#stock-content textarea {
    resize: vertical;
    min-height: 80px;
}

#stock-content .form-group {
    margin-bottom: 16px;
}

#stock-content .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

#stock-content .card {
    max-width: 100%;
}

/* Fix card max-width override for forms */
#stock-content .card[style*="max-width:560px"] {
    max-width: 560px;
}

/* ══════════════════════════════════════════
   GLOBAL FORM STYLES (applies everywhere)
══════════════════════════════════════════ */
.page-content input[type="text"],
.page-content input[type="email"],
.page-content input[type="number"],
.page-content input[type="password"],
.page-content input[type="tel"],
.page-content input[type="date"],
.page-content select,
.page-content textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.page-content input:focus,
.page-content select:focus,
.page-content textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.page-content .form-group {
    margin-bottom: 16px;
}

.page-content .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.page-content .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .page-content .form-row {
        grid-template-columns: 1fr;
    }
}


/* ══════════════════════════════════════════
   PAGE TABS (Settings, Stock, etc.)
══════════════════════════════════════════ */
.settings-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    border-radius: 0;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -1px;
    font-family: inherit;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.settings-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.settings-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: none;
}

.tabs-container {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs-container::-webkit-scrollbar { height: 3px; }
.tabs-container::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 99px;
}


/* ══════════════════════════════════════════
   EXPENSES FORM FIXES
══════════════════════════════════════════ */
#expenses-content input,
#expenses-content select,
#expenses-content textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

#expenses-content input:focus,
#expenses-content select:focus,
#expenses-content textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

#expenses-content textarea {
    resize: vertical;
    min-height: 80px;
}

#expenses-content .form-group {
    margin-bottom: 16px;
}

#expenses-content .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

#expenses-content .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Amount input special */
#exp-amount, #edit-exp-amount {
    font-size: 24px !important;
    text-align: center;
    padding: 16px !important;
    font-weight: 700;
    color: var(--accent) !important;
    letter-spacing: 1px;
}

/* Description full width */
#exp-description, #edit-exp-description {
    font-size: 14px;
    padding: 12px 14px;
}

/* Date input fix */
input[type="date"] {
    color-scheme: dark;
}

[data-theme="light"] input[type="date"] {
    color-scheme: light;
}


/* ══════════════════════════════════════════
   PIN LOGIN KEYPAD
══════════════════════════════════════════ */
.pin-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pin-display {
    display: flex;
    gap: 12px;
    margin: 8px 0;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    background: transparent;
    transition: all 0.2s ease;
}

.pin-dot.filled {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1);
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 280px;
}

.pin-key {
    height: 64px;
    border-radius: var(--radius);
    font-size: 20px;
    font-weight: 700;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    user-select: none;
}

.pin-key:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.pin-key:active {
    transform: scale(0.95);
}

.pin-key.pin-delete {
    background: var(--danger-light);
    color: var(--danger);
    border-color: transparent;
}

.pin-key.pin-delete:hover {
    background: var(--danger);
    color: white;
}

.pin-key.pin-enter {
    background: var(--success-light);
    color: var(--success);
    border-color: transparent;
    grid-column: span 2;
}

.pin-key.pin-enter:hover {
    background: var(--success);
    color: white;
}

.pin-key.pin-zero {
    grid-column: 1;
}

.cashier-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
}

.cashier-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-tertiary);
}

.cashier-item:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.cashier-item.selected {
    border-color: var(--accent);
    background: var(--accent-light);
}


@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-6px); }
    80%       { transform: translateX(6px); }
}