:root {
    --sidebar-bg: #1e1e2d;
    --sidebar-active: #2a2a3c;
    --sidebar-text: #9899ac;
    --sidebar-text-active: #fff;
    --brand-color: #6d4c41;
    --brand-color-light: #8d6e63;
    --bs-primary: #6d4c41;
    --bs-primary-rgb: 109,76,65;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f8fa;
    color: #3f4254;
    margin: 0;
    font-size: 14px;
}

.btn-primary {
    background-color: var(--brand-color);
    border-color: var(--brand-color);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--brand-color-light);
    border-color: var(--brand-color-light);
}

/* === LAYOUT === */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.main-content {
    flex: 1;
    padding: 30px;
    overflow-x: auto;
}

/* === SIDEBAR BRAND === */
.sidebar-brand {
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.05);
}
.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--brand-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}
.brand-title {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}
.brand-subtitle {
    font-size: 11px;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === SIDEBAR NAV === */
.sidebar-nav {
    flex: 1;
    padding: 15px 0;
    overflow-y: auto;
}
.nav-section {
    padding: 15px 25px 8px;
    font-size: 10px;
    font-weight: 600;
    color: #565674;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 25px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s;
}
.nav-link i { font-size: 16px; width: 20px; text-align: center; }
.nav-link:hover {
    color: var(--sidebar-text-active);
    background: rgba(255,255,255,.03);
}
.nav-link.active {
    color: var(--sidebar-text-active);
    background: var(--sidebar-active);
    border-left: 3px solid var(--brand-color);
    padding-left: 22px;
}
.nav-badge {
    margin-left: auto;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    animation: pulse-alert 2s infinite;
}
@keyframes pulse-alert {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
}

/* Stock alert banner */
.stock-alert-banner {
    background: linear-gradient(90deg, #fff3cd 0%, #ffe8a1 100%);
    border: 1px solid #ffc107;
    border-left: 4px solid #ff9800;
    border-radius: 8px;
    padding: 12px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    color: #664d03;
    font-size: 13.5px;
}
.stock-alert-banner i { color: #ff9800; font-size: 18px; margin-right: 10px; }
.stock-alert-banner a { color: #664d03; font-weight: 600; text-decoration: underline; }

/* === SIDEBAR FOOTER === */
.sidebar-footer {
    padding: 15px 25px;
    border-top: 1px solid rgba(255,255,255,.05);
}
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--brand-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.user-name {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}
.user-logout {
    color: var(--sidebar-text);
    font-size: 11px;
    text-decoration: none;
}
.user-logout:hover { color: #fff; }

/* === PAGE HEADER === */
.page-header {
    margin-bottom: 25px;
}
.page-header h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    color: #181c32;
}
.page-header .text-muted {
    font-size: 13px;
    margin-top: 2px;
}

/* === CARDS === */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,.03);
    margin-bottom: 20px;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #eff2f5;
    padding: 18px 22px;
    border-radius: 10px 10px 0 0 !important;
}
.card-header h5 { font-size: 15px; font-weight: 600; color: #181c32; }
.card-body { padding: 22px; }
.card-footer { background: #fff; border-top: 1px solid #eff2f5; padding: 15px 22px; border-radius: 0 0 10px 10px; }

/* === STAT CARDS === */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,.03);
    position: relative;
}
.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}
.stat-label {
    font-size: 12px;
    color: #7e8299;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.3px;
}
.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #181c32;
    margin-top: 2px;
}

/* === FORMS === */
.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #3f4254;
    margin-bottom: 6px;
    text-transform: none;
}
.form-control, .form-select {
    border: 1px solid #e4e6ef;
    font-size: 13.5px;
    padding: 9px 13px;
    border-radius: 6px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(109,76,65,.15);
}

/* === TABLES === */
.table {
    font-size: 13.5px;
    margin-bottom: 0;
}
.table thead th {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    color: #7e8299;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #eff2f5;
    padding: 12px 15px;
}
.table td {
    padding: 14px 15px;
    border-top: 1px solid #f1f3f6;
    vertical-align: middle;
}
.table-hover tbody tr:hover { background: #f8f9fc; }

code {
    background: #f5f5f7;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 12px;
    color: #6d4c41;
}

.badge { font-weight: 500; padding: 5px 10px; font-size: 11px; }

/* === AUTH === */
.auth-body { background: linear-gradient(135deg, #6d4c41 0%, #3e2723 100%); min-height: 100vh; font-family: 'Inter', sans-serif; }
.auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: #fff; padding: 45px; border-radius: 14px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-brand { text-align: center; margin-bottom: 30px; }
.auth-brand h1 { font-size: 24px; font-weight: 700; color: #181c32; margin: 15px 0 4px; }
.auth-brand p { color: #7e8299; font-size: 13px; margin: 0; }
.brand-logo-lg {
    width: 60px; height: 60px; border-radius: 12px;
    background: var(--brand-color); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700; margin: 0 auto;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { padding: 15px; }
}
