/* ==========================================================================
   1. CORE VARIABLES & RESET
   ========================================================================== */
:root {
    /* Brand Palette */
    --primary: #204164;        /* OECTA Navy */
    --primary-hover: #162e4a;
    --accent: #f39c12;         /* OECTA Orange */
    --accent-hover: #d68910;
    
    /* UI Colors */
    --bg-app: #f1f5f9;         /* Light Slate Grey */
    --bg-panel: #ffffff;
    --text-main: #2d3748;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    /* Status Colors */
    --success: #38a169;
    --error: #e53e3e;
    --warning: #dd6b20;
    
    /* Dimensions */
    --rail-width: 80px;
    --header-height: 70px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    overflow: hidden; /* App-like feel */
}

/* ==========================================================================
   2. GLOBAL LAYOUT (Icon Rail + Main Content)
   ========================================================================== */
.admin-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
        transition: all 0.3s ease;

}


#rail-new-btn {
    display: none; 
}
/* --- Left Icon Rail --- */
.icon-rail {
    width: var(--rail-width);
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 15px;
    z-index: 50;
    transition: width 0.2s ease;
    flex-shrink: 0;
}

.rail-item {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.rail-item:hover {
    background-color: #ebf8ff;
    color: var(--primary);
}

.rail-item .material-icons { font-size: 24px; margin-bottom: 2px; }
.rail-text { font-size: 9px; font-weight: 700; text-transform: uppercase; }

/* --- Main Content Area --- */
.portal-main {
    flex-grow: 1;
    background-color: var(--bg-app);
    position: relative;
    overflow-y: auto !important; /* Critical for scrolling tall pages */
    height: 100vh;
}

.main-panel {
    display: none; /* Hidden by default */
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 100px; /* Space for scrolling */
}

.main-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Full Width Mode (for Calendar/Builder) */
.full-width-mode .icon-rail { display: none; }
.full-width-mode .portal-main { width: 100vw; }
.full-width-mode .main-panel { max-width: 100%; padding: 0; }

/* ==========================================================================
   2b. EVENT DRAWER (The Middle Column) - RESTORED
   ========================================================================== */
.event-drawer {
    width: 320px;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 45;
    flex-shrink: 0;
    /* Smooth folding animation */
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.2s ease,
                padding 0.3s ease;
    overflow: hidden;
}


/* The "Folded" State */
.drawer-collapsed .event-drawer {
    width: 0;
    padding: 0;
    opacity: 0;
    border: none;
    pointer-events: none;
}

.drawer-collapsed #drawer-new-btn-container {
    display: none;
}

.drawer-collapsed #rail-new-btn {
    display: flex;
}

.admin-layout:not(.drawer-collapsed) #rail-new-btn {
    display: none;
}
.admin-layout:not(.drawer-collapsed) #drawer-new-btn-container {
    display: block;
}



/* --- 3. THE ELEGANT NEW BUTTON (Rail Version) --- */
.rail-new-btn {
    width: 48px;
    height: 48px;
    margin: 5px auto 25px auto; /* Centered auto margins */
    border-radius: 14px; /* Squircle shape */
    background: white;
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #3c4043;
    transition: all 0.2s ease;
}

.rail-new-btn:hover {
    background-color: #f1f3f4;
    box-shadow: 0 4px 6px 0 rgba(60,64,67,0.3), 0 8px 12px 6px rgba(60,64,67,0.15);
}


.rail-new-btn .material-icons {
    font-size: 28px;
}


.rail-header {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 15px 0 10px 0;
    background: transparent;
    border: none;
}

.rail-burger {
    width: 48px;
    height: 48px;
    border-radius: 50%; /* Circular touch target */
    border: none;
    background: transparent; /* Removes the boxy gray look */
    cursor: pointer;
    color: #5f6368; /* Google Gray */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.rail-burger:hover {
    background-color: rgba(60,64,67,0.08); /* Subtle circle hover */
    color: var(--primary);
}

.rail-burger .material-icons {
    font-size: 24px;
}



.drawer-logo {
    width: 100%;
    max-width: 280px; /* Increased from 220px */
    height: auto;
    display: block;
    margin: 0 auto 15px auto;
    transition: transform 0.3s ease;
}

.drawer-header {
    padding: 15px; /* Reduced padding to let logo fill space */
    border-bottom: 1px solid var(--border);
    background-color: white;
}

/* "New Event" Button (Drive Style) */
.new-event-dropdown-container {
    position: relative;
    margin-bottom: 15px;
}

.btn-add-drive {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: white;
    border: 1px solid #dadce0; /* Google Grey */
    border-radius: 24px;       /* Pill shape */
    padding: 10px 20px 10px 15px;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    cursor: pointer;
    transition: box-shadow 0.2s, background 0.1s;
    font-family: 'Google Sans', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #3c4043;
}

.btn-add-drive:hover {
    box-shadow: 0 4px 6px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    background-color: #f8f9fa;
}
.drive-style-menu {
    position: absolute;
    top: 0;
    left: 60px; /* Offset to the right of the Rail button */
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    width: 240px;
    z-index: 1000;
    padding: 8px 0;
    border: 1px solid #e2e8f0;
}

/* Position the menu next to the rail button */
#new-event-menu {
    position: fixed; /* Changed from absolute to fixed */
    top: 60px;
    left: 75px; 
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 240px;
    z-index: 10000; /* High z-index to stay above drawer */
}

.menu-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.95em;
    font-weight: 500;
}
.menu-item:hover { background-color: #f1f5f9; }
.menu-item .material-icons { color: var(--text-muted); font-size: 20px; }
.menu-divider { height: 1px; background: var(--border); margin: 5px 0; }

/* Search Box */
.search-row { margin-top: 5px; }
.drawer-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-app);
    font-size: 0.9em;
}
.drawer-search:focus {
    background-color: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(32, 65, 100, 0.1);
    outline: none;
}

/* Event List Container */
#sidebar-list {
    overflow-y: auto;
    flex-grow: 1;
    padding: 10px;
}

/* List Items */
.event-list-item {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    background: white;
}
.event-list-item:hover {
    background-color: #f8fafc;
    border-color: var(--border);
}
.event-list-item.selected {
    background-color: #ebf8ff; /* Light Blue */
    border-color: var(--primary);
}
.event-card-title {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    font-size: 0.95em;
}
.event-card-date {
    font-size: 0.85em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* HIDE DRAWER IN FULL WIDTH MODE (For Calendar/Form Builder) */
.full-width-mode .event-drawer {
    margin-left: -320px; /* Slide off screen */
}


.switch {
    position: relative;
    display: inline-block;
    width: 34px;  /* Slightly more compact */
    height: 20px;
}



/* ==========================================================================
   2c. ADMIN SETTINGS POPOVER (Bottom Left Menu)
   ========================================================================== */
.rail-item-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.settings-popover {
    position: absolute;
    left: 70px; /* Pushes it to the right of the sidebar */
    bottom: 10px;
    width: 240px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    padding: 8px 0;
    transform-origin: bottom left;
    animation: fadeIn 0.2s ease-out;
}

.popover-header {
    padding: 10px 15px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    margin-bottom: 5px;
}

.popover-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s;
}

.popover-item:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.popover-item .material-icons {
    font-size: 20px;
    color: var(--text-muted);
}

.popover-item:hover .material-icons {
    color: var(--primary);
}


/* Utility Class to hide elements */
.hidden {
    display: none !important;
}



.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000; /* Ensure it stays above everything */
}




.modal-box {
    background: white;
    width: 95%;
    max-width: 680px;
    max-height: 90vh;
    border-radius: 16px; /* Material 3 Style */
    overflow: hidden; /* Keeps header/tabs contained */
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    padding: 24px 32px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}



.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
}



/* --- TAB SYSTEM FIX (Crucial) --- */
.tab-content {
    display: none; /* Hide all by default */
}

.tab-content.active {
    display: block; /* Show only the active tab */
}



.modal-tabs {
    display: flex;
    width: 100%;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
        margin-bottom: 30px; /* Space between tabs and name/date fields */

}

.tab-btn {
    flex: 1; /* Key change: Tabs spread equally */
    padding: 18px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #64748b;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    background: #ffffff;
}

.modal-body {
    padding: 32px;
    overflow-y: auto; /* Scrollable content area */
}



.form-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}


/* Ensure labels inside grid rows align correctly */
.form-grid-row > div {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

#tab-logistics > div:nth-child(2) {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    margin: 24px 0;
}




.input-group {
    display: flex;
    gap: 5px;
}




/* --- BULLETPROOF TOOLTIP LOGIC --- */
.tooltip-container {
    display: inline-flex;
    position: relative;
    margin-left: 8px;
    vertical-align: middle;
}

.tooltip-icon {
    width: 18px;
    height: 18px;
    background: #e2e8f0; /* Soft gray */
    color: #475569;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    transition: all 0.2s ease;
}

.tooltip-container:hover .tooltip-icon {
    background: var(--primary);
    color: white;
}

/* The actual text bubble */
.tooltip-text {
    /* STOPS THE LEAKING: */
    display: none !important; 
    
    position: absolute;
    bottom: 150%; 
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b; /* Deep slate */
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    width: 240px; 
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.5;
    z-index: 10001;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    text-align: center;
}

/* Show on hover */
.tooltip-container:hover .tooltip-text {
    display: block !important;
    animation: fadeIn 0.2s ease-out;
}

/* The little arrow tip */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}








/* --- DRIVE PERMISSION FEEDBACK --- */

/* Green state for publicly shared files */
.valid-file {
    border-color: #38a169 !important; /* Success Green */
    background-color: #f0fff4 !important; /* Very light green tint */
    border-width: 2px !important;
}

/* Red state for private/restricted files */
.invalid-file {
    border-color: #e53e3e !important; /* Error Red */
    background-color: #fff5f5 !important; /* Very light red tint */
    border-width: 2px !important;
}

/* Small helper for the error text under the input */
.permission-error {
    font-size: 0.75rem;
    margin-top: 4px;
    color: #c53030;
    display: none; /* Hidden by default */
    font-weight: 600;
}



/* Styling for the Event Notes Textarea */
#evt-notes {
    font-family: inherit;
    line-height: 1.5;
    background-color: #fcfcfd;
    border-style: dashed; /* Visual cue that this is an optional/extra area */
    transition: all 0.3s ease;
}

#evt-notes:focus {
    border-style: solid;
    background-color: #ffffff;
}



/* Ensure Search Dropdowns look identical */
.custom-pac-container {
    position: absolute;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    width: 100%;
    z-index: 10002;
    margin-top: 4px;
    display: none;
    overflow: hidden;
}



.pac-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
}

.pac-item:last-child { border-bottom: none; }

.pac-item:hover {
    background-color: #f8fafc;
}

.pac-item-query {
    font-weight: 700;
    color: var(--primary);
    margin-right: 8px;
}





/* ==========================================================================
   3. SHARED COMPONENTS (Buttons, Inputs, Cards)
   ========================================================================== */

/* Dash Navigation Header */
.dash-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}


.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 14px 32px; /* Increased padding for better touch target */
    border-radius: 10px; /* Modern, softer radius */
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(32, 65, 100, 0.2); /* Added tactile shadow */
}




.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px); /* Physical "lift" on hover */
    box-shadow: 0 10px 15px -3px rgba(32, 65, 100, 0.3);
}

.btn-primary:active {
    transform: translateY(0); /* "Pressed" feedback */
}
.btn-primary:disabled {
    background-color: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


.btn-secondary {
    background-color: white;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}
.btn-secondary:hover { background-color: #f8fafc; color: var(--text-main); border-color: #cbd5e0; }

.btn-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
}
.btn-action:hover { background-color: #f1f5f9; color: var(--primary); }





/* --- UPDATED GLOBAL INPUTS --- */
.form-input, .form-control, select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0; /* Slightly thicker for better visibility */
    border-radius: 10px; /* Matching the button radius */
    font-size: 1rem;
    color: var(--text-main);
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(32, 65, 100, 0.1); /* Softer, larger focus ring */
    background-color: #ffffff;
}



/* Cards */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    overflow: hidden;
}

/* ==========================================================================
   4. DATA TABLES (Staff List, Events List)
   ========================================================================== */
.reg-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}
.reg-table th {
    text-align: left;
    padding: 15px 20px;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-size: 0.85em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}
.reg-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.reg-table tr:hover { background-color: #f8fafc; }

/* ==========================================================================
   5. SPECIFIC VIEWS (Login, Modals)
   ========================================================================== */
.app-view {
    display: none !important; /* Hide everything by default */
    height: 100vh;
    width: 100vw;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
}

.app-view.active {
    display: flex !important; /* Only show the active view */
    flex-direction: column;
}

/* ==========================================================================
   6. LOGIN VIEW STYLING (Professional Polish)
   ========================================================================== */
#view-login {
    background-color: #f8fafc; /* Subtle background, not stark white */
    align-items: center;
    justify-content: center;
    z-index: 100; /* Ensure it floats above everything else */
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: white;
    padding: 40px;
    border-radius: 16px; /* Modern rounded corners */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); /* Deep "Float" shadow */
    text-align: center;
    border: 1px solid white;
}

/* Logo Control */
.login-box img {
    width: 180px !important; /* Restrict size so it doesn't dominate */
    height: auto;
    margin-bottom: 25px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

/* Login Inputs */
#login-form .form-input {
    margin-bottom: 15px;
    padding: 14px; /* Taller touch targets */
    background-color: #f1f5f9; /* Contrast against white card */
    border: 1px solid transparent;
}

#login-form .form-input:focus {
    background-color: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(32, 65, 100, 0.1);
}

/* Login Button */
#login-form .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    margin-top: 10px;
    background-color: var(--primary);
}
#login-form .btn-primary:hover {
    background-color: var(--primary-hover);
}
/* ==========================================================================
   6. SURVEYJS CREATOR (THE FORM BUILDER)
   ========================================================================== */

/* Layout Container */
#forms-editor-view {
    height: auto !important;
    display: flex;
    flex-direction: column;
    padding: 20px;
    padding-bottom: 50px;
}

/* The Main Builder Box */
#surveyCreatorContainer {
    height: 850px !important;
    width: 100%;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* --- Internal Creator Theme Overrides --- */

/* 1. Hide the License Banner */
.svc-creator__banner {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* 2. Toolbox (Left) - Cleaner look */
.svc-toolbox {
    background-color: #ffffff !important;
    border-right: 1px solid var(--border) !important;
}
.svc-toolbox__item {
    color: var(--text-main) !important;
}
.svc-toolbox__item:hover {
    background-color: #f1f5f9 !important;
    color: var(--primary) !important;
}

/* 3. Canvas (Center) - Better contrast */
.svc-creator__content-wrapper {
    background-color: #f8fafc !important;
}
.svc-page__content {
    box-shadow: 0 4px 6px rgba(0,0,0,0.05) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
}

/* 4. Active Question Highlight */
.svc-question__content--selected {
    box-shadow: 0 0 0 2px var(--primary) !important; 
    border-radius: 4px !important;
}

/* 5. Action Buttons (inside builder) */
.svc-action-button {
    border-radius: 6px !important;
}
.svc-page__add-new-question > button {
    background-color: var(--primary) !important;
    color: white !important;
}

/* ==========================================================================
   7. SURVEYJS PUBLIC FORM (THE REGISTRATION PAGE)
   ========================================================================== */
/* Note: We scope these with .oecta-survey-wrapper to ensure they 
   don't break the Creator Preview or other forms */

.oecta-survey-wrapper .sd-title { display: none !important; }

/* Yes/No Toggles (Segmented Control) */
.oecta-survey-wrapper .sd-boolean {
    background-color: #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 4px !important;
    display: inline-flex !important;
    width: auto !important;
    border: none !important;
}
.oecta-survey-wrapper .sd-boolean__item { margin: 0 !important; padding: 0 !important; }
.oecta-survey-wrapper .sd-boolean__label {
    padding: 10px 30px !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    border-radius: 6px !important;
}
.oecta-survey-wrapper .sd-boolean--checked .sd-boolean__item--checked .sd-boolean__label {
    background-color: #ffffff !important;
    color: var(--primary) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Checkboxes as Chips */
.oecta-survey-wrapper .sd-selectbase {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}
.oecta-survey-wrapper .sd-item__control-label {
    padding: 12px 15px !important;
    background: #fff !important;
    border: 2px solid var(--border) !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    transition: all 0.2s !important;
}
.oecta-survey-wrapper .sd-item--checked .sd-item__control-label {
    background-color: #ebf8ff !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}
/* Hide the actual checkboxes */
.oecta-survey-wrapper .sd-item__control,
.oecta-survey-wrapper .sd-boolean__thumb,
.oecta-survey-wrapper .sd-boolean__switch {
    display: none !important;
}

/* Standard Inputs */
.oecta-survey-wrapper .sd-input, 
.oecta-survey-wrapper .sd-comment {
    border: 2px solid var(--border) !important;
    border-radius: 8px !important;
    padding: 12px !important;
    background-color: #f8fafc !important;
}
.oecta-survey-wrapper .sd-input:focus,
.oecta-survey-wrapper .sd-comment:focus {
    border-color: var(--primary) !important;
    background: white !important;
}

/* Complete Button */
.oecta-survey-wrapper .sd-btn--action {
    background-color: var(--primary) !important;
    color: white !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    padding: 16px !important;
    border-radius: 8px !important;
    border: none !important;
    margin-top: 20px !important;
    width: 100% !important;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


/* ==========================================================================
   7. DASHBOARD & CALENDAR RESTORATION
   ========================================================================== */

/* --- 7a. SYSTEM DASHBOARD (Launchpad) --- */
.sys-dash {
    animation: fadeIn 0.3s ease-out;
}

.dash-section-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    margin-top: 30px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}

.upcoming-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.quick-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.quick-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.quick-card-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.quick-card-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
}

.quick-card-detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.detail-unit {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.detail-unit .material-icons {
    font-size: 18px;
    color: var(--text-muted);
    padding-top: 2px;
}

.detail-text {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.detail-val {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

/* --- 7b. EVENT OVERVIEW (The "Event Name" Section) --- */
.overview-dashboard {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    display: none; /* Hidden until selected */
}
.overview-dashboard.visible { display: block; animation: slideUp 0.3s ease-out; }

.ov-header { margin-bottom: 25px; }
.ov-title { margin: 0; font-size: 2rem; color: var(--primary); }
.ov-date { color: var(--text-muted); font-size: 1.1rem; margin-top: 5px; }

.bubble-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.bubble {
    background: var(--bg-app);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border);
}

.bubble-val {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin: 10px 0;
}

.bubble-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

/* --- 7c. CALENDAR MODULE --- */
.calendar-wrapper {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    border: 1px solid var(--border);
    overflow: hidden;
    display: none; /* Hidden until toggled or active */
}
.calendar-wrapper.visible { display: block; }

.cal-header {
    padding: 20px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cal-title { font-size: 1.25rem; font-weight: 800; color: var(--primary); }

.cal-controls { display: flex; gap: 5px; }
.cal-btn {
    background: var(--bg-app);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9em;
}
.cal-btn:hover { background: #e2e8f0; color: var(--primary); }

.cal-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.cal-day-name {
    padding: 10px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.cal-grid-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* No gap, use borders */
}

.cal-cell {
    min-height: 100px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 8px;
    position: relative;
    background: white;
}

.cal-date-num {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.cal-cell.today { background-color: #fffaf0; }
.cal-cell.today .cal-date-num { color: var(--accent); }

/* Event Dots in Calendar */
.cal-event {
    background: #ebf8ff;
    color: var(--primary);
    font-size: 0.75rem;
    padding: 4px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid var(--primary);
}
.cal-event:hover { background: var(--primary); color: white; }
.cal-event.past { opacity: 0.6; filter: grayscale(1); }

/* Animations */
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- 1. THE COMMAND CENTER GRID --- */
.event-dashboard-container {
    display: grid;
    grid-template-columns: 1fr 340px; /* Wide table, narrow sidebar */
    gap: 24px;
    height: calc(100vh - 180px); /* Fill screen but leave room for header */
    margin-top: 20px;
}

/* --- 2. PANEL (CARD) STYLING --- */
.event-panel {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Clips children to rounded corners */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.panel-header {
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-header .material-icons {
    color: #94a3b8;
    font-size: 20px;
}

/* --- 3. INTERNAL SCROLLING (Crucial) --- */
.panel-body-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0;
}

/* --- 4. MATERIAL LINKS --- */
.material-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-main);
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.material-link:hover {
    background-color: #f0f7ff;
    color: var(--primary);
}

.material-link .material-icons {
    margin-right: 12px;
    color: #3182ce;
    font-size: 20px;
}

/* --- 5. ALERT BOXES --- */
.alert-card {
    margin: 15px;
    padding: 12px;
    border-radius: 8px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
}

.alert-card.dietary { border-left: 4px solid #e53e3e; }
.alert-card.accom { border-left: 4px solid #3182ce; background: #ebf8ff; border-color: #bee3f8; }

.alert-name { font-weight: 800; font-size: 0.85rem; color: #2d3748; }
.alert-detail { font-size: 0.8rem; color: #4a5568; margin-top: 2px; }

/* --- MINI TOGGLE FOR TABLE ROWS --- */
.table-switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    vertical-align: middle;
}

.table-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.table-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e0;
    transition: .3s;
    border-radius: 20px;
}

.table-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .table-slider {
    background-color: #38a169; /* Success Green */
}

input:checked + .table-slider:before {
    transform: translateX(14px);
}



/* Row styling when attended */
.row-attended {
    background-color: #f0fff4 !important; /* Very light green */
    transition: background-color 0.4s ease;
}
