:root {
    /* Modern Navy Palette */
    --navy-950: #050b14;
    --navy-900: #0a1626;
    --navy-800: #0f223d; /* Primary Brand */
    --navy-700: #1a365d;
    --navy-600: #2a4365;
    --navy-500: #2c5282;
    --navy-400: #4299e1; /* Accent */
    --navy-100: #ebf8ff;
    --navy-050: #f7fafc;

    /* Semantic Colors */
    --color-bg: #f4f6f8;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text-primary: #1a202c;
    --color-text-secondary: #4a5568;
    --color-text-muted: #718096;
    --color-primary: var(--navy-800);
    --color-primary-hover: var(--navy-700);
    --color-accent: var(--navy-400);

    /* Dimensions */
    --sidebar-width: 260px;
    --header-height: 64px;
    --border-radius: 8px;
    --border-radius-sm: 4px;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-size: 14px; /* Slightly denser text */
    height: 100%;
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--navy-900);
    font-weight: 600;
}

/* Utilities */
.text-primary { color: var(--navy-700) !important; }
.bg-primary { background-color: var(--navy-800) !important; }
.text-muted { color: var(--color-text-muted) !important; }

/* Card Styling */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--navy-900);
}

.card-body {
    padding: 1.25rem;
}

/* Button Styling */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background-color: var(--navy-700);
    border-color: var(--navy-700);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.btn-outline-secondary:hover {
    background-color: var(--navy-050);
    color: var(--navy-900);
}

/* Form Controls */
.form-control, .form-select {
    border-radius: var(--border-radius-sm);
    border-color: var(--color-border);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--navy-400);
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}

/* Badge Styling */
.badge {
    font-weight: 500;
    letter-spacing: 0.025em;
    padding: 0.35em 0.65em;
}

/* Table Styling */
.table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    font-weight: 600;
    background-color: var(--navy-050);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
}

.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.table-hover tbody tr:hover {
    background-color: var(--navy-050);
}

/* Loading Spinner */
.spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2em;
}

/* Layout Container (Used in MainLayout) */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

.sidebar-wrapper {
    width: var(--sidebar-width);
    background: var(--navy-900);
    color: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    z-index: 1040;
}

.main-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--color-bg);
    height: 100vh;
    overflow-y: auto;
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.auth-header .logo-section i {
    font-size: 3rem;
}

.auth-header h2 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
}

/* Mobile Sidebar Logic */
@media (max-width: 768px) {
    .sidebar-wrapper {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
    }

    .sidebar-wrapper.show {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 1030;
        backdrop-filter: blur(2px);
    }
}
