/* RGCenter Design System — Light Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,700;0,900;1,700&display=swap');

:root {
    /* Light Color Palette */
    --bg-base: 220 20% 97%;           /* #f5f6fa */
    --bg-surface: 0 0% 100%;          /* #ffffff */
    --bg-surface-elevated: 220 15% 95%; /* #f0f2f8 */

    --primary: 262 80% 55%;           /* Purple #7c3aed */
    --primary-hover: 262 80% 46%;
    --primary-glow: rgba(124, 58, 237, 0.12);

    --secondary: 262 80% 70%;

    --text-primary: 222 47% 11%;      /* Near-black #0f172a */
    --text-secondary: 215 16% 47%;    /* Slate #64748b */
    --text-muted: 215 16% 65%;        /* Muted slate */

    --border-color: 214 32% 91%;      /* #e2e8f0 */
    --border-glow: rgba(124, 58, 237, 0.08);

    --success: 142 71% 35%;
    --success-bg: rgba(22, 163, 74, 0.08);

    --warning: 38 92% 45%;
    --warning-bg: rgba(217, 119, 6, 0.08);

    --danger: 0 84% 55%;
    --danger-bg: rgba(220, 38, 38, 0.08);

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: hsl(var(--bg-base));
    color: hsl(var(--text-primary));
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: hsl(var(--bg-base)); }
::-webkit-scrollbar-thumb { background: hsl(var(--border-color)); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--primary)); }

/* Layout Shell */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background-color: hsl(var(--bg-surface));
    border-right: 1px solid hsl(var(--border-color));
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    overflow-y: auto;
}

.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 36px 40px;
    min-height: 100vh;
    background-color: hsl(var(--bg-base));
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: hsl(var(--text-primary));
    margin-bottom: 0.4em;
}

h1 {
    font-size: 2rem;
    color: hsl(var(--text-primary));
}

p {
    color: hsl(var(--text-secondary));
    margin-bottom: 1rem;
}

.text-muted { color: hsl(var(--text-muted)); }

/* Cards */
.card {
    background: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: rgba(124, 58, 237, 0.2);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid hsl(var(--border-color));
    padding-bottom: 14px;
}

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: hsl(var(--text-primary));
    margin-bottom: 0;
}

/* Sidebar Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 800;
    color: hsl(var(--text-primary));
    text-decoration: none;
    margin-bottom: 32px;
    padding: 0 8px;
}

.logo span span { color: hsl(var(--primary)); }

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--secondary)));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
    flex-shrink: 0;
}

/* Pure CSS RGC Logo Component */
.rgc-logo {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-family: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
    user-select: none;
    line-height: 1;
}

.rgc-logo .rgc-title {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: hsl(var(--text-primary));
    display: flex;
    align-items: baseline;
}

.rgc-logo .rgc-title .dot {
    font-size: 1.8rem;
    line-height: 0;
    margin-left: 1px;
    color: hsl(var(--primary));
}

.rgc-logo .rgc-subtitle {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.38em;
    color: hsl(var(--text-secondary));
    text-transform: uppercase;
    margin-top: 5px;
    white-space: nowrap;
}

/* Navigation */
.nav-menu { list-style: none; display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: hsl(var(--text-muted));
    padding: 16px 12px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--border-radius-md);
    color: hsl(var(--text-secondary));
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: var(--transition-smooth);
}

.nav-link:hover {
    background-color: hsl(var(--bg-surface-elevated));
    color: hsl(var(--text-primary));
}

.nav-link.active {
    background-color: var(--primary-glow);
    color: hsl(var(--primary));
    font-weight: 600;
}

.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link.active svg { color: hsl(var(--primary)); }

/* Admin nav links with distinct style */
.nav-link.nav-admin {
    background-color: rgba(124,58,237,0.05);
    border: 1px solid rgba(124,58,237,0.15);
    color: hsl(var(--primary));
    font-weight: 600;
}
.nav-link.nav-admin:hover, .nav-link.nav-admin.active {
    background-color: var(--primary-glow);
    border-color: rgba(124,58,237,0.3);
}

/* User Profile Widget */
.user-profile-widget {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid hsl(var(--border-color));
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-glow);
    border: 2px solid hsl(var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: hsl(var(--primary));
    flex-shrink: 0;
}

.user-details { display: flex; flex-direction: column; font-size: 0.82rem; overflow: hidden; min-width: 0; }
.user-name { font-weight: 600; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; color: hsl(var(--text-primary)); }
.user-role-badge { font-size: 0.72rem; color: hsl(var(--primary)); font-weight: 700; text-transform: uppercase; }

.btn-logout {
    margin-left: auto;
    background: none;
    border: none;
    color: hsl(var(--text-muted));
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 4px;
    flex-shrink: 0;
}
.btn-logout:hover { color: hsl(var(--danger)); }

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-header-sub {
    font-size: 0.82rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: hsl(var(--primary));
    margin-bottom: 2px;
}

/* Forms */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: hsl(var(--text-secondary));
}

.form-control {
    width: 100%;
    background-color: hsl(var(--bg-surface));
    border: 1.5px solid hsl(var(--border-color));
    border-radius: var(--border-radius-md);
    padding: 10px 14px;
    color: hsl(var(--text-primary));
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px var(--primary-glow);
    background-color: hsl(var(--bg-surface));
}

.form-control::placeholder { color: hsl(var(--text-muted)); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--secondary)));
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}
.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: hsl(var(--bg-surface-elevated));
    color: hsl(var(--text-primary));
    border: 1.5px solid hsl(var(--border-color));
}
.btn-secondary:hover {
    background-color: hsl(var(--border-color));
    border-color: hsl(var(--text-muted));
}

.btn-danger {
    background-color: hsl(var(--danger-bg));
    color: hsl(var(--danger));
    border: 1.5px solid rgba(220, 38, 38, 0.2);
}
.btn-danger:hover {
    background-color: hsl(var(--danger));
    color: #ffffff;
    border-color: transparent;
}

.btn-success {
    background-color: hsl(var(--success-bg));
    color: hsl(var(--success));
    border: 1.5px solid rgba(22, 163, 74, 0.2);
}
.btn-success:hover {
    background-color: hsl(var(--success));
    color: #ffffff;
    border-color: transparent;
}

.btn-warning {
    background-color: hsl(var(--warning-bg));
    color: hsl(var(--warning));
    border: 1.5px solid rgba(217, 119, 6, 0.2);
}
.btn-warning:hover {
    background-color: hsl(var(--warning));
    color: #ffffff;
    border-color: transparent;
}

.btn-sm { padding: 6px 12px; font-size: 0.82rem; border-radius: var(--border-radius-sm); }
.btn-lg { padding: 13px 28px; font-size: 1rem; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-primary { background-color: var(--primary-glow); color: hsl(var(--primary)); }
.badge-success { background-color: hsl(var(--success-bg)); color: hsl(var(--success)); }
.badge-warning { background-color: hsl(var(--warning-bg)); color: hsl(var(--warning)); }
.badge-danger  { background-color: hsl(var(--danger-bg));  color: hsl(var(--danger));  }
.badge-neutral { background-color: hsl(var(--bg-surface-elevated)); color: hsl(var(--text-secondary)); border: 1px solid hsl(var(--border-color)); }

/* Stat Cards */
.stat-card {
    background: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--border-radius-lg);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--secondary)));
    opacity: 0;
    transition: var(--transition-smooth);
}

.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card:hover::before { opacity: 1; }

.stat-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: hsl(var(--text-muted));
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: hsl(var(--text-primary));
    line-height: 1.1;
}

.stat-desc { font-size: 0.78rem; color: hsl(var(--text-muted)); }

/* Grids */
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }

.stat-card.clickable {
    cursor: pointer;
}
.stat-card.clickable:hover {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--bg-surface-elevated));
}

@media (max-width: 1400px) {
    .grid-cols-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1280px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 999;
    background-color: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--border-radius-md);
    padding: 8px;
    cursor: pointer;
    color: hsl(var(--text-primary));
    box-shadow: var(--shadow-sm);
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background-color: hsl(var(--bg-surface-elevated));
}

@media (max-width: 1024px) {
    .sidebar-toggle {
        display: flex;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 998;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 24px;
        padding-top: 80px;
    }
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px;
        padding-top: 80px;
    }
    .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius-md);
    border: 1px solid hsl(var(--border-color));
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background-color: hsl(var(--bg-surface));
}

.table th, .table td { padding: 13px 16px; border-bottom: 1px solid hsl(var(--border-color)); }

.table th {
    background-color: hsl(var(--bg-surface-elevated));
    font-weight: 700;
    color: hsl(var(--text-secondary));
    text-transform: uppercase;
    font-size: 0.73rem;
    letter-spacing: 0.06em;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background-color: hsl(var(--bg-surface-elevated)); }

/* Calendar — Weekly View */
.week-calendar {
    display: grid;
    grid-template-columns: repeat(5, 1fr) 40px 40px;
    gap: 10px;
    margin-top: 16px;
}

/* Narrow weekend columns */
.week-day-col.weekend-col {
    min-width: 0;
    overflow: hidden;
}

.week-day-col.weekend-col .week-day-header {
    padding: 10px 2px;
}

.week-day-col.weekend-col .week-day-name {
    font-size: 0.55rem;
    letter-spacing: 0;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    margin: 4px auto;
}

.week-day-col.weekend-col .week-day-date {
    font-size: 0.75rem;
    font-weight: 700;
}

.week-day-col.weekend-col .week-slot,
.week-day-col.weekend-col .week-empty-slot,
.week-day-col.weekend-col .week-slot-actions {
    display: none;
}

.week-day-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.week-day-header {
    text-align: center;
    padding: 10px 6px;
    border-radius: var(--border-radius-md);
    background: hsl(var(--bg-surface-elevated));
    border: 1px solid hsl(var(--border-color));
}

.week-day-name {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: hsl(var(--text-secondary));
}

.week-day-date {
    font-size: 1.2rem;
    font-weight: 800;
    color: hsl(var(--text-primary));
    line-height: 1.2;
    margin-top: 2px;
}

.week-day-header.today-header {
    background: var(--primary-glow);
    border-color: rgba(124, 58, 237, 0.3);
}

.week-day-header.today-header .week-day-name { color: hsl(var(--primary)); }
.week-day-header.today-header .week-day-date { color: hsl(var(--primary)); }

.week-slot {
    background: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--border-radius-md);
    padding: 10px;
    font-size: 0.8rem;
    transition: var(--transition-smooth);
    border-left: 3px solid hsl(var(--primary));
}

.week-slot:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(124, 58, 237, 0.3);
}

.week-slot-time {
    font-weight: 700;
    color: hsl(var(--text-primary));
    font-size: 0.85rem;
}

.week-slot-cap {
    font-size: 0.73rem;
    font-weight: 600;
    margin-top: 4px;
}

.week-slot-clients {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.week-slot-client-chip {
    background: var(--primary-glow);
    color: hsl(var(--primary));
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.week-slot-actions {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid hsl(var(--border-color));
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.week-empty-slot {
    border: 1.5px dashed hsl(var(--border-color));
    border-radius: var(--border-radius-md);
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--text-muted));
    font-size: 0.75rem;
}

.capacity-green { color: hsl(var(--success)); }
.capacity-yellow { color: hsl(var(--warning)); }
.capacity-red { color: hsl(var(--danger)); }

/* Schedule Capacity Block */
.schedule-capacity { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal-backdrop.show { opacity: 1; pointer-events: auto; }

.modal-container {
    width: 100%;
    max-width: 520px;
    background-color: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    transform: scale(0.94) translateY(-10px);
    transition: var(--transition-smooth);
}

.modal-backdrop.show .modal-container { transform: scale(1) translateY(0); }

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

.modal-header h3 { font-size: 1rem; margin-bottom: 0; }

.modal-close-btn {
    background: none;
    border: none;
    color: hsl(var(--text-muted));
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}
.modal-close-btn:hover { background-color: hsl(var(--bg-surface-elevated)); color: hsl(var(--text-primary)); }

.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid hsl(var(--border-color)); display: flex; justify-content: flex-end; gap: 10px; }

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-left: 4px solid hsl(var(--primary));
    border-radius: var(--border-radius-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: hsl(var(--text-primary));
    font-weight: 500;
    animation: slideInRight 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-success { border-left-color: hsl(var(--success)); }
.toast-warning { border-left-color: hsl(var(--warning)); }
.toast-error   { border-left-color: hsl(var(--danger));  }

@keyframes slideInRight {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, hsl(var(--bg-base)) 0%, hsl(220 30% 93%) 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo svg { filter: drop-shadow(0 0 6px rgba(124,58,237,0.3)); }

/* Feature Flag Toggles */
.flag-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background-color: hsl(var(--bg-surface-elevated));
    border: 1.5px solid hsl(var(--border-color));
    border-radius: var(--border-radius-md);
    margin-bottom: 10px;
    transition: var(--transition-smooth);
}

.flag-toggle-wrapper:hover { border-color: rgba(124, 58, 237, 0.3); background-color: hsl(var(--bg-surface)); }
.flag-info { display: flex; flex-direction: column; gap: 2px; }
.flag-title { font-weight: 600; font-size: 0.92rem; color: hsl(var(--text-primary)); }
.flag-key { font-family: monospace; font-size: 0.72rem; color: hsl(var(--text-muted)); }

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 46px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }

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

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: #fff;
    transition: .35s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

input:checked + .slider { background-color: hsl(var(--primary)); }
input:checked + .slider:before { transform: translateX(22px); }

/* Settings Page Sections */
.settings-section {
    background: hsl(var(--bg-surface));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--border-radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

.settings-section-header {
    padding: 16px 24px;
    background: hsl(var(--bg-surface-elevated));
    border-bottom: 1px solid hsl(var(--border-color));
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0;
}

.settings-section-body { padding: 24px; }

/* Sidebar Mock warning badge */
.sidebar-mock-badge {
    margin: 12px 16px 8px 16px;
    padding: 6px 10px;
    background: rgba(217, 119, 6, 0.08);
    border: 1px dashed rgba(217, 119, 6, 0.35);
    border-radius: var(--border-radius-sm);
    font-size: 0.72rem;
    color: hsl(var(--warning));
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}

.sidebar-mock-badge svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: hsl(var(--warning));
}

/* Exercise item */
.workout-exercise-item {
    padding: 14px 16px;
    background-color: hsl(var(--bg-surface-elevated));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--border-radius-md);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.workout-exercise-details h4 { margin-bottom: 3px; font-size: 0.92rem; }
.workout-exercise-sets { font-weight: 700; color: hsl(var(--primary)); font-size: 1.05rem; white-space: nowrap; }

/* Info & Alert blocks */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-info { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); color: #1d4ed8; }
.alert-warning { background: hsl(var(--warning-bg)); border: 1px solid rgba(217,119,6,0.25); color: hsl(var(--warning)); }
.alert-danger { background: hsl(var(--danger-bg)); border: 1px solid rgba(220,38,38,0.25); color: hsl(var(--danger)); }
.alert-success { background: hsl(var(--success-bg)); border: 1px solid rgba(22,163,74,0.25); color: hsl(var(--success)); }

/* Divider */
.divider { border: none; border-top: 1px solid hsl(var(--border-color)); margin: 20px 0; }

/* Helpers */
.text-right { text-align: right; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-full { width: 100%; }
.mt-1 { margin-top: 4px; }
.mb-0 { margin-bottom: 0; }

/* Custom Searchable Dropdown Component */
.custom-dropdown-container {
    position: relative;
    width: 100%;
}

.custom-dropdown-trigger {
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background-color: hsl(var(--bg-surface-elevated));
    user-select: none;
}

.custom-dropdown-trigger::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 8px;
    vertical-align: middle;
    border-top: 5px solid hsl(var(--text-secondary));
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    transition: transform 0.2s ease;
}

.custom-dropdown-menu.open + .custom-dropdown-trigger::after,
.custom-dropdown-container:has(.custom-dropdown-menu.open) .custom-dropdown-trigger::after {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1100;
    background: hsl(var(--bg-surface-elevated));
    border: 1px solid hsl(var(--border-color));
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    max-height: 260px;
    flex-direction: column;
}

.custom-dropdown-menu.open {
    display: flex;
}

.custom-dropdown-search {
    margin-bottom: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
}

.custom-dropdown-options {
    overflow-y: auto;
    max-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.custom-dropdown-option {
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    color: hsl(var(--text-primary));
    transition: background 0.15s ease;
}

.custom-dropdown-option:hover {
    background: rgba(168, 85, 247, 0.12);
    color: hsl(var(--primary));
}

.custom-dropdown-option.selected {
    background: hsl(var(--primary));
    color: #ffffff;
    font-weight: 600;
}

.custom-dropdown-empty {
    padding: 12px;
    text-align: center;
    font-size: 0.85rem;
    color: hsl(var(--text-muted));
}

