@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================
   1. VARIABLES (THEME CONTROL PANEL) & GLOBAL RESETS
   ========================================================== */
:root {
    /* Primary Colors (from your screenshot) */
    --primary-color: #008080; /* The darker, more professional teal */
    --primary-color-light: #00A99D; /* The brighter teal for accents */
    --primary-color-dark: #006666; /* For hover states */

    /* Header & Navigation */
    --header-bg: #343a40; /* The dark header from your second screenshot */
    --header-text: #ffffff;
    
    --dropdown-bg: #ffffff;
    --dropdown-hover-bg: #f1f1f1;

    /* Body & Content */
    --body-bg: #343a40;
    --content-bg: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.06);

    /* Welcome Banner */
    --welcome-banner-bg: #e0f2f1;
    --welcome-banner-border: #008080;
    --welcome-banner-text-heading: #004d4d;
    --welcome-banner-text-body: #006666;

    /* Font */
    --font-family: 'Inter', sans-serif;
}

/* Global Resets */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--body-bg);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20; vertical-align: middle; }
a { text-decoration: none; }

/* ==========================================================
   2. CORE LAYOUT & HEADER
   ========================================================== */
.container { width: 95%; max-width: 1300px; margin: 25px auto; padding: 25px; background-color: var(--content-bg); border-radius: 12px; box-shadow: 0 5px 25px var(--shadow-color); position: relative; z-index: 1; }
header { background-color: var(--header-bg); color: var(--header-text); padding: 0.5rem 0; border-bottom: 1px solid var(--header-border); position: sticky; top: 0; z-index: 1020; }
header .header-content {
    display: flex;
    justify-content: space-between; /* Changed from space-between */
    align-items: center;
    gap: 20px; /* NEW: This creates a consistent space between logo and nav */
    width: 95%;
    max-width: 1300px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 6px;
    
}

#crm-logo { height: 45px; width: auto; max-width: 180px; } /* Assuming you have a version of the logo that works on a dark background */
footer { background-color: var(--header-bg); color: #adb5bd; text-align: center; padding: 1.5rem 0; font-size: 0.9rem; margin-top: auto; }
.footer-separator { display: inline-block; width: 1px; height: 12px; background-color: rgba(255, 255, 255, 0.2); margin: 0 20px; vertical-align: middle; }

/* ==========================================================
   NEW STYLES FOR UNIFIED ADD/EDIT PAGES
   ========================================================== */

/* Defines the two-column grid layout for forms */
.form-grid.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
.form-column {
    display: flex;
    flex-direction: column;
}
/* Aligns the action buttons to the right */
.form-actions {
    margin-top: auto; /* Pushes to the bottom of the column */
    padding-top: 20px; /* Space above the buttons */
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
/* A simple style for a required field indicator */
.required {
    color: #dc3545;
    font-weight: bold;
}
/* Styles the non-editable fields to look "disabled" */
.form-control-static {
    padding: 12px 15px;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-height: 50px; /* Matches your input height */
    display: flex;
    align-items: center;
    color: var(--text-dark);
}
/* Make the layout responsive on smaller screens */
@media (max-width: 800px) {
    .form-grid.two-col {
        display: block;
    }
}

/* ==========================================================
   3. REFINED NAVIGATION STYLES (for new HTML)
   ========================================================== */
.nav-container { display: flex; align-items: center; margin-left: auto; }
nav { position: relative; }
nav ul { list-style: none; padding: 0; margin: 0; }
.dropdown-menu { display: none; }
.dropdown-li.is-open > .dropdown-menu { display: block; }

/* Desktop Navigation */
@media (min-width: 992px) {
    .hamburger-menu, .nav-overlay { display: none; }
    nav > ul { display: flex; align-items: center; gap: 8px; }
    .dropdown-li { position: relative; }
    .dropdown-toggle {
        display: inline-flex; align-items: center; gap: 8px;
        background-color: #f8f9fa; color: var(--text-dark);
        border: 1px solid #e0e0e0; border-radius: 8px;
        padding: 10px 15px; font-family: var(--font-family);
        font-size: 0.95rem; font-weight: 500; cursor: pointer;
        transition: background-color 0.2s, border-color 0.2s; white-space: nowrap;
    }
    .dropdown-toggle:hover { background-color: #e9ecef; }
    .dropdown-li.is-open > .dropdown-toggle, .dropdown-li.active > .dropdown-toggle {
        background-color: var(--primary-color); border-color: var(--primary-color-dark);
        color: #fff;
    }
    .dropdown-toggle .material-symbols-outlined:last-child { transition: transform 0.2s ease-in-out; }
    .dropdown-li.is-open > .dropdown-toggle .material-symbols-outlined:last-child { transform: rotate(180deg); }
    .dropdown-menu {
        position: absolute; top: calc(100% + 5px); left: 0; z-index: 1030;
        min-width: 240px; background-color: var(--dropdown-bg);
        border: 1px solid var(--border-color); border-radius: 8px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.1); padding: 8px;
    }
    .user-profile-menu .dropdown-menu { left: auto; right: 0; }
    .dropdown-menu li a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; font-size: 0.9rem; border-radius: 6px; }
    .dropdown-menu li a:hover { background-color: var(--dropdown-hover-bg); }
    .menu-divider { height: 1px; background-color: var(--border-color); margin: 8px 0; }
}

/* Mobile Navigation */
@media (max-width: 991px) {
    body.mobile-menu-active { overflow: hidden; }
    body.mobile-menu-active .nav-overlay { display: block; opacity: 1; }
    body.mobile-menu-active nav { transform: translateX(0); }
    .nav-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1020; display: none; opacity: 0; transition: opacity 0.3s; }
    .hamburger-menu { display: block; width: 30px; height: 24px; cursor: pointer; background: transparent; border: none; z-index: 1051; position: relative; }
    .hamburger-menu span { display: block; position: absolute; height: 3px; width: 100%; background: var(--text-dark); border-radius: 3px; left: 0; transition: all 0.25s; }
    .hamburger-menu span:nth-child(1) { top: 0; } .hamburger-menu span:nth-child(2) { top: 10px; } .hamburger-menu span:nth-child(3) { top: 20px; }
    body.mobile-menu-active .hamburger-menu span:nth-child(1) { top: 10px; transform: rotate(135deg); }
    body.mobile-menu-active .hamburger-menu span:nth-child(2) { opacity: 0; }
    body.mobile-menu-active .hamburger-menu span:nth-child(3) { top: 10px; transform: rotate(-135deg); }
    nav { position: fixed; top: 0; right: 0; width: 280px; height: 100%; background: var(--content-bg); box-shadow: -5px 0 15px rgba(0,0,0,0.1); z-index: 1050; padding-top: 80px; overflow-y: auto; transform: translateX(100%); transition: transform 0.3s; }
    nav > ul { flex-direction: column; }
    .dropdown-li { width: 100%; border-bottom: 1px solid var(--border-color); }
    .dropdown-toggle { display: flex; align-items: center; width: 100%; background: transparent; border: none; padding: 15px; text-align: left; font-size: 1rem; gap: 15px; }
    .dropdown-toggle > span:not(.material-symbols-outlined) { flex-grow: 1; }
    .dropdown-li.is-open > .dropdown-toggle { background-color: var(--primary-color); color: #fff; }
    .dropdown-menu { position: static; width: 100%; box-shadow: none; border: none; background: #f8f9fa; padding: 0 0 10px 0; }
    .dropdown-menu li a { display: flex; align-items: center; gap: 15px; padding: 12px 20px 12px 30px; font-size: 0.95rem; }
}


/* ==========================================================
   4. REFINED & PRESERVED COMPONENT STYLES
   ========================================================== */
/* Main Content Headers */
.page-header { display: flex; align-items: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.page-header .material-symbols-outlined { font-size: 2.8rem; margin-right: 15px; color: var(--primary-color); }
.page-header h1 { font-size: 2.2rem; border-bottom: none; margin-bottom: 0; padding-bottom: 0; color: var(--text-dark); font-weight:700;}

/* Dashboard Specifics */
/* ==========================================================
   DEFINITIVE Welcome Banner Styles
   ========================================================== */

/* The main banner container */
.dashboard-welcome {
    display: flex;
    justify-content: space-between; /* Pushes text left, GIF right */
    align-items: center;            /* Vertically aligns them */
    gap: 20px;                      /* Creates space between them */
    flex-wrap: nowrap;              /* THIS IS THE KEY: Prevents wrapping on mobile */
    
    padding: 20px 25px;
    background-color: var(--welcome-banner-bg);
    border-left: 5px solid var(--welcome-banner-border);
    margin-bottom: 30px;
    border-radius: 8px;
}

/* The text content on the left */
.dashboard-welcome .welcome-text {
    flex-grow: 1; /* Allows the text block to take up all available space */
}
.dashboard-welcome .welcome-text h2 {
    margin-top:0;
    color: var(--welcome-banner-text-heading);
    font-size: 1.5rem;
}
.dashboard-welcome .welcome-text p {
    color: var(--welcome-banner-text-body);
    font-size: 1rem;
    margin-bottom: 0;
}

/* The GIF container on the right */
.greeting-svg-container {
    flex-shrink: 0; /* Prevents the GIF from shrinking */
    width: 60px;
    height: 60px;
}
.greeting-svg-container img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures the GIF scales nicely without distortion */
}

.dashboard-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:25px; }
.dashboard-card { background-color: var(--content-bg); padding:20px; border-radius:10px; box-shadow:0 4px 15px var(--shadow-color); border:1px solid var(--border-color); transition:transform .2s ease,box-shadow .2s ease; display:flex; flex-direction:column;}
.dashboard-card:hover { transform:translateY(-3px); box-shadow:0 6px 20px rgba(0,0,0,0.08); }
.dashboard-card h3 { margin-top:0; margin-bottom:20px; color: var(--primary-color-light); font-size:1.1rem; font-weight:600; display:flex; align-items:center; gap: 10px;}

/* REFINED: Dashboard card font sizes */
.dashboard-card p.card-metric {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}
.dashboard-card p.card-metric strong {
    font-size: 1.8rem;
    font-weight: 700;
    margin-right: 0.5rem;
}
.dashboard-card p.card-main-action {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
}
.dashboard-card .card-actions { margin-top:auto; padding-top: 1rem; }
.dashboard-card .card-actions a {
    color: var(--primary-color); /* CORRECTED LINK COLOR */
    text-decoration:none;
    font-weight:600;
    font-size:0.9rem;
}
.dashboard-card .card-actions a:hover { color: var(--primary-color-dark); }


/* Forms (Preserved) */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: #495057; }
.form-group input:not([type=checkbox]):not([type=radio]),
.form-group select.form-control, .form-group textarea.form-control {
    width: 100%; padding: 12px 15px; border: 1px solid var(--border-color); border-radius: 8px; font-family: var(--font-family); font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease; background-color: #fff; color: #495057;
}
.form-group input:focus, .form-group select.form-control:focus, .form-group textarea.form-control:focus {
    border-color: var(--primary-color) !important; box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--primary-color) 25%, transparent) !important; outline: none !important;
}

/* Buttons (Preserved & Themed) */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; font-size: 0.95rem; font-weight: 600; text-align: center; text-decoration: none; border-radius: 8px; cursor: pointer; transition: all 0.2s ease-in-out; border: 1px solid transparent; line-height: 1.5; }
.btn .material-symbols-outlined { margin-right: 8px; font-size: 1.2em; line-height:0; }
.btn-primary { background-color: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.btn-primary:hover { background-color: var(--primary-color-dark); border-color: var(--primary-color-dark); }
/* Other buttons... */
.btn-secondary { background-color: #6c757d; border-color: #6c757d; color: #fff; }
.btn-secondary:hover { background-color: #5a6268; border-color: #545b62; }
.btn-success { background-color: #198754; border-color: #198754; color: #fff; }
.btn-success:hover { background-color: #157347; border-color: #146c43; }
.btn-danger { background-color: #dc3545; border-color: #dc3545; color: #fff; }
.btn-danger:hover { background-color: #bb2d3b; border-color: #b02a37; }


/* Tables & Other Components (Preserved) */
table { width:100%; border-collapse:separate; border-spacing:0; margin-bottom:20px; font-size:0.9rem; box-shadow: var(--shadow-color); border-radius:10px; border:1px solid var(--border-color); }
table th, table td { border-bottom:1px solid var(--border-color); padding:12px 15px; text-align:left; vertical-align:middle; }
table th { background-color:#f8f9fa; font-weight:600; color:#495057; }
table tbody tr:hover { background-color:#e9f5ff; }
.alert { padding:15px 20px; margin-bottom:20px; border:1px solid transparent; border-radius:8px; display:flex; align-items:center; }
fieldset { border:1px solid var(--border-color); padding:20px; margin-bottom:20px; border-radius:8px; }
fieldset legend { font-weight:600; padding:0 10px; color: var(--primary-color); font-size:1.1rem; }

/* ==========================================================
   FIX for Invisible Navigation Buttons (Nov 2023)
   ========================================================== */

/* 1. This creates the white "container" bar inside the dark header */
header .header-content {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 8px 15px;
}

/* 2. This makes the button text dark, so it's visible on the new white bar */
@media (min-width: 992px) {
    .dropdown-toggle {
        color: var(--text-dark); /* Change from white text to dark gray text */
        border-color: #ffffff;   /* A light border to match the look */
        background-color: #ffffff; /* A very light gray background to stand out slightly */
    }

    .dropdown-toggle:hover {
        background-color: #e9ecef; /* A standard, slightly darker hover */
        border-color: #ffffff;
    }

    /* This part is correct and stays the same: when a button is active, it turns teal with white text */
    .dropdown-li.is-open > .dropdown-toggle,
    .dropdown-li.active > .dropdown-toggle {
        background-color: var(--primary-color);
        border-color: var(--primary-color-dark);
        color: #fff; /* Text becomes white again on the active teal background */
    }
}
.hamburger-menu span {
    background: #006666 !important; /* Makes the hamburger lines white */
}

/* ==========================================================
   FIX for ALL Standalone/Tool Pages (Login, Reset, etc.)
   ========================================================== */

/* 1. Style the body for all these pages */
body.login-page-body,
body.tool-page {
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100vh;
}

/* 2. Style the main content box for both pages */
.login-container,
.tool-container-simple {
    width: 100%;
    max-width: 550px; /* Use the larger width for the reset tool */
    margin: 20px auto;
    padding: 30px 35px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

/* Make login container slightly smaller */
.login-container {
    max-width: 420px;
}

/* 3. Style the headers and links inside the boxes */
.login-container h2,
.tool-container-simple h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.5rem;
    color: var(--text-dark);
}

.login-container p a,
.tool-container-simple p a {
    color: var(--primary-color);
    font-weight: 500;
}
.login-container p a:hover,
.tool-container-simple p a:hover {
    color: var(--primary-color-dark);
}

/* 4. Style the footer for all these pages to be light */
body.login-page-body footer,
body.tool-page footer {
    background-color: transparent;
    color: var(--text-light);
    border-top: none; /* Remove the top border it might inherit */
}

/* ==========================================================
   MODAL & PAGINATION STYLES (for Filter System)
   ========================================================== */

/* --- The Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    transform: translateY(-50px);
    transition: transform 0.3s;
}

.modal-overlay.is-visible .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.modal-header h3 { margin: 0; font-size: 1.5rem; }
.close-btn { background: none; border: none; font-size: 2rem; color: var(--text-light); cursor: pointer; line-height: 1; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 10px;
}

/* --- The Form Inside the Modal --- */
.filter-form-modal {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two-column layout */
    gap: 20px;
}
.filter-form-modal .form-group:first-child {
    grid-column: 1 / -1; /* Make the search bar span both columns */
}

/* --- The Pagination Controls --- */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 20px;
}
.per-page-selector form {
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-info { font-size: 0.9rem; color: var(--text-light); }
.page-buttons { display: flex; gap: 10px; }

/* ==========================================================
   FINAL POLISH for Data Table Pages
   ========================================================== */

/* Fix the Page Header alignment */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.page-header-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
}
page-header-title h1 {
    display: flex;
    align-items: center; /* This is the key property */
    gap: 15px;
    margin: 0;
}
.page-header-actions {
    display: flex;
    gap: 10px;
}

/* Make the table scroll horizontally on small screens */
.table-responsive-wrapper {
    overflow-x: auto;
    width: 100%;
}

/* ==========================================================
   FINAL POLISH for Data Table Pages (Nov 2023)
   ========================================================== */

/* --- 1. Rule #7: Highlighting for Table Rows --- */
tr.row-overdue {
    background-color: #ffebee !important; /* A subtle, light red */
    font-weight: 500;
}
tr.row-today {
    background-color: #e3f2fd !important; /* A subtle, light blue */
}
/* Ensure hover effect still works on highlighted rows */
tr.row-overdue:hover,
tr.row-today:hover {
    background-color: #e9f5ff !important; /* Your existing hover color */
}

/* ==========================================================
   TOGGLE SWITCH STYLES (for Filter Modals)
   ========================================================== */

.modal-footer {
    justify-content: space-between; /* This is a change to the existing rule */
    align-items: center;
}
.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.toggle-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0; /* Override default form-group margin */
}
.toggle-switch-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0;
    cursor: pointer;
}

/* The switch - a container for our slider */
.switch {
    position: relative;
    display: inline-block;
    width: 50px; /* Width of the switch */
    height: 28px; /* Height of the switch */
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px; /* Size of the circle */
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    -webkit-transform: translateX(22px); /* How far the circle moves */
    -ms-transform: translateX(22px);
    transform: translateX(22px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ==========================================================
   STATUS BADGE STYLES (for Projects Table)
   ========================================================== */

.status-badge {
    display: inline-flex;
    justify-content: center;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 12px;
    
    min-width: 80px;
}

/* Color Coding */
.status-badge.status-active,
.status-badge.status-upcoming {
    background-color: #d4edda; /* Light Green */
    color: #155724;
}

.status-badge.status-pending-approval {
    background-color: #fff3cd; /* Light Yellow */
    color: #856404;
}

.status-badge.status-on-hold {
    background-color: #d6d8db; /* Light Gray */
    color: #383d41;
}

.status-badge.status-sold-out {
    background-color: #cce5ff; /* Light Blue */
    color: #004085;
}

.status-badge.status-rejected,
.status-badge.status-permanently-rejected,
.status-badge.status-deleted {
    background-color: #f8d7da; /* Light Red */
    color: #721c24;
}

/* ==========================================================
   LOGIN PAGE SPECIFIC STYLES (NEW)
   ========================================================== */

/* The container for the logo */
.login-logo-container {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 5px;
}

/* The logo image itself */
#stacked-logo {
    height: 150px;
    width: auto;
    max-width: 80%;
    display: inline-block; /* Correct display for text-align to work */
}

/* ==========================================================
   PASSWORD VISIBILITY TOGGLE (DEFINITIVE FIX)
   ========================================================== */

.password-wrapper {
    position: relative;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 45px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--text-light);
}

.toggle-password:hover {
    color: var(--text-dark);
}

/* This rule is highly specific and ensures the icon renders correctly */
.toggle-password > .material-symbols-outlined {
    font-family: 'Material Symbols Outlined'; /* Use the correct font */
    font-size: 24px;                          /* Set a consistent size */
    font-weight: 400;                         /* Use the normal font weight */
    user-select: none;                        /* Prevent the icon text from being selectable */
}

/* ==========================================================
   LOGIN ERROR "RED FLASH" ANIMATION
   ========================================================== */

/* This class will be added by JavaScript to trigger the animation */
.login-container.has-error {
    /* The animation will run for 0.5 seconds */
    animation: shake-horizontal 0.5s cubic-bezier(0.455, 0.030, 0.515, 0.955) both;
    
    /* We can also add a persistent red glow while the error is active */
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.25);
    border: 1px solid rgba(220, 53, 69, 0.5);
}

/* The @keyframes rule defines the steps of the animation */
@keyframes shake-horizontal {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* ==========================================================
   LOGIN BUTTON DYNAMIC STATES
   ========================================================== */

/* The main login button needs to be full-width */
.btn-login {
    width: 100%;
    transition: background-color 0.3s ease, border-color 0.3s ease; /* Smooth color changes */
}

/* State: Loading */
.btn-login.is-loading {
    background-color: #6c757d; /* A neutral gray */
    border-color: #6c757d;
    cursor: wait;
}

/* State: Error (Invalid Credentials or Inactive) */
.btn-login.is-error {
    background-color: #dc3545; /* Red for error */
    border-color: #dc3545;
}

/* State: Success */
.btn-login.is-success {
    background-color: #198754; /* Green for success */
    border-color: #198754;
}

/* ==========================================================
   LOGIN HERO ANIMATION (FINAL - REWRITTEN)
   ========================================================== */

/* The hidden dashboard header on the login page */
.login-animation-header {
    position: fixed;
    /* Positioned to align with the final destination in the main app header */
    top: 20px; 
    left: calc(2.5% + 20px); 
    opacity: 0; /* Hidden by default */
    transition: opacity 0.4s ease-in-out 0.4s; /* Fade in with a delay */
}
.login-animation-header img {
    height: 45px;
    width: auto;
}

/* Base transition rules for the elements that will animate */
.login-logo-container, .login-container {
    transition: transform 0.8s cubic-bezier(0.6, 0, 0.2, 1), opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================
   NEW STYLES FOR VIEW DETAILS PAGES
   ========================================================== */

/* Fixes the "boxes around data" issue */
.info-group {
    margin-bottom: 15px;
}
.info-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 3px;
}
.info-group .info-value {
    font-size: 1rem;
    padding: 5px 0;
}
.info-group .info-value a {
    font-weight: 500;
    color: var(--primary-color);
}
.info-value.notes-display {
    white-space: pre-wrap; /* Preserves line breaks in notes */
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
}

/* ==========================================================
   NEW STYLES FOR FOLLOW-UP DATE HIGHLIGHTING
   ========================================================== */
.info-group.highlight-overdue-critical { background-color: #f8d7da; color: #721c24; /* Red */ }
.info-group.highlight-overdue { background-color: #ffebee; color: #c62828; /* Light Red */ }
.info-group.highlight-today { background-color: #fff3cd; color: #856404; /* Yellow */ }
.info-group.highlight-tomorrow { background-color: #e0f2f1; color: #004d4d; /* Light Teal/Yellow */ }

/* Common styles for all highlighted follow-ups */
.info-group[class*="highlight-"] .info-value {
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 4px;
}

/* Styles for the follow-up history log */
.follow-up-log { max-height: 300px; overflow-y: auto; }
.follow-up-entry {
    background-color: #f8f9fa;
    border-left: 3px solid var(--primary-color-light);
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}
.follow-up-entry p { margin: 5px 0 0 0; }
.follow-up-entry small { color: var(--text-light); }

/* --- Fix for Requirement #5 --- */
.form-actions {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap */
    justify-content: flex-end; /* Align to the right on desktop */
    gap: 10px;
}

@media (max-width: 600px) {
    .form-actions {
        flex-direction: column; /* Stack buttons vertically */
        align-items: stretch; /* Make them full-width */
    }
    .form-actions .btn {
        width: 100%;
        justify-content: center; /* Center text and icon */
        font-size: 1.1rem;
        padding: 12px;
    }
}

/* ==========================================================
   NEW STYLES FOR COMPACT VIEW DETAILS PAGES
   ========================================================== */

.details-section {
    margin-bottom: 25px;
}

.details-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px 32px; /* Less vertical gap, more horizontal */
}

.details-grid .info-group {
    padding: 5px 0;
}

/* NEW: Clear Hyperlink Style */
.info-value a.action-link {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.info-value a.action-link:hover {
    color: var(--primary-color-dark);
}

/* Make Follow-up History more compact */
.follow-up-history {
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    padding-top: 15px;
}

/* ==========================================================
   NEW STYLES FOR FOLLOW-UP LOG ICONS
   ========================================================== */
.follow-up-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}
.follow-up-header .material-symbols-outlined {
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* ==========================================================
   FIX FOR MOBILE HORIZONTAL SCROLLING
   ========================================================== */
.mobile-scroll-wrapper {
    width: 100%;
    overflow-x: auto; /* Enables horizontal scrolling */
    -webkit-overflow-scrolling: touch; /* Adds smooth scrolling on iOS */
    padding-bottom: 15px; /* Gives space for the scrollbar */
}

/* ==========================================================
   EXPANDED STATUS BADGE STYLES
   ========================================================== */

/* This rule groups all "bad" statuses to be red */
.status-badge.status-rejected,
.status-badge.status-permanently_rejected,
.status-badge.status-deleted {
    background-color: #f8d7da; /* Light Red */
    color: #721c24;
}

/* This rule groups all "neutral" or "inactive" statuses to be gray */
.status-badge.status-on-hold,
.status-badge.status-do_not_contact {
    background-color: #d6d8db; /* Light Gray */
    color: #383d41;
}

/* This rule groups "good" statuses to be green */
.status-badge.status-active,
.status-badge.status-upcoming,
.status-badge.status-sold-out, /* Sold Out is a positive outcome */
.status-badge.status-closed-won {
    background-color: #d4edda; /* Light Green */
    color: #155724;
}

/* This rule groups "needs attention" statuses to be yellow */
.status-badge.status-pending_approval,
.status-badge.status-pending_follow_up,
.status-badge.status-contacted {
    background-color: #fff3cd; /* Light Yellow */
    color: #856404;
}

.swal2-container {
    z-index: 2001;
}

/* Custom style for the biometric login button */
#biometric-login-btn {
    background: transparent;
    border: none;
    color: #008080; /* Your --primary-color */
    cursor: pointer;
    padding: 8px; /* Gives a slightly larger clickable area */
    border-radius: 50%; /* Makes the hover effect look nice and circular */
    transition: background-color 0.2s ease-in-out;
}

/* Add a subtle visual feedback on hover/focus */
#biometric-login-btn:hover,
#biometric-login-btn:focus {
    background-color: rgba(0, 128, 128, 0.1); 
}

/* Adjust icon size if needed */
#biometric-login-btn .material-symbols-outlined {
    font-size: 60px; 
}

.gallery-container {
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-top: 30px; /* This was gap: 30px before */
    border-radius: 8px;
}
.gallery-container fieldset {
    border: none;
    padding: 0;
    margin-bottom: 0;
}

.dropdown-menu a,
.dropdown-menu a:visited,
.dropdown-menu a:hover,
.dropdown-menu a:active {
    color: #008080; /* Your desired color */
}

/* User Management Row Styles */
tr.table-danger,
tr.table-danger > td {
    background-color: #f8d7da !important; /* Light Red */
    color: #721c24;
}

tr.table-warning,
tr.table-warning > td {
    background-color: #fff3cd !important; /* Light Yellow */
    color: #856404;
}

/* Pagination Styles */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
    margin-top: 20px;
    justify-content: center;
}
.page-item {
    margin: 0 2px;
}
.page-item .page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    line-height: 1.25;
    color: #008080;
    background-color: #fff;
    border: 1px solid #008080;
    text-decoration: none;
}
.page-item.active .page-link {
    z-index: 1;
    color: #fff;
    background-color: #008080;
    border-color: #008080;
}
.page-item:first-child .page-link {
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}
.page-item:last-child .page-link {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

/* ========================================= */
/* === STYLES FOR ADMIN USER MANAGEMENT ==== */
/* ========================================= */

/* 1. User Management Row Styles */
tr.table-danger,
tr.table-danger > td {
    background-color: #f8d7da !important; /* Light Red */
    color: #721c24;
}

tr.table-warning,
tr.table-warning > td {
    background-color: #fff3cd !important; /* Light Yellow */
    color: #856404;
}

/* 2. Pagination Styles */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
    margin-top: 20px;
    justify-content: center;
}
.page-item {
    margin: 0 2px;
}
.page-item .page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    line-height: 1.25;
    color: #007bff;
    background-color: #fff;
    border: 1px solid #dee2e6;
    text-decoration: none;
}
.page-item.active .page-link {
    z-index: 1;
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
.page-item:first-child .page-link {
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}
.page-item:last-child .page-link {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

/* 3. Modal (Popup) Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 25px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 500px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
}

#addUserForm .form-group {
    margin-bottom: 15px;
}

#addUserForm label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

#addUserForm input[type="text"],
#addUserForm input[type="email"],
#addUserForm input[type="password"],
#addUserForm select {
    box-sizing: border-box; /* Important for consistent sizing */
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#modal-error-message {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none; /* Hidden by default */
}

/* ========================================= */
/* === STYLES FOR VIEW USER DETAILS PAGE === */
/* ========================================= */

.profile-container {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 25px 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 20px auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.profile-header h2 {
    margin: 0;
    font-size: 1.75rem;
    color: #343a40;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.details-section h3 {
    font-size: 1.1rem;
    color: #495057;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.details-section h3 .material-symbols-outlined {
    font-size: 1.4rem;
}

.detail-item {
    margin-bottom: 20px;
}

.detail-item label {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.detail-item p {
    margin: 0;
    font-size: 1rem;
    color: #212529;
    display: flex;
    align-items: center;
}

.detail-item .icon-link {
    font-size: 1.2rem;
    color: #007bff;
    text-decoration: none;
    margin-left: 8px;
}
.detail-item .icon-link:hover {
    color: #0056b3;
}

.profile-actions {
    border-top: 1px solid #e9ecef;
    padding-top: 25px;
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .profile-actions {
        flex-direction: column;
    }
    .profile-actions .btn {
        width: 100%;
    }
}

/* ========================================= */
/* === STYLES FOR VIEW USER DETAILS PAGE === */
/* ========================================= */

.profile-container {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 25px 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-width: 900px;
    margin: 20px auto;
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* This will push items to opposite ends */
    gap: 15px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.profile-header-main {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-header h2 {
    margin: 0;
    font-size: 1.75rem;
    color: #343a40;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-badge.active { background-color: #d4edda; color: #155724; }
.status-badge.inactive { background-color: #f8d7da; color: #721c24; }


.header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}
.header-action-btn.deactivate { color: #dc3545; }
.header-action-btn.deactivate:hover { background-color: #f8d7da; }
.header-action-btn.activate { color: #28a745; }
.header-action-btn.activate:hover { background-color: #d4edda; }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.details-section h3 { font-size: 1.1rem; color: #495057; margin-top: 0; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.details-section h3 .material-symbols-outlined { font-size: 1.4rem; }
.detail-item { margin-bottom: 20px; }
.detail-item label { display: block; font-size: 0.85rem; color: #6c757d; margin-bottom: 4px; }
.detail-item p { margin: 0; font-size: 1rem; color: #212529; display: flex; align-items: center; }
.detail-item .icon-link { font-size: 1.2rem; color: #007bff; text-decoration: none; margin-left: 8px; }
.detail-item .icon-link:hover { color: #0056b3; }

.profile-actions {
    border-top: 1px solid #e9ecef;
    padding-top: 25px;
    margin-top: 15px;
    display: flex;
    justify-content: center; /* Center the buttons */
    gap: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-header { flex-direction: column; align-items: flex-start; }
    .profile-grid { grid-template-columns: 1fr; gap: 20px; }
    .profile-actions { flex-direction: column; }
    .profile-actions .btn { width: 100%; }
}


/* ========================================= */
/* === STYLES FOR VIEW USER DETAILS PAGE (FINAL) === */
/* ========================================= */

.profile-container { background-color: #ffffff; border-radius: 12px; padding: 25px 30px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); max-width: 900px; margin: 20px auto; }
.profile-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid #e9ecef; padding-bottom: 15px; margin-bottom: 25px; }
.profile-header-main { display: flex; align-items: center; gap: 15px; }
.profile-header h2 { margin: 0; font-size: 1.75rem; color: #343a40; }
.status-badge { padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; }
.status-badge.active { background-color: #d4edda; color: #155724; }
.status-badge.inactive { background-color: #f8d7da; color: #721c24; }

/* Prominent Header Action Button */
.header-action-btn { display: inline-flex; align-items: center; gap: 8px; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; font-weight: 600; transition: all 0.2s; }
.header-action-btn .material-symbols-outlined { font-size: 1.25rem; }
.header-action-btn.deactivate { color: #fff; background-color: #dc3545; }
.header-action-btn.deactivate:hover { background-color: #c82333; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.header-action-btn.activate { color: #fff; background-color: #28a745; }
.header-action-btn.activate:hover { background-color: #218838; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.details-section h3 { font-size: 1.1rem; color: #495057; margin-top: 0; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.details-section h3 .material-symbols-outlined { font-size: 1.4rem; }
.detail-item { margin-bottom: 20px; }
.detail-item label { display: block; font-size: 0.85rem; color: #6c757d; margin-bottom: 4px; }
.detail-item p { margin: 0; font-size: 1rem; color: #212529; display: flex; align-items: center; }
.detail-item .icon-link { font-size: 1.2rem; color: #007bff; text-decoration: none; margin-left: 8px; }
.detail-item .icon-link:hover { color: #0056b3; }
.profile-actions { border-top: 1px solid #e9ecef; padding-top: 25px; margin-top: 15px; display: flex; justify-content: center; gap: 15px; }
.profile-actions .btn .material-symbols-outlined { vertical-align: middle; margin-right: 4px; }


/* Styles for Edit User Modal (inherits from previous modal styles) */
#editUserForm .form-group { margin-bottom: 15px; }
#editUserForm label { display: block; margin-bottom: 5px; font-weight: bold; }
#editUserForm input[type="text"], #editUserForm input[type="email"] { box-sizing: border-box; width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; }

@media (max-width: 768px) {
    .profile-header { flex-direction: column; align-items: flex-start; }
    .profile-grid { grid-template-columns: 1fr; gap: 20px; }
    .profile-actions { flex-direction: column; }
    .profile-actions .btn { width: 100%; }
}

.modal-grid {
    gap: 20px !important;
    padding: 0 10px;
}

.modal select {
    box-sizing: border-box;
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
}

/* Add to your css/style.css file */

/* For the new KPI cards */
.kpi-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.kpi-card .kpi-number {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
    color: #008080; /* Your accent color */
}
.kpi-card .kpi-number.is-urgent {
    color: #dc3545; /* A red color for urgent numbers */
}
.kpi-card .kpi-label {
    margin-top: 0.5rem;
    font-size: 1rem;
    color: #6c757d;
}

.kpi-grid-top {
    margin-bottom: 1.5rem; /* Or 20px if you prefer fixed pixels */
}

/* For the Team Pulse list */
.kpi-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    width: 100%;
}
.kpi-list li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}
.kpi-list li:last-child {
    border-bottom: none;
}
.kpi-list .overdue-count {
    color: #dc3545;
    font-weight: 600;
}

/* ==========================================================================
   Dashboard Responsive Layout
   ========================================================================== */

/* --- BASE (Desktop) --- */
/* We are formalizing the 4-column grid for desktops */
.dashboard-grid {
    display: grid;
    gap: 1.5rem; /* The space between cards */
}

/* --- BASE (Desktop) --- */
/* Specifically for the top 3 KPI cards */
.kpi-grid-top {
    grid-template-columns: repeat(3, 1fr);
}

/* --- MOBILE VIEW (e.g., iPhones, Android) --- */
/* When the screen is 768px wide or less, stack everything in a single column */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr; /* Single column layout */
    }

    /* This is a crucial fix for the chart cards.
       The inline style "grid-column: span 2" in the HTML needs to be overridden
       so the charts don't try to span two columns when only one exists. */
    .dashboard-grid .dashboard-card {
        grid-column: auto !important;
    }
    
    /* This specifically fixes the text wrapping in the "Team Pulse" card on mobile.
       Instead of pushing items to opposite ends, it aligns them neatly to the start. */
    .kpi-list li {
        justify-content: flex-start;
        gap: 1rem; /* Adds a nice space between the name and the count */
    }
}

/* Add to your css/style.css file */

.leaderboard-list {
    list-style-type: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.leaderboard-list li {
    display: flex;
    align-items: center;
    padding: 8px 5px;
    font-size: 0.9em;
    border-bottom: 1px solid #f0f0f0;
}

.leaderboard-list li:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    font-weight: 700;
    font-size: 1.1em;
    width: 30px;
    text-align: center;
    color: #6c757d;
}

.leaderboard-name {
    flex-grow: 1;
    padding-left: 10px;
}

.leaderboard-score {
    font-weight: 700;
    font-size: 1.1em;
    color: #008080; /* Your accent color */
}

/* Special style for the winner */
.leaderboard-list li.rank-1 .leaderboard-rank {
    color: #ffc107; /* Gold color */
}

.form-group label .material-symbols-outlined {
    vertical-align: bottom; /* Aligns icon with text */
    margin-right: 6px;      /* Adds a little space */
    font-size: 1.2rem;      /* Makes icon slightly larger */
}
/* --- FINAL, PROMINENT TOGGLE SWITCH CONTAINER STYLE --- */
.toggle-switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    padding: 15px; /* More padding for a better look */
    background-color: #f8f9fa; /* A subtle background to lift it off the page */
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color); /* Highlight bar on the left */
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03); /* Optional subtle shadow */
}
.toggle-switch-container label {
    margin: 0;
    font-weight: 500;
}
.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between No, switch, and Yes */
}
.toggle-switch-wrapper .toggle-label {
    font-size: 0.9rem;
    color: #6c757d;
    user-select: none;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px; /* Shorter width */
    height: 28px; /* Slightly smaller height */
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}
.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px; /* Smaller handle */
    width: 20px;  /* Smaller handle */
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
.toggle-switch input:checked + .slider {
    background-color: var(--primary-color); /* Prominent color when on */
}
.toggle-switch input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}
.toggle-switch input:checked + .slider:before {
    transform: translateX(22px); /* Adjusted for new shorter width */
}