:root {
    /* --- Core Palette (Modern Blue) --- */
    --color-primary: #0ea5e9;
    --color-primary-hover: #0284c7;
    --color-primary-active: #0369a1;
    --color-primary-soft: rgba(14, 165, 233, 0.1);
    
    --color-secondary: #0ea5e9;
    --color-secondary-hover: #0284c7;
    
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ca1717;
    --color-danger-soft: rgba(239, 68, 68, 0.1);
    --color-info: #3b82f6;

    /* --- Neutral Palette (Light Mode) --- */
    --color-bg-main: #f8fafc;
    --color-bg-secondary: #f1f5f9;
    --color-surface: #ffffff;
    --color-surface-hover: #f8fafc;
    --color-border: #e2e8f0;
    --color-border-hover: #cbd5e1;
    --color-text: #0f172a;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;

    /* --- Spacing & Radii --- */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-base: 1rem;
    --spacing-lg: 1.25rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 9999px;

    /* --- Shadows --- */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* --- Transitions --- */
    --transition-fast: 100ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* --- Inputs --- */
    --input-bg: var(--color-surface);
    --input-border: var(--color-border);
    --input-focus-border: var(--color-primary);
    --input-focus-ring: rgba(14, 165, 233, 0.15);
}

/* --- Dark Theme Overrides --- */
:root.theme-dark,
:root.dark {
    --color-bg-main: #08111F;
    --color-bg-secondary: #0f172a;
    --color-surface: #131c2e;
    --color-surface-hover: #1e293b;
    --color-border: #1e293b;
    --color-border-hover: #334155;
    --color-text: #f8fafc;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;

    --input-bg: #0f172a;
    --input-border: #1e293b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* =========================================
   BASE TYPOGRAPHY
   ========================================= */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

/* Hauptüberschriften: h1 für Seiten-Titel, h2 für Sektions-Überschriften, h3 für Karten-Titel */
h1 { font-size: clamp(2rem, 1.5rem + 1.5vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    margin-bottom: var(--spacing-base);
    color: var(--color-text-secondary);
}

small {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* =========================================
   BUTTONS
   ========================================= */
/* Basis-Klasse für alle Buttons: Definiert die Grundform, Abstände, Schrift und Klick-Animationen */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid transparent;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.25;
    min-height: 44px;
}

.btn:active {
    transform: scale(0.96);
    filter: brightness(0.9);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile Hit Area Enhancement */
@media (max-width: 640px) {
    .btn {
        min-height: 48px; /* Slightly larger for touch */
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        width: 100%; /* Default buttons to full width on small mobile if not specified */
    }
    
    .btn-sm {
        min-height: 40px;
        width: auto;
    }
    
    .btn-icon, .btn-icon-only {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
    }
}

/* Variants */
/* Primär-Button: Hauptaktionen wie "Auftritt anlegen", "Speichern" oder "Band erstellen" */
.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
    transform: translateY(-1px);
}

/* Sekundär-Button: Alternative Aktionen wie "Abbrechen", "Filter zurücksetzen" oder "Details" */
.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-hover);
    color: var(--color-primary);
}

/* Danger-Button: Einheitliches Design für alle Lösch-Aktionen (Account, Termine, Songs etc.) */
.btn-danger {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-soft);
    padding: 0.6rem 1.25rem;
    transition: all var(--transition-base);
}

.btn-danger:hover {
    background: var(--color-danger);
    color: white;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 15px var(--color-danger-soft);
}

/* Alias für Abwärtskompatibilität */
.btn-danger-soft {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-soft);
    padding: 0.6rem 1.25rem;
    transition: all var(--transition-base);
}

.btn-danger-soft:hover {
    background: var(--color-danger);
    color: white;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 15px var(--color-danger-soft);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

/* Sizes */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    min-height: 36px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.8rem 1.75rem;
    font-size: 1.0625rem;
    min-height: 52px;
}

/* 
   Icon-Buttons & Drag-Handles: 
   Einheitliches Design für alle funktionalen Symbole (Header-Aktionen, Edit-Buttons, Drag-Handles etc.)
*/
/* 
   Zentraler Icon-Button-Block: 
   Alle funktionalen Icons (Header, Widgets, Listen, Modals, Drag-Handles)
*/
.btn-icon,
.btn-header,
.dashboard-drag-handle,
.event-rundown-drag-handle,
.btn-icon-only,
.modal-close,
.accordion-toggle,
.quick-access-edit-btn,
.band-card-open-icon,
.edit-location,
.edit-calendar,
.delete-calendar,
.edit-news,
.delete-news,
.edit-song,
.delete-song,
.edit-songpool-song {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 12px;
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    line-height: 0;
}

/* Spezifische Text-Korrektur für Drag-Handles (da diese Text statt SVGs nutzen können) */
.dashboard-drag-handle,
.event-rundown-drag-handle {
    line-height: 1;
    font-size: 1.4rem !important;
}

.btn-icon:hover,
.btn-header:hover,
.dashboard-drag-handle:hover,
.event-rundown-drag-handle:hover,
.btn-icon-only:hover,
.modal-close:hover,
.accordion-toggle:hover,
.quick-access-edit-btn:hover,
.band-card-open-icon:hover,
.edit-location:hover,
.edit-calendar:hover,
.edit-news:hover,
.edit-song:hover,
.edit-songpool-song:hover {
    background-color: var(--color-surface);
    color: var(--color-primary);
    border-color: var(--color-primary-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Icons (SVG/I/Span) in Standard-Buttons */
.btn-icon svg,
.dashboard-drag-handle svg,
.event-rundown-drag-handle svg,
.btn-icon-only svg,
.modal-close svg,
.accordion-toggle svg,
.quick-access-edit-btn svg,
.band-card-open-icon svg,
.btn-icon i,
.toggle-icon {
    width: 20px !important;
    height: 20px !important;
    font-size: 1.2rem !important;
    stroke-width: 1.8;
    display: block;
    margin: 0 auto;
}

/* Header-Icons dürfen größer sein (24px) */
.btn-header svg,
.btn-header i {
    width: 24px !important;
    height: 24px !important;
    font-size: 1.5rem !important;
    stroke-width: 1.8;
    display: block;
    margin: 0 auto;
}

/* Block deleted to fix small icon issue */

/* Danger Icon-Button: Roter Papierkorb zum Löschen von Songs, Ablaufpunkten oder Kalendern */
.btn-icon.btn-danger,
.delete-calendar,
.delete-news,
.delete-song,
.delete-songpool-song {
    color: var(--color-danger);
    background-color: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.1);
}

.btn-icon.btn-danger:hover,
.delete-calendar:hover,
.delete-news:hover,
.delete-song:hover,
.delete-songpool-song:hover {
    background-color: var(--color-danger);
    color: #ffffff;
    border-color: var(--color-danger);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-icon.btn-sm {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.btn-icon.btn-sm svg,
.btn-icon.btn-sm i {
    width: 14px !important;
    height: 14px !important;
}

/* =========================================
   FORM ELEMENTS
   ========================================= */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}

/* Standard Eingabefelder: Textfelder für Namen, Titel, Beschreibungen oder Suchfelder */
.form-input,
.profile-form-input,
.form-select,
.form-textarea,
.search-field-input,
.modern-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.9375rem;
    transition: all var(--transition-base);
    appearance: none;
}

.form-input:focus,
.profile-form-input:focus,
.form-select:focus,
.form-textarea:focus,
.search-field-input:focus,
.modern-search-input:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.form-input::placeholder,
.form-textarea::placeholder,
.modern-search-input::placeholder {
    color: var(--color-text-muted);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Einheitliches Dropdown Styling (angelehnt an das Instrumenten-Multiselect) */
select.form-input,
select.profile-form-input,
.form-select,
select {
    appearance: none;
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 2.5rem !important; /* Platz für den Pfeil */
    border-radius: 14px;
    border: 1px solid var(--settings-border-soft, var(--input-border));
    color: var(--color-text);
    font-size: 0.9375rem;
    transition: all var(--transition-base);
    
    /* Chevron Arrow + Gradient aus dem Instrumenten-Dropdown + Hintergrund */
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") no-repeat right 1rem center / 1rem,
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
        var(--settings-input-bg, var(--input-bg)) !important;
}

select.form-input:hover,
select.profile-form-input:hover,
.form-select:hover,
select:hover {
    border-color: var(--color-border-hover);
}

select.form-input:focus,
select.profile-form-input:focus,
.form-select:focus,
select:focus {
    outline: none;
    border-color: rgba(136, 104, 255, 0.72) !important;
    box-shadow: 0 0 0 4px rgba(108, 84, 210, 0.12) !important;
}

/* TOGGLE SWITCH */
/* Toggle-Switch: Schalter für Optionen wie "Ganztägig" oder "Weitere Infos einblenden" */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0; /* Verhindert das Verengen in Flex-Containern */
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--color-border);
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

input:checked + .toggle-slider {
    background-color: var(--color-primary);
}

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

/* CHECKBOX & RADIO */
.form-checkbox,
.form-radio {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--color-border);
    background-color: var(--color-surface);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-checkbox { border-radius: 4px; }
.form-radio { border-radius: 50%; }

.form-checkbox:checked,
.form-radio:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: 100% 100%;
}

/* Pill-Variante: Abgerundete Suchfelder (z. B. Songpool-Suche oder Band-Suche) */
.search-field-input,
.modern-search-input {
    border-radius: var(--radius-pill);
    padding-left: 2.75rem !important;
}

/* SEARCH FIELD ICON */
.search-field-container,
.search-container {
    position: relative;
    width: 100%;
}

/* Such-Icon: Lupe innerhalb der abgerundeten Suchfelder */
.search-field-icon,
.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    width: 1.125rem;
    height: 1.125rem;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Help Button Styling (Circular Floating - Desktop & Mobile) */
.header-help-btn {
    position: fixed;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.header-help-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.header-help-btn svg {
    width: 22px;
    height: 22px;
}

@media (min-width: 769px) {
    .header-help-btn {
        top: 90px; /* Positions it nicely in the top-right of the content area */
        right: 40px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 768px) {
    .header-help-btn {
        top: 80px;
        right: 16px;
        width: 42px;
        height: 42px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

@media (max-width: 768px) {
    .header-help-btn {
        top: 80px; /* Below mobile header */
        right: 16px;
        width: 42px;
        height: 42px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

/* =========================================
   MODAL BASE
   ========================================= */
/* Modals: Alle Dialogfenster wie "Auftritt bearbeiten", "Song hinzufügen" oder "Einstellungen" */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Size Variants (Desktop) */
@media (min-width: 769px) {
    .modal-large,
    .modal-lg {
        max-width: 950px !important;
    }
    
    .modal-xl {
        max-width: 1200px !important;
        width: 95% !important;
    }

    #absenceEditModal .modal-content {
        max-width: 950px !important;
    }
}

/* =========================================
   NOTIFICATION CARDS (Global Overhaul)
   ========================================= */
.notification-item-body {
    position: relative;
    flex: 1;
    min-width: 0;
}

.notification-item-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 4px 0 !important;
    color: var(--color-text);
    padding-right: 32px; /* Raum für den X-Button */
}

.notification-item-info-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.notification-item-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.notification-item-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.notification-remove-btn {
    position: absolute;
    top: -2px;
    right: 0;
    width: 28px !important;
    height: 28px !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border-radius: 50% !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
    min-width: 28px !important;
    min-height: 28px !important;
}

.notification-remove-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.notification-remove-btn svg {
    width: 14px;
    height: 14px;
}

/* Mobile Modal/Sheet Optimization */
@media (max-width: 768px) {
    /* Target the backdrop/overlay ONLY when active - GLOBAL CENTERING */
    body .modal.active, 
    body [id*="Modal"].active,
    body #settingsModal.active,
    body #quickAccessModal.active,
    body #profileImageModal.active,
    body #confirmDeleteModal.active {
        padding: 1rem !important; /* Spacing from edges */
        align-items: center !important; /* CENTERED for all modals now */
        justify-content: center !important;
        display: flex !important;
    }

    /* Target the actual window content */
    body .modal.active > div[class*="content"],
    body [id*="Modal"].active > div[class*="content"],
    body #settingsModal.active .settings-modal-content,
    body #quickAccessModal.active .quick-access-modal-content,
    body #profileImageModal.active .profile-image-preview-modal-content,
    body #confirmDeleteModal.active .modal-content,
    body .modal-content,
    body .modal-large,
    body .settings-modal-content,
    body .news-compose-modal,
    body .news-modal-content,
    body .quick-access-modal-content,
    body .scheduler-modal,
    body .band-entry-modal-content {
        border-radius: 28px !important; /* Rounded all around for 'floating' look */
        max-height: 90vh !important;
        width: 100% !important;
        max-width: 500px !important;
        border-bottom: 1px solid var(--color-border) !important;
        transform: translateY(0) !important;
        margin: auto !important; /* Force centering via margin auto in flex container */
        box-shadow: 0 20px 40px rgba(0,0,0,0.4) !important;
        position: relative !important;
    }

    /* Vertical centering adjustment - reset any legacy translations */
    body .modal.active .modal-content,
    body .modal.active > div[class*="content"],
    body #settingsModal.active .settings-modal-content,
    body #quickAccessModal.active .quick-access-modal-content,
    body #profileImageModal.active .profile-image-preview-modal-content,
    body #confirmDeleteModal.active .modal-content {
        margin: auto !important;
        transform: none !important;
    }
    
    body .modal.active .modal-content,
    body .modal.active > div[class*="content"] {
        transform: translateY(0) !important;
    }

    /* Centering Header Title on Mobile */
    body:not(.landing-active) .app-header .header-context {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        pointer-events: none !important;
        z-index: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    body:not(.landing-active) .app-header .header-page-title-main {
        position: static !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        max-width: 60% !important; /* Prevent overlap with side buttons */
    }

    body:not(.landing-active) .app-header .header-page-title {
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        text-align: center !important;
    }

    /* Notification Dropdown Mobile Refinement - PREMIUM & SPACIOUS */
    body:not(.landing-active) .app-header #notificationDropdown.notification-dropdown {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        border-radius: 24px !important;
        top: calc(75px + env(safe-area-inset-top)) !important;
        box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important;
        display: flex !important;
        flex-direction: column !important;
        max-height: 70vh !important;
        border: 1px solid rgba(255,255,255,0.08) !important;
        background: rgba(15, 23, 42, 0.95) !important;
        backdrop-filter: blur(20px) !important;
    }

    body:not(.landing-active) .app-header .notification-dropdown-head {
        padding: 1.25rem 1.5rem 0.75rem !important;
    }

    body:not(.landing-active) .app-header .notification-dropdown-head h3 {
        font-size: 1.1rem !important;
        font-weight: 800 !important;
        letter-spacing: -0.01em !important;
    }

    body:not(.landing-active) .app-header .notification-dropdown-kicker {
        font-size: 0.65rem !important;
        letter-spacing: 0.2em !important;
        margin-bottom: 2px !important;
        display: block !important;
    }

    body:not(.landing-active) .app-header .notification-list-toolbar {
        padding: 0.6rem 1.25rem !important;
        border-bottom: 1px solid rgba(255,255,255,0.05) !important;
        margin-bottom: 0.5rem !important;
    }

    body:not(.landing-active) .app-header .notification-list-toolbar span {
        font-size: 0.7rem !important;
        font-weight: 700 !important;
        color: var(--color-text-muted) !important;
    }

    body:not(.landing-active) .app-header .notification-list {
        padding: 0.5rem !important;
    }

    body:not(.landing-active) .app-header .notification-item {
        padding: 0.75rem 1rem !important;
        gap: 0.75rem !important;
        margin-bottom: 0.4rem !important;
        border-radius: 18px !important;
        background: rgba(255,255,255,0.03) !important;
        border: 1px solid rgba(255,255,255,0.05) !important;
        grid-template-columns: 40px 1fr !important;
        transition: transform 0.2s ease !important;
    }

    body:not(.landing-active) .app-header .notification-item-topline {
        margin-bottom: 0.25rem !important;
    }

    body:not(.landing-active) .app-header .notification-item-top-actions {
        gap: 0.5rem !important;
    }

    body:not(.landing-active) .app-header .notification-avatar-fallback,
    body:not(.landing-active) .app-header .notification-avatar-img {
        width: 40px !important;
        height: 40px !important;
        font-size: 0.85rem !important;
        border-radius: 12px !important;
    }

    body:not(.landing-active) .app-header .notification-item-body {
        padding-right: 0 !important;
    }

    body:not(.landing-active) .app-header .notification-item-title {
        font-size: 0.95rem !important;
        font-weight: 700 !important;
        color: #fff !important;
        margin-bottom: 4px !important;
        line-height: 1.35 !important;
        padding-right: 32px !important;
    }

    body:not(.landing-active) .app-header .notification-item-info-line {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 6px !important;
        margin-bottom: 8px !important;
    }

    body:not(.landing-active) .app-header .notification-item-time {
        font-size: 0.68rem !important;
        color: var(--color-text-muted) !important;
        margin: 0 !important;
        line-height: 1 !important;
    }

    body:not(.landing-active) .app-header .notification-item-badges {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 4px !important;
    }

    body:not(.landing-active) .app-header .notification-status-chip,
    body:not(.landing-active) .app-header .notification-meta-pill {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.5rem !important;
        border-radius: 6px !important;
        font-weight: 700 !important;
    }

    body:not(.landing-active) .app-header .notification-remove-btn {
        top: 0 !important;
        right: 0 !important;
    }

    body:not(.landing-active) .app-header .notification-item-copy {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
        color: var(--color-text-secondary) !important;
        margin-top: 8px !important;
    }

    body:not(.landing-active) .app-header .notification-item + .notification-item {
        margin-top: 0 !important;
        border-top: none !important;
    }

    .modal-header {
        padding: 1.5rem;
        position: sticky;
        top: 0;
        background: var(--color-surface);
        z-index: 10;
        border-bottom: 1px solid var(--color-border);
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
        margin-bottom: 0;
    }

    .modal-body {
        padding: 1.5rem;
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }

    .modal-footer,
    .modal-actions {
        padding: 1.25rem 1.5rem !important;
        flex-direction: column-reverse !important; /* Put primary action at top on mobile */
        gap: 0.75rem !important;
        display: flex !important;
    }
    
    .modal-footer .btn,
    .modal-actions .btn {
        width: 100% !important;
        margin: 0 !important; /* Reset any legacy margins */
    }

    /* Dashboard Mobile Refinements */
    #dashboardView .dashboard-hero {
        gap: 0.75rem !important;
        margin-bottom: 1.5rem !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #dashboardView .hero-welcome {
        padding: 1.25rem !important;
    }

    #dashboardView .welcome-text {
        font-size: 1.5rem !important;
        margin-bottom: 0.25rem !important;
    }

    #dashboardView .next-event-hero-card {
        padding: 1.25rem !important;
        min-height: auto !important;
        position: relative !important;
        overflow: hidden !important;
    }

    #dashboardView .next-event-badge {
        font-size: 0.62rem !important;
        padding: 0.2rem 0.6rem !important;
        margin-bottom: 1rem !important;
        display: inline-flex !important;
    }

    #dashboardView .next-event-title {
        font-size: 1.3rem !important;
        font-weight: 700 !important;
        text-align: center !important;
        width: 100% !important;
    }

    #dashboardView .next-event-content article {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    #dashboardView .next-event-detail-list {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        margin-top: 1rem !important;
        width: 100% !important;
        justify-content: center !important;
    }

    #dashboardView .next-event-detail-item {
        flex: 1 1 calc(33% - 0.5rem) !important;
        min-width: 80px !important;
        padding: 0.6rem 0.4rem !important;
        background: rgba(255,255,255,0.03) !important;
        border-radius: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2px !important;
    }

    #dashboardView .next-event-info-label {
        font-size: 0.58rem !important;
        opacity: 0.6 !important;
    }

    #dashboardView .next-event-detail-item strong {
        font-size: 0.75rem !important;
        white-space: nowrap !important;
    }

    /* Dashboard Stat Cards - push icon and number towards middle */
    #dashboardView .dashboard-card.stat-card {
        padding-left: 2.2rem !important;
        padding-right: 2.2rem !important;
        justify-content: space-between !important;
        display: flex !important;
        flex-direction: row !important;
    }

    #dashboardView .card-content {
        text-align: right !important;
    }

    /* Next Event Spacing Refinement */
    #dashboardView .next-event-badge {
        margin-bottom: 0.4rem !important;
        padding: 0.15rem 0.5rem !important;
    }

    #dashboardView .next-event-hero-card article {
        margin-top: 0 !important;
    }

    #dashboardView .next-event-detail-list {
        margin-top: 0.6rem !important;
    }

    #dashboardView .next-event-title {
        margin-bottom: 0 !important;
    }

    /* Drag Handle & Action Button Position Correction - Force to the Right */
    .dashboard-section-header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        position: relative !important;
        gap: 0.5rem !important;
    }

    .dashboard-section-header > div:first-child {
        flex: 1 !important;
        min-width: 0 !important;
    }

    .section-header-actions {
        margin-left: auto !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 0.5rem !important;
        flex-shrink: 0 !important;
    }

    .dashboard-drag-indicator {
        margin-left: 0 !important;
        margin-right: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    .dashboard-drag-handle {
        margin: 0 !important;
    }

    /* Ensure edit button and drag handle are side-by-side on the right */
    .quick-access-edit-btn {
        order: 1 !important;
    }
    
    .quick-access-section .dashboard-drag-indicator {
        order: 2 !important;
    }

    /* Band Cards - Compact List Item Redesign */
    #bandsView .bands-grid {
        gap: 0.75rem !important;
        padding: 0.5rem 0 !important;
    }

    #bandsView .band-card {
        padding: 0.55rem !important;
        border-radius: 18px !important;
        min-height: auto !important;
        background: var(--color-surface) !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        position: relative !important;
        overflow: hidden !important;
        width: 100% !important;
        text-align: left !important;
    }

    #bandsView .band-card-header {
        margin: 0 !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 1rem !important;
    }

    #bandsView .band-card-identity {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 1rem !important;
        flex: 1 !important;
        min-width: 0 !important;
    }

    #bandsView .band-card-avatar-shell {
        width: 74px !important;
        height: 74px !important;
        border-radius: 14px !important;
        flex-shrink: 0 !important;
    }

    #bandsView .band-card-title-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.25rem !important;
        text-align: left !important;
    }

    #bandsView .band-card h3 {
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        line-height: 1.1 !important;
        margin: 0 !important;
    }

    #bandsView .band-role-badge {
        font-size: 0.65rem !important;
        padding: 0.15rem 0.5rem !important;
        width: fit-content !important;
    }

    #bandsView .band-card-open-icon {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        background: transparent !important;
        border: 1px solid rgba(255,255,255,0.08) !important;
        font-size: 0.85rem !important;
        position: absolute !important;
        right: 0.75rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    #bandsView .band-card-description,
    #bandsView .band-card-facts {
        display: none !important;
    }
}

.modal-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: var(--spacing-xl);
    overflow-y: auto;
}

.modal-footer {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-text);
}

/* =========================================
   UTILITIES
   ========================================= */
/* Hilfsklassen für schnelles Layouting */
.text-center { text-align: center; } /* Text zentrieren */
.w-full { width: 100%; }              /* Volle Breite */
.mt-4 { margin-top: 1rem; }           /* Außenabstand oben */
.mb-4 { margin-bottom: 1rem; }        /* Außenabstand unten */

/* 2-spaltiges Layout für Formulare (z. B. Startdatum & Enddatum nebeneinander) */
.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-base);
}

@media (max-width: 640px) {
    .form-group-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   SCHEDULE: ARCHIVE & SPACING
   ========================================= */

.schedule-archive-section {
    margin-top: 6rem !important; /* Even more space as requested */
    padding-top: 2rem !important;
}

.schedule-archive-divider {
    margin-bottom: 3rem !important;
}

/* =========================================
   MODALS: EXPORT SIDEBAR WIDTH
   ========================================= */

.rundown-pdf-modal-body {
    grid-template-columns: 420px 1fr !important; /* Match Band Rider width */
}


/* =========================================
   SETTINGS INSTRUMENT SELECTOR
   ========================================= */

#settingsModal .profile-main-column,
#settingsModal .profile-section,
#settingsModal .profile-form-grid,
#settingsModal .form-group,
#settingsModal .instrument-selector {
    overflow: visible;
}

#settingsModal .settings-modal-body,
#settingsModal .settings-shell,
#settingsModal .settings-tab-content.active,
#settingsModal .profile-settings-grid,
#settingsModal .profile-main-column,
#settingsModal .profile-section,
#settingsModal .form-group {
    position: relative;
}

#settingsModal .profile-section,
#settingsModal .settings-surface-card {
    isolation: isolate;
}

.multiselect-host-active {
    z-index: 9002 !important;
}

.custom-multiselect {
    position: relative;
    isolation: isolate;
}

.custom-multiselect.is-open {
    z-index: 9000;
}

.form-group:has(.custom-multiselect),
.settings-modal-body:has(.custom-multiselect),
.settings-shell:has(.custom-multiselect),
.settings-tab-content.active:has(.custom-multiselect),
.profile-settings-grid:has(.custom-multiselect),
.profile-main-column:has(.custom-multiselect),
.profile-section:has(.custom-multiselect),
.settings-surface-card:has(.custom-multiselect) {
    z-index: 9000;
}

.multiselect-trigger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    min-height: 54px;
    border-color: var(--settings-border-soft);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
        var(--settings-input-bg);
}

.multiselect-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    min-height: 1.4rem;
}

.multiselect-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    line-height: 1;
}

.multiselect-trigger:hover {
    border-color: var(--settings-border);
}

.multiselect-trigger.active {
    border-color: rgba(136, 104, 255, 0.72);
    box-shadow: 0 0 0 4px rgba(108, 84, 210, 0.12);
}

.multiselect-badge {
    background: rgba(136, 104, 255, 0.12);
    border-color: rgba(136, 104, 255, 0.22);
    color: var(--color-text);
}

.multiselect-placeholder,
.multiselect-arrow {
    color: var(--settings-muted);
}

.multiselect-placeholder {
    display: inline-flex;
    align-items: center;
    min-height: 1.2rem;
    line-height: 1.25;
}

.multiselect-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    margin-top: 0;
}

.multiselect-menu {
    display: none !important; /* Hidden by default */
    z-index: 9001;
    border-color: color-mix(in srgb, var(--settings-border) 92%, rgba(255, 255, 255, 0.08));
    background: #182338;
    backdrop-filter: none;
    box-shadow: 0 28px 56px rgba(6, 14, 31, 0.46);
    max-height: min(280px, calc(100vh - 220px));
    padding: 0.5rem;
    overflow-x: hidden;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    flex-direction: column;
    gap: 0.3rem;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(-10px);
}

.multiselect-menu.show {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.multiselect-option {
    display: grid;
    grid-template-columns: 1.2rem minmax(0, 1fr);
    align-items: center;
    gap: 0.72rem;
    position: relative;
    min-height: 50px;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: #22304a;
}

.multiselect-option:hover {
    background: color-mix(in srgb, var(--color-primary) 12%, #22304a);
    border-color: color-mix(in srgb, var(--color-primary) 18%, var(--settings-border-soft));
}

.multiselect-option:has(input[type="checkbox"]:checked) {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 10%, transparent), transparent 85%),
        color-mix(in srgb, var(--color-primary) 8%, var(--color-surface));
    border-color: color-mix(in srgb, var(--color-primary) 26%, var(--settings-border));
}

.multiselect-option-indicator {
    margin: 0;
    align-self: center;
    background: color-mix(in srgb, var(--color-surface) 96%, #0d1728);
    border-color: color-mix(in srgb, var(--color-primary) 24%, var(--settings-border));
}

.multiselect-option:has(input[type="checkbox"]:checked) .multiselect-option-indicator {
    border-color: var(--color-primary);
    background: var(--color-primary);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.multiselect-option-label {
    display: inline-flex;
    align-items: center;
    min-height: 1.2rem;
    line-height: 1.25;
    color: var(--color-text);
    font-weight: 600;
}

.multiselect-option:has(input[type="checkbox"]:checked) .multiselect-option-indicator::before {
    line-height: 1;
}

html[data-theme="light"] .multiselect-menu,
:root:not(.theme-dark):not(.dark) .multiselect-menu {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.34);
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.18);
}

html[data-theme="light"] .multiselect-trigger,
:root:not(.theme-dark):not(.dark) .multiselect-trigger {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.98)),
        var(--settings-input-bg);
    border-color: rgba(148, 163, 184, 0.28);
    color: #1e293b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

html[data-theme="light"] .multiselect-trigger:hover,
html[data-theme="light"] .multiselect-trigger.active,
:root:not(.theme-dark):not(.dark) .multiselect-trigger:hover,
:root:not(.theme-dark):not(.dark) .multiselect-trigger.active {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(244, 247, 255, 0.98)),
        var(--settings-input-bg);
    border-color: rgba(129, 140, 248, 0.38);
}

html[data-theme="light"] .multiselect-badge,
:root:not(.theme-dark):not(.dark) .multiselect-badge {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.16);
    color: #312e81;
}

html[data-theme="light"] .multiselect-placeholder,
html[data-theme="light"] .multiselect-arrow,
:root:not(.theme-dark):not(.dark) .multiselect-placeholder,
:root:not(.theme-dark):not(.dark) .multiselect-arrow {
    color: #64748b;
}

html[data-theme="light"] .multiselect-option,
:root:not(.theme-dark):not(.dark) .multiselect-option {
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.9);
    color: #0f172a;
}

html[data-theme="light"] .multiselect-option:hover,
:root:not(.theme-dark):not(.dark) .multiselect-option:hover {
    background: #eef4ff;
    border-color: rgba(129, 140, 248, 0.32);
}

html[data-theme="light"] .multiselect-option:has(input[type="checkbox"]:checked),
:root:not(.theme-dark):not(.dark) .multiselect-option:has(input[type="checkbox"]:checked) {
    background:
        linear-gradient(180deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.02)),
        #ffffff;
    border-color: rgba(99, 102, 241, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .multiselect-option-indicator,
:root:not(.theme-dark):not(.dark) .multiselect-option-indicator {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.38);
}

html[data-theme="light"] .multiselect-option:has(input[type="checkbox"]:checked) .multiselect-option-indicator,
:root:not(.theme-dark):not(.dark) .multiselect-option:has(input[type="checkbox"]:checked) .multiselect-option-indicator {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.12);
}

html[data-theme="light"] .multiselect-option-label,
:root:not(.theme-dark):not(.dark) .multiselect-option-label {
    color: #0f172a;
}

html[data-theme="dark"] .multiselect-menu,
html.dark .multiselect-menu,
:root.theme-dark .multiselect-menu {
    background: #182338;
    border-color: rgba(132, 157, 214, 0.42);
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.44);
}

html[data-theme="dark"] .multiselect-option,
html.dark .multiselect-option,
:root.theme-dark .multiselect-option {
    background: #22304a;
    color: var(--color-text, #e2e8f0);
}

html[data-theme="dark"] .multiselect-option:hover,
html.dark .multiselect-option:hover,
:root.theme-dark .multiselect-option:hover {
    background: color-mix(in srgb, var(--color-primary, #8868ff) 12%, #22304a);
}

html.dark .multiselect-trigger {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
        #1a2540;
    border-color: rgba(100, 130, 200, 0.3);
    color: #e2e8f0;
}

html.dark .multiselect-placeholder,
html.dark .multiselect-arrow {
    color: rgba(148, 163, 184, 0.7);
}

html.dark .multiselect-badge {
    background: rgba(136, 104, 255, 0.12);
    border-color: rgba(136, 104, 255, 0.22);
    color: #e2e8f0;
}

html.dark .multiselect-option-label {
    color: #e2e8f0;
}

html.dark .multiselect-option-indicator {
    background: #22304a;
    border-color: rgba(100, 130, 200, 0.4);
}

#settingsModal .settings-form-actions {
    position: relative;
    z-index: 1;
}

@media (max-width: 980px) {
    .multiselect-menu {
        max-height: min(250px, calc(100vh - 240px));
    }
}



/* =========================================
   GLOBAL MULTISELECT (Instrument Selector)
   ========================================= */

#settingsModal .admin-inline-form.is-shortcut-target,
#settingsModal .profile-section.is-shortcut-target,
#settingsModal .resource-calendar-settings.is-shortcut-target {
    border-radius: 16px;
    outline: 2px solid color-mix(in srgb, var(--color-primary) 72%, transparent);
    outline-offset: 6px;
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--color-primary) 12%, transparent);
    transition: outline-color 0.2s ease, box-shadow 0.2s ease;
}

/* =========================================
   SETTINGS MOBILE POLISH
   ========================================= */

@media (max-width: 640px) {
    #settingsModal .settings-modal-header {
        padding: 0.9rem 0.95rem 0.75rem;
    }

    #settingsModal .settings-modal-body {
        padding: 0.85rem 0.95rem calc(6.2rem + env(safe-area-inset-bottom));
    }

    #settingsModal .settings-pane-intro,
    #settingsModal .profile-section,
    #settingsModal .settings-surface-card,
    #settingsModal .absences-form-column,
    #settingsModal .admin-accordion-card,
    #settingsModal .admin-subsection-form {
        padding: 0.9rem;
        border-radius: 16px;
    }

    #settingsModal .settings-pane-intro h3,
    #settingsModal .settings-column-head h3,
    #settingsModal .settings-column-head h4 {
        font-size: 1rem;
        line-height: 1.2;
    }

    #settingsModal .settings-pane-intro p,
    #settingsModal .settings-column-head p,
    #settingsModal .profile-summary-copy p,
    #settingsModal .settings-inline-note {
        font-size: 0.8rem;
        line-height: 1.38;
    }

    #settingsModal .profile-summary-card {
        gap: 0.75rem;
        padding: 0.85rem;
    }

    #settingsModal .profile-summary-copy h4 {
        font-size: 1.04rem;
    }

    #settingsModal .settings-form-actions {
        gap: 0.55rem;
        padding-top: 0.7rem;
    }

    #settingsModal .settings-form-actions .btn,
    #settingsModal .settings-meta-links {
        width: 100%;
    }

    #settingsModal .settings-meta-links {
        justify-content: flex-start;
    }

    #settingsModal .absence-item-card,
    #settingsModal .band-admin-member-card,
    #settingsModal .member-item,
    #settingsModal .user-band-tag {
        border-radius: 14px;
    }

    #settingsModal .admin-toolbar-end,
    #settingsModal .absence-actions,
    #settingsModal .confirm-notify-actions {
        width: 100%;
    }
}

/* =========================================
   SETTINGS MOBILE FINAL PASS
   ========================================= */

@media (max-width: 640px) {
    #settingsModal .settings-modal-body {
        gap: 0.8rem;
        scroll-padding-bottom: calc(6.5rem + env(safe-area-inset-bottom));
    }

    #settingsModal .settings-tabs {
        gap: 0.45rem;
    }

    #settingsModal .settings-tab-btn {
        min-width: 118px;
        min-height: 46px;
        padding: 0.54rem 0.68rem;
        overflow: hidden;
    }

    #settingsModal .settings-tab-label {
        gap: 0.12rem;
        min-width: 0;
        overflow: hidden;
    }

    #settingsModal .settings-tab-label strong,
    #settingsModal .settings-tab-label small {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

    #settingsModal .settings-pane-intro,
    #settingsModal .profile-section,
    #settingsModal .settings-surface-card,
    #settingsModal .absences-form-column,
    #settingsModal .admin-accordion-card,
    #settingsModal .admin-subsection-form {
        padding: 0.82rem;
        border-radius: 15px;
    }

    #settingsModal .settings-pane-intro,
    #settingsModal .settings-column-head,
    #settingsModal .settings-column-head-compact,
    #settingsModal .profile-summary-copy,
    #settingsModal .profile-main-column {
        gap: 0.45rem;
    }

    #settingsModal .profile-summary-card {
        gap: 0.7rem;
        padding: 0.82rem;
    }

    #settingsModal .profile-section-title {
        align-items: center;
        gap: 0.65rem;
    }

    #settingsModal .profile-form-grid,
    #settingsModal .profile-settings-grid {
        gap: 0.75rem;
    }

    #settingsModal .settings-pane-intro p,
    #settingsModal .settings-column-head p,
    #settingsModal .profile-summary-copy p,
    #settingsModal .settings-inline-note {
        max-width: none;
    }

    #settingsModal .settings-form-actions {
        gap: 0.5rem;
        padding-top: 0.6rem;
    }

    #settingsModal .settings-form-actions .btn {
        min-height: 48px;
    }

    #settingsModal .settings-meta-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
    }

    #settingsModal .settings-meta-links > * {
        width: 100%;
    }

    #settingsModal .external-calendar-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.6rem;
    }

    #settingsModal .external-calendar-visibility {
        grid-column: 1 / -1;
        padding-inline: 0;
    }

    #settingsModal .external-calendar-field-url {
        grid-column: 1 / -1;
    }
}

/* =========================================
   ORGANIZATIONS (Hub Redesign)
   ========================================= */
.org-hero-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.org-hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
    opacity: 0.05;
    filter: blur(50px);
}

.org-hero-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-2xl);
    position: relative;
    z-index: 1;
}

.org-hero-avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-2xl);
    background: var(--color-bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-primary);
    box-shadow: var(--shadow-lg);
}

.org-hero-info h2 {
    font-size: 2.25rem;
    margin-bottom: var(--spacing-xs);
}

.org-hero-description {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin-bottom: var(--spacing-lg);
}

.org-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xl);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color var(--transition-base);
}

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

.sticky-tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--color-bg-primary);
    padding: var(--spacing-sm) 0;
}

/* Choice Modal - Removed redundant styles (now using global songpool classes) */

/* Animated List */
.animated-list-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.browse-org-item {
    padding: var(--spacing-lg);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.browse-org-item:hover {
    background: var(--color-bg-tertiary);
    transform: scale(1.02);
}

/* Compact Songpool Grid */
.songpool-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.song-card-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    text-decoration: none;
    color: inherit;
}

.song-card-compact:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-primary-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.song-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.song-card-info {
    flex: 1;
    min-width: 0;
}

.song-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.song-card-artist {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Animation for Tab Content */
.tab-content.active {
    animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Header Enhancements */
.section-header-mobile-adjust {
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 640px) {
    .section-header-mobile-adjust {
        flex-direction: column;
        align-items: flex-start;
    }
    .section-header-mobile-adjust .btn {
        width: 100%;
    }
}

/* =========================================
   ORG DETAILS MODAL — VISUAL PARITY WITH BAND MODAL
   All #bandDetailsModal-scoped rules mirrored here so
   #orgDetailsModal renders identically.
   ========================================= */

/* --- Tab pill container --- */
#orgDetailsModal .tab-buttons.band-details-tabs {
    display: inline-flex;
    align-self: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0;
    padding: 0.45rem;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.08);
}

/* --- Individual tab buttons --- */
#orgDetailsModal .tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.78rem 1rem;
    border-radius: 14px;
    border-bottom: none;
    margin-bottom: 0;
    color: var(--color-text-secondary);
    font-weight: 700;
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 0.875rem;
}

#orgDetailsModal .tab-btn:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.07);
}

#orgDetailsModal .tab-btn.active {
    color: var(--color-text);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(59, 130, 246, 0.12));
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.24);
}

/* --- Tab icon sizing --- */
#orgDetailsModal .band-details-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

#orgDetailsModal .band-details-tab-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* --- Tab content --- */
#orgDetailsModal .tab-content {
    padding-top: 0;
    display: none;
}

#orgDetailsModal .tab-content.active {
    display: block;
}

/* --- Members list --- */
#orgDetailsModal .members-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0;
}

/* --- Member rows --- */
#orgDetailsModal .member-row {
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
        rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    padding: 0.95rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: none;
    transition: all var(--transition-base);
}

#orgDetailsModal .member-row:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.24);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.12), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
        rgba(15, 23, 42, 0.1);
}

#orgDetailsModal .member-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
}

#orgDetailsModal .member-name {
    font-size: 1.02rem;
    font-weight: 700;
}

#orgDetailsModal .member-actions-col {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* --- Section header --- */
#orgDetailsModal .band-details-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

/* --- Panel section card look --- */
#orgDetailsModal .band-details-panel-section {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent), var(--color-surface);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 22px;
    padding: 1.2rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

/* --- Intro panel --- */
#orgDetailsModal .band-details-panel-intro {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent), var(--color-surface);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 22px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

/* --- Section h3 top margin fix --- */
#orgDetailsModal .section h3 {
    margin-top: 0;
}

/* --- Responsive: stack tabs on small screens --- */
@media (max-width: 640px) {
    #orgDetailsModal .tab-buttons.band-details-tabs {
        width: 100%;
    }
    #orgDetailsModal .tab-btn {
        flex: 1;
        justify-content: center;
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
    }
    #orgDetailsModal .band-details-section-header {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    #orgDetailsModal .tab-btn span:not(.band-details-tab-icon) {
        display: none;
    }
    #orgDetailsModal .tab-btn {
        padding: 0.7rem;
    }
}

/* =========================================
   ORG DETAILS MODAL — REFINED PARITY BLOCK
   Uses exact same values as #bandDetailsModal lines 24384–24530
   ========================================= */

#orgDetailsModal .band-details-modal-header {
    padding: 22px 24px 18px;
}

#orgDetailsModal .band-details-modal-body {
    padding: 0 24px 24px;
    gap: 16px;
}

#orgDetailsModal .band-details-cover {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: white;
}

/* Pill tab container — overrides global .band-details-tabs */
#orgDetailsModal .band-details-tabs {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    align-self: stretch;
    padding: 6px;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

/* Tab button base — overrides global .tab-btn border-bottom styles */
#orgDetailsModal .tab-btn {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    gap: 0.48rem;
    min-height: 42px;
    padding: 0.7rem 0.95rem;
    border: 1px solid transparent !important;
    border-bottom: 1px solid transparent !important;
    border-radius: 12px;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 0 !important;
    transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}

#orgDetailsModal .tab-btn:hover {
    color: var(--color-text);
    border-color: var(--color-border) !important;
    background: var(--color-surface-hover);
}

#orgDetailsModal .tab-btn.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(14, 165, 233, 0.05));
    border-color: rgba(14, 165, 233, 0.35) !important;
    color: var(--color-text);
    box-shadow: 0 12px 22px -18px rgba(14, 165, 233, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

#orgDetailsModal .tab-btn.active::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 6px;
    height: 2px;
    border-radius: 999px;
    background: var(--color-primary);
}

/* Tab icon — constrain SVG to 16px like band modal */
#orgDetailsModal .band-details-tab-icon {
    width: 16px !important;
    height: 16px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--color-text-secondary);
    transition: color var(--transition-base);
}

#orgDetailsModal .tab-btn.active .band-details-tab-icon {
    color: var(--color-primary);
}

#orgDetailsModal .band-details-tab-icon svg {
    width: 16px !important;
    height: 16px !important;
    display: block;
}

/* Panel sections */
#orgDetailsModal .band-details-panel-section,
#orgDetailsModal .band-details-panel-intro {
    border-radius: 18px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: none;
}

/* Songpool View Switch */
.songpool-view-switch {
    display: flex;
    background: color-mix(in srgb, var(--surface-secondary) 40%, transparent);
    padding: 3px;
    border-radius: 20px;
    border: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
    margin-right: 1rem;
}

.songpool-view-switch .switch-btn {
    padding: 6px 14px;
    border-radius: 17px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.songpool-view-switch .switch-btn.active {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.songpool-view-switch .switch-btn:not(.active):hover {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--surface-secondary) 60%, transparent);
}

.resource-calendar-settings {
    margin-top: 1rem;
}

.resource-calendar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--color-border);
}

.resource-calendar-item-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.resource-calendar-item-main small {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    word-break: break-all;
}

.resource-calendar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    flex: 0 0 auto;
}

.resource-calendar-icon svg {
    width: 1rem;
    height: 1rem;
}

.resource-calendar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.resource-calendar-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.resource-calendar-item-main {
    min-width: 0;
}

.resource-calendar-item-main small {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.org-resources-workspace {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.org-resources-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.org-resources-hero-copy {
    max-width: 680px;
}

.org-resources-hero-copy h3 {
    margin: 0.2rem 0 0.35rem;
}

.org-resources-hero-copy p,
.org-resources-panel-head p,
.org-resources-guide-item p {
    margin: 0;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.org-resources-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.org-resources-guide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.org-resources-guide-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--color-surface) 86%, transparent);
}

.org-resources-guide-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-primary) 16%, transparent);
    color: var(--color-primary);
    font-weight: 800;
    flex: 0 0 auto;
}

.org-resources-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}

.org-resources-panel {
    border: 1px solid var(--color-border);
    border-radius: 0.85rem;
    padding: 1rem;
    background: color-mix(in srgb, var(--color-surface) 92%, transparent);
}

.org-resources-panel-head {
    margin-bottom: 0.85rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.org-resources-panel-head h4 {
    margin: 0.2rem 0 0.3rem;
}

.org-resource-location-row {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--color-border);
}

.org-resource-location-row:last-child {
    border-bottom: 0;
}

.org-resource-location-main,
.org-resource-location-identity {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.org-resource-location-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(8rem, auto) auto;
    justify-content: stretch;
}

.org-resource-location-identity {
    justify-content: flex-start;
    min-width: 0;
}

.org-resource-location-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.org-resource-location-copy span {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

.org-resource-calendar-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 15rem;
    min-width: 0;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    color: var(--color-text);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
    text-align: center;
    white-space: normal;
}

.org-resource-calendar-pill.is-muted {
    background: color-mix(in srgb, var(--color-text-secondary) 10%, transparent);
    color: var(--color-text-secondary);
}

.org-resource-location-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex: 0 0 auto;
}

.scheduler-date-assistant-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.scheduler-assistant-btn {
    white-space: nowrap;
}

.scheduling-assistant-content {
    max-width: 920px;
}

.scheduling-assistant-toolbar {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(120px, 0.6fr) minmax(120px, 0.6fr) auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1rem;
}

.scheduling-assistant-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.scheduling-suggestion-card {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--color-surface) 94%, transparent);
}

.scheduling-suggestion-card.is-best {
    border-color: color-mix(in srgb, var(--color-success, #22c55e) 45%, var(--color-border));
}

.scheduling-suggestion-card.has-conflict {
    border-color: color-mix(in srgb, var(--color-warning, #f59e0b) 45%, var(--color-border));
}

.scheduling-suggestion-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
    color: var(--color-primary);
    font-weight: 800;
}

.scheduling-suggestion-main {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.scheduling-suggestion-main > span,
.scheduling-suggestion-meta,
.scheduling-suggestion-conflicts {
    color: var(--color-text-secondary);
}

.scheduling-suggestion-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    font-size: 0.85rem;
}

.scheduling-suggestion-meta span {
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-text-secondary) 10%, transparent);
}

.scheduling-suggestion-conflicts {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.82rem;
}

.org-resource-overview {
    padding-bottom: 0.15rem;
}

.org-resources-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
    gap: 1rem;
    align-items: start;
}

.org-resources-panel-primary {
    min-width: 0;
}

.org-resource-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.82fr);
    gap: 1rem;
    align-items: start;
}

.org-equipment-split {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
    gap: 1rem;
    align-items: start;
}

.org-resource-subsection {
    min-width: 0;
    overflow: hidden;
}

.org-resource-subsection + .org-resource-subsection {
    padding-left: 1rem;
    border-left: 1px solid var(--color-border);
}

.org-resource-subsection-head {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.75rem;
}

.org-resource-subsection-head strong {
    color: var(--color-text);
}

.org-resource-subsection-head span {
    color: var(--color-text-secondary);
    font-size: 0.82rem;
}

.org-resource-calendar-list {
    display: grid;
    gap: 0.65rem;
}

.org-resource-subsection-reservations .org-workspace-card {
    padding: 0.85rem;
}

.org-resource-hidden-actions {
    display: none !important;
}

.org-resource-create-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.org-resource-create-card {
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr);
    gap: 0.65rem 0.85rem;
    align-items: center;
    width: 100%;
    padding: 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.org-resource-create-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.org-resource-create-card > span {
    grid-row: span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
    color: var(--color-primary);
}

.org-resource-create-card svg {
    width: 1.15rem;
    height: 1.15rem;
}

.org-resource-create-card strong {
    align-self: end;
}

.org-resource-create-card small {
    align-self: start;
    color: var(--color-text-secondary);
    line-height: 1.35;
}

@media (max-width: 1100px) {
    .org-resource-split,
    .org-equipment-split {
        grid-template-columns: 1fr;
    }

    .org-resource-subsection + .org-resource-subsection {
        padding-left: 0;
        padding-top: 1rem;
        border-left: 0;
        border-top: 1px solid var(--color-border);
    }
}

@media (max-width: 768px) {
    .songpool-view-switch {
        margin-right: 0;
        margin-bottom: 0.75rem;
        width: 100%;
        justify-content: center;
    }
    .songpool-view-switch .switch-btn {
        flex: 1;
        text-align: center;
    }

    .resource-calendar-item {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .resource-calendar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .org-resources-hero,
    .org-resources-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .org-resource-location-main {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .org-resource-location-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .org-resources-actions {
        justify-content: stretch;
    }

    .org-resources-actions .btn {
        flex: 1;
    }

    .org-resources-guide,
    .org-resources-grid,
    .org-resources-main-grid,
    .org-resource-split,
    .org-equipment-split,
    .org-resource-create-grid {
        grid-template-columns: 1fr;
    }

    .org-resource-subsection + .org-resource-subsection {
        padding-left: 0;
        padding-top: 1rem;
        border-left: 0;
        border-top: 1px solid var(--color-border);
    }

    .org-resource-calendar-pill {
        width: fit-content;
        white-space: normal;
    }

    .scheduler-date-assistant-row,
    .scheduling-assistant-toolbar,
    .scheduling-suggestion-card {
        grid-template-columns: 1fr;
    }

    .scheduler-assistant-btn,
    .scheduling-suggestion-card .btn {
        width: 100%;
    }
}


/* Roles Overview in Organization Settings */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: 1rem;
}

.role-group-card {
    background: color-mix(in srgb, var(--surface-secondary) 30%, transparent);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--spacing-md);
}

.role-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.role-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--surface-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
}

.role-group-users {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.role-user-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: var(--surface-secondary);
    border-radius: 6px;
    color: var(--text-primary);
}

.org-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    align-items: start;
}

@media (max-width: 768px) {
    .org-settings-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   UNIFIED PREMIUM LOADER (LOGO SPINNER)
   ========================================= */

/* Note: Global Loader styles are now centralized in style.css for better maintainability */

.premium-loader {
    width: 340px;
    max-width: calc(100vw - 3rem);
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .premium-loader {
        padding: 2rem 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .loader-spinner {
        width: 70px;
        height: 70px;
    }
    
    .loader-logo-spinner {
        width: 50px;
        height: 50px;
    }
}

.loader-spinner {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.loader-logo-spinner {
    width: 60px;
    height: 60px;
    background: url('../images/branding/bandmate-logo-only-dark.svg') no-repeat center;
    background-size: contain;
    animation: spin 2s linear infinite;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Global Spinner Overrides */
.spinner, .loading-spinner, .loading-spinner-circle {
    width: 48px;
    height: 48px;
    background: url('../images/branding/bandmate-logo-only-dark.svg') no-repeat center !important;
    background-size: contain !important;
    animation: spin 2s linear infinite !important;
    border: none !important;
    border-radius: 0 !important;
}

.spinner-sm {
    width: 24px;
    height: 24px;
    background: url('../images/branding/bandmate-logo-only-dark.svg') no-repeat center !important;
    background-size: contain !important;
    animation: spin 2s linear infinite !important;
    border: none !important;
}

/* Organization Band Card Members Preview */
.members-avatars-row {
    display: flex;
    align-items: center;
}

.member-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: white;
    border: 2px solid var(--color-bg-secondary);
    margin-right: -8px; /* Stacking effect */
    transition: transform 0.2s ease;
    position: relative;
    z-index: 1;
}

.member-avatar-sm:hover {
    transform: translateY(-2px);
    z-index: 10;
}

.member-avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-avatar-more {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-left: 12px;
    padding-bottom: 2px;
}

/* Compact Member List for Confirmation Modals */
.compact-member-list-alt {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: var(--color-bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

.compact-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.compact-member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
}

.compact-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compact-member-info {
    display: flex;
    flex-direction: column;
}

.compact-member-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.compact-member-role {
    font-size: 11px;
    color: var(--color-text-secondary);
}

/* Band Card Mini Members List */
.band-card-members-list-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.band-member-mini-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-avatar-xs {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: white;
}

.member-avatar-xs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-mini-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.member-mini-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
}

.member-mini-role {
    font-size: 10px;
    color: var(--color-text-secondary);
}

.member-mini-more {
    font-size: 11px;
    color: var(--color-text-secondary);
    padding-top: 4px;
    font-style: italic;
}

/* =========================================
   ANIMATED LIST (ReactBits Style)
   ========================================= */

@keyframes staggeredSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animated-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.animated-list-item {
    opacity: 0;
    animation: staggeredSlideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Musikerpool List Styling */
.musikpool-list-item {
    display: flex;
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    gap: 16px;
}

.musikpool-list-item:hover {
    border-color: var(--color-primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.musikpool-list-item .member-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.musikpool-list-item .member-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.musikpool-list-item .member-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
}

.musikpool-list-item .member-meta {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.musikpool-list-item .member-actions {
    display: flex;
    gap: 8px;
    opacity: 1; /* Always visible */
    transition: opacity var(--transition-base);
}

.musikpool-organization-groups {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.musikpool-organization-group {
    border: 1px solid var(--color-border);
    border-radius: 0.85rem;
    padding: 1rem;
    background: color-mix(in srgb, var(--color-surface) 92%, transparent);
}

.musikpool-organization-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.musikpool-organization-group-head h3 {
    margin: 0.2rem 0 0;
    font-size: 1.05rem;
}

.source-badge {
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

/* =========================================
   MODERN FEEDBACK VIEW
   ========================================= */

.feedback-container-v2 {
    display: grid;
    grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
    align-items: start;
    gap: 1.25rem;
    width: 100%;
}

.feedback-intro-panel,
.feedback-form-panel {
    border: 1px solid color-mix(in srgb, var(--settings-border, var(--color-border)) 86%, transparent);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0)),
        var(--settings-surface, var(--color-surface));
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.18);
}

.feedback-intro-panel {
    display: grid;
    gap: 1rem;
    padding: 1.35rem;
}

.feedback-intro-panel h3 {
    margin: 0;
    color: var(--color-text);
    font-size: clamp(1.25rem, 1.2vw, 1.65rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.feedback-intro-panel p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

.feedback-guidance-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.feedback-guidance-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.8rem;
    padding: 0.85rem;
    border: 1px solid color-mix(in srgb, var(--settings-border-soft, var(--color-border)) 82%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--settings-input-bg, var(--color-bg-secondary)) 86%, transparent);
}

.feedback-guidance-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--color-primary) 22%, var(--settings-border, var(--color-border)));
    background: color-mix(in srgb, var(--color-primary) 12%, var(--settings-input-bg, var(--color-bg-secondary)));
    color: var(--color-primary);
}

.feedback-guidance-icon.is-danger {
    border-color: color-mix(in srgb, var(--color-danger, #ef4444) 24%, var(--settings-border, var(--color-border)));
    background: color-mix(in srgb, var(--color-danger, #ef4444) 10%, var(--settings-input-bg, var(--color-bg-secondary)));
    color: var(--color-danger, #ef4444);
}

.feedback-guidance-icon svg {
    width: 19px;
    height: 19px;
}

.feedback-guidance-item div {
    display: grid;
    gap: 0.22rem;
    min-width: 0;
}

.feedback-guidance-item strong {
    color: var(--color-text);
    font-size: 0.92rem;
    line-height: 1.3;
}

.feedback-guidance-item span:last-child {
    color: var(--color-text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
}

.feedback-form-panel {
    padding: 1.1rem;
}

.feedback-type-selector-wrapper {
    margin-bottom: 1rem;
}

.feedback-type-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.35rem;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--settings-border-soft, var(--color-border)) 82%, transparent);
    background: var(--settings-input-bg, var(--color-bg-secondary));
}

.feedback-type-card {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 48px;
    padding: 0.75rem 0.9rem;
    border-radius: 11px;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.2;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.feedback-type-card:hover {
    color: var(--color-text);
    background: color-mix(in srgb, var(--color-primary) 6%, transparent);
}

.feedback-type-card.active {
    background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
    border-color: color-mix(in srgb, var(--color-primary) 26%, var(--settings-border, var(--color-border)));
    color: var(--color-primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.feedback-type-card:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.feedback-type-card[data-feedback-tab="bug"].active {
    background: color-mix(in srgb, var(--color-danger, #ef4444) 9%, var(--color-surface));
    border-color: color-mix(in srgb, var(--color-danger, #ef4444) 26%, var(--settings-border, var(--color-border)));
    color: var(--color-danger, #ef4444);
}

.feedback-type-card .type-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.feedback-type-card .type-icon svg {
    width: 100%;
    height: 100%;
}

.feedback-tab-panel {
    display: none;
}

.feedback-submit-confirmation {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.8rem;
    margin: 0 0 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid color-mix(in srgb, var(--color-success, #22c55e) 28%, var(--settings-border, var(--color-border)));
    border-radius: 14px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--color-success, #22c55e) 12%, transparent), transparent),
        color-mix(in srgb, var(--settings-input-bg, var(--color-bg-secondary)) 88%, transparent);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.12);
}

.feedback-submit-confirmation[hidden] {
    display: none;
}

.feedback-submit-confirmation-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    color: var(--color-success, #22c55e);
    background: color-mix(in srgb, var(--color-success, #22c55e) 14%, var(--settings-input-bg, var(--color-bg-secondary)));
    border: 1px solid color-mix(in srgb, var(--color-success, #22c55e) 28%, transparent);
}

.feedback-submit-confirmation-icon svg {
    width: 19px;
    height: 19px;
}

.feedback-submit-confirmation strong {
    display: block;
    color: var(--color-text);
    font-size: 0.94rem;
    line-height: 1.35;
}

.feedback-submit-confirmation p {
    margin: 0.2rem 0 0;
    color: var(--color-text-secondary);
    font-size: 0.86rem;
    line-height: 1.5;
}

.feedback-tab-panel.active {
    display: block;
    animation: slideUpFade 0.4s ease;
}

.feedback-settings-form {
    display: grid;
    gap: 1rem;
}

.feedback-panel-heading {
    display: grid;
    gap: 0.25rem;
    padding: 0.2rem 0.1rem 0.35rem;
}

.feedback-panel-heading span {
    color: var(--color-text);
    font-size: 1.05rem;
    font-weight: 760;
    line-height: 1.3;
}

.feedback-panel-heading p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
}

.feedback-settings-form .form-group {
    display: grid;
    gap: 0.55rem;
}

.feedback-settings-form label {
    color: var(--color-text);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.feedback-settings-form input,
.feedback-settings-form textarea {
    width: 100%;
    border-color: var(--settings-border-soft, var(--color-border));
    background: var(--settings-input-bg, var(--color-bg-secondary));
}

.feedback-settings-form input:focus,
.feedback-settings-form textarea:focus {
    border-color: color-mix(in srgb, var(--color-primary) 45%, var(--settings-border, var(--color-border)));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 13%, transparent);
}

.feedback-textarea {
    min-height: 170px;
    resize: vertical;
}

.feedback-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.25rem;
}

.feedback-form-footer span {
    color: var(--color-text-secondary);
    font-size: 0.84rem;
    line-height: 1.45;
}

.feedback-form-footer .btn {
    min-width: 150px;
}

@media (max-width: 900px) {
    .feedback-container-v2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .feedback-intro-panel,
    .feedback-form-panel {
        border-radius: 16px;
        padding: 1rem;
    }

    .feedback-type-selector {
        grid-template-columns: 1fr;
    }

    .feedback-form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .feedback-form-footer .btn {
        width: 100%;
    }
}

/* =========================================
   MOBILE OPTIMIZATION OVERRIDES
   ========================================= */

@media (max-width: 768px) {
    :root {
        --page-padding: 1rem;
    }

    /* Fixed Header for Mobile */
    .app-header {
        position: sticky !important;
        top: 0;
        z-index: 1000;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .header-content {
        padding: 0.75rem var(--page-padding) !important;
        gap: 0.5rem !important;
    }

    /* Hide less important header items on small screens */
    .header-actions .user-name,
    #dashboardOpenCalendarShortcut,
    .header-dashboard-shortcuts {
        display: none !important;
    }

    /* Show a compact quick-add for mobile */
    .header-quick-add {
        display: flex !important;
    }

    /* View Container Padding */
    .view-page-shell {
        padding: 1.25rem var(--page-padding);
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Dashboard Layout */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        margin-bottom: 2rem !important;
    }

    .dashboard-bento-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .dashboard-hero {
        flex-direction: column !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .dashboard-panel {
        padding: 1.25rem !important;
        width: 100% !important;
        border-radius: 20px !important;
    }

    /* Stat Cards Optimization */
    .stat-card {
        padding: 1.25rem !important;
        gap: 1.25rem !important;
        border-radius: 20px !important;
    }

    .stat-card .card-icon {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
    }

    .stat-card .card-stat {
        font-size: 1.75rem !important;
        font-weight: 800 !important;
    }

    /* Bento Grid Sections */
    .dashboard-section {
        grid-column: span 1 !important;
    }

    /* Typography Adjustments */
    h2 {
        font-size: 1.5rem !important;
        letter-spacing: -0.02em !important;
    }

    .page-overview-card h2 {
        font-size: 1.85rem !important;
        line-height: 1.15 !important;
    }

    /* Forms & Inputs */
    .form-group {
        margin-bottom: 1.5rem !important;
    }

    input, select, textarea {
        font-size: 16px !important; /* Prevents auto-zoom on iOS */
        padding: 0.875rem 1rem !important;
        border-radius: 14px !important;
    }

    /* Lists and Grids */
    .bands-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .schedule-status-overview {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Dropdowns & Menus Optimization */
    .notification-dropdown, 
    .header-quick-add-menu {
        position: fixed !important;
        top: calc(70px + env(safe-area-inset-top)) !important;
        left: var(--page-padding) !important;
        right: var(--page-padding) !important;
        width: auto !important;
        max-width: none !important;
        border-radius: 20px !important;
        margin: 0 !important;
        box-shadow: 0 12px 32px rgba(0,0,0,0.3) !important;
        border: 1px solid var(--color-border) !important;
    }

    /* Fix for horizontal overflows */
    .app-main, .view, .view-page-shell {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Mobile Navigation Drawer Improvement */
    .app-nav {
        background: rgba(var(--color-surface-rgb), 0.95) !important;
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--color-border);
        padding: 0.5rem !important;
    }

    .nav-item {
        padding: 1rem !important;
        border-radius: 12px !important;
        font-size: 0.875rem !important;
    }
}

/* Extra small devices optimization */
@media (max-width: 400px) {
    :root {
        --page-padding: 0.875rem;
    }

    .page-overview-card {
        padding: 1.75rem 1rem !important;
    }

    .btn {
        padding: 0.875rem 1.25rem !important;
        font-size: 1rem !important;
    }
}

/* =========================================
   MUSIKPOOL REFRESH BUTTON
   ========================================= */

.musikpool-refresh-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-hover, rgba(255,255,255,0.06));
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.musikpool-refresh-btn:hover {
    background: var(--color-primary-soft, rgba(136,104,255,0.12));
    color: var(--color-primary);
}

.musikpool-refresh-btn:active {
    transform: scale(0.92);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.musikpool-refresh-btn.is-loading .musikpool-refresh-icon {
    animation: spin 0.8s linear infinite;
}


/* =========================================
   MOBILE FLOATING ACTION BUTTON (FAB)
   ========================================= */

#mobileViewFab,
#bandModalFab {
    display: none;
}

.mobile-view-fab-menu {
    display: none;
}

@media (max-width: 768px) {
    #songpoolView #addSongpoolSongBtn,
    #organizationsView #openOrgChoiceBtn {
        display: none !important;
    }

    #songpoolView #songpoolAddDropdown,
    #organizationsView #orgAddDropdown {
        display: none !important;
    }

    #mobileViewFab,
    #bandModalFab {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        right: 1.15rem;
        bottom: calc(7.5rem + env(safe-area-inset-bottom));
        z-index: 800;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: var(--color-primary);
        color: #fff;
        border: none;
        cursor: pointer;
        box-shadow:
            0 4px 16px rgba(0,0,0,0.28),
            0 0 0 0 rgba(136,104,255,0.4);
        transition:
            transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
            box-shadow 0.25s ease,
            opacity 0.2s ease;
    }

    #mobileViewFab:active,
    #bandModalFab:active {
        transform: scale(0.92);
    }

    #mobileViewFab:hover,
    #bandModalFab:hover {
        box-shadow:
            0 6px 24px rgba(0,0,0,0.35),
            0 0 0 6px rgba(136,104,255,0.18);
    }

    #mobileViewFab svg,
    #bandModalFab svg {
        width: 24px;
        height: 24px;
        stroke: #fff;
        flex-shrink: 0;
        transition: transform 0.22s ease;
    }

    #mobileViewFab.is-menu-open svg,
    #bandModalFab.is-menu-open svg {
        transform: rotate(45deg);
    }

    #mobileViewFab::before,
    #bandModalFab::before {
        content: attr(data-label);
        position: absolute;
        right: calc(100% + 10px);
        top: 50%;
        transform: translateY(-50%);
        background: var(--color-surface);
        color: var(--color-text);
        border: 1px solid var(--color-border);
        font-size: 0.78rem;
        font-weight: 600;
        white-space: nowrap;
        padding: 0.3rem 0.65rem;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.18);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease;
    }

    #mobileViewFab.show-label::before,
    #bandModalFab.show-label::before {
        opacity: 1;
    }

    #mobileViewFab[hidden],
    #bandModalFab[hidden] {
        display: none !important;
    }

    .mobile-view-fab-menu:not([hidden]) {
        display: grid;
        gap: 0.45rem;
        position: fixed;
        right: 1.15rem;
        bottom: calc(7.5rem + env(safe-area-inset-bottom) + 64px);
        z-index: 801;
        width: min(270px, calc(100vw - 2rem));
        padding: 0.45rem;
        border: 1px solid var(--color-border);
        border-radius: 14px;
        background: color-mix(in srgb, var(--color-surface) 94%, transparent);
        box-shadow:
            0 20px 45px rgba(0,0,0,0.32),
            0 0 0 1px rgba(255,255,255,0.04) inset;
        backdrop-filter: blur(16px);
        animation: mobileFabMenuIn 0.18s ease-out;
    }

    .mobile-view-fab-menu-item {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        width: 100%;
        min-height: 44px;
        padding: 0.72rem 0.78rem;
        border: 1px solid transparent;
        border-radius: 10px;
        background: transparent;
        color: var(--color-text);
        font: inherit;
        font-size: 0.92rem;
        font-weight: 650;
        line-height: 1.25;
        text-align: left;
        cursor: pointer;
        transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
    }

    .mobile-view-fab-menu-item:hover,
    .mobile-view-fab-menu-item:focus-visible {
        border-color: color-mix(in srgb, var(--color-primary) 30%, transparent);
        background: color-mix(in srgb, var(--color-primary) 12%, transparent);
        color: var(--color-primary);
        outline: none;
    }

    .mobile-view-fab-menu-item:active {
        transform: translateY(1px);
    }

    .mobile-view-fab-menu-item-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        border-radius: 10px;
        background: color-mix(in srgb, var(--color-primary) 14%, transparent);
        color: var(--color-primary);
    }

    .mobile-view-fab-menu-item-icon svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
    }

    @keyframes mobileFabMenuIn {
        from {
            opacity: 0;
            transform: translateY(8px) scale(0.98);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}

/* =========================================
   MUSIKPOOL SECTION HEADER ALIGNMENT
   ========================================= */

#musikpoolView .page-section-card .section-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 0.75rem !important;
}

#musikpoolView .page-section-card .section-header > div {
    flex: 1 !important;
    min-width: 0 !important;
}

#musikpoolView .page-section-card .section-header .musikpool-refresh-btn {
    flex-shrink: 0 !important;
    margin-left: auto !important;
    align-self: center !important;
}

/* Force refresh icon to be visible size regardless of btn-icon overrides */
.musikpool-refresh-btn .musikpool-refresh-icon {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    display: block !important;
    flex-shrink: 0 !important;
}

/* =========================================
   PROBEORTE CALENDAR TABS — COMPACT CHIPS
   ========================================= */

/* Force the submenu into a single scrollable row of compact chips */
#probeorteView .calendar-submenu.probeorte-submenu {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 0.4rem !important;
    padding: 0.35rem !important;
    /* Keep the pill-shaped card background */
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent 42%),
        var(--color-surface) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 999px !important;
}

#probeorteView .calendar-submenu.probeorte-submenu::-webkit-scrollbar {
    display: none !important;
}

/* Compact chip style for each tab */
#probeorteView .personal-calendar-action-btn,
#probeorteView .calendar-tab {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    min-height: 30px !important;
    height: 30px !important;
    padding: 0 0.75rem !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    border-radius: 999px !important;
    line-height: 1 !important;
    border: 1px solid transparent !important;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease !important;
}

/* Inactive chip */
#probeorteView .calendar-tab.btn-secondary {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--color-text-secondary) !important;
    box-shadow: none !important;
}

#probeorteView .calendar-tab.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Active chip */
#probeorteView .calendar-tab.btn-primary,
#probeorteView .calendar-tab.active {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.92), rgba(99, 102, 241, 0.88)) !important;
    border-color: rgba(147, 197, 253, 0.18) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22) !important;
}

#probeorteView .calendar-tab-icon {
    font-size: 0.8rem !important;
    line-height: 1 !important;
}

#probeorteView .calendar-tab-icon svg {
    width: 0.85rem !important;
    height: 0.85rem !important;
}

/* =========================================
   PROBEORTE MOBILE CALENDAR SELECT
   ========================================= */

/* Mobile dropdown row — hidden by default (desktop) */
.probeorte-mobile-cal-row {
    display: none;
}

/* On mobile: show dropdown, hide chip tabs, hide desktop Heute button */
@media (max-width: 640px) {
    /* Hide chip tab bar on mobile */
    #probeorteView .calendar-submenu.probeorte-submenu {
        display: none !important;
    }

    /* Show the mobile calendar select row */
    .probeorte-mobile-cal-row {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-top: 0.5rem;
        width: 100%;
    }

    /* Hide desktop Heute button, show mobile one */
    .probeorte-desktop-heute {
        display: none !important;
    }

    .probeorte-mobile-heute {
        display: inline-flex !important;
        flex-shrink: 0;
        white-space: nowrap;
        min-height: 34px;
        padding: 0 0.75rem;
        font-size: 0.8rem;
    }

    /* The select itself */
    .probeorte-mobile-cal-select {
        flex: 1;
        min-width: 0;
        appearance: none;
        -webkit-appearance: none;
        background:
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238892a4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center / 1rem,
            linear-gradient(180deg, rgba(255,255,255,0.04), transparent),
            var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: 10px;
        color: var(--color-text);
        font-size: 0.85rem;
        font-weight: 600;
        padding: 0.45rem 2.2rem 0.45rem 0.8rem;
        height: 34px;
        cursor: pointer;
        outline: none;
        transition: border-color 0.18s ease, box-shadow 0.18s ease;
    }

    .probeorte-mobile-cal-select:focus {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(136, 104, 255, 0.15);
    }
}

/* On desktop: always show chip tabs, hide mobile row */
@media (min-width: 641px) {
    .probeorte-mobile-cal-row {
        display: none !important;
    }
    .probeorte-mobile-heute {
        display: none !important;
    }
    .probeorte-desktop-heute {
        display: inline-flex !important;
    }
}

/* Single-calendar label in mobile row */
.probeorte-mobile-cal-name {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 0.5rem;
}

/* =========================================
   PROBEORTE TOOLBAR HOST — STACKED ON MOBILE
   ========================================= */

@media (max-width: 640px) {
    /* Stack toolbar-host items vertically: [Select + Heute] above [‹ Month ›] */
    #probeorteView .probeorte-calendar-toolbar-host {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 0.4rem !important;
    }

    /* Nav bar (‹ Month ›) takes full width, centered */
    #probeorteView .probeorte-calendar-toolbar-host .personal-calendar-toolbar-nav {
        width: 100% !important;
        justify-content: space-between !important;
    }

    /* Also stack the scope row (Privat/Org) cleanly, hide hint text */
    #probeorteView .probeorte-scope-row {
        gap: 0.5rem !important;
    }

    #probeorteView .probeorte-scope-hint {
        display: none !important;
    }
}

/* =========================================
   DESKTOP CALENDAR CELL SIZE — COMPACT
   ========================================= */

/* Desktop only: Restore calendar cell heights to be more generous, but still uniform */
@media (min-width: 769px) {
    #kalenderView .calendar-day,
    #probeorteView .calendar-day {
        min-height: 100px !important;
        aspect-ratio: 1 / 0.85 !important; /* Larger rectangles for desktop */
    }

    /* Also restore the day-headers padding slightly */
    #kalenderView .calendar-day-header,
    #probeorteView .calendar-day-header {
        padding: 0.6rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    /* Widen ALL modals on desktop */
    .modal-content {
        max-width: 850px !important;
    }
    
    /* Special even wider for setup help if needed */
    #calendarSetupHelpModal .modal-content {
        max-width: 950px !important;
    }
}

/* Unified Today Highlighting: Match Probeorte to Meine Termine style (solid circle) */
#probeorteView .calendar-day.today .calendar-day-number {
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: var(--color-primary) !important;
    color: white !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: none !important;
    margin-bottom: 0.45rem;
}

#probeorteView .calendar-day.today {
    background: transparent !important; /* Remove purple background */
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.2) !important;
}

/* =========================================
   EVENT RUNDOWN EDITOR OVERHAUL
   ========================================= */

.event-rundown-editor-shell {
    margin-bottom: 1.5rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.event-rundown-header-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
}

.event-rundown-title-group .section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0.2rem 0 0.4rem;
}

.event-rundown-actions-secondary {
    display: flex;
    gap: 0.6rem;
}

.event-rundown-quick-add-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.quick-add-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.event-rundown-quick-add-bar {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Keeps label left and buttons/plus spaced */
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.quick-add-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1; /* Pushes the dropdown to the right */
}

.event-rundown-quick-add-bar .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.event-rundown-quick-add-bar .btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: var(--color-primary);
}

.event-rundown-quick-add-bar .btn:active {
    transform: translateY(0);
}

.event-rundown-quick-add-bar .btn i {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

/* Template Modal Overhaul */
.rundown-template-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.rundown-template-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--color-primary);
}

.rundown-template-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.rundown-template-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rundown-template-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rundown-template-meta svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.rundown-template-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: 1.5rem;
}

.rundown-template-actions .btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
}

.rundown-template-actions .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rundown-template-actions .btn-icon svg {
    width: 16px;
    height: 16px;
}

.rundown-template-warning {
    display: flex;
    gap: 0.8rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 12px;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #f59e0b;
    line-height: 1.5;
}

.rundown-template-warning svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 0.1rem;
}

/* Rundown Cards */
.event-rundown-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: 0.8rem;
    transition: all 0.2s ease;
    overflow: hidden;
}

.event-rundown-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: var(--shadow-sm);
}

.event-rundown-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.event-rundown-card.drag-over {
    border-top: 2px solid var(--color-primary);
}

.event-rundown-card-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 1rem;
}

.event-rundown-drag-zone {
    cursor: grab;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.2s;
}

.event-rundown-drag-zone:hover {
    opacity: 1;
}

.event-rundown-type-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.08);
    border-radius: 10px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.is-songblock .event-rundown-type-icon {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.event-rundown-type-icon svg {
    width: 18px;
    height: 18px;
}

.event-rundown-main-inputs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.event-rundown-title-input {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--color-text) !important;
    box-shadow: none !important;
}

.event-rundown-notes-input {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    font-size: 0.82rem !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
}

.event-rundown-timing-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    padding: 0 1rem;
    border-left: 1px solid rgba(148, 163, 184, 0.1);
    min-width: 120px;
}

.event-rundown-time-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.event-rundown-duration-field {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.event-rundown-duration-input {
    width: 48px !important;
    text-align: right;
    background: transparent !important;
    border: 1px solid transparent !important;
    padding: 2px 4px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
}

.event-rundown-duration-input:focus {
    border-color: var(--color-primary) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.event-rundown-duration-field .unit {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.event-rundown-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Song Summary in Collapsed Card */
.event-rundown-song-summary-mini {
    padding: 0.5rem 1rem 0.8rem 4rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.08);
}

.event-rundown-song-summary-mini.is-hidden {
    display: none;
}

.event-rundown-song-summary-mini .count {
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

/* Song Block Body */
.event-rundown-item-body {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--color-border);
}

.event-rundown-song-block-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.event-rundown-song-block-actions {
    display: flex;
    gap: 0.5rem;
}

.event-rundown-song-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.event-rundown-song-empty {
    padding: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.event-rundown-empty {
    padding: 4rem 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-xl);
    border: 2px dashed rgba(148, 163, 184, 0.1);
}

.event-rundown-empty strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.event-rundown-empty p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Tooltip/Dropdown active state */
.rundown-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0 !important; /* Force align to right edge */
    left: auto !important;
    z-index: 100;
    min-width: 200px;
    background: #1a1f2e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.rundown-dropdown-menu.active {
    display: block;
}

.rundown-dropdown-wrapper {
    position: relative;
}

.rundown-dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.rundown-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-primary);
}

.rundown-dropdown-separator {
    margin: 0.4rem 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* =========================================
   FIX: TOGGLE ICON ALIGNMENT
   ========================================= */

.toggle-icon,
.btn-icon svg,
.event-rundown-drag-handle svg,
.event-rundown-type-icon svg {
    display: block;
    margin: auto !important;
}

.btn-icon, 
.event-rundown-drag-handle,
.event-rundown-type-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.toggle-icon {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

[aria-expanded="true"] .toggle-icon,
.rundown-dropdown-wrapper .btn[aria-expanded="true"] {
    transform: rotate(45deg);
}

.rundown-dropdown-wrapper .btn {
    transition: transform 0.2s ease;
}

/* Mobile Visibility Utilities */
@media (max-width: 1024px) {
    .hidden-mobile,
    #kalenderView .hidden-mobile {
        display: none !important;
    }
}

/* =========================================
   SCHEDULER MODAL: DATE & TIME REFINEMENTS
   ========================================= */

.scheduler-modal .scheduler-schedule-subpanel,
.scheduler-modal .date-proposal-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(148, 163, 184, 0.12) !important;
    border-radius: 1.25rem !important;
    padding: 1.15rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.scheduler-modal .scheduler-schedule-subpanel:hover,
.scheduler-modal .date-proposal-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

.scheduler-modal .date-time-range {
    display: flex !important;
    flex-wrap: nowrap !important; /* Desktop: Stay in one line */
    align-items: center !important;
    gap: 0.6rem !important;
    width: 100% !important;
}

/* Ensure inputs don't grow too large but fit nicely */
.scheduler-modal input[type="date"] {
    flex: 1.2 !important;
    min-width: 130px !important;
}

.scheduler-modal input[type="time"] {
    flex: 0.8 !important;
    min-width: 90px !important;
}

.scheduler-modal .time-separator {
    flex: 0 0 auto !important;
    color: var(--text-muted) !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 0 0.1rem !important;
}

/* Mobile: Stack fields when space is tight */
@media (max-width: 640px) {
    .scheduler-modal .date-time-range {
        flex-wrap: wrap !important;
    }
    
    .scheduler-modal input[type="date"],
    .scheduler-modal input[type="time"] {
        flex: 1 1 calc(50% - 0.5rem) !important;
        min-width: 100px !important;
    }
    
    .scheduler-modal .remove-date,
    .scheduler-modal .remove-event-date {
        margin-left: auto !important;
    }
}

/* Unified Input Base */
.scheduler-modal input[type="date"],
.scheduler-modal input[type="time"] {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px !important;
    padding: 0.6rem 0.7rem !important;
    color: var(--color-text) !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    min-height: 42px !important;
}

.scheduler-modal input[type="date"]:focus,
.scheduler-modal input[type="time"]:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2) !important;
    outline: none !important;
}

.scheduler-subpanel-title-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 1rem !important;
    gap: 1rem !important;
}

.scheduler-header-add-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    padding: 0.35rem 0.75rem !important;
    border-radius: 999px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    transition: all 0.2s ease !important;
    background: var(--color-primary) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2) !important;
}

.scheduler-header-add-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 15px rgba(14, 165, 233, 0.3) !important;
    filter: brightness(1.1) !important;
}

.scheduler-header-add-btn svg {
    width: 14px !important;
    height: 14px !important;
}

.scheduler-modal .scheduler-schedule-date-label {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    margin-bottom: 0 !important; /* Managed by row gap */
    color: var(--color-text) !important;
    display: block !important;
}

/* Remove button in proposals */
.scheduler-modal .remove-date,
.scheduler-modal .remove-event-date {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border-radius: 10px !important;
    width: 42px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

.scheduler-modal .remove-date:hover:not(:disabled),
.scheduler-modal .remove-event-date:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2) !important;
    transform: scale(1.05) !important;
}

/* Scheduling Mode Selection Row */
.scheduler-mode-row {
    display: flex !important;
    align-items: flex-start !important;
    gap: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    flex-wrap: wrap !important;
}

.event-schedule-mode-grid {
    display: flex !important;
    gap: 0.75rem !important;
    flex: 1 !important;
    min-width: 320px !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.event-schedule-mode-option {
    flex: 1 !important;
    cursor: pointer !important;
    position: relative !important;
}

.event-schedule-mode-option input {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

.event-schedule-mode-option-body {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.25rem 1rem !important;
    background: transparent !important;
    border: 1px solid rgba(148, 163, 184, 0.12) !important;
    border-radius: 1rem !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-align: center !important;
}

.event-schedule-mode-option input:checked + .event-schedule-mode-option-body {
    background: rgba(14, 165, 233, 0.12) !important; /* Use Primary Blue shade */
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 1px var(--color-primary), 0 10px 20px rgba(14, 165, 233, 0.15) !important;
    transform: translateY(-2px) !important;
}

.event-schedule-mode-option input:checked + .event-schedule-mode-option-body strong {
    color: var(--color-primary) !important;
}

.scheduler-mode-assistant-btn {
    width: auto !important; /* Not full width anymore */
    margin-bottom: 0 !important;
    padding: 0.8rem 1.2rem !important;
    min-height: 52px !important; /* Match height of mode cards roughly */
    border-radius: 12px !important;
    font-weight: 700 !important;
    background: var(--color-primary) !important;
    border: 1px solid var(--color-primary) !important;
    color: white !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    margin-top: 0 !important;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2) !important;
}

/* Mobile: Stack again if necessary */
@media (max-width: 768px) {
    .scheduler-mode-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .event-schedule-mode-grid {
        min-width: 100% !important;
    }
    
    .scheduler-mode-assistant-btn {
        width: 100% !important;
    }
}

/* =========================================
   SCHEDULER: UNIFIED FIELD WIDTHS
   ========================================= */

.scheduler-modal .scheduler-panel-basics input,
.scheduler-modal .scheduler-panel-basics select,
.scheduler-modal .scheduler-panel-basics textarea {
    width: 100% !important;
    max-width: 40rem !important; /* Mobile/Default max-width */
    box-sizing: border-box !important;
}

@media (min-width: 800px) {
    .scheduler-modal .scheduler-panel-basics input,
    .scheduler-modal .scheduler-panel-basics select,
    .scheduler-modal .scheduler-panel-basics textarea {
        max-width: 100% !important; /* Allow expansion in grid */
    }
}

/* Ensure the grid itself doesn't limit them differently */
.scheduler-modal .scheduler-grid-basics {
    width: 100% !important;
    max-width: 40rem !important;
}

@media (min-width: 800px) {
    .scheduler-modal .scheduler-grid-basics {
        max-width: 58rem !important; /* Wider on desktop for 2 cols */
        grid-template-columns: 1fr 1fr !important;
    }
}

.scheduler-span-1 {
    grid-column: span 1 !important;
}

.scheduler-span-2 {
    grid-column: 1 / -1 !important;
}

.scheduler-mode-assistant-btn:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 15px rgba(14, 165, 233, 0.3) !important;
}

/* =========================================
   SCHEDULER: COMPACT MEMBER SELECTION
   ========================================= */

/* =========================================
   MODALS: FULLSCREEN EXPORT & PREVIEW
   ========================================= */

.rundown-pdf-modal-content,
.bandrider-pdf-modal-content,
.chordpro-preview-modal-content,
.finance-export-modal-content {
    width: 90vw !important;
    max-width: 1000px !important;
    height: 96vh !important;
    max-height: 96vh !important;
    margin: 2vh auto !important;
    border-radius: 1rem !important;
}

/* Ensure the preview stage scales nicely */
.rundown-pdf-preview-stage,
.bandrider-pdf-preview-stage {
    padding: 2rem !important;
}

#pdfPreviewModal .modal-content {
    width: 90vw !important;
    max-width: 1200px !important;
    height: 96vh !important;
    max-height: 96vh !important;
    margin: 2vh auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 1rem !important;
}

#pdfPreviewModal .modal-body {
    background:
        radial-gradient(circle at top left, rgba(91, 140, 255, 0.08), transparent 38%),
        #0f172a !important;
    padding: clamp(1rem, 3vw, 2.5rem) !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
}

#pdfPreviewModal iframe {
    width: min(100%, 820px) !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.55);
}

/* =========================================
   SETTINGS TABS: LABEL OVERFLOW FIX
   ========================================= */

#settingsModal .settings-tab-btn {
    min-width: 0;
    overflow: hidden;
}

#settingsModal .settings-tab-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    flex: 1;
}

#settingsModal .settings-tab-label strong,
#settingsModal .settings-tab-label small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

#settingsModal .settings-tab-icon {
    flex: 0 0 auto;
}

/* Settings modal: wider on desktop for readability */
@media (min-width: 900px) {
    #settingsModal .settings-modal-content {
        max-width: 1400px !important;
        width: min(96vw, 1400px) !important;
    }
}

/* =========================================
   BAND DETAILS: WIDER MODAL
   ========================================= */

#bandDetailsModal .modal-content.band-details-modal-content,
#orgDetailsModal .modal-content.band-details-modal-content {
    width: min(98vw, 1200px) !important;
    max-width: 1200px !important;
}

/* Ensure Absence Layout handles the extra width */
#bandDetailsModal .absence-main-layout {
    display: flex !important;
    gap: 2rem !important;
}

#bandDetailsModal .absence-calendar-content {
    flex: 1 !important;
    min-width: 0 !important;
}

/* =========================================
   FINANCE EXPORT: FULLSCREEN & DROPDOWN
   ========================================= */

.finance-export-modal-content {
    width: 98vw !important;
    max-width: 98vw !important;
    height: 96vh !important;
    max-height: 96vh !important;
    margin: 2vh auto !important;
    border-radius: 1rem !important;
    overflow: hidden !important;
}

.finance-export-modal-content .rundown-pdf-modal-body,
.finance-export-modal-content .rundown-pdf-preview-panel,
.finance-export-modal-content .rundown-pdf-preview-stage {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
}

.finance-export-modal-content .rundown-pdf-preview-stage {
    overflow-y: auto !important;
    background: #0f172a !important; /* Professional dark backdrop */
    padding: 3rem 1rem !important;
    align-items: center !important;
}

.finance-export-modal-content .export-preview-paper {
    background: white !important;
    color: #1e293b !important;
    width: 210mm !important;
    min-height: 297mm !important;
    padding: 20mm !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important;
    border-radius: 4px !important;
    margin: 0 auto !important;
}

.dropdown-container {
    position: relative !important;
    display: inline-block !important;
}

.header-quick-add-menu:not(.app-header .header-quick-add-menu):not([hidden]) {
    /* Only apply grid layout to our custom ones when visible (NOT hidden) */
    display: grid !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Ensure items have the correct bordered look even outside header */
.header-quick-add-item {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    margin: 0 !important;
}

.header-quick-add-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--color-primary) !important;
}

.finance-export-modal-content .export-preview-paper {
    background: white !important;
    color: #1e293b !important;
    width: 210mm !important;
    max-width: 95% !important; /* Safety for smaller screens */
    min-height: 297mm !important;
    padding: 20mm !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important;
    border-radius: 4px !important;
    margin: 0 auto !important;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .finance-export-trigger {
        padding: 0.6rem !important;
    }
}

/* FORCE LEFT ALIGNMENT FOR UPCOMING APPOINTMENTS ON DASHBOARD */
#dashboardView #upcomingList .upcoming-card,
#dashboardView #upcomingList .upcoming-card-content,
#dashboardView #upcomingList .upcoming-card-title-row,
#dashboardView #upcomingList .upcoming-card-meta,
#dashboardView #upcomingList .upcoming-card-title,
#dashboardView #upcomingList .upcoming-card-band,
#dashboardView #upcomingList .upcoming-card-meta-primary,
#dashboardView #upcomingList .upcoming-card-meta-secondary {
    text-align: left !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
}

#dashboardView #upcomingList .upcoming-card-content {
    display: flex !important;
    flex-direction: column !important;
}

#dashboardView #upcomingList .upcoming-card-meta {
    display: flex !important;
    flex-wrap: wrap !important;
}

/* News Detail Modal Z-Index Boost */
.news-detail-modal {
    z-index: 12000 !important;
}

/* Schedule accordion: centered SVG chevrons and mobile event cards */
.event-card .accordion-toggle,
.rehearsal-card .accordion-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    flex: 0 0 38px !important;
    line-height: 0 !important;
}

.event-card .accordion-toggle .toggle-icon,
.rehearsal-card .accordion-toggle .toggle-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    line-height: 0 !important;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: transform var(--transition-base), color var(--transition-base);
}

.event-card.expanded .accordion-toggle .toggle-icon,
.rehearsal-card.expanded .accordion-toggle .toggle-icon {
    transform: rotate(0deg);
}

.event-card .accordion-toggle .toggle-chevron,
.rehearsal-card .accordion-toggle .toggle-chevron {
    display: block;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    #eventsView .event-card,
    #rehearsalsView .rehearsal-card {
        overflow: hidden !important;
        padding: 0 !important;
        border: 1px solid var(--border) !important;
        border-left: 1px solid var(--border) !important;
        border-radius: 18px !important;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 74%),
            var(--surface) !important;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08) !important;
    }

    #eventsView .event-card::before,
    #rehearsalsView .rehearsal-card::before {
        width: 4px;
        border-radius: 999px;
        inset: 0 auto 0 0;
    }

    #eventsView .event-card.expanded,
    #rehearsalsView .rehearsal-card.expanded {
        border-color: color-mix(in srgb, var(--band-accent, var(--color-primary)) 38%, var(--border)) !important;
        box-shadow: 0 16px 40px rgba(15, 23, 42, 0.13) !important;
    }

    #eventsView .event-card .accordion-header,
    #rehearsalsView .rehearsal-card .accordion-header {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: stretch !important;
        gap: 0.85rem !important;
        margin: 0 !important;
        padding: 1rem !important;
        background: transparent !important;
    }

    #eventsView .event-card.expanded .accordion-header,
    #rehearsalsView .rehearsal-card.expanded .accordion-header {
        background: color-mix(in srgb, var(--band-accent, var(--color-primary)) 7%, transparent) !important;
    }

    #eventsView .event-card .accordion-title,
    #rehearsalsView .rehearsal-card .accordion-title {
        display: flex !important;
        min-width: 0 !important;
        flex-direction: column !important;
        gap: 0.55rem !important;
    }

    #eventsView .event-card .accordion-title h3,
    #rehearsalsView .rehearsal-card .accordion-title h3 {
        margin: 0 !important;
        font-size: 1.06rem !important;
        line-height: 1.22 !important;
        letter-spacing: 0 !important;
        overflow-wrap: anywhere;
    }

    #eventsView .event-card .schedule-card-band,
    #rehearsalsView .rehearsal-card .schedule-card-band {
        min-width: 0 !important;
        font-size: 0.84rem !important;
        line-height: 1.35 !important;
    }

    #eventsView .event-card .schedule-card-band span:last-child,
    #rehearsalsView .rehearsal-card .schedule-card-band span:last-child {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #eventsView .event-card .schedule-card-meta-row,
    #rehearsalsView .rehearsal-card .schedule-card-meta-row {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.42rem !important;
        min-width: 0 !important;
    }

    #eventsView .event-card .schedule-card-chip,
    #rehearsalsView .rehearsal-card .schedule-card-chip {
        max-width: 100%;
        min-height: 30px;
        align-items: center;
        border-radius: 11px !important;
        padding: 0.36rem 0.62rem !important;
        font-size: 0.75rem !important;
        line-height: 1.25 !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    #eventsView .event-card .schedule-card-chip-primary,
    #rehearsalsView .rehearsal-card .schedule-card-chip-primary {
        flex-basis: 100%;
        justify-content: flex-start;
    }

    #eventsView .event-card .accordion-actions,
    #rehearsalsView .rehearsal-card .accordion-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 40px !important;
        width: 100% !important;
        align-items: center !important;
        gap: 0.75rem !important;
        justify-content: stretch !important;
        padding-top: 0.75rem !important;
        border-top: 1px solid var(--border) !important;
    }

    #eventsView .event-card .schedule-card-status-stack,
    #rehearsalsView .rehearsal-card .schedule-card-status-stack {
        display: flex !important;
        min-width: 0 !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0.42rem !important;
    }

    #eventsView .event-card .rehearsal-status,
    #eventsView .event-card .schedule-card-user-state,
    #rehearsalsView .rehearsal-card .rehearsal-status,
    #rehearsalsView .rehearsal-card .schedule-card-user-state {
        min-height: 28px !important;
        padding: 0.32rem 0.58rem !important;
        border-radius: 999px !important;
        font-size: 0.68rem !important;
        line-height: 1.1 !important;
        letter-spacing: 0.04em !important;
    }

    #eventsView .event-card .accordion-toggle,
    #rehearsalsView .rehearsal-card .accordion-toggle {
        justify-self: end !important;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        flex-basis: 40px !important;
        border-radius: 13px !important;
        background: color-mix(in srgb, var(--surface-secondary) 92%, transparent) !important;
        border-color: color-mix(in srgb, var(--band-accent, var(--color-primary)) 22%, var(--border)) !important;
        color: var(--text-secondary) !important;
    }

    #eventsView .event-card.expanded .accordion-toggle,
    #rehearsalsView .rehearsal-card.expanded .accordion-toggle {
        background: color-mix(in srgb, var(--band-accent, var(--color-primary)) 16%, var(--surface)) !important;
        color: var(--text-primary) !important;
    }

    #eventsView .event-card .accordion-content,
    #rehearsalsView .rehearsal-card .accordion-content {
        padding-top: 0 !important;
        border-top: 1px solid var(--border) !important;
        background: color-mix(in srgb, var(--surface-secondary) 42%, transparent) !important;
    }

    #eventsView .event-card .accordion-body,
    #rehearsalsView .rehearsal-card .accordion-body {
        gap: 0.85rem !important;
        padding: 0.95rem 1rem 1rem !important;
        border-top: none !important;
    }

    #eventsView .event-details-expanded,
    #eventsView .confirmed-event-details,
    #eventsView .pending-event-info,
    #rehearsalsView .event-details-expanded,
    #rehearsalsView .rehearsal-details-expanded {
        gap: 0.75rem !important;
    }

    #eventsView .event-details-grid,
    #rehearsalsView .event-details-grid {
        gap: 0.7rem !important;
        margin-bottom: 0 !important;
    }

    #eventsView .event-details-meta-row,
    #rehearsalsView .event-details-meta-row {
        grid-template-columns: 1fr !important;
        gap: 0.7rem !important;
    }

    #eventsView .event-details-grid .detail-item,
    #eventsView .detail-row,
    #rehearsalsView .event-details-grid .detail-item,
    #rehearsalsView .detail-row,
    #eventsView .event-overview-container,
    #rehearsalsView .rehearsal-overview-container,
    #eventsView .setlist-section {
        border-radius: 14px !important;
        background: var(--surface) !important;
    }

    #eventsView .event-details-grid .detail-item,
    #rehearsalsView .event-details-grid .detail-item {
        padding: 0.82rem 0.9rem !important;
    }

    #eventsView .detail-label,
    #rehearsalsView .detail-label {
        font-size: 0.66rem !important;
        letter-spacing: 0.08em !important;
    }

    #eventsView .detail-value,
    #rehearsalsView .detail-value {
        min-width: 0;
        font-size: 0.9rem !important;
        line-height: 1.42 !important;
        overflow-wrap: anywhere;
    }

    #eventsView .event-overview-container,
    #rehearsalsView .rehearsal-overview-container {
        margin: 0 !important;
        overflow-x: auto !important;
    }

    #eventsView .rehearsal-overview-table,
    #rehearsalsView .rehearsal-overview-table {
        min-width: 560px;
        font-size: 0.78rem !important;
    }

    #eventsView .event-action-buttons,
    #rehearsalsView .rehearsal-action-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.65rem !important;
        margin-top: 0.2rem !important;
        padding-top: 0.85rem !important;
        border-top: 1px solid var(--border) !important;
    }

    #eventsView .event-action-buttons .btn,
    #rehearsalsView .rehearsal-action-buttons .btn {
        width: 100% !important;
        margin-left: 0 !important;
        justify-content: center !important;
    }
}

/* =========================================
   UNIFIED CONFLICT BOX (Premium Edition)
   ========================================= */
.conflict-unified-container {
    margin-top: 1rem;
    margin-bottom: 1rem;
    width: 100%;
}

.conflict-unified-box {
    background: rgba(239, 68, 68, 0.03);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 14px;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.conflict-unified-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.06);
    color: #ef4444;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
    border-bottom: 1px solid rgba(239, 68, 68, 0.08);
}

.conflict-unified-header svg {
    opacity: 0.9;
}

.conflict-unified-body {
    padding: 0.5rem 0;
}

.conflict-unified-section {
    padding: 0.75rem 1rem;
}

.conflict-unified-section:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.conflict-unified-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.conflict-header-kicker {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.1);
    line-height: 1;
}

.conflict-unified-section-header strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    opacity: 0.95;
}

.conflict-unified-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.2rem 0 0.2rem 0.25rem;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.conflict-unified-dot {
    flex-shrink: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ef4444;
    margin-top: 0.45rem;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.conflict-unified-text {
    flex: 1;
}

.conflict-unified-text strong {
    color: var(--color-text);
    font-weight: 600;
}

.conflict-unified-text .conflict-date-range {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-left: 0.2rem;
}

.availability-details-stack .conflict-unified-box {
    margin-top: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Positive Indicators */
.conflict-header-kicker.is-positive {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.1);
}

.conflict-unified-dot.is-positive {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.conflict-unified-header.has-conflicts {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
}

.conflict-unified-header.is-all-good {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.06);
    border-bottom-color: rgba(34, 197, 94, 0.08);
}

/* Organization workspace extensions */
.org-workspace-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.org-workspace-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.org-workspace-filter {
    min-width: 150px;
    max-width: 220px;
}

.org-workspace-view-switch {
    justify-content: flex-start;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
}

.org-workspace-search {
    width: 100%;
    max-width: 560px;
}

.org-workspace-search .search-icon svg {
    width: 1rem;
    height: 1rem;
}

.org-workspace-insights,
.org-mini-kpi-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.org-insight-pill,
.org-mini-kpi {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    line-height: 1.25;
}

.org-insight-pill strong,
.org-mini-kpi strong {
    color: var(--color-text);
    font-weight: 750;
}

.org-insight-pill.is-warning,
.org-mini-kpi.is-warning {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(245, 158, 11, 0.08);
}

.org-insight-pill.is-danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

.org-mini-kpi {
    display: grid;
    justify-items: start;
    min-width: 132px;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.org-mini-kpi:hover {
    transform: translateY(-1px);
    border-color: var(--color-primary);
}

.org-mini-kpi span {
    font-size: 0.78rem;
}

.org-workspace-list,
.org-workspace-grid {
    display: grid;
    gap: 0.75rem;
}

.org-workspace-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.org-workspace-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.org-workspace-card-main {
    min-width: 0;
    flex: 1;
}

.org-workspace-card-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}

.org-workspace-card h4 {
    margin: 0;
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.3;
}

.org-workspace-card p {
    margin: 0.45rem 0 0;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.org-workspace-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    margin-top: 0.6rem;
    color: var(--color-text-secondary);
    font-size: 0.82rem;
}

.org-workspace-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.7rem;
}

.org-workspace-tags span {
    padding: 0.22rem 0.45rem;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

.org-workspace-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.org-status-pill,
.org-priority-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: rgba(148, 163, 184, 0.1);
    color: var(--color-text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
}

.org-status-pill.is-open,
.org-status-pill.is-planning,
.org-status-pill.is-requested {
    border-color: rgba(59, 130, 246, 0.28);
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.org-status-pill.is-active,
.org-status-pill.is-in_progress,
.org-status-pill.is-reserved,
.org-status-pill.is-in_use {
    border-color: rgba(20, 184, 166, 0.28);
    background: rgba(20, 184, 166, 0.1);
    color: #2dd4bf;
}

.org-status-pill.is-available,
.org-status-pill.is-completed,
.org-status-pill.is-returned {
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

.org-status-pill.is-waiting,
.org-status-pill.is-paused,
.org-status-pill.is-maintenance,
.org-priority-pill.is-high {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.org-status-pill.is-blocked,
.org-status-pill.is-broken,
.org-status-pill.is-cancelled,
.org-priority-pill.is-critical {
    border-color: rgba(239, 68, 68, 0.32);
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.org-priority-pill.is-low {
    border-color: rgba(148, 163, 184, 0.28);
}

.org-priority-pill.is-medium {
    border-color: rgba(99, 102, 241, 0.26);
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
}

.org-project-progress {
    width: 100%;
    height: 0.45rem;
    overflow: hidden;
    margin-top: 0.85rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
}

.org-project-progress > div {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14b8a6, #60a5fa);
}

.org-inventory-panel {
    margin-top: 1rem;
}

.org-reservation-head {
    margin-top: 1.25rem;
}

.org-conflict-hint {
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(239, 68, 68, 0.32);
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    font-size: 0.88rem;
}

.org-workspace-empty-inline {
    padding: 0.9rem;
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    color: var(--color-text-secondary);
    text-align: center;
}

.org-workspace-empty-state .btn {
    margin-top: 0.75rem;
}

@media (max-width: 720px) {
    .org-workspace-actions {
        width: 100%;
        justify-content: stretch;
    }

    .org-workspace-actions .btn,
    .org-workspace-filter {
        width: 100%;
        max-width: none;
    }

    .org-workspace-card {
        flex-direction: column;
    }

    .org-workspace-card-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .org-mini-kpi {
        flex: 1 1 46%;
        min-width: 0;
    }
}

/* SETTINGS DIVIDER */
.settings-divider {
    height: 1px;
    background: linear-gradient(to right, var(--color-border), transparent);
    margin: 2.5rem 0;
    opacity: 0.6;
}

.theme-dark .settings-divider {
    background: linear-gradient(to right, rgba(255,255,255,0.1), transparent);
}

/* HELP ICON BUTTON */
#settingsModal .profile-section,
#settingsModal .settings-surface-card {
    position: relative;
}

.settings-help-btn {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0;
    margin-top: 0;
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    display: flex !important;
    box-shadow: none !important;
    z-index: 10 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50% !important;
    padding: 0 !important;
    align-items: center;
    justify-content: center;
}

.settings-help-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: scale(1.05);
}

.settings-help-btn svg {
    width: 18px !important;
    height: 18px !important;
}

/* Inline Help Buttons (e.g. Events) */
.help-btn-premium {
    width: 34px !important;
    height: 34px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    border-radius: 50% !important;
    cursor: pointer;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    padding: 0 !important;
}

.help-btn-premium:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: scale(1.05);
}

.help-btn-premium svg {
    width: 18px !important;
    height: 18px !important;
}

/* NEW ITEM HIGHLIGHTING */
.is-new-calendar {
    position: relative;
    border-left: 3px solid var(--color-primary) !important;
    background: rgba(14, 165, 233, 0.04) !important;
    animation: fadeInGlow 0.5s ease-out;
}

.badge-new-item {
    position: absolute;
    top: -8px;
    right: 12px;
    background: var(--color-primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 99px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

@keyframes fadeInGlow {
    from { opacity: 0; transform: translateY(-10px); background: rgba(14, 165, 233, 0.2); }
    to { opacity: 1; transform: translateY(0); background: rgba(14, 165, 233, 0.04); }
}

/* Songpool Add Dropdown */
.songpool-add-dropdown-container {
    position: relative;
    display: inline-block;
}

.songpool-add-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    z-index: 1000;
    min-width: 260px;
    display: none;
    flex-direction: column;
    padding: 8px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: fadeInDropdown 0.2s ease-out;
    transform-origin: top right;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.songpool-add-menu.active {
    display: flex;
}

.songpool-add-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--color-text);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    font-size: 0.95rem;
    width: 100%;
}

.songpool-add-menu-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.songpool-add-menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--color-primary);
}

.songpool-add-menu-icon svg {
    width: 18px;
    height: 18px;
}

#settingsModal .settings-column-head-compact {
    padding-right: 3.5rem !important;
}

#pdfPreviewModal .pdf-preview-footer,
#chordproPreviewModal .chordpro-preview-modal-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
}

#pdfPreviewModal #pdfPreviewCancel,
#chordproPreviewModal #chordproPreviewCancel {
    order: 1;
}

#pdfPreviewModal #pdfPreviewDownload,
#chordproPreviewModal #chordproPreviewDownload {
    order: 2;
    margin-left: auto;
}

@media (max-width: 768px) {
    #pdfPreviewModal .pdf-preview-footer,
    #chordproPreviewModal .chordpro-preview-modal-actions {
        gap: 0.6rem !important;
    }

    #pdfPreviewModal .pdf-preview-footer .btn,
    #chordproPreviewModal .chordpro-preview-modal-actions .btn {
        width: auto !important;
        flex: 0 1 auto !important;
        min-width: 0;
    }
}

/* Password Visibility Toggle */
.password-field-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.password-field-wrapper input {
    flex: 1 !important;
    width: 100% !important; /* Standard width, but flex-basis will handle it */
    min-width: 0 !important;
}

.password-toggle-btn {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
    cursor: pointer;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    z-index: 10;
    border-radius: 12px;
}

.password-toggle-btn:hover {
    opacity: 1;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.password-toggle-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.15);
}

.password-toggle-btn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
    stroke-width: 2.5;
}

/* Clickable Song Title */
.clickable-song-title {
    cursor: pointer;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.clickable-song-title:hover {
    color: var(--color-accent-secondary) !important;
    text-decoration: underline !important;
}

.clickable-song-title:active {
    opacity: 0.7;
}

/* Global Search Dropdown */
.global-search-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.global-search-group {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}
.global-search-group:last-child {
    border-bottom: none;
}

.global-search-group-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    letter-spacing: 0.05em;
}

.global-search-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: var(--color-text);
}
.global-search-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.global-search-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    flex-shrink: 0;
}
.global-search-icon i {
    width: 16px;
    height: 16px;
}

.global-search-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.global-search-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-meta {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

