/* ============================================================
   Bright Electric POS – Luxurious Mobile-First Design
   ============================================================ */
:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 280px;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(70px + var(--safe-bottom));
}

#sidebar-wrapper {
    min-height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    position: fixed;
    z-index: 1040;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.5rem 1.25rem;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

#sidebar-wrapper .list-group-item {
    border: none;
    border-radius: 12px;
    margin: 4px 12px;
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
    background: transparent;
    transition: all 0.2s;
}

#sidebar-wrapper .list-group-item:hover,
#sidebar-wrapper .list-group-item.active {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
}

#sidebar-wrapper .list-group-item i { width: 22px; text-align: center; }

#page-content-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin 0.3s;
}

.navbar {
    background: rgba(255,255,255,0.92) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border) !important;
    padding: 0.65rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar .badge {
    font-weight: 500;
    font-size: 0.78rem;
    padding: 0.4em 0.75em;
    border-radius: 20px;
}

.card {
    border: none;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.stat-card {
    border-radius: var(--radius);
    border-left: none !important;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    border-radius: 4px 0 0 4px;
}

.stat-card.primary::before { background: #3b82f6; }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--accent); }
.stat-card.danger::before  { background: var(--danger); }

.stat-card h3 {
    font-weight: 700;
    letter-spacing: -0.03em;
    font-size: 1.5rem;
}

.table { margin-bottom: 0; }

.table th {
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: #f8fafc !important;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    padding: 0.85rem 1rem;
}

.table td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-color: var(--border);
    font-size: 0.92rem;
}

.table-hover tbody tr:hover { background: #f8fafc; }

.badge-stock-ok  { background: #d1fae5; color: #065f46; font-weight: 600; }
.badge-stock-low { background: #fef3c7; color: #92400e; font-weight: 600; }
.badge-stock-out { background: #fee2e2; color: #991b1b; font-weight: 600; }

.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.55rem 1.1rem;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e293b, #334155);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    border: none;
    color: #fff;
}

.btn-lg {
    padding: 0.85rem 1.5rem;
    font-size: 1.05rem;
    border-radius: 14px;
}

.form-control, .form-select {
    border-radius: 10px;
    border: 1.5px solid var(--border);
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.pos-product-card {
    cursor: pointer;
    border-radius: 14px !important;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1.5px solid transparent !important;
}

.pos-product-card:active { transform: scale(0.96); }

.pos-product-card:hover {
    border-color: var(--accent) !important;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}

.cart-item {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 1050;
    padding: 0.4rem 0 calc(0.4rem + var(--safe-bottom));
    box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
}

.mobile-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.35rem 0;
    gap: 2px;
    transition: color 0.2s;
}

.mobile-bottom-nav a i { font-size: 1.35rem; }

.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover { color: #f59e0b; }

.offcanvas-start {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    width: 280px !important;
}

.offcanvas-start .list-group-item {
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: none;
    border-radius: 12px;
    margin: 2px 8px;
}

.offcanvas-start .list-group-item:hover,
.offcanvas-start .list-group-item.active {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(145deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    border: none;
    box-shadow: 0 25px 50px rgba(0,0,0,0.35);
    overflow: hidden;
}

.login-card .card-body { padding: 2.25rem 1.75rem; }

@media print {
    body * { visibility: hidden; }
    .invoice-print, .invoice-print * { visibility: visible; }
    .invoice-print {
        position: absolute;
        left: 0; top: 0;
        width: 100%;
        max-width: 80mm;
        font-size: 12px;
        padding: 0;
        margin: 0;
    }
    .no-print { display: none !important; }
    #sidebar-wrapper, .navbar, .mobile-bottom-nav, .btn { display: none !important; }
    #page-content-wrapper { margin: 0 !important; padding: 0 !important; }
}

@media (max-width: 991.98px) {
    body { padding-bottom: calc(72px + var(--safe-bottom)); }
    #sidebar-wrapper { transform: translateX(-100%); }
    #page-content-wrapper { margin-left: 0 !important; }
    .mobile-bottom-nav { display: flex; }
    .stat-card h3 { font-size: 1.25rem; }
    .table-responsive { border-radius: var(--radius); }
    .container-fluid {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }
    .btn-sm {
        padding: 0.45rem 0.7rem;
        min-height: 38px;
    }
    .form-control, .form-select {
        min-height: 48px;
        font-size: 16px;
    }
}

@media (min-width: 992px) {
    body { padding-bottom: 0; }
}

.text-accent { color: var(--accent) !important; }
.bg-dark-gradient { background: linear-gradient(135deg, #0f172a, #1e293b); }
.shadow-lux { box-shadow: var(--shadow-lg); }
