:root {
    --primary-color: #FF8C00;
    --primary-hover: #e67e00;
    --secondary-color: #333;
    --bg-color: #f4f4f4;
    --card-bg: #ffffff;
    --text-color: #333;
    --text-muted: #666;
    --border-color: #ddd;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --site-max-width: 1200px;
    --site-width: 94%;
    --site-min-width: 980px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --notification-red: #ef4444;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: auto;
    overflow-y: scroll;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-image: url('../img/background.png');
    background-size: max(1200px, 100%) auto;
    background-position: top center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 1042px;
    width: 100%;
}

/* Header */
header {
    background: linear-gradient(135deg, #FF8C00 0%, #FFA500 100%);
    color: #fff;
    width: var(--site-width) !important;
    max-width: var(--site-max-width);
    min-width: var(--site-min-width);
    margin: 20px auto 0 auto;
    padding: 0.75rem 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px rgba(255, 140, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1100;
}


.container {
    width: var(--site-width) !important;
    max-width: var(--site-max-width);
    min-width: var(--site-min-width);
    margin: 0 auto;
    padding: 0;
}



/* Verification Banner */
.verification-banner {
    background: #FFF4E5;
    border-bottom: 2px solid #FF8C00;
    color: #663C00;
    padding: 12px 20px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.verification-banner a,
.verification-banner button {
    color: #FF8C00;
    font-weight: 700;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.verification-banner a:hover,
.verification-banner button:hover {
    color: #e67e00;
}



@media (min-width: 1240px) {
    .container {
        margin: 0 auto;
    }
}

main.container {
    padding: 0;
    margin-top: 12px;
}

header h1 {
    margin: 0;
    font-size: 1.85rem;
    color: #fff;
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.5px;
}

.navbar-logo {
    height: 60px;
    width: auto;
    display: block;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    align-items: center;
}

header nav a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 8px 12px;
    position: relative;
    transition: color 0.3s ease;
}

header nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 2px;
    left: 50%;
    background-color: #fff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

header nav a:hover {
    color: #fff;
}

header nav a:hover::after {
    width: calc(100% - 24px);
}

/* Main Content */
main {
    flex: 1;
    padding: 0;
}

/* Body padding-bottom removed to fix footer gap */
body {
    padding-bottom: 0;
}

/* Cards */
/* Glassmorphism Cards */
.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.card h2 {
    margin-top: 0;
    color: var(--secondary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.3s, transform 0.1s;
    font-size: 0.9rem;
}

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

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

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid #e2e8f0;
    color: var(--secondary-color);
    transition: all 0.2s ease;
    font-weight: 600;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: transparent;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.2);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

/* Forms */
form {
    margin-top: 1rem;
}

.form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 500;
    color: #0f172a;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 0.5rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
    background: #fff;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 500;
    color: #0f172a;
    transition: all 0.2s ease;
}

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

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f8f9fa;
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #fafafa;
}

/* Authentication Page Specifics */
.auth-container {
    max-width: 480px;
    margin: 4rem auto;
    padding: 0 1rem;
}

.auth-container .card {
    background: #fff;
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.auth-container h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-container p {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
}

.auth-container .help-text {
    display: block;
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 0.8rem;
    line-height: 1.4;
}

.auth-container label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    display: block;
}

.auth-container input[type="text"],
.auth-container input[type="email"],
.auth-container input[type="password"] {
    background: #fcfcfc;
    border: 1.5px solid #eee;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-family);
    font-weight: 400;
    transition: all 0.2s ease;
}

.auth-container input:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.1);
    transform: translateY(-1px);
}

.auth-container .btn-primary {
    padding: 16px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(255, 140, 0, 0.25);
    margin-top: 1rem;
}

.auth-container .btn-outline {
    background: transparent;
    border: 1.5px solid #eee;
    color: var(--secondary-color);
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    font-weight: 600;
}

.auth-container .btn-outline:hover {
    background: #f8f8f8;
    border-color: #ddd;
}

/* Dashboard Specifics */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Breadcrumbs */
.breadcrumb-container {
    padding: 0;
    margin-top: 12px;
    margin-bottom: 0px;
}

.breadcrumb-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.breadcrumb-link {
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.breadcrumb-link:hover {
    color: var(--primary-color);
}

.breadcrumb-current {
    color: #1e293b;
    font-weight: 600;
    padding: 4px 0;
}

.breadcrumb-separator {
    display: flex;
    align-items: center;
    color: #94a3b8;
    margin: 0 10px;
}

.breadcrumb-separator svg {
    stroke-width: 2px;
}

/* Mobile Breadcrumb Adjustments */
@media (max-width: 768px) {
    .breadcrumb-container {
        margin-top: 10px;
    }

    .breadcrumb-card {
        padding: 10px 16px;
    }

    .breadcrumb-item {
        font-size: 0.8rem;
    }

    .breadcrumb-separator {
        margin: 0 8px;
    }
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* User Profile Dropdown */
.dropdown-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.user-profile-trigger {
    cursor: pointer;
    transition: all 0.2s ease;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
}

.user-profile-trigger:hover .avatar-circle {
    background: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    /* Perfectly flush with the header's bottom edge */
    right: -2.5rem;
    /* Matches the header's right padding to align with the absolute edge */
    min-width: 220px;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 16px !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15) !important;
    z-index: 3000 !important;
    display: none;
    overflow: hidden;
    padding: 0 !important;
    animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-dropdown.show {
    display: block !important;
}

.dropdown-header {
    padding: 16px 20px !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.user-email {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
}

.dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 20px !important;
    color: #334155 !important;
    text-decoration: none !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    background: none !important;
    border: none !important;
    width: 100% !important;
    box-shadow: none !important;
}

.dropdown-item:hover:not(.disabled) {
    background: #f8fafc;
    color: var(--primary-color);
}

.dropdown-item.disabled {
    opacity: 0.5;
    cursor: default;
}

.dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}

.logout-btn:hover {
    background: #fef2f2 !important;
    color: #ef4444 !important;
}



/* Responsive Design */
@media (max-width: 1200px) {
    header {
        max-width: none;
    }

    main.container {
        max-width: none;
        padding: 0;
    }
}

@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        margin: 20px auto 0 auto;
        padding: 0.75rem 2.5rem;
        border-radius: var(--border-radius-lg);
        position: relative;
    }

    /* Mobile menu styles removed */
    header nav {
        display: block;
    }

    header nav a {
        font-size: 1.1rem;
        padding: 8px 12px;
    }

    @keyframes navSlideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

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

    header h1 {
        font-size: 1.85rem;
    }

    main.container {
        padding: 0;
        margin-top: 15px;
        margin-left: auto;
        margin-right: auto;
    }

    .card {
        padding: 1.5rem;
    }

    table {
        font-size: 0.85rem;
    }

    th,
    td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    header {
        margin: 20px auto 0 auto;
        padding: 0.75rem 2.5rem;
    }

    header h1 {
        font-size: 1.85rem;
    }

    header nav a {
        font-size: 1.1rem;
        padding: 8px 12px;
    }

    main.container {
        padding: 0;
        margin-left: auto;
        margin-right: auto;
    }

    .card {
        padding: 1.5rem;
        border-radius: var(--border-radius-md);
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    table {
        font-size: 0.75rem;
    }

    th,
    td {
        padding: 6px 8px;
    }
}

/* --- Styles moved from base.html --- */

/* Toast Notifications */
#toast-container {
    position: fixed !important;
    top: 2rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 99999 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 250px;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    font-weight: 500;
    color: #333;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Area Selector & Dropdowns */
.area-selector button:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-1px);
}

.area-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    background: white;
    border: 1px solid #eee;
    border-radius: var(--border-radius-md);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    z-index: 2000;
    display: none;
    padding: 8px 0;
    animation: dropdownFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.area-dropdown.show {
    display: block;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

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

/* Legacy dropdown items replaced by global .dropdown-item above */

.dropdown-item:hover {
    background: #fdf2e9;
    color: var(--primary-color);
}

.dropdown-item.active {
    font-weight: 700;
    color: var(--primary-color);
    background: #fff8f1;
    box-shadow: inset 3px 0 0 var(--primary-color);
}

/* Footer Hover */
footer a:hover {
    color: var(--primary-color) !important;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid white;
    line-height: 1;
}

.badge-overlay {
    position: absolute;
    top: -5px;
    right: -5px;
    pointer-events: none;
}

.dropdown-item .badge {
    margin-left: auto;
    border: none;
    width: 16px;
    height: 16px;
    font-size: 10px;
}