/* RIB Kalender – style.css */

:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6c757d;
    --border: #e0e4ea;
    --primary: #0066cc;
    --primary-hover: #0052a3;
    --danger: #dc3545;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

/* ---------- THIN TOP BORDER ---------- */
body::before {
    content: '';
    display: block;
    height: 3px;
    background: var(--primary);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    transition: background 0.3s ease;
}

/* ---------- SCROLLBAR STYLING ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #c0c4cc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a0a4ac; }

/* ---------- KEYFRAMES ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes modalOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95); }
}

@keyframes backdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes backdropOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes flashSlideIn {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    70% { transform: translateX(-50%) translateY(3px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes focusRing {
    0% { box-shadow: 0 0 0 0 rgba(0,102,204,0.4); }
    70% { box-shadow: 0 0 0 4px rgba(0,102,204,0.15); }
    100% { box-shadow: 0 0 0 3px rgba(0,102,204,0.12); }
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, box-shadow .15s, transform .15s;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow);
}
.btn:focus-visible {
    outline: none;
    animation: focusRing 0.3s ease forwards;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c82333; }
.btn-small { padding: 5px 12px; font-size: 13px; }
.btn-large { padding: 12px 32px; font-size: 16px; }
.btn-icon { padding: 6px 14px; font-size: 20px; font-weight: 700; background: transparent; border: 1px solid var(--border); }
.btn-icon:hover { background: var(--bg); }
.btn-block { width: 100%; }

/* ---------- FLASH ---------- */
.flash-container { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1000; max-width: 600px; width: 90%; }
.flash {
    padding: 10px 20px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 14px;
    box-shadow: var(--shadow);
    word-break: break-all;
    animation: flashSlideIn 0.4s ease-out;
}
.flash-error { background: #fee; color: var(--danger); border: 1px solid #fcc; }
.flash-success { background: #efffef; color: #1b7a1b; border: 1px solid #b5e8b5; }
.flash-info { background: #e8f4fd; color: #0c5da5; border: 1px solid #b3d7f2; font-family: monospace; font-size: 12px; }

/* ---------- LOGIN ---------- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.login-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.3s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.login-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-logo { width: 180px; margin-bottom: 16px; }
.login-header h1 { font-size: 26px; margin-bottom: 4px; }
.login-header p { color: var(--text-muted); font-size: 14px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text-muted); }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-group input[type="time"] {
    padding: 8px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    width: 90px;
    text-align: center;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,102,204,0.12);
}
.login-card .btn { margin-top: 8px; }
.remember-group { margin-top: -4px; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}
.checkbox-label input { width: auto; margin: 0; }

/* ---------- APP LAYOUT ---------- */
.app-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
    animation: fadeInUp 0.3s ease-out;
}
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, transparent 100%);
}
.logo-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.header-logo { height: 32px; width: auto; }
.header-left .logo { font-size: 20px; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.user-badge {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 10px;
    background: var(--bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- USER DROPDOWN ---------- */
.user-dropdown { position: relative; }
.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    transition: background .15s, transform .15s;
}
.user-dropdown-toggle:hover { background: #eaecf0; transform: translateY(-1px); }
.user-dropdown-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-arrow { font-size: 10px; color: var(--text-muted); transition: transform 0.2s ease; }
.user-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 800;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.user-dropdown-menu.open {
    display: block;
    animation: dropdownIn 0.2s ease-out forwards;
}
.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
}
.dropdown-user-info strong { font-size: 14px; }
.dropdown-divider { height: 1px; background: var(--border); }
.dropdown-item {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    transition: background .1s, padding-left .15s;
}
.dropdown-item:hover { background: var(--bg); padding-left: 20px; }
.dropdown-item-danger { color: var(--danger); }
.dropdown-item-danger:hover { background: #fee; }
.user-dropdown-backdrop { display: none; }
.dropdown-handle { display: none; }

/* ---------- AVATARS ---------- */
.avatar-tiny {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.avatar-legend {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--border);
}
.avatar-modal {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* ---------- CALENDAR NAV ---------- */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}
.cal-title { font-size: 22px; min-width: 200px; text-align: center; }
.cal-title-dropdowns { display: flex; align-items: center; gap: 6px; }
.nav-select {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 4px 8px;
    cursor: pointer;
    appearance: auto;
    outline: none;
    transition: border-color .15s, background .15s;
}
.nav-select:hover, .nav-select:focus {
    border-color: var(--border);
    background: var(--bg);
}

/* ---------- LEGEND ---------- */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 13px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.4s ease-out both;
}
.legend-item:nth-child(1) { animation-delay: 0.05s; }
.legend-item:nth-child(2) { animation-delay: 0.1s; }
.legend-item:nth-child(3) { animation-delay: 0.15s; }
.legend-item:nth-child(4) { animation-delay: 0.2s; }
.legend-item:nth-child(5) { animation-delay: 0.25s; }
.legend-item:nth-child(6) { animation-delay: 0.3s; }
.legend-item:nth-child(7) { animation-delay: 0.35s; }
.legend-item:nth-child(8) { animation-delay: 0.4s; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend-dot-inline { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; }

/* ---------- CALENDAR GRID ---------- */
.cal-grid {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow), inset 0 1px 3px rgba(0,0,0,0.03);
    overflow: hidden;
}
.cal-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.cal-header-cell {
    padding: 10px 4px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}
.cal-weekend { color: var(--primary); }

.cal-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--border);
    animation: fadeInUp 0.3s ease-out both;
}
.cal-week:nth-child(2) { animation-delay: 0.03s; }
.cal-week:nth-child(3) { animation-delay: 0.06s; }
.cal-week:nth-child(4) { animation-delay: 0.09s; }
.cal-week:nth-child(5) { animation-delay: 0.12s; }
.cal-week:nth-child(6) { animation-delay: 0.15s; }
.cal-week:nth-child(7) { animation-delay: 0.18s; }
.cal-week:last-child { border-bottom: none; }

.cal-day {
    min-height: 80px;
    padding: 4px 6px;
    border-right: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    transition: background .15s ease, box-shadow .15s ease;
}
.cal-day:last-child { border-right: none; }
.cal-day:hover { background: #f0f4ff; box-shadow: inset 0 0 0 1px rgba(0,102,204,0.08); }
.cal-day-outside { background: #fafbfc; }
.cal-day-outside .day-number { color: #c0c4cc; }
.cal-day-today { background: #e8f0fe; }
.cal-day-today .day-number { font-weight: 700; color: var(--primary); }

.day-number {
    font-size: 13px;
    font-weight: 500;
    display: block;
    margin-bottom: 2px;
}
.day-bookings {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ---------- BOOKING BARS ---------- */
.booking-bar {
    height: 22px;
    border-radius: 0;
    margin: 0 -6px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity .15s, transform .15s, filter .15s;
    animation: slideInLeft 0.3s ease-out both;
}
.booking-bar:hover { opacity: 1; transform: scale(1.02); filter: brightness(1.08); }
.booking-bar.bar-start {
    margin-left: 0;
    border-radius: 4px 0 0 4px;
}
.booking-bar.bar-end {
    margin-right: 0;
    border-radius: 0 4px 4px 0;
}
.booking-bar.bar-start.bar-end {
    border-radius: 4px;
    margin-left: 0;
    margin-right: 0;
}
.bar-label {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
    pointer-events: none;
}

/* ---------- ICAL INFO ---------- */
.ical-info {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ---------- FEED URL / COPY ---------- */
.feed-url-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius);
    margin: 14px 0;
    flex-wrap: wrap;
    position: relative;
}
.feed-url-box label { font-weight: 600; font-size: 13px; white-space: nowrap; }
.feed-url-box code {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    user-select: all;
    word-break: break-all;
    color: var(--primary);
}
.btn-copy {
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background .15s, color .15s, transform .15s;
    display: flex;
    align-items: center;
}
.btn-copy:hover { background: var(--bg); color: var(--primary); transform: translateY(-1px); }
.copy-feedback {
    position: absolute;
    right: 14px;
    top: -28px;
    background: var(--text);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s, transform .2s;
    pointer-events: none;
}
.copy-feedback.show { opacity: 1; transform: translateY(0); }

/* ---------- MODAL ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal.modal-open {
    display: flex;
}
.modal.modal-open .modal-backdrop {
    animation: backdropIn 0.2s ease-out forwards;
}
.modal.modal-open .modal-content {
    animation: modalIn 0.2s ease-out forwards;
}
.modal.modal-closing .modal-backdrop {
    animation: backdropOut 0.15s ease-in forwards;
}
.modal.modal-closing .modal-content {
    animation: modalOut 0.15s ease-in forwards;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
}
.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    padding: 28px 28px 20px;
    width: 90%;
    max-width: 420px;
}
.modal-content h3 { margin-bottom: 16px; font-size: 18px; }
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
.detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.detail-header h3 { margin-bottom: 0; }

/* ---------- ADMIN ---------- */
.admin-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.admin-card h3 { margin-bottom: 16px; font-size: 17px; }
.admin-card h4 { margin-top: 16px; margin-bottom: 8px; font-size: 15px; color: var(--text); }
.admin-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.color-picker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 4px;
}
.color-option input { display: none; }
.color-swatch {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color .15s, transform .1s;
}
.color-option input:checked + .color-swatch {
    border-color: var(--text);
    transform: scale(1.15);
}
.color-swatch:hover { transform: scale(1.1); }

.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg);
    border-radius: var(--radius);
    flex-wrap: wrap;
    gap: 8px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-info .legend-dot { width: 14px; height: 14px; flex-shrink: 0; }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; }
.badge-admin {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    padding: 1px 7px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}
.badge-invite {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    background: #FF9800;
    color: #fff;
    padding: 1px 7px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}
.text-muted { color: var(--text-muted); font-size: 13px; }

/* ---------- STATS ---------- */
.stats-bars { display: flex; flex-direction: column; gap: 12px; }
.stat-row { display: flex; align-items: center; gap: 12px; }
.stat-label { display: flex; align-items: center; gap: 8px; min-width: 140px; font-size: 14px; font-weight: 500; }
.stat-bar-wrap { flex: 1; background: var(--bg); border-radius: 6px; height: 28px; overflow: hidden; }
.stat-bar {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    min-width: 50px;
    transition: width 0.6s ease-out;
}
.stat-bar-value { font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.stat-count { font-size: 12px; color: var(--text-muted); white-space: nowrap; min-width: 90px; text-align: right; }

.stats-recent { display: flex; flex-direction: column; gap: 8px; }
.stat-recent-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; background: var(--bg); border-radius: var(--radius); }
.stat-recent-info { font-size: 14px; }

@media (max-width: 700px) {
    .stat-label { min-width: 100px; font-size: 13px; }
    .stat-row { gap: 8px; }
    .stat-count { min-width: auto; font-size: 11px; }
}

/* ---------- COLLAPSIBLE ---------- */
.collapsible-header {
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    list-style: none;
    padding: 4px 0;
}
.collapsible-header::-webkit-details-marker { display: none; }
.collapsible-header::before { content: "▸ "; }
details[open] > .collapsible-header::before { content: "▾ "; }

/* ---------- PROFILE ---------- */
.profile-info {
    display: flex;
    align-items: center;
    gap: 20px;
}
.profile-info h3 { margin-bottom: 4px; }

/* ---------- ONBOARDING ---------- */
.onboarding-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.onboarding-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 48px 40px 32px;
    width: 100%;
    max-width: 640px;
    animation: fadeInUp 0.3s ease-out;
}
.onboarding-step { text-align: center; }
.onboarding-step h1 { font-size: 28px; margin-bottom: 12px; }
.onboarding-step h2 { font-size: 22px; margin-bottom: 16px; }
.onboarding-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.onboarding-logo { width: 160px; margin-bottom: 16px; }
.onboarding-icon { font-size: 56px; margin-bottom: 16px; }
.onboarding-content { text-align: left; margin: 20px 0; }
.onboarding-instruction {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius);
}
.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}
.onboarding-note {
    color: var(--text-muted);
    font-size: 13px;
    padding: 10px 14px;
    background: #fff8e1;
    border-radius: var(--radius);
    border-left: 3px solid #FF9800;
    margin-top: 12px;
}
.onboarding-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}
.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
}
.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: background .2s;
}
.progress-dot.active { background: var(--primary); }

.onboarding-feed-url {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius);
    margin: 16px 0;
    flex-wrap: wrap;
}
.onboarding-feed-url label { font-weight: 600; font-size: 13px; }
.onboarding-feed-url code {
    font-size: 12px;
    flex: 1;
    min-width: 200px;
    user-select: all;
    word-break: break-all;
}

.onboarding-clients { text-align: left; margin-top: 16px; }
.client-guide {
    margin-bottom: 8px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius);
}
.client-guide summary {
    cursor: pointer;
    padding: 4px 0;
}
.client-guide ol {
    margin-top: 8px;
    padding-left: 20px;
    font-size: 14px;
}
.client-guide ol li { margin-bottom: 6px; }

/* ---------- PWA INSTALL STEP ---------- */
.pwa-platform-guide {
    text-align: left;
    margin-top: 16px;
}
.pwa-platform-guide details {
    margin-bottom: 8px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius);
}
.pwa-platform-guide summary {
    cursor: pointer;
    padding: 4px 0;
    font-weight: 600;
}
.pwa-platform-guide ol {
    margin-top: 8px;
    padding-left: 20px;
    font-size: 14px;
}
.pwa-platform-guide ol li { margin-bottom: 6px; }

/* ---------- DOCS ---------- */
.docs-content { max-width: 800px; margin: 0 auto; }
.docs-toc {
    list-style: none;
    padding: 0;
}
.docs-toc li { margin-bottom: 6px; }
.docs-toc a {
    color: var(--primary);
    text-decoration: none;
    font-size: 15px;
}
.docs-toc a:hover { text-decoration: underline; }

.admin-card ol, .admin-card ul {
    margin-left: 20px;
    margin-bottom: 12px;
}
.admin-card ol li, .admin-card ul li {
    margin-bottom: 6px;
    font-size: 14px;
}
.admin-card p {
    font-size: 14px;
    margin-bottom: 8px;
}
.admin-card code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* ---------- CHANGELOG ---------- */
.changelog-entry { position: relative; }
.changelog-version {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.version-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.version-current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---------- HOLIDAYS ---------- */
.holiday-label {
    font-size: 9px;
    color: #8b6914;
    background: #fff8e1;
    border-radius: 3px;
    padding: 0 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.cal-day-holiday {
    background: #fffdf5;
}
.cal-day-holiday.cal-day-today {
    background: #e8f0fe;
}

/* ---------- TOGGLE SWITCH ---------- */
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 26px; transition: .3s; }
.toggle-slider:before { content: ''; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s; }
.toggle-switch input:checked + .toggle-slider { background: #4CAF50; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); }

/* ---------- AUDIT LOG TABLE ---------- */
.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.audit-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.audit-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.audit-table tbody tr:hover {
    background: var(--bg);
}
.audit-time {
    white-space: nowrap;
    font-size: 13px;
    color: var(--text-muted);
    font-family: monospace;
}
.audit-details {
    font-size: 12px;
    color: var(--text-muted);
    max-width: 300px;
    word-break: break-word;
}
.audit-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.audit-badge-green { background: #e8f5e9; color: #2e7d32; }
.audit-badge-red { background: #ffebee; color: #c62828; }
.audit-badge-blue { background: #e3f2fd; color: #1565c0; }
.audit-badge-orange { background: #fff3e0; color: #e65100; }
.audit-badge-gray { background: #f5f5f5; color: #616161; }

/* ---------- DARK MODE ---------- */
body.dark-mode {
    --bg: #1a1a2e;
    --surface: #252540;
    --text: #e8e8f0;
    --text-muted: #9898b0;
    --border: #3a3a55;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}
body.dark-mode .login-card { background: rgba(37,37,64,0.95); border-color: rgba(255,255,255,0.1); }
body.dark-mode .cal-day:hover { background: #2a2a48; }
body.dark-mode .cal-day-outside { background: #1e1e35; }
body.dark-mode .cal-day-today { background: #1a2a4e; }
body.dark-mode .holiday-label { background: #3a3520; color: #c8a848; }
body.dark-mode .cal-day-holiday { background: #252535; }
body.dark-mode .booking-bar { opacity: 0.9; }
body.dark-mode .flash-error { background: #3a1a1a; border-color: #5a2a2a; color: #ff8888; }
body.dark-mode .flash-success { background: #1a3a1a; border-color: #2a5a2a; color: #88cc88; }
body.dark-mode .flash-info { background: #1a2a3a; border-color: #2a3a5a; color: #88aacc; }
body.dark-mode .user-dropdown-menu { background: var(--surface); border-color: var(--border); }
body.dark-mode .dropdown-item:hover { background: var(--bg); }
body.dark-mode .stat-bar-wrap { background: var(--bg); }
body.dark-mode img.header-logo { filter: brightness(0) invert(1); }
body.dark-mode .user-dropdown-toggle { background: var(--surface); border-color: var(--border); color: var(--text); }
body.dark-mode .user-dropdown-toggle:hover { background: var(--bg); }
body.dark-mode .btn-outline { border-color: var(--border); color: var(--text); }
body.dark-mode .btn-outline:hover { background: var(--bg); }
body.dark-mode .btn-icon { border-color: var(--border); color: var(--text); }
body.dark-mode .btn-icon:hover { background: var(--bg); }
body.dark-mode .nav-select { color: var(--text); }
body.dark-mode .nav-select:hover, body.dark-mode .nav-select:focus { border-color: var(--border); background: var(--bg); }
body.dark-mode .form-group input,
body.dark-mode .form-group textarea { background: var(--bg); border-color: var(--border); color: var(--text); }
body.dark-mode .modal-backdrop { background: rgba(0,0,0,0.6); }
body.dark-mode .modal-content { background: var(--surface); }
body.dark-mode .color-option input:checked + .color-swatch { border-color: var(--text); }
body.dark-mode .user-row { background: var(--bg); }
body.dark-mode .onboarding-card { background: var(--surface); }
body.dark-mode .onboarding-note { background: #2a2520; border-color: #5a4520; color: #c8a848; }
body.dark-mode .audit-badge-green { background: #1a3a1a; color: #66bb6a; }
body.dark-mode .audit-badge-red { background: #3a1a1a; color: #ef5350; }
body.dark-mode .audit-badge-blue { background: #1a2a3a; color: #42a5f5; }
body.dark-mode .audit-badge-orange { background: #3a2a1a; color: #ffa726; }
body.dark-mode .audit-badge-gray { background: #2a2a3a; color: #9898b0; }
body.dark-mode .dropdown-item-danger:hover { background: #3a1a1a; }
body.dark-mode .dropdown-handle { background: #5a5a70; }
body.dark-mode ::-webkit-scrollbar-track { background: var(--bg); }
body.dark-mode ::-webkit-scrollbar-thumb { background: #4a4a60; }
body.dark-mode .app-header { background: linear-gradient(180deg, rgba(37,37,64,0.7) 0%, transparent 100%); }

/* ---------- DATETIME ROW ---------- */
.datetime-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.datetime-row input[type="date"] {
    width: 120px;
    min-width: 0;
    flex: 0 1 120px;
    padding: 8px 2px;
    font-size: 12px;
}
.datetime-row input[type="time"] {
    width: 90px !important;
    min-width: 90px;
    max-width: 90px;
    flex: 0 0 90px;
    padding: 8px 6px;
    font-size: 13px;
    text-align: center;
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- PWA / SAFE AREAS ---------- */
@supports (padding-top: env(safe-area-inset-top)) {
    body::before { top: env(safe-area-inset-top); }
    .flash-container { top: calc(16px + env(safe-area-inset-top)); }
}

/* PWA standalone mode – extra space for status bar / Dynamic Island */
@media (display-mode: standalone) {
    body::before { display: none; }
    body { padding-top: env(safe-area-inset-top, 20px); }
    .app-wrapper {
        padding-top: 12px;
        padding-left: calc(8px + env(safe-area-inset-left, 0px));
        padding-right: calc(8px + env(safe-area-inset-right, 0px));
    }
    .login-wrapper { padding-top: calc(20px + env(safe-area-inset-top, 20px)); }
    .flash-container { top: calc(12px + env(safe-area-inset-top, 20px)); }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 700px) {
    /* Header: single row, logo left, avatar right */
    .app-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        padding: 8px 0;
        gap: 4px;
    }
    .header-left .logo { font-size: 16px; }
    .header-logo { height: 26px; }
    .logo-link { gap: 6px; }
    .header-right { width: auto; flex-wrap: nowrap; }

    /* User dropdown: bottom sheet on mobile */
    .user-dropdown-toggle {
        padding: 4px 8px;
        gap: 6px;
        border-radius: 50%;
        border: 2px solid var(--border);
    }
    .user-dropdown-toggle .avatar-small { width: 30px; height: 30px; }
    .user-dropdown-name { display: none; }
    .dropdown-arrow { display: none; }
    .user-dropdown-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 799;
    }
    .user-dropdown-backdrop.open { display: block; }
    .user-dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        min-width: 100%;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 30px rgba(0,0,0,0.2);
        max-height: 80vh;
        overflow-y: auto;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 16px));
        z-index: 801;
    }
    .dropdown-handle {
        display: block;
        width: 36px;
        height: 4px;
        background: #d0d4dc;
        border-radius: 2px;
        margin: 10px auto 4px;
    }
    .dropdown-user-info { padding: 16px 20px; }
    .dropdown-item { padding: 14px 20px; font-size: 16px; }

    /* Calendar nav compact */
    .cal-nav { gap: 6px; margin-bottom: 8px; }
    .nav-select { font-size: 14px; padding: 2px 4px; }
    .btn-icon { padding: 4px 10px; font-size: 18px; }
    .cal-title { font-size: 18px; min-width: auto; }

    /* Calendar grid */
    .cal-day { min-height: 52px; padding: 2px 3px; }
    .day-number { font-size: 11px; }
    .bar-label { font-size: 8px; }
    .booking-bar { height: 16px; }
    .cal-header-cell { font-size: 11px; padding: 6px 2px; }
    .legend { gap: 6px; font-size: 10px; margin-bottom: 8px; }
    .avatar-legend { width: 16px; height: 16px; }
    .legend-dot { width: 10px; height: 10px; }
    .holiday-label { font-size: 7px; padding: 0 2px; }

    /* Modals: full width on mobile, slide up from bottom */
    .modal-content {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 16px));
        max-height: 85vh;
        overflow-y: auto;
    }

    /* Feed URL */
    .feed-url-box { padding: 8px 10px; }
    .feed-url-box code { font-size: 11px; }

    /* iCal info */
    .ical-info { margin-top: 12px; }

    /* Forms */
    .datetime-row { gap: 4px; }
    .datetime-row input[type="time"] { width: 72px !important; min-width: 72px; max-width: 72px; flex: 0 0 72px; font-size: 12px; padding: 8px 2px; }
    .datetime-row input[type="date"] { font-size: 12px; padding: 8px 2px; }

    /* General spacing */
    .app-wrapper { padding: 8px; }
    .admin-card { padding: 16px; margin-bottom: 12px; }
    .admin-card:hover { transform: none; box-shadow: var(--shadow); }
    .btn:hover { transform: none; }
    .profile-info { flex-direction: column; text-align: center; }
    .onboarding-card { padding: 32px 20px 24px; }
}

@media (max-width: 420px) {
    .cal-day { min-height: 42px; padding: 1px 2px; }
    .booking-bar { height: 14px; margin: 0 -2px; padding: 0 2px; }
    .booking-bar.bar-start { margin-left: 0; }
    .booking-bar.bar-end { margin-right: 0; }
    .bar-label { font-size: 7px; }
    .header-left .logo { font-size: 14px; }
    .header-logo { height: 22px; }
    .nav-select { font-size: 13px; }
}
