:root {
    --sidebar-width: 260px;
    --color-primary: #4f46e5;
    --color-primary-light: #6366f1;
    --color-primary-dark: #3730a3;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    --color-surface: #ffffff;
    --color-surface-alt: #f8fafc;
    --color-border: #e2e8f0;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-sidebar-bg: #1e293b;
    --color-sidebar-text: #cbd5e1;
    --color-sidebar-hover: #334155;
    --color-sidebar-active: var(--color-primary);
}

html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--color-text);
    background-color: var(--color-surface-alt);
    margin: 0;
    padding: 0;
    height: 100%;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Page layout */
.page {
    display: flex;
    min-height: 100vh;
}

.page .sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-sidebar-bg);
    color: var(--color-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.page .main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem;
    min-width: 0;
}

/* Sidebar brand */
.sidebar-brand {
    padding: 1.25rem 1.5rem;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand .brand-logo {
    width: 5.5rem;
    height: 5.5rem;
    object-fit: contain;
}

.sidebar-brand .brand-text {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Sidebar nav */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 0.5rem 0;
}

.nav-group-label {
    padding: 0.75rem 1.5rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
}

.nav-item {
    display: block;
}

.nav-item a,
.nav-item .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: var(--color-sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.nav-item a:hover,
.nav-item .nav-link:hover {
    background-color: var(--color-sidebar-hover);
    color: #fff;
}

.nav-item a.active,
.nav-item .nav-link.active {
    background-color: rgba(79, 70, 229, 0.15);
    color: #fff;
    border-left-color: var(--color-sidebar-active);
}

.nav-icon {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

/* Page header */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--color-text);
}

.page-header p {
    color: var(--color-text-muted);
    margin: 0;
}

/* Card styles */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}

.card-body {
    padding: 1.5rem;
}

/* Table styles */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: var(--color-surface-alt);
}

/* Paging bar */
.paging-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.5;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-primary-dark);
}

.btn-secondary {
    background-color: #e2e8f0;
    color: var(--color-text);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #cbd5e1;
}

.btn-danger {
    background-color: var(--color-danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-success {
    background-color: var(--color-success);
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background-color: #16a34a;
}

.btn-outline {
    background-color: transparent;
    border-color: var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--color-surface-alt);
}

.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.8rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-select {
    appearance: none;
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    background: var(--color-surface) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 0.75rem center/12px 12px;
    color: var(--color-text);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-inline {
    display: flex;
    align-items: end;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-inline .form-group {
    margin-bottom: 0;
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-available {
    background-color: #dcfce7;
    color: #166534;
}

.badge-reserved {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-occupied {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-restricted {
    background-color: #e2e8f0;
    color: #475569;
}

.badge-booked {
    background-color: #fce7f3;
    color: #9d174d;
}

.badge-checked-in {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-cancelled {
    background-color: #f1f5f9;
    color: #64748b;
}

.badge-expired {
    background-color: #fef2f2;
    color: #991b1b;
}

.badge-desk {
    background-color: #ede9fe;
    color: #5b21b6;
}

.badge-room {
    background-color: #e0f2fe;
    color: #075985;
}

.badge-parking {
    background-color: #fef9c3;
    color: #854d0e;
}

/* Booking wizard steps */
.wizard-steps {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    position: relative;
}

.wizard-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 0 0.5rem;
}

/* Left half of connecting line (enters this step from the previous one) */
.wizard-step::before {
    content: '';
    position: absolute;
    top: 1rem;
    left: 0;
    right: 50%;
    height: 2px;
    background-color: var(--color-border);
    z-index: 0;
    transition: background-color 0.2s;
}

/* Right half of connecting line (exits this step toward the next one) */
.wizard-step::after {
    content: '';
    position: absolute;
    top: 1rem;
    left: 50%;
    right: 0;
    height: 2px;
    background-color: var(--color-border);
    z-index: 0;
    transition: background-color 0.2s;
}

.wizard-step:first-child::before {
    display: none;
}

.wizard-step:last-child::after {
    display: none;
}

/* Completed step: both halves green */
.wizard-step.completed::before,
.wizard-step.completed::after {
    background-color: var(--color-success);
}

/* Active step: left half green (arrives from completed), right half stays gray */
.wizard-step.active::before {
    background-color: var(--color-success);
}

.wizard-step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--color-border);
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    transition: all 0.2s;
}

.wizard-step.active .wizard-step-number {
    background-color: var(--color-primary);
    color: #fff;
}

.wizard-step.completed .wizard-step-number {
    background-color: var(--color-success);
    color: #fff;
}

.wizard-step-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

.wizard-step.active .wizard-step-label {
    color: var(--color-primary);
    font-weight: 600;
}

.wizard-step.completed .wizard-step-label {
    color: var(--color-success);
}

.wizard-step-value {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text);
    font-weight: 500;
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.wizard-step.completed .wizard-step-value {
    color: var(--color-success);
}

.wizard-step.completed:hover .wizard-step-number {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 25%, transparent);
}

/* Resource cards for booking */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.resource-card {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.resource-card:hover {
    border-color: var(--color-primary-light);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.resource-card.selected {
    border-color: var(--color-primary);
    background: rgba(79, 70, 229, 0.04);
}

.resource-card.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
}

.resource-card .resource-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.resource-card .resource-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Booked time slots inside resource cards */
.resource-card-bookings {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.resource-card-booking-slot {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    padding: 0.2rem 0.4rem;
    border-radius: 0.3rem;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.resource-card-booking-slot.today {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--color-text);
    font-weight: 500;
}

/* Equipment chips on resource cards */
.resource-equipment-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.45rem;
}

.resource-eq-chip {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    color: #1e40af;
    background: #dbeafe;
    padding: 0.1rem 0.45rem;
    border-radius: 8px;
    white-space: nowrap;
    cursor: default;
}

/* Equipment filter multiselect on Book page */
.eq-multiselect-wrap {
    position: relative;
    display: inline-block;
    z-index: 1050;
}

.eq-multiselect-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
}

.eq-multiselect-toggle {
    cursor: pointer;
    white-space: nowrap;
}

.eq-multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    min-width: 220px;
    max-height: 240px;
    overflow-y: auto;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    padding: 0.35rem 0;
    margin-top: 2px;
}

.eq-multiselect-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
}

.eq-multiselect-item:hover {
    background: var(--color-surface-alt, #f7fafc);
}

.eq-multiselect-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.eq-multiselect-cat {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--color-text-muted, #718096);
}

/* Time conflict warning & booked slots reference (step 5) */
.time-conflict-warning {
    margin-top: 0.75rem;
    padding: 0.6rem 1rem;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.booked-slots-reference {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

.booked-slots-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.booked-slot-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 1rem;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.booked-slot-chip.today {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--color-text);
    font-weight: 500;
}

/* Quick-select buttons */
.quick-select-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--color-border);
    border-radius: 0.5rem;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.quick-select-btn:hover {
    border-color: var(--color-primary-light);
    background: rgba(79, 70, 229, 0.04);
}

.quick-select-btn.active {
    border-color: var(--color-primary);
    background: rgba(79, 70, 229, 0.08);
    color: var(--color-primary);
}

.quick-select-hint {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

/* Weekday label next to date picker */
.booking-weekday {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary, #4a6fa5);
    white-space: nowrap;
    text-transform: capitalize;
}

/* Recurring booking section */
.recurring-section {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
}

.recurring-options {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.weekday-chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.weekday-chip {
    width: 2.4rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-surface);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.weekday-chip:hover {
    border-color: var(--color-primary-light);
}

.weekday-chip.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.recurring-preview {
    padding: 0.5rem 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.4rem;
    font-size: 0.85rem;
}

.recurring-dates-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

/* Selection list for booking flow */
.selection-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.selection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.selection-item:hover {
    border-color: var(--color-primary-light);
    background-color: rgba(79, 70, 229, 0.02);
}

.selection-item.selected {
    border-color: var(--color-primary);
    background-color: rgba(79, 70, 229, 0.04);
}

.selection-item .item-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.selection-item .item-name {
    font-weight: 600;
}

.selection-item .item-detail {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.selection-item .item-arrow {
    color: var(--color-text-muted);
    font-size: 1.25rem;
}

/* Alert / message */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.5rem;
}

.filter-bar .card-body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.5rem;
}

.filter-divider {
    width: 1px;
    align-self: stretch;
    background: var(--color-border);
    margin: 0 0.25rem;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-section-row {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: var(--color-primary-light);
    color: var(--color-primary);
}

.filter-chip.active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.filter-custom-dates {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

/* Loading spinner */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--color-text-muted);
}

.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.75rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-dialog {
    background: var(--color-surface);
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.25rem;
}

/* Floor plan picker (load dialog) */
.fp-picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 340px;
    overflow-y: auto;
}

.fp-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background 0.15s;
}

.fp-picker-item:last-child { border-bottom: none; }
.fp-picker-item:hover { background: var(--color-bg); }

.fp-picker-item .fp-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.fp-picker-item .fp-meta {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.fp-picker-item .fp-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}

.fp-badge.draft { background: #fefcbf; color: #975a16; }
.fp-badge.assigned { background: #c6f6d5; color: #276749; }

.fp-picker-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--color-text-muted);
}

.fp-picker-tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 0;
}

.fp-picker-tab {
    flex: 1;
    padding: 0.6rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--color-text-muted);
    transition: color 0.15s, border-color 0.15s;
}

.fp-picker-tab:hover { color: var(--color-text); }
.fp-picker-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Stats / dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* ── Mobile Navigation Toggle ── */

.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 200;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--color-sidebar-bg);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: background-color 0.15s;
}

.mobile-nav-toggle:hover {
    background: var(--color-sidebar-hover);
}

.hamburger-icon {
    line-height: 1;
}

.sidebar-overlay {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 99;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    .page .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .page .sidebar.open {
        transform: translateX(0);
    }

    .page .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 3.5rem;
    }

    .page-header h1 {
        font-size: 1.35rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .wizard-steps {
        flex-direction: column;
        gap: 0.5rem;
    }

    .wizard-step::before,
    .wizard-step::after {
        display: none;
    }

    .wizard-step-value {
        display: inline;
        margin-left: 0.5rem;
    }

    .resource-grid {
        grid-template-columns: 1fr;
    }

    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .home-section-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.8rem;
    }

    .btn-sm {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .paging-bar {
        flex-wrap: wrap;
        font-size: 0.8rem;
    }

    .filter-bar {
        gap: 0.75rem;
    }

    .filter-bar .form-select,
    .filter-bar .form-control {
        width: 100% !important;
        min-width: 0 !important;
    }

    .filter-section {
        min-width: 0;
        flex: 1 1 calc(50% - 0.5rem);
    }

    .filter-divider {
        display: none;
    }

    .qr-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
}

/* ── Floor Plan Editor ── */

.editor-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: calc(100vh - 160px);
    min-height: 500px;
}

/* Top toolbar */
.editor-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 0.4rem 0.75rem;
    gap: 0.25rem 1rem;
}

.toolbar-left,
.toolbar-right-stack {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toolbar-right-stack {
    align-items: stretch;
}

.toolbar-right-stack > .toolbar-row {
    justify-content: flex-start;
}

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.toolbar-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.toolbar-divider {
    width: 1px;
    height: 1.6rem;
    background: var(--color-border);
    margin: 0 0.4rem;
}

.toolbar-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-right: 0.15rem;
    white-space: nowrap;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.3;
}

.toolbar-btn:hover {
    background-color: var(--color-surface-alt);
    border-color: var(--color-primary-light);
}

.toolbar-btn.active {
    background-color: rgba(79, 70, 229, 0.1);
    border-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
}

.toolbar-btn .tb-icon {
    font-size: 0.9rem;
    line-height: 1;
}

/* Zoom controls */
.toolbar-right input[type=range] {
    width: 80px;
    accent-color: var(--color-primary);
}

.zoom-pct {
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
    min-width: 2.8rem;
    text-align: center;
}

/* Canvas + properties area */
.editor-body {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 0.75rem;
    flex: 1;
    min-height: 0;
    margin-top: 0.5rem;
}

.editor-canvas-wrap {
    position: relative;
    background: #e8e8e8;
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: grab;
}

.editor-canvas-wrap.panning {
    cursor: grabbing;
}

.editor-canvas {
    width: 100%;
    height: 100%;
    background: #fff;
}

/* Grid overlay rendered inside SVG */
.editor-canvas .fp-grid line {
    stroke: #cbd5e1;
    stroke-width: 0.5;
}

.editor-canvas .fp-grid .fp-grid-major {
    stroke: #94a3b8;
    stroke-width: 1;
}

/* SVG element styles — match a1-f1.svg conventions */
.editor-canvas .wall        { fill: none; stroke: #2d3748; stroke-width: 3; }
.editor-canvas .window      { fill: none; stroke: #63b3ed; stroke-width: 2; stroke-dasharray: 8 4; }
.editor-canvas .door        { fill: none; stroke: #48bb78; stroke-width: 3; }
.editor-canvas .fp-staircase { fill: #f7fafc; stroke: #a0aec0; stroke-width: 1.5; }
.editor-canvas .fp-stair-line { stroke: #a0aec0; stroke-width: 1; }
.editor-canvas .desk        { fill: #ebf4ff; stroke: #4a6fa5; stroke-width: 1.5; }
.editor-canvas .room        { fill: #fefcbf; stroke: #d69e2e; stroke-width: 1.5; }
.editor-canvas .parking     { fill: #e2e8f0; stroke: #718096; stroke-width: 1.5; }

/* Label element */
.editor-canvas .fp-label    { font-size: 14px; fill: #2d3748; font-weight: 400; cursor: move; font-family: inherit; }

/* Meeting table elements */
.editor-canvas .fp-mt-shape { stroke-width: 2; }
.editor-canvas .fp-meeting-rect   { fill: #e8f5e9; stroke: #388e3c; }
.editor-canvas .fp-meeting-circle { fill: #e8f5e9; stroke: #388e3c; }
.editor-canvas .fp-meeting-oval   { fill: #e8f5e9; stroke: #388e3c; }
.editor-canvas .fp-meeting-ushape { fill: #e8f5e9; stroke: #388e3c; }
.editor-canvas .fp-mt-seat  { fill: #a0aec0; stroke: #718096; stroke-width: 1; }

.editor-canvas [data-editor-id] {
    cursor: move;
}

.editor-canvas .fp-handle {
    fill: var(--color-primary);
    stroke: #fff;
    stroke-width: 1.5;
    pointer-events: all;
}

.editor-canvas .fp-rotate-handle {
    fill: #f59e0b;
    stroke: #fff;
    stroke-width: 1.5;
    cursor: crosshair;
    pointer-events: all;
}

.editor-canvas .fp-rotate-line {
    stroke: #f59e0b;
    stroke-width: 1;
    stroke-dasharray: 3 2;
    pointer-events: none;
}

.editor-canvas .fp-background {
    opacity: 0.35;
    pointer-events: none;
}

/* Properties panel */
.editor-properties {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.props-scroll {
    overflow-y: auto;
    flex-shrink: 1;
    min-height: 0;
}

.palette-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.palette-section {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-top: 1rem;
    margin-bottom: 0.375rem;
    flex-shrink: 0;
}

.prop-group {
    margin-bottom: 0.6rem;
}

.prop-group .form-label {
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
}

.prop-group .form-control {
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

.editor-hint {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    padding: 0.5rem 0;
}

.element-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.element-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.1s;
}

.element-list-item:hover {
    background-color: var(--color-surface-alt);
}

.element-list-item.selected {
    background-color: rgba(79, 70, 229, 0.08);
    font-weight: 600;
}

.element-coords {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

/* SVG source editor */
.svg-source-editor {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 260px;
    background: #1e293b;
    border-top: 2px solid var(--color-primary);
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.svg-source-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 600;
}

.svg-source-editor textarea {
    flex: 1;
    background: #1e293b;
    color: #e2e8f0;
    border: none;
    padding: 0.75rem;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    tab-size: 2;
}

.svg-source-editor textarea::selection {
    background: rgba(99, 102, 241, 0.4);
}

/* Color picker in properties */
.color-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.color-row input[type=color] {
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    padding: 0.15rem;
    cursor: pointer;
    background: var(--color-surface);
}

.color-row input[type=text] {
    flex: 1;
}

@media (max-width: 900px) {
    .editor-body {
        grid-template-columns: 1fr;
    }

    .editor-properties {
        max-height: 250px;
    }

    .editor-toolbar {
        overflow-x: auto;
    }

    .toolbar-row {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
}

/* ── Home Dashboard ── */

.home-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .home-section-grid {
        grid-template-columns: 1fr;
    }
}

.recent-bookings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recent-booking-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
}

.recent-booking-item:last-child {
    border-bottom: none;
}

.recent-booking-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recent-booking-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    padding-left: 0.15rem;
}

.coming-soon-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9999px;
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: #fff;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ── QR Code Grid ── */

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.qr-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    text-align: center;
}

.qr-image {
    width: 180px;
    height: auto;
    image-rendering: pixelated;
}

.qr-card-label {
    margin-top: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
}

.qr-card-type {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    text-transform: capitalize;
}

/* ── Check-In Landing Page ── */

.checkin-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.checkin-card {
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 3rem 2.5rem;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.checkin-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.checkin-success-icon {
    animation: checkin-pop 0.4s ease;
}

@keyframes checkin-pop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.checkin-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.checkin-subtitle {
    color: var(--color-text-muted);
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.checkin-detail {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* ── QR Print Styles ── */

@media print {
    body * {
        visibility: hidden;
    }

    #qr-print-area,
    #qr-print-area * {
        visibility: visible;
    }

    #qr-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        padding: 1rem;
    }

    .qr-card {
        border: 1px dashed #ccc;
        page-break-inside: avoid;
        padding: 0.75rem;
    }

    .qr-image {
        width: 150px;
    }

    .qr-card-label {
        font-size: 0.85rem;
    }

    .qr-card-type {
        font-size: 0.7rem;
    }
}

/* ── Book page: sliding sticky continue bar ── */
.book-continue-overlay {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width, 260px);
    right: 0;
    z-index: 1060;
    animation: bookSlideUp 0.3s ease-out;
}

@media (max-width: 768px) {
    .book-continue-overlay {
        left: 0;
    }
}

.book-continue-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 2px solid var(--color-primary, #4a6fa5);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.book-continue-summary {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text, #2d3748);
    margin-right: auto;
}

@keyframes bookSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}