:root {
    --sidebar-bg: #1b2a41;
    --accent: #2f855a;
    --warn: #d97706;
    --danger: #dc2626;
    --over: #7c3aed;
}

* { border-radius: 0 !important; }

body { background: #f4f6f9; font-family: "Segoe UI", system-ui, sans-serif; }

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

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #1b2a41, #12202f);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-brand { padding: 1.25rem; font-weight: 700; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand i { color: var(--accent); margin-right: .4rem; }
.sidebar-nav { flex: 1; padding: .75rem; overflow-y: auto; }
.sidebar-nav .nav-link {
    color: rgba(255,255,255,.75); padding: .6rem .9rem; margin-bottom: .25rem;
    display: flex; align-items: center; gap: .6rem; text-decoration: none;
}
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--accent); color: #fff; font-weight: 600; }
.sidebar-footer { padding: .75rem 1rem; border-top: 1px solid rgba(255,255,255,.08); }

.main-content { flex: 1; min-width: 0; padding: 0 1.5rem 2rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; row-gap: .5rem; padding: 1rem 0; margin-bottom: .5rem; border-bottom: 1px solid #e9ecef; }
.flash-area { margin-bottom: 1rem; }

.kpi-card .card-body { padding: 1rem 1.25rem; }
.kpi-label { color: #6c757d; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.kpi-value { font-size: 1.55rem; font-weight: 700; line-height: 1.2; }

.table thead th { text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; color: #6c757d; }

.badge { border-radius: 6px; }
.bg-danger-subtle { background-color: #f8d7da !important; }
.bg-success-subtle { background-color: #d1e7dd !important; }
.bg-warning-subtle { background-color: #fff3cd !important; }
.bg-purple-subtle { background-color: #e9d5ff !important; }

.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot-healthy { background: var(--accent); }
.dot-low { background: var(--warn); }
.dot-out { background: var(--danger); }
.dot-overstock { background: var(--over); }

.traffic-card { border-left: 5px solid #ccc; }
.traffic-healthy { border-left-color: var(--accent); }
.traffic-low { border-left-color: var(--warn); }
.traffic-out { border-left-color: var(--danger); }
.traffic-overstock { border-left-color: var(--over); }

.scan-input { min-width: 200px; max-width: 240px; }

#scanCamera {
    position: fixed;
    top: 80px;
    right: 1.5rem;
    width: 320px;
    max-width: 92vw;
    background: #000;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    z-index: 1055;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
#scanCamera #scanCam { width: 100%; }

@media print {
    .sidebar, .topbar, .btn { display: none !important; }
    .main-content { padding: 0 !important; }
}

@media (max-width: 991px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .sidebar-nav { display: flex; flex-wrap: wrap; gap: .25rem; }
}
