/* Parkado — Modern minimalistic UI
   Voyado-inspired: clean whites, subtle borders, restrained color, generous spacing.
   Mobile-first, then enhanced for wider viewports. */

/* ───────────────────────────── Design Tokens ───────────────────────────── */
:root {
    /* Palette */
    --color-primary: #1e40af;
    --color-primary-hover: #1e3a8a;
    --color-primary-light: #3b82f6;
    --color-primary-tint: rgba(30, 64, 175, 0.07);
    --color-success: #059669;
    --color-success-tint: rgba(5, 150, 105, 0.08);
    --color-warning: #d97706;
    --color-warning-tint: rgba(217, 119, 6, 0.09);
    --color-error: #dc2626;
    --color-error-tint: rgba(220, 38, 38, 0.08);

    /* Surfaces */
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Text */
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Depth */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);

    /* Shape */
    --radius: 8px;
    --radius-lg: 10px;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1.25rem;
    --space-xl: 2rem;

    /* Type */
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ───────────────────────────── Dark Mode Tokens ───────────────────────────── */
html.dark {
    /* Palette — slightly desaturated for dark surfaces */
    --color-primary: #60a5fa;
    --color-primary-hover: #93bbfd;
    --color-primary-light: #93c5fd;
    --color-primary-tint: rgba(96, 165, 250, 0.12);
    --color-success: #34d399;
    --color-success-tint: rgba(52, 211, 153, 0.12);
    --color-warning: #fbbf24;
    --color-warning-tint: rgba(251, 191, 36, 0.12);
    --color-error: #f87171;
    --color-error-tint: rgba(248, 113, 113, 0.10);

    /* Surfaces */
    --bg: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --border-light: #1e293b;

    /* Text */
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    /* Depth — stronger shadow on dark */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.2);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);

    color-scheme: dark;
}

/* ───────────────────────────── Dark Mode Toggle ───────────────────────────── */
.dark-mode-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.dark-mode-toggle:hover {
    background: var(--border-light);
    border-color: var(--text-muted);
}

.dark-mode-icon {
    font-size: 0.95rem;
    line-height: 1;
}

/* ───────────────────────────── Dark Mode Overrides ───────────────────────────── */
/* Elements that use hard-coded colours instead of tokens */

html.dark body {
    background: var(--bg);
    color: var(--text);
}

html.dark .login-modal {
    background: var(--surface);
}

html.dark .login-title {
    color: var(--color-primary);
}

html.dark .login-input {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}

html.dark .ui-table th {
    background: #334155;
    color: var(--text);
}

html.dark .employee-report-table th {
    background: #334155;
    color: var(--text);
}

html.dark .yearly-bookings-table th {
    background: #334155;
    color: var(--text);
}

html.dark .tooltip {
    background: rgba(241, 245, 249, 0.92);
    color: #0f172a;
}

html.dark .stat-info-icon .stat-info-tooltip {
    background: rgba(241, 245, 249, 0.92);
    color: #0f172a;
}

html.dark .achievement-star-tooltip {
    background: #f1f5f9;
    color: #0f172a;
}

html.dark .achievement-star-tooltip::after {
    border-top-color: #f1f5f9;
}

html.dark .yearly-bookings-overlay {
    background: rgba(0, 0, 0, 0.6);
}

html.dark .info-agreement-overlay {
    background: rgba(0, 0, 0, 0.7);
}

html.dark .modal-backdrop {
    background: rgba(0, 0, 0, 0.6);
}

html.dark .toast-success {
    background: #064e3b;
    border-color: rgba(52, 211, 153, 0.3);
    color: #a7f3d0;
}
html.dark .toast-success .toast-dismiss { color: #a7f3d0; }

html.dark .toast-error {
    background: #7f1d1d;
    border-color: rgba(248, 113, 113, 0.3);
    color: #fecaca;
}
html.dark .toast-error .toast-dismiss { color: #fecaca; }

html.dark .toast-warning {
    background: #78350f;
    border-color: rgba(251, 191, 36, 0.3);
    color: #fde68a;
}
html.dark .toast-warning .toast-dismiss { color: #fde68a; }

html.dark .toast-achievement {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    border-color: rgba(202, 138, 4, 0.4);
    color: #fef08a;
}
html.dark .toast-achievement .toast-dismiss { color: #fef08a; }

html.dark .achievement-card-tier {
    background: #78350f;
    color: #fde68a;
    border-color: rgba(202, 138, 4, 0.3);
}

html.dark .role-badge.standard {
    background: var(--border);
    color: var(--text-secondary);
}

html.dark .employee-tag.super-admin {
    background: linear-gradient(135deg, #92400e, #78350f, #a16207);
}

html.dark .role-badge.super {
    background: linear-gradient(135deg, #92400e, #78350f, #a16207);
}

html.dark .legend-swatch.swatch-available {
    background: var(--surface);
    border-color: var(--border);
}

html.dark .form-control {
    background: var(--bg);
    color: var(--text);
}

html.dark .super-admin-office-select {
    background: var(--bg);
    color: var(--text);
}

html.dark .info-box-editor .ql-toolbar {
    background: var(--bg);
    border-color: var(--border);
}

html.dark .info-box-editor .ql-container {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

html.dark .ql-toolbar .ql-stroke {
    stroke: var(--text-secondary);
}

html.dark .ql-toolbar .ql-fill {
    fill: var(--text-secondary);
}

html.dark .ql-toolbar .ql-picker-label {
    color: var(--text-secondary);
}

html.dark .spot-card .spot-card-label {
    color: var(--text);
}

html.dark .ui-button-content {
    color: #fff;
}

html.dark .ui-button.subtle-button {
    color: var(--text-secondary);
    border-color: var(--border);
}

html.dark .ui-button.subtle-button .ui-button-content {
    color: inherit;
}

/* ───────────────────────────── Reset / Global ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ───────────────────────────── Page Header ───────────────────────────── */
.ui-page-header {
    background: url('assets/header.jpg') center / cover no-repeat;
    min-height: 80px;
}

.ui-page-header-content {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: var(--space-lg);
    max-width: 960px;
    margin: 0 auto;
    min-height: 80px;
    width: 100%;
    gap: var(--space-md);
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,.55);
}

.login-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.user-greeting {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ───────────────────────────── Navigation ───────────────────────────── */
.navigation-menu {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: relative;
}

.nav-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Hamburger Button (hidden on desktop) ── */
.hamburger-button {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    margin-right: var(--space-xs);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-icon {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    position: relative;
    border-radius: 1px;
    transition: background 0.2s;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: transform 0.25s ease, top 0.25s ease;
}

.hamburger-icon::before { top: -6px; }
.hamburger-icon::after  { top:  6px; }

/* Animated X when open */
.hamburger-button[aria-expanded="true"] .hamburger-icon {
    background: transparent;
}

.hamburger-button[aria-expanded="true"] .hamburger-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.hamburger-button[aria-expanded="true"] .hamburger-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

.nav-tabs {
    display: flex;
    margin: 0;
    padding: 0;
    gap: 0;
}

.nav-tab {
    background: none;
    border: none;
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--text);
}

.nav-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* ───────────────────────────── Page Content ───────────────────────────── */
.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

.main-container {
    max-width: 960px;
    margin: 0 auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* ───────────────────────────── Cards ───────────────────────────── */
.ui-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
}

.ui-card h3 {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 var(--space-lg) 0;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
}

/* ───────────────────────────── User Type Selection ───────────────────────────── */
.user-type-container {
    display: flex;
    gap: var(--space-md);
}

.employee-card,
.guest-card {
    flex: 1;
    min-width: 0;
    padding: var(--space-lg);
    transition: border-color 0.15s;
}

.employee-card h3,
.guest-card h3 {
    margin: 0 0 var(--space-md) 0;
    padding-bottom: var(--space-xs);
    font-size: 0.95rem;
}

.user-option {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-weight: 500;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    background: var(--border-light);
    font-size: 0.875rem;
    transition: background 0.15s;
}

.radio-label:hover {
    background: var(--border);
}

.radio-text {
    font-size: 0.875rem;
    color: var(--text);
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--color-primary);
}

/* Selected state */
.employee-card:has(input[type="radio"]:checked) {
    border-color: var(--color-primary);
    background: var(--color-primary-tint);
}

.guest-card:has(input[type="radio"]:checked) {
    border-color: var(--color-success);
    background: var(--color-success-tint);
}

/* ───────────────────────────── Form Controls ───────────────────────────── */
.form-control {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: var(--surface);
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.08);
}

.user-option .form-control {
    margin-top: var(--space-sm);
}

/* Month picker — dynamic width, entire field clickable */
.month-picker-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.month-picker-row label {
    white-space: nowrap;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.month-picker {
    width: auto;
    min-width: 0;
    cursor: pointer;
}

/* Make the entire input field open the native picker on click */
.month-picker::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

/* Month navigation arrows */
.month-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    padding: 0;
    user-select: none;
}

.month-nav-btn:hover {
    background: var(--color-primary-tint);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.month-nav-btn:active {
    transform: scale(0.93);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
    line-height: 1.35;
}

.error-message {
    background: var(--color-error-tint);
    border: 1px solid rgba(220,38,38,0.2);
    color: var(--color-error);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius);
    margin: var(--space-md) 0;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ───────────────────────────── Parking Card ───────────────────────────── */
.parking-card h3 {
    margin-bottom: var(--space-md);
}

.date-picker-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.date-picker-inline {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.date-picker-inline label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.85rem;
    white-space: nowrap;
}

.date-shortcut-buttons {
    display: flex;
    gap: var(--space-xs);
}

.date-shortcut-btn {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    box-shadow: none;
    line-height: 1.4;
}

.date-shortcut-btn:hover {
    background: var(--surface-alt);
    color: var(--text);
    border-color: var(--border-dark, var(--border));
}

.date-shortcut-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.date-input-compact {
    width: auto;
    max-width: 170px;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
}

/* ───────────────────────────── Parking Visualization ───────────────────────────── */
.parking-visualization {
    position: relative;
    display: inline-block;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
    width: 100%;
}

.parking-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.parking-spot-overlay {
    position: absolute;
    cursor: pointer;
    border-radius: var(--radius);
    transition: transform 0.15s, box-shadow 0.15s;
    border: 2px solid transparent;
}

.parking-spot-overlay:hover {
    transform: scale(1.08);
    z-index: 10;
}

.spot-available {
    background: rgba(5, 150, 105, 0.7);
    border-color: var(--color-success);
}

.spot-booked {
    background: rgba(220, 38, 38, 0.7);
    border-color: var(--color-error);
    cursor: not-allowed;
}

.spot-own-booking {
    background: rgba(217, 119, 6, 0.7);
    border-color: var(--color-warning);
    cursor: pointer;
}

/* Parking map legend */
.parking-legend {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-md);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.available { background: var(--color-success); }
.legend-dot.booked { background: var(--color-error); }
.legend-dot.own { background: var(--color-warning); }
.legend-dot.employee { background: var(--color-primary); }
.legend-dot.guest { background: var(--color-success); }

/* ───────────── Mobile Spot Cards ───────────── */
.mobile-only { display: none; }
.desktop-only { display: block; }

/* Inline-block override for parking-visualization which uses display:inline-block */
.parking-visualization.desktop-only { display: inline-block; }

.mobile-spot-cards {
    display: none;
    flex-direction: column;
    gap: var(--space-sm);
}

.spot-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
    gap: var(--space-md);
}

.spot-card:active {
    background: var(--border-light);
}

.spot-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.spot-card-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}

.spot-card-status {
    font-size: 0.78rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spot-card-action {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    padding: var(--space-xs) var(--space-md);
    border-radius: 999px;
    white-space: nowrap;
}

/* Available */
.spot-card.spot-card--available {
    border-color: var(--color-success);
    background: var(--color-success-tint);
}

.spot-card.spot-card--available .spot-card-status {
    color: var(--color-success);
}

.spot-card.spot-card--available .spot-card-action {
    background: var(--color-success);
    color: #fff;
}

/* Own booking */
.spot-card.spot-card--own {
    border-color: var(--color-warning);
    background: var(--color-warning-tint);
}

.spot-card.spot-card--own .spot-card-status {
    color: var(--color-warning);
    font-weight: 600;
}

.spot-card.spot-card--own .spot-card-action {
    background: var(--color-warning);
    color: #fff;
}

/* Booked by someone else */
.spot-card.spot-card--booked {
    border-color: var(--color-error);
    background: var(--color-error-tint);
    cursor: default;
}

.spot-card.spot-card--booked .spot-card-status {
    color: var(--color-error);
}

.spot-card.spot-card--booked .spot-card-action {
    background: var(--color-error);
    color: #fff;
}

/* Admin can click booked spots */
.spot-card.spot-card--booked.spot-card--admin {
    cursor: pointer;
}

.parking-map-link {
    display: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    margin-top: var(--space-sm);
}

.parking-map-link:hover {
    text-decoration: underline;
}

/* ───────────────────────────── Monthly Table ───────────────────────────── */
#monthlyTableContainer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--space-md) calc(-1 * var(--space-lg));
    padding: 0 var(--space-lg);
}

.ui-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-md) 0;
    font-size: 0.82rem;
    min-width: 420px;
}

.ui-table th {
    background: var(--color-primary);
    color: #fff;
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.ui-table th:first-child { border-radius: var(--radius) 0 0 0; }
.ui-table th:last-child { border-radius: 0 var(--radius) 0 0; }

.ui-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.ui-table tbody tr:last-child td {
    border-bottom: none;
}

.ui-table td.week-number {
    background: var(--border-light);
    font-weight: 700;
    color: var(--text-muted);
    width: 44px;
    font-size: 0.75rem;
}

.ui-table td.clickable-cell {
    cursor: pointer;
}

.ui-table td.clickable-cell:hover {
    background: var(--color-primary-tint);
}

/* Booking type cell colors — flat subtle tints */
.my-booking {
    background: var(--color-warning-tint);
    color: var(--color-warning);
    font-weight: 700;
    cursor: pointer;
}

.my-booking:hover {
    background: rgba(217, 119, 6, 0.16);
}

.employee-booking {
    background: var(--color-primary-tint);
    color: var(--color-primary);
    font-weight: 600;
}

.guest-booking {
    background: var(--color-success-tint);
    color: var(--color-success);
    font-weight: 600;
}

.admin-cancellable {
    cursor: pointer;
}

.admin-cancellable:hover {
    filter: brightness(0.94);
}

.current-day {
    background: rgba(30, 64, 175, 0.03);
    border-left: 3px solid var(--color-primary);
}

/* Monthly table legend */
.table-legend {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-sm);
    flex-wrap: wrap;
}

.table-legend .legend-item {
    gap: var(--space-xs);
}

.legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-swatch.swatch-own { background: rgba(217, 119, 6, 0.25); border: 1px solid var(--color-warning); }
.legend-swatch.swatch-employee { background: rgba(30, 64, 175, 0.15); border: 1px solid var(--color-primary); }
.legend-swatch.swatch-guest { background: rgba(5, 150, 105, 0.15); border: 1px solid var(--color-success); }
.legend-swatch.swatch-available { background: var(--surface); border: 1px solid var(--border); }

/* Monthly empty state */
.monthly-empty {
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.monthly-empty-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
    opacity: 0.5;
}

/* ───────────────────────────── Buttons ───────────────────────────── */
.ui-button {
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius);
    padding: var(--space-sm) var(--space-lg);
    font-weight: 600;
    transition: background 0.15s, box-shadow 0.15s;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.ui-button:hover {
    background: var(--color-primary-hover);
}

.ui-button:active {
    box-shadow: none;
}

.ui-button-content {
    color: #fff;
    font-size: 0.85rem;
}

.ui-button.secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.ui-button.secondary .ui-button-content {
    color: var(--text-secondary);
}

.ui-button.secondary:hover {
    background: var(--border-light);
}

.ui-button.danger {
    background: var(--color-error);
}

.ui-button.danger:hover {
    background: #b91c1c;
}

.ui-button.subtle-button {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: var(--space-xs) var(--space-md);
    border-radius: 999px;
    box-shadow: none;
    font-size: 0.78rem;
}

.ui-button.subtle-button .ui-button-content {
    font-size: 0.78rem;
    color: inherit;
}

.ui-button.subtle-button:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.ui-button-sm {
    padding: var(--space-sm) var(--space-md);
}

.ui-button-sm .ui-button-content {
    font-size: 0.8rem;
}

/* ───────────────────────────── Tooltip ───────────────────────────── */
.tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
    white-space: nowrap;
}

/* ───────────────────────────── Personal Stats ───────────────────────────── */
.personal-stats-card {
    padding: var(--space-md) var(--space-lg);
}

.personal-stats-card h4 {
    margin: 0 0 var(--space-sm) 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.personal-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-sm);
}

.personal-stat-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-sm) var(--space-md);
    background: var(--border-light);
    border-radius: var(--radius);
}

.personal-stat-item .stat-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
}

.personal-stat-item .stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
}

.personal-stat-item .stat-label-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.stat-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid var(--text-muted);
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: help;
    position: relative;
    flex-shrink: 0;
    line-height: 1;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
}

.stat-info-icon .stat-info-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    font-style: normal;
    font-family: var(--font);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius);
    white-space: nowrap;
    box-shadow: var(--shadow);
    z-index: 100;
    pointer-events: none;
}

.stat-info-icon:hover .stat-info-tooltip {
    display: block;
}

.stat-value-link {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1.5px dashed var(--color-primary-light);
    transition: border-color 0.15s, color 0.15s;
    width: fit-content;
}

.stat-value-link:hover {
    color: var(--color-primary-hover);
    border-bottom-color: var(--color-primary-hover);
    border-bottom-style: solid;
}

/* ───────────────────────────── Yearly Bookings Modal ───────────────────────────── */
.yearly-bookings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.yearly-bookings-modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    max-width: 420px;
    width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.2s ease;
}

.yearly-bookings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--border);
}

.yearly-bookings-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.yearly-bookings-body {
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    overflow-y: auto;
    flex: 1;
}

.yearly-bookings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.yearly-bookings-table th {
    background: var(--color-primary);
    color: #fff;
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    position: sticky;
    top: 0;
}

.yearly-bookings-table th:first-child { border-radius: var(--radius) 0 0 0; }
.yearly-bookings-table th:last-child { border-radius: 0 var(--radius) 0 0; }

.yearly-bookings-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text);
}

.yearly-bookings-table tbody tr:last-child td {
    border-bottom: none;
}

.yearly-bookings-table tbody tr:hover td {
    background: var(--color-primary-tint);
}

.yearly-bookings-empty {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.yearly-bookings-loading {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ───────────────────────────── Info Box ───────────────────────────── */
.info-box-card #infoBoxContent {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
}

.info-box-card #infoBoxContent p { margin: 0.25rem 0; }
.info-box-card #infoBoxContent a { color: var(--color-primary); }

/* Shared styles for info-box rich text tables (used on Information page + agreement modal) */
.info-box-card #infoBoxContent table,
.info-agreement-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.8rem;
}

.info-box-card #infoBoxContent th,
.info-agreement-body th {
    background: var(--color-primary);
    color: #fff;
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
}

.info-box-card #infoBoxContent td,
.info-agreement-body td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.info-box-card #infoBoxContent h4,
.info-agreement-body h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

/* ───────────────────────────── Information Agreement Modal ───────────────────────────── */
.info-agreement-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    animation: fadeIn 0.2s ease;
}

.info-agreement-modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    max-width: 540px;
    width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.2s ease;
}

.info-agreement-header {
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--border);
}

.info-agreement-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.info-agreement-body {
    padding: var(--space-md) var(--space-lg);
    overflow-y: auto;
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
}

.info-agreement-body p { margin: 0.25rem 0; }
.info-agreement-body a { color: var(--color-primary); }

.info-agreement-footer {
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--border);
    text-align: center;
}

.info-agreement-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 var(--space-md);
    font-style: italic;
}

.info-agree-button {
    width: 100%;
    font-weight: 600;
}

/* ───────────────────────────── Admin — Finance Reports ───────────────────────────── */
.finance-reports-card {
    cursor: default;
}

.finance-controls {
    margin-bottom: var(--space-lg);
}

#reportStats {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: var(--border-light);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stats-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
}

.stats-item {
    margin: var(--space-sm) 0;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
}

.stats-item strong {
    color: var(--color-primary);
}

.stats-list {
    margin: var(--space-md) 0;
    padding-left: var(--space-lg);
}

.stats-list div {
    margin: var(--space-xs) 0;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
}

.employee-report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--space-lg);
    max-width: 400px;
    font-size: 0.85rem;
}

.employee-report-table th {
    background: var(--text-secondary);
    color: #fff;
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
}

.employee-report-table th:first-child { border-radius: var(--radius) 0 0 0; }
.employee-report-table th:last-child { border-radius: 0 var(--radius) 0 0; }

.employee-report-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

.employee-report-table tbody tr:last-child td {
    border-bottom: none;
}

/* ───────────────────────────── Admin — Audit Log ───────────────────────────── */
.audit-log-card {
    cursor: default;
}

.audit-log-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.audit-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.audit-log-table th,
.audit-log-table td {
    text-align: left;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.audit-log-table thead th {
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
}

.audit-log-table tbody tr:last-child td {
    border-bottom: none;
}

.audit-col-date {
    font-variant-numeric: tabular-nums;
    color: var(--text-light);
}

.audit-col-action {
    font-weight: 600;
}

/* ───────────────────────────── Admin — Settings ───────────────────────────── */
.settings-card {
    cursor: default;
}

.settings-row {
    margin-bottom: var(--space-md);
}

.settings-label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    font-size: 0.875rem;
}

.settings-input-group {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.settings-input-compact {
    width: auto;
    max-width: 110px;
    padding: var(--space-sm) var(--space-md);
}

/* Quill editor */
.info-box-editor {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 100px;
    background: var(--surface);
}

.info-box-editor .ql-toolbar {
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    border-color: var(--border);
}

.info-box-editor .ql-container {
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    border-color: var(--border);
    min-height: 80px;
    font-size: 0.875rem;
}

/* Recurring bookings */
.recurring-bookings-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.recurring-rule {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
}

.recurring-rule .recurring-title {
    flex: 1 1 140px;
    min-width: 100px;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
}

.recurring-rule .recurring-weekday,
.recurring-rule .recurring-spot {
    width: auto;
    min-width: 100px;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
}

.recurring-rule .recurring-spot {
    min-width: 75px;
}

.recurring-remove-btn {
    padding: var(--space-xs) var(--space-sm) !important;
    min-width: auto !important;
    background: var(--color-error) !important;
    color: #fff !important;
    font-size: 0.8rem;
    line-height: 1;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
}

.recurring-remove-btn:hover {
    opacity: 0.85;
}

/* ───────────────────────────── Employee Management ───────────────────────────── */
.employee-management-card {
    cursor: default;
}

.employees-list {
    min-height: 120px;
}

.employee-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: var(--space-xs);
    background: var(--surface);
    transition: border-color 0.15s;
}

.employee-item:hover {
    border-color: var(--color-primary-light);
}

.employee-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

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

.employee-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.employee-status.active { color: var(--color-success); }
.employee-status.inactive { color: var(--color-error); }

.employee-tags {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.employee-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: var(--color-primary-tint);
    color: var(--color-primary);
}

.employee-tag.local-office {
    background: var(--color-primary);
    color: #fff;
}

.employee-tag.admin {
    background: var(--color-success-tint);
    color: var(--color-success);
}

.employee-tag.super-admin {
    background: linear-gradient(135deg, #d4a017, #b8860b, #daa520);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 1px 2px rgba(184,134,11,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
    border: 1px solid rgba(184,134,11,0.35);
}

.employee-tag.office {
    background: var(--border-light);
    color: var(--text-secondary);
}

.employee-actions {
    opacity: 0;
    display: flex;
    gap: var(--space-xs);
    transition: opacity 0.15s;
}

.employee-item:hover .employee-actions {
    opacity: 1;
}

.employee-action-btn {
    padding: var(--space-xs) var(--space-sm);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity 0.15s;
    font-size: 0.78rem;
}

.employee-edit-btn {
    background: var(--color-primary);
    color: #fff;
}

.employee-edit-btn:hover { opacity: 0.85; }

.employee-delete-btn {
    background: var(--color-error);
    color: #fff;
}

.employee-delete-btn:hover { opacity: 0.85; }

.employees-empty {
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
    color: var(--text-muted);
}

.employees-empty-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
    opacity: 0.4;
}

/* ───────────────────────────── Toggle Switches ───────────────────────────── */
.admin-toggle-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.admin-toggle-input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.admin-toggle-input:disabled { cursor: not-allowed; }

.local-office-switch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    user-select: none;
}

.local-office-switch input {
    position: absolute;
    opacity: 0;
    width: 34px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.local-office-switch .switch-track {
    position: relative;
    width: 34px;
    height: 18px;
    background: var(--border);
    border-radius: 999px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.local-office-switch .switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.local-office-switch input:checked + .switch-track {
    background: var(--color-primary);
}

.local-office-switch input:checked + .switch-track::after {
    transform: translateX(16px);
}

.local-office-switch input:focus-visible + .switch-track {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.local-office-switch input:disabled + .switch-track {
    opacity: 0.35;
    cursor: not-allowed;
}

.local-office-switch:has(input:disabled) {
    cursor: not-allowed;
}

.local-office-switch .switch-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.15s;
}

.local-office-switch input:checked ~ .switch-label {
    color: var(--color-primary);
    font-weight: 600;
}

/* ───────────────────────────── Super Admin (legacy classes) ───────────────────────────── */
.super-admin-card { margin-top: var(--space-lg); }
.super-admin-header { display: flex; flex-direction: column; gap: var(--space-xs); margin-bottom: var(--space-md); }
.super-admin-subtitle { margin: 0; font-size: 0.82rem; color: var(--text-secondary); }
.super-admin-account { margin-bottom: var(--space-md); padding: var(--space-md); border-radius: var(--radius); background: var(--border-light); color: var(--text-secondary); font-size: 0.82rem; }
.super-admin-table-wrapper { overflow-x: auto; }
.super-admin-table th, .super-admin-table td { font-size: 0.82rem; white-space: nowrap; }
.super-admin-table td { vertical-align: middle; }

.super-admin-table .role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
}

.role-badge.super {
    background: linear-gradient(135deg, #d4a017, #b8860b, #daa520);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 1px 2px rgba(184,134,11,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
    border: 1px solid rgba(184,134,11,0.35);
}

.role-badge.standard {
    background: var(--border-light);
    color: var(--text-secondary);
}

.super-admin-office-select {
    min-width: 140px;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.82rem;
    cursor: pointer;
}

.super-admin-office-select:focus {
    border-color: var(--color-primary);
    outline: none;
}

.super-admin-identity { display: flex; flex-direction: column; gap: 0.15rem; }
.super-admin-name { font-weight: 600; color: var(--text); }
.super-admin-status { font-size: 0.68rem; color: var(--color-error); text-transform: uppercase; letter-spacing: 0.04em; }
.super-admin-empty { display: flex; flex-direction: column; align-items: center; padding: var(--space-lg); border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-secondary); }
.super-admin-empty-icon { font-size: 2rem; }

/* ───────────────────────────── Modals ───────────────────────────── */
.employee-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.employee-modal.hidden { display: none; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(3px);
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    max-width: 480px;
    width: 90vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    z-index: 1001;
    animation: slideIn 0.2s ease;
}

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

.modal-header h3 { margin: 0; color: var(--text); }

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: var(--space-xs);
    border-radius: var(--radius);
    transition: color 0.15s;
}

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

.modal-body { padding: var(--space-lg); }

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

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    color: var(--text);
}

.form-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
    color: var(--text);
}

.form-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

/* ───────────────────────────── Login Overlay ───────────────────────────── */
.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.login-modal {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 400px;
    width: calc(100% - 2rem);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.login-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.login-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.login-submit-button {
    width: 100%;
    justify-content: center;
}

.slack-commands-card {
    margin-top: var(--space-lg);
}

.slack-command-list {
    display: grid;
    gap: var(--space-md);
}

.slack-command-item {
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-alt, rgba(148, 163, 184, 0.08));
}

.slack-command-name {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.35rem;
}

.slack-command-description {
    color: var(--text-secondary);
    line-height: 1.45;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.login-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.login-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ───────────────────────────── Toast Notifications ───────────────────────────── */
.toast-container {
    position: fixed;
    top: var(--space-md);
    right: var(--space-md);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
    max-width: 380px;
    width: calc(100% - 2rem);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    pointer-events: auto;
    transform: translateX(110%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

.toast-visible { transform: translateX(0); opacity: 1; }
.toast-exit { transform: translateX(110%); opacity: 0; }

.toast-message { flex: 1; }

.toast-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    opacity: 0.5;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.toast-dismiss:hover { opacity: 1; }

.toast-success {
    background: #ecfdf5;
    border: 1px solid rgba(5, 150, 105, 0.25);
    color: #065f46;
}
.toast-success .toast-dismiss { color: #065f46; }

.toast-error {
    background: #fef2f2;
    border: 1px solid rgba(220, 38, 38, 0.25);
    color: #991b1b;
}
.toast-error .toast-dismiss { color: #991b1b; }

.toast-warning {
    background: #fffbeb;
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #92400e;
}
.toast-warning .toast-dismiss { color: #92400e; }

/* ── Achievement Toast ── */
.toast-achievement {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    border: 1px solid rgba(202, 138, 4, 0.35);
    color: #713f12;
}
.toast-achievement .toast-dismiss { color: #713f12; }

/* ───────────────────────────── Golden Star (Nav & Headings) ───────────────────────────── */
.golden-star-nav {
    color: #ca8a04;
    font-size: 1.05em;
    text-shadow: 0 1px 2px rgba(202, 138, 4, 0.3);
}

.golden-star-heading {
    color: #ca8a04;
    font-size: 1.1em;
    text-shadow: 0 1px 2px rgba(202, 138, 4, 0.25);
    margin-right: 0.15em;
}

/* ───────────────────────────── Achievements Grid ───────────────────────────── */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-md);
}

.achievement-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.achievement-card:hover {
    box-shadow: var(--shadow);
    border-color: #e2e8f0;
}

.achievement-card-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}

.achievement-card-body {
    flex: 1;
    min-width: 0;
}

.achievement-card-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text);
    margin: 0 0 0.15rem 0;
}

.achievement-card-tier {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #ca8a04;
    background: #fef9c3;
    border: 1px solid rgba(202, 138, 4, 0.2);
    border-radius: 4px;
    padding: 0 0.35em;
    margin-left: 0.35em;
    vertical-align: middle;
}

.achievement-card-description {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.achievement-card-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.achievements-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ───────────────────────────── Achievement Star in Monthly Table ───────────────────────────── */
.achievement-star-cell {
    position: relative;
    cursor: default;
}

.achievement-star-badge {
    color: #ca8a04;
    font-size: 0.75rem;
    margin-left: 0.2em;
    cursor: help;
    position: relative;
}

.achievement-star-badge:hover .achievement-star-tooltip {
    display: block;
}

.achievement-star-tooltip {
    display: none;
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    max-width: 260px;
    white-space: normal;
    text-align: left;
    line-height: 1.4;
}

.achievement-star-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
}

/* ───────────────────────────── Admin Achievements Table ───────────────────────────── */
.achievements-filter-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.achievements-filter-row label {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.achievements-filter-row .form-control {
    max-width: 260px;
}

.achievements-admin-table-container {
    overflow-x: auto;
}

.achievements-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.achievements-admin-table th,
.achievements-admin-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.achievements-admin-table th {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg);
    position: sticky;
    top: 0;
}

.achievements-admin-table tr:hover td {
    background: var(--color-primary-tint);
}

.achievements-admin-table .achievement-icon-cell {
    font-size: 1.15rem;
    text-align: center;
    width: 2.5rem;
}

.achievements-admin-table .achievement-action-cell {
    width: 2rem;
    text-align: center;
    padding: 0;
}

.achievement-remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: var(--radius);
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.achievement-remove-btn:hover {
    color: var(--color-danger, #dc2626);
    background: rgba(220, 38, 38, 0.08);
}

/* ───────────────────────────── Assign Achievement Card ───────────────────────────── */
.achievements-assign-card {
    border-top: 3px solid var(--color-warning);
}

.assign-achievement-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: 480px;
}

.assign-achievement-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.assign-achievement-row label {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.assign-achievement-preview {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    font-size: 0.88rem;
}

.assign-achievement-preview .preview-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.assign-achievement-preview .preview-body {
    flex: 1;
    min-width: 0;
}

.assign-achievement-preview .preview-title {
    font-weight: 700;
    color: var(--text);
}

.assign-achievement-preview .preview-description {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ───────────────────────────── Latest Achievements Feed ───────────────────────────── */
.latest-achievements-feed-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.latest-achievement-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    font-size: 0.82rem;
}

.latest-achievement-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.latest-achievement-body {
    flex: 1;
    min-width: 0;
}

.latest-achievement-title {
    font-weight: 700;
    color: var(--text);
}

.latest-achievement-employee {
    color: var(--text-secondary);
    font-weight: 500;
}

.latest-achievement-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
}

/* ───────────────────────────── Animations ───────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: scale(0.95) translateY(-10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ───────────────────────────── Responsive — Tablet+ ───────────────────────────── */
@media (min-width: 769px) {
    .ui-page-header {
        min-height: 140px;
    }

    .ui-page-header-content {
        min-height: 140px;
        padding: var(--space-xl);
    }

    .app-title {
        font-size: 1.75rem;
    }

    .main-container {
        padding: var(--space-xl);
        gap: var(--space-lg);
    }

    .ui-card {
        padding: var(--space-xl);
    }

    .ui-card h3 {
        font-size: 1.1rem;
    }

    /* Full parking image on desktop */
    .parking-visualization {
        display: inline-block;
        width: auto;
    }

    .parking-image {
        max-width: 100%;
        width: auto;
    }
}

/* ───────────────────────────── Responsive — Mobile ───────────────────────────── */
@media (max-width: 768px) {

    /* ── Hamburger Navigation ── */
    .hamburger-button {
        display: flex;
        align-items: center;
    }

    .nav-container {
        flex-wrap: wrap;
    }

    .nav-tabs {
        /* Hidden by default on mobile; toggled via .nav-open */
        display: none;
        flex-direction: column;
        width: 100%;
        order: 10; /* push below the top row */
        border-top: 1px solid var(--border);
        padding: var(--space-xs) 0;
    }

    .navigation-menu.nav-open .nav-tabs {
        display: flex;
    }

    .navigation-menu.nav-open .nav-tab {
        border-bottom: none;
        border-left: 3px solid transparent;
        padding: var(--space-md) var(--space-lg);
        text-align: left;
    }

    .navigation-menu.nav-open .nav-tab.active {
        border-left-color: var(--color-primary);
        background: var(--color-primary-tint);
    }

    .login-status {
        margin-left: auto; /* keep right-aligned next to hamburger */
    }

    .user-type-container {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .ui-page-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .login-status {
        gap: var(--space-xs);
    }

    .user-greeting {
        font-size: 0.7rem;
    }

    /* Hide monthly overview on mobile — table doesn't fit */
    .monthly-overview-card {
        display: none;
    }

    /* Also hide latest achievements on mobile (tied to monthly overview) */
    .latest-achievements-card {
        display: none;
    }

    /* Achievements grid: single column on mobile */
    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .achievements-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .achievements-filter-row .form-control {
        max-width: none;
    }

    .date-picker-row {
        gap: var(--space-sm);
    }

    .date-shortcut-buttons {
        width: 100%;
    }

    .date-shortcut-btn {
        flex: 1;
    }

    .employee-item {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
    }

    .employee-tags {
        flex-wrap: wrap;
    }

    .employee-actions {
        opacity: 1;
        justify-content: flex-end;
    }

    .modal-content {
        width: 95vw;
        margin: 10px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .recurring-rule {
        flex-direction: column;
    }

    .recurring-rule .recurring-title,
    .recurring-rule .recurring-weekday,
    .recurring-rule .recurring-spot {
        width: 100%;
        min-width: 0;
    }

    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }

    .mobile-spot-cards {
        display: flex;
    }

    .parking-map-link {
        display: block;
    }
}

@media (max-width: 480px) {
    .toast-container {
        right: var(--space-sm);
        top: var(--space-sm);
        max-width: calc(100% - 1rem);
    }

    .personal-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ───────────────────────────── Misc ───────────────────────────── */
.warning-text {
    color: var(--color-warning);
    font-size: 0.82rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.user-id-section {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
}

.employee-controls {
    margin-bottom: var(--space-md);
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.employee-controls .ui-button {
    flex: 1;
    min-width: 140px;
}

/* ───────────────────────────── Weekly Pages ───────────────────────────── */
.weekly-grid {
    display: grid;
    gap: var(--space-lg);
}

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

.blocked-week-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.blocked-week-grid .weekly-form-row label {
    min-height: 2.5rem;
    display: flex;
    align-items: flex-end;
}

.weekly-form-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.weekly-textarea {
    min-height: 96px;
}

.weekly-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.weekly-plan-controls,
.weekly-inline-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: nowrap;
}

.weekly-range-select {
    min-width: 0;
    width: auto;
    flex: 0 0 10.5rem;
}

.weekly-rich-content {
    color: var(--text-secondary);
}

.weekly-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    margin: 0.15rem 0.25rem 0.15rem 0;
    background: var(--border-light);
}

.weekly-chip-button {
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.weekly-chip-button:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-tint);
}

.weekly-assignment-mode-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.weekly-inline-choice {
    margin-bottom: 0;
}

.weekly-assignment-note {
    margin-bottom: 0;
}

.weekly-chip-muted {
    color: var(--text-muted);
    font-size: 0.85em;
}

.weekly-status {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.9rem;
}

.weekly-status-active {
    background: var(--color-success-tint);
    color: var(--color-success);
}

.weekly-status-blocked {
    background: var(--color-warning-tint);
    color: var(--color-warning);
}

.weekly-assigned-blocked {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.weekly-plan-block-reason {
    color: var(--text-muted);
}

.weekly-row-current td {
    background: var(--color-primary-tint);
}

.weekly-list-block {
    margin-top: var(--space-lg);
}

.weekly-schedule-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    background: var(--border-light);
}

.weekly-preview-list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-secondary);
}

.weekly-preview-list li + li {
    margin-top: 0.4rem;
}

.weekly-message-preview-item + .weekly-message-preview-item {
    margin-top: var(--space-md);
}

.weekly-template-test-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.weekly-template-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.weekly-template-editor {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.weekly-template-editor summary,
.weekly-collapsible-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-md);
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.weekly-template-editor summary::-webkit-details-marker,
.weekly-collapsible-panel summary::-webkit-details-marker {
    display: none;
}

.weekly-template-editor summary::after,
.weekly-collapsible-panel summary::after {
    content: '+';
    color: var(--text-secondary);
    font-size: 1rem;
}

.weekly-template-editor[open] summary::after,
.weekly-collapsible-panel[open] summary::after {
    content: '-';
}

.weekly-template-editor-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: 0 var(--space-md) var(--space-md);
    border-top: 1px solid var(--border-light);
}

.weekly-collapsible-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.weekly-collapsible-panel-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: 0 var(--space-md) var(--space-md);
    border-top: 1px solid var(--border-light);
}

.weekly-template-editor-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--border-light);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.weekly-template-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.weekly-template-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.weekly-message-preview-text {
    margin: var(--space-xs) 0 0;
    padding: var(--space-md);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    color: var(--text);
}

.weekly-checkbox-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

html.dark .weekly-schedule-group {
    background: #162132;
    border-color: var(--border);
}

html.dark .weekly-template-editor {
    background: #0f172a;
    border-color: var(--border);
}

html.dark .weekly-collapsible-panel {
    background: #0f172a;
    border-color: var(--border);
}

html.dark .weekly-template-editor-body {
    border-top-color: var(--border);
}

html.dark .weekly-collapsible-panel-body {
    border-top-color: var(--border);
}

html.dark .weekly-template-editor-count {
    background: #1e293b;
    color: var(--text-light);
}

html.dark .weekly-message-preview-text {
    background: #0f172a;
}

@media (max-width: 640px) {
    .weekly-card-header,
    .weekly-plan-controls,
    .weekly-inline-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
