@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ========== Layout Variables ========== */

:root {
    --primary: #f97316;
    --primary-hover: #ea6c0a;
    --primary-active: #dc5f00;
    --primary-light: #fff7ed;
    --primary-rgb: 249, 115, 22;
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --content-bg: #f5f6fa;
    --nav-link-color: rgba(255, 255, 255, 0.75);
    --nav-active-bg: rgba(255, 255, 255, 0.12);
    --nav-active-color: #ffffff;
}

[data-bs-theme="dark"] {
    --sidebar-bg: #0f172a;
    --content-bg: #16181d;
    --nav-link-color: rgba(255, 255, 255, 0.7);
    --nav-active-bg: rgba(255, 255, 255, 0.1);
    --nav-active-color: #ffffff;
    --primary-light: rgba(249, 115, 22, 0.12);
}

/* ========== Global ========== */

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--content-bg);
    min-height: 100vh;
}

/* ========== Cards ========== */

.card {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 14px rgba(0, 0, 0, .06);
}

[data-bs-theme="dark"] .card {
    box-shadow: 0 2px 14px rgba(0, 0, 0, .25);
}

/* ========== Sidebar ========== */

.sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 16px;
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.3s ease;
}

/* Sidebar Brand */

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 4px 18px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 10px;
}

.sidebar-brand:hover {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--primary);
}

/* Sidebar Nav Links */

.sidebar .nav-link {
    color: var(--nav-link-color);
    border-radius: 10px;
    margin-bottom: 3px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    font-weight: 400;
    transition: background 0.15s, color 0.15s;
}

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

.sidebar .nav-link:hover {
    background: var(--nav-active-bg);
    color: var(--nav-active-color);
}

.sidebar .nav-link.active {
    background: var(--nav-active-bg);
    color: var(--nav-active-color);
    font-weight: 500;
}

.sidebar .nav-link.active i {
    color: var(--primary);
}

/* Sidebar Nav grows to push footer down */
.sidebar > .nav.flex-column {
    flex: 1;
    overflow-y: auto;
}

/* Sidebar Divider */
.sidebar-divider {
    border-color: rgba(255, 255, 255, 0.12);
    margin: 8px 0;
}

/* Sidebar Footer */

.sidebar-footer {
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

/* ========== Theme Toggle ========== */

.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--nav-link-color);
    font-size: 0.95rem;
    padding: 0.3rem 0.55rem;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ========== Content Area ========== */

.content {
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: 100vh;
    font-size: 0.875rem;
    font-family: 'Inter', system-ui, sans-serif;
}

.content h1 { font-size: 1.5rem; }
.content h2 { font-size: 1.25rem; }
.content h3 { font-size: 1.1rem; }
.content h4 { font-size: 1rem; }
.content h5, .content .card-title { font-size: 0.9375rem; }
.content h6 { font-size: 0.875rem; }

.content-footer {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    margin-top: 2rem;
    border-top: 1px solid var(--bs-border-color);
}

/* ========== Mobile Topbar ========== */

.mobile-topbar {
    display: flex;
    align-items: center;
    background: var(--sidebar-bg);
    padding: 12px 16px;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    margin-bottom: 18px;
}

/* ========== Sidebar Overlay (mobile) ========== */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1039;
}

.sidebar-overlay.show {
    display: block;
}

/* ========== Responsive (mobile) ========== */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .content {
        margin-left: 0;
    }
}

@media (min-width: 992px) {
    .mobile-topbar {
        display: none !important;
    }
    .sidebar {
        transform: none !important;
    }
}
