:root {
    /* Boston Pizza Brand Palette (Exact Matches) */

    /* Brand Blue (Text, Headers, Primary) */
    --primary: #04034F;
    /* Pantone 2747C */
    --primary-light: #2A2970;
    /* Lighter shade for gradients/hovers */

    /* Brand Red (Accents, Buttons, Selected) */
    --accent: #E31E38;
    /* Pantone 185C */
    --accent-hover: #C4122C;

    /* Brand Beige (Backgrounds) */
    --bg-body: #FFEED4;
    /* Pantone 7499C */
    --bg-surface: #FFFFFF;
    /* White for cards to pop against beige */

    /* Text Colors - All Blue as requested */
    --text-main: #04034F;
    --text-secondary: rgba(4, 3, 79, 0.7);

    /* Status Colors */
    --success: #2E7D32;
    --danger: #E31E38;
    /* Use Brand Red for danger too */
    --warning: #F9A825;

    /* Shadows tinted with Blue */
    --shadow-sm: 0 1px 2px 0 rgba(4, 3, 79, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(4, 3, 79, 0.1), 0 2px 4px -1px rgba(4, 3, 79, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(4, 3, 79, 0.1), 0 4px 6px -2px rgba(4, 3, 79, 0.05);

    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

body {
    /* System fonts for maximum legibility */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    line-height: 1.5;
}

/* Sidebar - Refactored to Light Theme (Beige + Blue) */
.sidebar {
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    background-color: var(--bg-body);
    /* Beige Background */
    color: var(--primary);
    /* Blue Text */
    box-shadow: 1px 0 0 rgba(4, 3, 79, 0.1);
    /* Subtle border */
    border-right: 1px solid rgba(4, 3, 79, 0.1);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: 100vh;
    padding-top: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 600;
    /* Slightly bolder for blue on beige */
    color: var(--primary);
    /* Blue Text */
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.sidebar .nav-link:hover {
    color: var(--accent);
    /* Red on hover */
    background-color: rgba(227, 30, 56, 0.05);
    /* Faint red tint */
    opacity: 1;
}

.sidebar .nav-link.active {
    color: var(--accent);
    /* Red for selected */
    background-color: rgba(227, 30, 56, 0.1);
    border-right: 3px solid var(--accent);
    opacity: 1;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* Navbar */
.navbar-brand {
    font-weight: 800;
    letter-spacing: -0.025em;
    padding: 1rem 0;
    /* Adjusted padding */
    font-size: 1.25rem;
    /* Slightly smaller for mobile safety */
    color: var(--primary) !important;
    /* Blue Brand */
    text-decoration: none;
}

/* Header Background matches Body Beige */
.navbar.bg-light {
    background-color: var(--bg-body) !important;
    border-bottom: 1px solid rgba(4, 3, 79, 0.1);
}

/* Mobile Header Wrapper */
.mobile-header {
    background-color: var(--bg-body);
}

@media (min-width: 768px) {
    .navbar-brand {
        font-size: 1.5rem;
    }
}

/* Main Content */
main {
    padding-top: 2rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--radius-lg);
    background-color: var(--bg-surface);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #F1F5F9;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

/* Tables */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background-color: #F8FAFC;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #E2E8F0;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #F1F5F9;
    color: var(--text-main);
}

/* Login Page Specifics */
.login-body {
    background-color: var(--primary);
    background-image: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 1.5rem;
    border-radius: 50%;
    background: white;
    padding: 10px;
    box-shadow: var(--shadow-md);
}

.form-floating>.form-control {
    border-radius: var(--radius-md);
    border: 1px solid #E2E8F0;
}

.form-floating>.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

/* Mobile Optimizations */
@media (max-width: 768px) {

    /* Force tables to be wide enough to scroll */
    .table-responsive .table {
        white-space: nowrap;
    }

    /* Ensure sidebar links are big enough to tap */
    .sidebar .nav-link {
        padding: 1rem;
        font-size: 1.1rem;
    }

    /* Mobile Sidebar Padding to prevent Header Overlap */
    .sidebar {
        padding-top: 140px;
        /* Header is taller now with Sign Out button */
    }

    /* Force Mobile Header to full width for alignment */
    .mobile-header-container {
        width: 100% !important;
    }

    /* Mobile Sign Out Button (Red with White Text) */
    .sign-out-link {
        display: inline-block;
        background-color: var(--danger);
        /* Red */
        color: white !important;
        padding: 0.5rem 1.5rem;
        border-radius: 50px;
        /* Rounded pill */
        margin-top: 0.5rem;
        font-weight: 700;
        text-align: center;
        width: 90%;
        /* Almost full width */
        margin-left: 5%;
        box-shadow: 0 4px 6px rgba(227, 30, 56, 0.3);
    }
}

/* Desktop Fix for Sidebar Overlap */
@media (min-width: 769px) {
    .sidebar {
        z-index: 100;
        /* Behind header if needed, or adjust padding */
        padding-top: 80px;
        /* Push content down so "Dashboard" isn't hidden behind header */
    }

    .sign-out-link {
        /* Desktop: Simple Blue Link */
        color: var(--primary) !important;
        font-weight: 700;
    }
}

/* Ensure Active Link is always visible (High Contrast) */
.sidebar .nav-link.active {
    font-weight: 800 !important;
    /* Extra bold */
    background-color: rgba(227, 30, 56, 0.15);
    /* Slightly darker tint */
}