/* =====================================================
   1. CSS VARIABLES
   ===================================================== */

:root {
    /* Base colors */
    --app-bg: #f8fafd;
    --app-surface: #ffffff;
    --app-border: #e3e8ee;

    /* Text */
    --app-text: #1f2933;
    --app-text-muted: #6b7280;

    /* Primary (blue nuance) */
    --app-primary: #2563eb;
    --app-primary-soft: #e0e7ff;

    /* Layout */
    --sidebar-width: 240px;
    --navbar-height: 56px;

    /* Spacing */
    --content-padding: 1.5rem;

    /* Typography */
    --font-base: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Dark mode placeholders (future) */
    --dark-app-bg: #0f172a;
    --dark-app-surface: #020617;
    --dark-app-text: #e5e7eb;
}

/* =====================================================
   2. GLOBAL RESETS (MINIMAL)
   ===================================================== */

html,
body {
    height: 100%;
}

body {
    font-family: var(--font-base);
    background-color: var(--app-bg);
    color: var(--app-text);
    margin: 0;
}

/* Avoid aggressive Bootstrap overrides */
a {
    text-decoration: none;
}

hr {
    border-color: var(--app-border);
}

/* =====================================================
   3. LAYOUT STRUCTURE
   ===================================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

.app-main {
    flex: 1;
    min-width: 0;
    padding-top: var(--navbar-height);
}

/* Fixed navbar offset helper */
.has-fixed-navbar {
    padding-top: var(--navbar-height);
}

/* =====================================================
   4. SIDEBAR STYLING
   ===================================================== */

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--app-surface);
    border-right: 1px solid var(--app-border);
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    z-index: 1020;
}

.sidebar .nav-link {
    color: var(--app-text);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.sidebar .nav-link:hover {
    background-color: var(--app-primary-soft);
    color: var(--app-primary);
}

.sidebar .nav-link.active {
    background-color: var(--app-primary);
    color: #ffffff;
}

/* Sidebar responsive behavior */
@media (max-width: 991.98px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--app-border);
    }
}

/* =====================================================
   5. CONTENT AREA STYLING
   ===================================================== */

.content-wrapper {
    margin-left: var(--sidebar-width);
    padding: var(--content-padding);
    background-color: var(--app-bg);
    min-height: calc(100vh - var(--navbar-height));
}

@media (max-width: 991.98px) {
    .content-wrapper {
        margin-left: 0;
        padding: 1rem;
    }
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--app-text);
}

/* Card spacing normalization */
.content-wrapper .card {
    border-color: var(--app-border);
}

/* =====================================================
   6. HELPER UTILITIES
   ===================================================== */

.navbar-brand-custom {
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--app-primary);
}

.navbar-brand-custom:hover {
    color: var(--app-primary);
}

.text-muted-soft {
    color: var(--app-text-muted);
}

.bg-surface {
    background-color: var(--app-surface);
}

.border-soft {
    border-color: var(--app-border);
}

/* Utility for consistent section spacing */
.section {
    margin-bottom: 1.5rem;
}

/* Future dark mode hook */
[data-theme="dark"] {
    /* intentionally empty for now */
}
