:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1e2a3a;
    --sidebar-active: #2f6fed;
    --topbar-bg: #ffffff;
    --content-bg: #f4f6fa;
}

[data-bs-theme="dark"] {
    --topbar-bg: #1e2a3a;
    --content-bg: #14181f;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--content-bg);
}

.wrapper { display: flex; width: 100%; align-items: stretch; min-height: 100vh; }

.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    transition: margin-left .3s ease;
    min-height: 100vh;
}

.sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-width)); }

.sidebar-header {
    padding: 22px 20px;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar ul.components { padding: 10px 0; }

.sidebar ul li a {
    padding: 12px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: .93rem;
    transition: all .2s;
    border-left: 3px solid transparent;
}

.sidebar ul li a:hover, .sidebar ul li.active a {
    background: rgba(255,255,255,.06);
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.content-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.top-navbar {
    background: var(--topbar-bg);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    padding: 10px 20px;
}

.btn-toggle {
    background: transparent;
    border: none;
    font-size: 1.1rem;
}

.main-content { padding: 24px; flex: 1; }

.stat-card {
    border: none;
    border-radius: 14px;
    color: #fff;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
    height: 100%;
}

.stat-card .stat-icon {
    font-size: 1.8rem;
    opacity: .85;
}

.stat-card h3 { font-weight: 700; margin: 6px 0 0; }
.stat-card p { margin: 0; opacity: .9; font-size: .85rem; }

.bg-grad-blue { background: linear-gradient(135deg,#2f6fed,#1c4fb0); }
.bg-grad-green { background: linear-gradient(135deg,#22b573,#178a58); }
.bg-grad-orange { background: linear-gradient(135deg,#ff9f43,#e07a1f); }
.bg-grad-red { background: linear-gradient(135deg,#ea5455,#c0392b); }
.bg-grad-purple { background: linear-gradient(135deg,#8854d0,#6c3fb0); }
.bg-grad-teal { background: linear-gradient(135deg,#0fb9b1,#0a8f89); }

.card { border-radius: 12px; border: none; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.card-header { background: transparent; font-weight: 600; border-bottom: 1px solid rgba(0,0,0,.06); }

.table thead th { white-space: nowrap; font-size: .82rem; text-transform: uppercase; color: #6b7280; }

.badge-stock-ok { background: #22b573; }
.badge-stock-low { background: #ff9f43; }
.badge-stock-out { background: #ea5455; }

@media print {
    .sidebar, .top-navbar, .no-print { display: none !important; }
    .main-content { padding: 0; }
    body { background: #fff; }
}

.sidebar-logo {
    height: 32px;
    width: 32px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    padding: 2px;
}

.brand-header-logo {
    height: 60px;
    max-width: 160px;
    object-fit: contain;
}

.brand-header-name {
    font-weight: 700;
}

@media print {
    .brand-header { break-inside: avoid; }
}

@media (max-width: 768px) {
    .sidebar { margin-left: calc(-1 * var(--sidebar-width)); position: fixed; z-index: 999; }
    .sidebar.show { margin-left: 0; }
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,#1e2a3a,#2f6fed);
}

.login-card {
    width: 380px;
    border-radius: 16px;
    padding: 10px;
}
