:root {
    /* Color Palette - Bordeaux & Modern Grey/Dark */
    --primary: #7C2832;
    --primary-hover: #9e3340;
    --primary-light: #ba4a5a;
    --background: #f8f9fa;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.9);
    --text-main: #2c3e50;
    --text-muted: #6c757d;
    --border: #e9ecef;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #1a1a2e;
        --surface: #16213e;
        --surface-glass: rgba(22, 33, 62, 0.9);
        --text-main: #e9ecef;
        --text-muted: #adb5bd;
        --border: #2c3e50;
    }
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.05em;
    text-align: center;
    margin-top: 2rem;
}

h2 {
    font-size: 1.75rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

main {
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-height: 80vh;
}

/* Glassmorphism Cards */
.card {
    background: var(--surface-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 40, 50, 0.1);
}

button,
input[type="submit"],
.btn {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: inline-block;
}

button:hover,
input[type="submit"]:hover,
.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    color: white;
}

/* Dashboard List */
.activity-list {
    list-style: none;
    padding: 0;
}

.activity-list li {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-list li:last-child {
    border-bottom: none;
}

/* Settings Form Specifics */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.checkbox-group input {
    width: auto;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
}

/* Status Messages */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    background: #e3f2fd;
    color: #0d47a1;
}

.alert-error {
    background: #ffebee;
    color: #b71c1c;
}

.alert-success {
    background: #e8f5e9;
    color: #1b5e20;
}

/* Navbar Components (Migrated from base.html) */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 auto;
    padding: 0.75rem 1rem;
}

.brand a {
    color: white;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.nav-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    font-weight: 600;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a:focus {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-1px);
}

.has-dropdown>a::after {
    content: ' ▾';
    font-size: 0.8em;
    margin-left: 0.25rem;
    opacity: 0.7;
}

/* Dropdown */
.dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: none;
    border-radius: var(--radius-md);
    padding: 0.5rem;
    z-index: 100;
    overflow: hidden;
}

.dropdown li a {
    color: var(--text-main);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
}

.dropdown li a:hover {
    background: var(--background);
    color: var(--primary);
    transform: none;
}

/* Dropdown Animation */
.dropdown.showing {
    display: block;
    animation: dropdown-fade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdown-fade {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 800px) {
    .nav-toggle {
        display: inline-block;
    }

    .nav-menu {
        position: absolute;
        right: 1rem;
        left: 1rem;
        top: 80px;
        flex-direction: column;
        background: var(--surface);
        padding: 1rem;
        border-radius: var(--radius-lg);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        display: none;
        align-items: stretch;
        border: 1px solid var(--border);
    }

    .nav-menu a {
        color: var(--text-main);
    }

    .nav-menu a:hover {
        background: var(--background);
        color: var(--primary);
    }

    .nav-menu.show {
        display: flex;
        animation: dropdown-fade 0.2s ease-out;
    }

    .dropdown {
        position: static;
        width: auto;
        box-shadow: none;
        border: none;
        margin: 0;
        padding-left: 1rem;
        background: transparent;
        display: none !important;
        /* JS toggles 'showing' which sets display block */
    }

    .dropdown.showing {
        display: block !important;
    }
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem 1rem;
    background: var(--surface);
    text-align: center;
    color: var(--text-muted);
    margin-top: auto;
}

footer a {
    color: var(--text-muted);
    font-weight: 500;
}

footer a:hover {
    color: var(--primary);
}