/*
 * P3 Shop Pro V2 — Professional Retail Management UI
 * Light theme, sidebar navigation, data-rich components
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css');

/* =========================================
   CSS VARIABLES — Design Tokens
   ========================================= */
:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #818cf8;
    --primary-bg: #eef2ff;

    --success: #059669;
    --success-bg: #d1fae5;
    --success-light: #10b981;

    --warning: #d97706;
    --warning-bg: #fef3c7;
    --warning-light: #f59e0b;

    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --danger-light: #ef4444;

    --info: #0284c7;
    --info-bg: #e0f2fe;

    /* Surfaces */
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-bg: #1e1b4b;
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active: rgba(99, 102, 241, 0.9);
    --sidebar-text: rgba(255,255,255,0.7);
    --sidebar-text-active: #ffffff;

    /* Text */
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.2s ease;
}

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

html { font-size: 16px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* =========================================
   LAYOUT — Sidebar + Main
   ========================================= */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* =========================================
   SIDEBAR
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 200;
    transition: transform 0.3s ease, width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: 72px;
}

.sidebar-brand-icon {
    width: 40px; height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.sidebar-brand-text h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.sidebar-brand-text span {
    font-size: 0.7rem;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.35);
    padding: 0.75rem 0.75rem 0.25rem;
    margin-top: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: white;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.sidebar-link .badge-count {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-user:hover { background: var(--sidebar-hover); }

.sidebar-avatar {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong {
    display: block;
    font-size: 0.85rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-info span {
    font-size: 0.7rem;
    color: var(--sidebar-text);
    text-transform: capitalize;
}

.sidebar-user .logout-icon {
    color: rgba(255,255,255,0.4);
    font-size: 1.1rem;
    transition: var(--transition);
}
.sidebar-user:hover .logout-icon { color: var(--danger-light); }

/* =========================================
   MAIN CONTENT AREA
   ========================================= */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Top Header Bar */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.hamburger-btn:hover { background: var(--bg); color: var(--text); }

.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.page-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    text-decoration: none;
}

.topbar-btn:hover { background: var(--bg); color: var(--text); }

.topbar-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Page Content */
.page-content {
    padding: 2rem;
    flex: 1;
}

/* =========================================
   CARDS
   ========================================= */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.card-header h2, .card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h2 i, .card-header h3 i {
    color: var(--primary);
    font-size: 1.1rem;
}

.card-body { padding: 1.5rem; }
.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

/* =========================================
   KPI CARDS
   ========================================= */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.kpi-card.primary::before { background: var(--primary); }
.kpi-card.success::before { background: var(--success); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.danger::before { background: var(--danger); }
.kpi-card.info::before { background: var(--info); }

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.kpi-label i { font-size: 0.9rem; }

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.kpi-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 500;
}

.kpi-trend-up { color: var(--success); }
.kpi-trend-down { color: var(--danger); }
.kpi-trend-neutral { color: var(--text-muted); }

/* =========================================
   TABLES
   ========================================= */
.table-container {
    overflow-x: auto;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead th {
    background: var(--surface-2);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.data-table thead th:hover { color: var(--primary); background: var(--primary-bg); }
.data-table thead th i { font-size: 0.8rem; margin-left: 0.25rem; opacity: 0.5; }

.data-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover { background: var(--primary-bg); }

.data-table td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.data-table td.money { color: var(--success); font-weight: 700; }
.data-table td.money-neg { color: var(--danger); font-weight: 700; }

/* Table Tools */
.table-tools {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    flex: 1;
    max-width: 300px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-box i { color: var(--text-muted); font-size: 0.9rem; }

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-size: 0.875rem;
    color: var(--text);
    width: 100%;
    font-family: inherit;
}

.table-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
    font-weight: 500;
}

/* =========================================
   BADGES
   ========================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-primary { background: var(--primary-bg); color: var(--primary-dark); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
}

.btn i { font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.3); }

.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #047857; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5,150,105,0.3); }

.btn-warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn-warning:hover { background: #b45309; transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(220,38,38,0.3); }

.btn-info { background: var(--info); color: white; border-color: var(--info); }
.btn-info:hover { background: #0369a1; transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-outline:hover { background: var(--bg); border-color: var(--text-muted); }

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

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* =========================================
   FORMS
   ========================================= */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text);
    background: var(--surface);
    transition: var(--transition);
    font-family: inherit;
    outline: none;
}

.form-control::placeholder { color: var(--text-light); }

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

select.form-control { cursor: pointer; }

.form-control.error { border-color: var(--danger); }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 0.25rem; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

/* =========================================
   ALERT MESSAGES
   ========================================= */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert i { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.05rem; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #a7f3d0; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: #fca5a5; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #fcd34d; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #7dd3fc; }

/* =========================================
   GRID UTILITIES
   ========================================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; align-items: start; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; align-items: start; }

/* =========================================
   CHARTS
   ========================================= */
.chart-wrapper {
    position: relative;
    padding: 1.5rem;
}

.chart-wrapper canvas {
    max-height: 320px;
}

/* =========================================
   STOCK INDICATORS
   ========================================= */
.stock-bar-wrap { width: 80px; }
.stock-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.stock-bar-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.stock-good .stock-bar-fill { background: var(--success); }
.stock-low .stock-bar-fill { background: var(--warning); }
.stock-critical .stock-bar-fill { background: var(--danger); }

/* =========================================
   SPARKLINE MINI CHART
   ========================================= */
.sparkline-wrap { display: flex; align-items: center; gap: 0.5rem; }

/* =========================================
   ACTIVITY FEED
   ========================================= */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--surface-2); }

.activity-dot {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.activity-dot.sale { background: var(--success-bg); color: var(--success); }
.activity-dot.stock { background: var(--primary-bg); color: var(--primary); }
.activity-dot.void { background: var(--danger-bg); color: var(--danger); }

.activity-content { flex: 1; min-width: 0; }
.activity-title { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.activity-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }
.activity-amount { font-size: 0.875rem; font-weight: 700; color: var(--success); white-space: nowrap; }
.activity-amount.neg { color: var(--danger); }

/* =========================================
   PROGRESS BAR
   ========================================= */
.progress-bar-wrap { width: 100%; }
.progress-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: var(--text);
}
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.8s ease;
}

/* =========================================
   TABS
   ========================================= */
.tab-nav {
    display: flex;
    gap: 0.25rem;
    padding: 1rem 1.5rem 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    overflow-x: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    bottom: -1px;
}

.tab-btn:hover { color: var(--primary); background: var(--primary-bg); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--surface-2); }

/* =========================================
   MODAL
   ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.2s ease;
}

.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close {
    background: var(--bg);
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body { padding: 1.25rem; flex: 1; overflow-y: auto; }
.modal-body .form-group { margin-bottom: 0.875rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 0.75rem; justify-content: flex-end; }

/* =========================================
   RECEIPT
   ========================================= */
.receipt {
    background: white;
    max-width: 320px;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px dashed var(--border-strong);
}

.receipt-header { text-align: center; margin-bottom: 1rem; border-bottom: 1px dashed var(--border); padding-bottom: 0.75rem; }
.receipt-header h2 { font-size: 1.1rem; letter-spacing: 2px; }
.receipt-header p { color: var(--text-muted); font-size: 0.7rem; }

.receipt-items { margin-bottom: 1rem; }
.receipt-row { display: flex; justify-content: space-between; padding: 0.25rem 0; }
.receipt-row.total { font-weight: 700; font-size: 1rem; border-top: 1px solid var(--border); margin-top: 0.5rem; padding-top: 0.5rem; }
.receipt-footer { text-align: center; border-top: 1px dashed var(--border); padding-top: 0.75rem; color: var(--text-muted); font-size: 0.7rem; }

/* =========================================
   CART (POS)
   ========================================= */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1.5rem;
    align-items: start;
}

.pos-products { display: flex; flex-direction: column; gap: 1rem; }

.pos-cat-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    flex-shrink: 0;
}

.pos-cat-btn {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition);
    color: var(--text-muted);
    font-family: inherit;
}
.pos-cat-btn:hover, .pos-cat-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.pos-product-btn {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.pos-product-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--primary-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.pos-product-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pos-product-btn .product-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.pos-product-btn .product-price {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary);
}

.pos-product-btn .product-stock {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.pos-product-btn.out-of-stock .product-stock { color: var(--danger); }

/* Cart Panel */
.cart-panel {
    position: sticky;
    top: 80px;
}

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

.cart-header h3 { font-size: 0.95rem; font-weight: 700; }
.cart-count {
    background: var(--primary);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.cart-item-price { font-size: 0.75rem; color: var(--text-muted); }

.qty-control {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg);
    border-radius: 20px;
    padding: 0.2rem;
}

.qty-btn {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--surface);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.qty-btn:hover { background: var(--primary); color: white; }
.qty-num { font-size: 0.85rem; font-weight: 700; width: 24px; text-align: center; }

.cart-remove { color: var(--text-light); font-size: 1rem; cursor: pointer; transition: var(--transition); background: none; border: none; }
.cart-remove:hover { color: var(--danger); }

.cart-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}
.cart-empty i { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; opacity: 0.4; }
.cart-empty p { font-size: 0.85rem; }

.cart-totals { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    padding: 0.2rem 0;
    color: var(--text-muted);
}
.cart-total-row.grand {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border);
}

.cart-checkout { padding: 1rem 1.25rem; }

/* =========================================
   LOGIN PAGE
   ========================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79,70,229,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(5,150,105,0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px rgba(79,70,229,0.3);
}

.login-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.login-logo span { color: var(--primary); }
.login-logo p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

/* =========================================
   STAFF - TODAY SUMMARY BAR
   ========================================= */
.staff-summary-bar {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.staff-summary-item { text-align: center; }
.staff-summary-item .s-value { font-size: 1.5rem; font-weight: 800; }
.staff-summary-item .s-label { font-size: 0.72rem; opacity: 0.8; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

/* =========================================
   UTILITIES
   ========================================= */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }

.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-end { display: flex; justify-content: flex-end; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-0 { padding: 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.divider { height: 1px; background: var(--border); margin: 1rem 0; }

.overflow-auto { overflow: auto; }
.nowrap { white-space: nowrap; }

/* =========================================
   PRINT STYLES
   ========================================= */
@media print {
    .sidebar, .topbar, .btn, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0; }
    body { background: white; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .pos-layout { grid-template-columns: 1fr; }
    .cart-panel { position: static; }
}

@media (max-width: 768px) {
    :root { --sidebar-width: 0px; }

    .sidebar {
        transform: translateX(-260px);
        width: 260px;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.2);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 199;
        display: none;
    }
    .sidebar-overlay.open { display: block; }

    .main-content { margin-left: 0; }
    .hamburger-btn { display: flex; }
    .topbar { padding: 0 1rem; }
    .page-content { padding: 1rem; }

    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr 1fr; }

    .kpi-grid { grid-template-columns: 1fr 1fr; }

    .form-row { grid-template-columns: 1fr; }

    .data-table thead { display: none; }
    .data-table tbody tr {
        display: flex;
        flex-direction: column;
        padding: 0.75rem;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 0.75rem;
    }
    .data-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--border);
        padding: 0.5rem 0;
        font-size: 0.8rem;
    }
    .data-table tbody td:last-child { border-bottom: none; }
    .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .table-tools { flex-direction: column; align-items: stretch; }
    .search-box { max-width: none; }

    .pos-product-grid { grid-template-columns: repeat(2, 1fr); }

    .staff-summary-bar { gap: 1rem; }
    .staff-summary-item .s-value { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr; }
    .pos-product-grid { grid-template-columns: repeat(2, 1fr); }
}