/* ============================================
   SHARED STYLES - Common Components
   ============================================ */

/* Global Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Prevent overscroll bounce in PWA standalone mode */
html, body {
    overscroll-behavior: none;
}

/* ============================================
   CSS VARIABLES - Color Theme
   ============================================ */
:root {
    /* Primary Brand Colors */
    --color-primary: #1e3a5f;
    --color-primary-light: #2d5282;
    --color-primary-dark: #152b47;
    
    /* Secondary/Accent Colors (for highlights, auth page backgrounds) */
    --color-secondary: #667eea;
    --color-secondary-light: #8b9ff0;
    --color-secondary-dark: #4a5bb8;

    /* Button Colors (for action buttons) */
    --color-button: #28a745;
    --color-button-light: #34c759;
    --color-button-dark: #218838;

    /* Text/Heading Colors (for headings, links, accents) */
    --color-text: #1e3a5f;
    --color-text-light: #2d5282;
    --color-text-dark: #152b47;

    /* Secondary Colors */
    --color-success: #28a745;
    --color-success-dark: #20873a;
    --color-success-light: #d4edda;
    --color-success-text: #155724;
    
    --color-warning: #ffc107;
    --color-warning-dark: #e0a800;
    --color-warning-light: #fff3cd;
    --color-warning-text: #856404;
    
    --color-danger: #dc3545;
    --color-danger-dark: #c82333;
    --color-danger-light: #f8d7da;
    --color-danger-text: #721c24;
    
    --color-info: #17a2b8;
    --color-info-dark: #138496;
    --color-info-light: #d1ecf1;
    --color-info-text: #0c5460;
    
    /* Neutral Colors */
    --color-gray-50: #fafafa;
    --color-gray-100: #f8f9fa;
    --color-gray-200: #e9ecef;
    --color-gray-300: #dee2e6;
    --color-gray-400: #e0e0e0;
    --color-gray-500: #6c757d;
    --color-gray-600: #666;
    --color-gray-700: #555;
    --color-gray-800: #333;
    --color-gray-900: #1e1e1e;
    
    /* Background Colors */
    --color-bg-light: #f5f7fa;
    --color-bg-white: #ffffff;
    --color-bg-hover: #f8f9fa;
    
    /* Border Colors */
    --color-border-light: #f0f0f0;
    --color-border-medium: #e0e0e0;
    --color-border-dark: #dee2e6;
    
    /* Shadow */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* ============================================
   BUTTONS - Standardized Styles
   ============================================ */
.btn-primary,
.btn-submit {
    background: var(--color-button);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(30, 58, 95, 0.2);
    text-align: center;
}

.btn-primary:hover,
.btn-submit:hover {
    background: var(--color-button-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 58, 95, 0.3);
}

.btn-success,
.btn-create,
.btn-book,
.btn-keep {
    background: linear-gradient(135deg, var(--color-button) 0%, var(--color-button-dark) 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.2);
    text-align: center;
}

.btn-success:hover,
.btn-create:hover,
.btn-book:hover,
.btn-keep:hover {
    background: linear-gradient(135deg, var(--color-button-dark) 0%, var(--color-button-dark) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-danger,
.btn-delete,
.btn-cancel-booking {
    background: linear-gradient(135deg, var(--color-danger) 0%, var(--color-danger-dark) 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.2);
    text-align: center;
}

.btn-danger:hover,
.btn-delete:hover,
.btn-cancel-booking:hover {
    background: linear-gradient(135deg, var(--color-danger-dark) 0%, #a71d2a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-secondary,
.btn-cancel,
.btn-clear,
.btn-reset {
    background: white;
    color: var(--color-text);
    padding: 12px 30px;
    border: 2px solid var(--color-text);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
    text-align: center;
}

.btn-secondary:hover,
.btn-cancel:hover,
.btn-clear:hover,
.btn-reset:hover {
    background: var(--color-primary);
    border-color: var(--color-text);
    color: white;
}

.btn-filter {
    background: var(--color-button);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-filter:hover {
    background: var(--color-button-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

/* Action Button Variants (smaller buttons) */
.btn-action,
.btn-edit,
.btn-view,
.btn-bookings {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-edit {
    background: var(--color-warning-light);
    color: var(--color-warning-text);
}

.btn-edit:hover {
    background: #ffeaa7;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-view,
.btn-bookings {
    background: var(--color-info-light);
    color: var(--color-info-text);
}

.btn-view:hover,
.btn-bookings:hover {
    background: #bee5eb;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-action.btn-delete {
    background: var(--color-danger-light);
    color: var(--color-danger-text);
    padding: 8px 16px;
    box-shadow: none;
}

.btn-action.btn-delete:hover {
    background: #f5c6cb;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   ACTION DROPDOWN
   Clean dropdown menu for table action buttons
   ============================================ */
.action-dropdown {
    position: relative;
    display: inline-block;
}

.action-dropdown-trigger {
    display: inline-block;
    background: var(--color-button);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.action-dropdown-trigger:hover {
    background: var(--color-button-dark);
}

.action-dropdown-trigger::after {
    content: " ▼";
    font-size: 0.7rem;
}

.action-dropdown-menu {
    position: fixed;
    top: 0;
    left: 0;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    z-index: 10001;
    overflow: hidden;
    /* Hidden by default - use visibility and opacity for smoother transitions */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.action-dropdown.open .action-dropdown-menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Action dropdown container - position relative for proper stacking */
.action-dropdown {
    position: relative;
    display: inline-block;
}

.action-dropdown-menu a,
.action-dropdown-menu button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    text-decoration: none;
    color: var(--color-gray-800);
    background: none;
    border: none;
    border-bottom: 1px solid var(--color-border-light);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background var(--transition-fast);
}

.action-dropdown-menu a:last-child,
.action-dropdown-menu button:last-child {
    border-bottom: none;
}

.action-dropdown-menu a:hover,
.action-dropdown-menu button:hover {
    background: var(--color-bg-hover);
}

.action-dropdown-menu .action-delete {
    color: var(--color-danger);
}

.action-dropdown-menu .action-delete:hover {
    background: var(--color-danger-light);
}

/* Legacy support - hide if still present in templates */
.action-buttons-desktop {
    display: none;
}

/* Disabled State */
.btn:disabled,
.btn-primary:disabled,
.btn-submit:disabled,
.btn-delete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover,
.btn-primary:disabled:hover,
.btn-submit:disabled:hover,
.btn-delete:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Disabled link buttons (for <a>/<span> elements that can't use :disabled) */
.btn-create-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   HEADER BUTTONS - Specific to navigation header
   ============================================ */
.header-right .btn {
    padding: 10px 25px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid white;
    display: inline-block;
    background: transparent;
    color: white;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
}

.header-right .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.header-right .btn-primary {
    background: white;
    color: var(--color-text);
    border-color: white;
}

.header-right .btn-primary:hover {
    background: #f0f0f0;
    color: var(--color-text);
}

.header-right .btn-admin {
    background: var(--color-button);
    color: white;
    border-color: var(--color-button);
}

.header-right .btn-admin:hover {
    background: var(--color-button-dark);
    border-color: var(--color-button-dark);
    color: white;
}

.header-right .btn-dashboard {
    border-color: var(--color-button);
    color: white;
    background: var(--color-button);
}

.header-right .btn-dashboard:hover {
    background: var(--color-button-dark);
    color: white;
}

.header-right .btn-switch-org {
    border-color: var(--color-button);
    color: white;
    background: var(--color-button);
}

.header-right .btn-switch-org:hover {
    background: var(--color-button-dark);
    color: white;
}

.header-right .btn-account,
.header-right .btn-help {
    border-color: white;
    color: white;
    background: transparent;
}

.header-right .btn-account:hover,
.header-right .btn-help:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Stats Bar (horizontal) */
.stats-bar {
    background: var(--color-gray-100);
    padding: 20px 30px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.stats-bar .stat-item {
    display: flex;
    flex-direction: column;
}

.stats-bar .stat-label {
    font-size: 0.85rem;
    color: var(--color-gray-600);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-bar .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--color-border-medium);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-normal);
    font-family: 'Inter', 'Roboto', sans-serif;
    background: var(--color-bg-white);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-text);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--color-gray-600);
    font-size: 0.85rem;
}

/* Filter Sections */
.filters-section {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.filter-group label {
    font-weight: 600;
    color: var(--color-gray-800);
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 10px 15px;
    border: 2px solid var(--color-border-medium);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    background: var(--color-gray-50);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--color-text);
    outline: none;
    background: var(--color-bg-white);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 20px 30px;
    border-top: 1px solid var(--color-border-light);
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination a {
    background: var(--color-gray-100);
    color: var(--color-text);
    cursor: pointer;
}

.pagination a:hover {
    background: var(--color-primary);
    color: white;
}

.pagination .current {
    background: var(--color-primary);
    color: white;
}

.pagination .disabled {
    background: var(--color-gray-100);
    color: #999;
    cursor: not-allowed;
}

.pagination .ellipsis {
    background: transparent;
    color: var(--color-gray-600);
}

.pagination-info {
    margin-left: 15px;
    color: var(--color-gray-600);
    font-size: 0.9rem;
}

.pagination-link {
    cursor: pointer;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-gray-600);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3,
.empty-state-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--color-text);
    margin-bottom: 10px;
    font-weight: 500;
}

.empty-state p,
.empty-state-text {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-bg-white);
}

.data-table thead {
    background: var(--color-bg-hover);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border-dark);
    white-space: nowrap;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid var(--color-border-light);
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--color-bg-hover);
}

.data-table th:first-child,
.data-table td:first-child {
    position: sticky;
    left: 0;
    background: var(--color-bg-white);
    z-index: 2;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.data-table thead th:first-child {
    background: var(--color-bg-hover);
    z-index: 3;
}

.data-table tr:hover td:first-child {
    background: var(--color-bg-hover);
}

/* ============================================
   TABLE CELL STYLING - Consistent across all tables
   First column is bold, all others have standard styling
   ============================================ */

/* Base styling for all table cells - consistent font */
.data-table td {
    font-size: 0.95rem;
    color: var(--color-gray-800);
    font-weight: 400;
}

/* First column is always bold (primary column) */
.data-table td:first-child {
    font-weight: 600;
    color: var(--color-text);
}

/* For tables with checkbox in first column, make second column bold instead */
.data-table td:first-child:has(.booking-checkbox),
.data-table td.cell-center:first-child {
    font-weight: 400;
    color: var(--color-gray-800);
}

.data-table td:first-child:has(.booking-checkbox) + td,
.data-table td.cell-center:first-child + td {
    font-weight: 600;
    color: var(--color-text);
}

/* Legacy support: .cell-primary class for explicit bold styling */
.cell-primary {
    font-weight: 600 !important;
    color: var(--color-text) !important;
}

/* Remove bold from cells that should NOT be bold (non-first columns) */
.data-table td:not(:first-child):not(.cell-primary) {
    font-weight: 400;
}

/* Secondary text styling (muted, smaller text) */
.cell-secondary {
    color: var(--color-gray-500) !important;
    font-size: 0.9rem !important;
    font-weight: 400 !important;
}

/* Remove any inherited bold from strong tags inside non-first columns */
.data-table td:not(:first-child) strong {
    font-weight: 600;
    color: var(--color-text);
}

.cell-actions {
    text-align: right;
    white-space: nowrap;
}

.cell-center {
    text-align: center;
}

.booking-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Table empty/loading states */
.table-message {
    text-align: center;
    padding: 40px;
    color: var(--color-gray-600);
}

/* Badges */
.pattern-badge,
.status-badge,
.site-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-lg);
    font-size: 0.75rem;
    font-weight: 600;
}

.pattern-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.site-badge {
    background: #e7f3ff;
    color: var(--color-text);
}

.status-badge {
    font-size: 0.85rem;
    padding: 5px 12px;
    border-radius: var(--radius-xl);
}

.status-confirmed {
    background: var(--color-success-light);
    color: var(--color-success-text);
}

.status-pending {
    background: var(--color-warning-light);
    color: var(--color-warning-text);
}

.status-cancelled {
    background: var(--color-danger-light);
    color: var(--color-danger-text);
}

.status-completed {
    background: var(--color-gray-200);
    color: var(--color-gray-700);
}

.status-upcoming {
    background: var(--color-warning-light);
    color: var(--color-warning-text);
}

.status-past {
    background: #e2e3e5;
    color: var(--color-gray-500);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-warning {
    background: var(--color-warning-light);
    color: var(--color-warning-text);
}

.alert-success {
    background: var(--color-success-light);
    color: var(--color-success-text);
}

.alert-error,
.alert-danger {
    background: var(--color-danger-light);
    color: var(--color-danger-text);
}

.alert-info {
    background: var(--color-info-light);
    color: var(--color-info-text);
}

/* Loading States */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-gray-600);
}

.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-gray-200);
    border-top: 4px solid var(--color-text);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Upload progress overlay — used by upload-progress.js. Lives here
   rather than being JS-injected so the strict CSP `style-src` (which
   has no `'unsafe-inline'`) can't drop it; an injected <style> tag
   with no nonce would let the overlay fall through to its default
   block layout and stay permanently visible. */
.upload-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.upload-overlay.visible { display: flex; }

.upload-modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    min-width: 300px;
}
.upload-modal h3 {
    margin: 0 0 20px 0;
    color: var(--color-primary);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--color-gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}
.progress-bar {
    height: 100%;
    background: var(--color-primary);
    width: 0%;
    transition: width 0.3s ease;
}

.upload-status {
    font-size: 0.9rem;
    color: var(--color-gray-600);
    margin: 0;
}

.upload-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-gray-200);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* Page Headers */
.page-header {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    padding: 30px 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.page-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.page-header p {
    color: var(--color-gray-600);
    font-size: 1rem;
}

/* Sections - base structural container with no padding */
.section,
.content-section {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    /* overflow: hidden removed to allow action dropdowns to display outside section bounds */
}

/* Section header - for title area with padding */
.section-header {
    padding: 25px 30px;
    border-bottom: 2px solid var(--color-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Section with content padding (for forms, not tables) */
.section-with-content {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    padding: 30px;
    /* overflow: hidden removed to allow action dropdowns to display outside section bounds */
}

/* Section title - used inside section-header or standalone */
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--color-text);
    margin: 0;
    padding: 0;
    border: none;
}

.section-title h3 {
    margin: 0;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
}

/* Info Notes */
.info-note {
    background: linear-gradient(135deg, var(--color-warning-light) 0%, #ffe8a1 100%);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    color: var(--color-warning-text);
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.info-note-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* ===============================================
   Form Layout Components
   =============================================== */

/* Main page container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Page header for management pages */
.page-header {
    background: white;
    border-radius: 12px;
    padding: 30px 40px;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 10;
}

.page-header-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.page-header-content p {
    color: #666;
    font-size: 1rem;
}

.page-header-content {
    flex: 1 1 300px;
}

/* Header actions container - for buttons in page headers */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
}

.header-actions .btn,
.header-actions .btn-create,
.header-actions .btn-secondary {
    white-space: nowrap;
}

/* Resource Actions container */
.resource-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.resource-actions .btn-primary {
    flex: 1;
}

/* Site card link styling */
.site-card-link {
    text-decoration: none;
    color: inherit;
}

.site-card-wrapper {
    position: relative;
}

/* Form header with gradient */
.form-header {
    background: var(--color-primary);
    color: white;
    padding: 40px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.form-header h2 {
    margin: 0;
    font-size: 2rem;
}

/* Form container - white box */
.form-container {
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 0;
}

/* Form content wrapper with padding */
.form-content {
    padding: 40px;
}

/* Section labels with green accent bar */
.section-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-label::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--color-button);
    border-radius: 2px;
}

/* Form sections with spacing */
.form-section {
    margin-bottom: 35px;
}

.form-section:last-child {
    margin-bottom: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .filter-group {
        width: 100%;
        min-width: 0;
    }
    
    .filter-group select,
    .filter-group input {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    
    .stats-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        padding: 20px 15px;
        justify-content: flex-start;
    }

    .page-header-content {
        text-align: center;
        width: 100%;
        flex: none;
    }

    .header-actions,
    .page-header-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .header-actions .btn,
    .header-actions .btn-create,
    .page-header-actions .btn,
    .page-header-actions .btn-create {
        width: 100%;
        text-align: center;
        margin-left: 0 !important;
    }

    .section,
    .content-section {
        margin-bottom: 20px;
    }
    
    .section-header {
        padding: 15px 20px;
    }
    
    .section-with-content {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    /* Card-based layout for tables on mobile */
    .table-wrapper {
        overflow: visible;
    }

    .data-table thead {
        display: none;
    }
    
    .data-table,
    .data-table tbody {
        display: block;
        width: 100%;
    }
    
    .data-table tbody tr {
        display: block;
        background: var(--color-bg-white);
        border: 1px solid var(--color-border-medium);
        border-radius: var(--radius-md);
        margin-bottom: 12px;
        padding: 15px;
        box-shadow: var(--shadow-sm);
    }
    
    .data-table tbody tr:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid var(--color-border-light);
        text-align: right;
        font-size: 0.9rem;
        word-break: break-word;
        min-width: 0;
    }
    
    .data-table td:last-child {
        border-bottom: none;
        padding-top: 12px;
        margin-top: 4px;
        justify-content: center;
    }
    
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--color-gray-700);
        text-align: left;
        flex-shrink: 0;
        margin-right: 15px;
    }
    
    .data-table td:last-child::before {
        content: none;
    }
    
    .data-table th:first-child,
    .data-table td:first-child {
        border-left: none;
        padding-left: 0;
        /* Reset desktop sticky-column styles */
        position: static;
        box-shadow: none;
        z-index: auto;
    }

    /* Checkbox-first-column: position checkbox in top-right of card */
    .data-table tbody tr:has(td:first-child .booking-checkbox) {
        position: relative;
        padding-top: 15px;
        padding-right: 40px;
    }

    .data-table td:first-child:has(.booking-checkbox) {
        position: absolute;
        top: 15px;
        right: 12px;
        width: auto;
        border: none;
        padding: 0;
        background: transparent;
        display: block;
    }

    .data-table td:first-child:has(.booking-checkbox)::before {
        content: none;
    }

    /* Multi-line cells (name + email, etc.) — stack label above content
       so <br> tags and long text wrap correctly */
    .data-table td.cell-primary {
        display: block;
        text-align: left;
    }

    .data-table td.cell-primary::before {
        display: block;
        margin-bottom: 4px;
    }

    .data-table td strong {
        word-break: break-word;
    }
    
    .btn,
    .btn-primary,
    .btn-submit,
    .btn-success,
    .btn-create,
    .btn-book,
    .btn-keep,
    .btn-danger,
    .btn-delete,
    .btn-cancel-booking,
    .btn-secondary,
    .btn-cancel,
    .btn-clear,
    .btn-reset,
    .btn-filter,
    .btn-action,
    .btn-edit,
    .btn-view,
    .btn-bookings {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* ===============================================
   Radio Card Options (for resource types, roles, etc.)
   =============================================== */
.option-cards {
    display: grid;
    gap: 12px;
    margin-bottom: 15px;
}

.option-card {
    position: relative;
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-card label {
    display: block;
    padding: 15px 20px;
    background: var(--color-gray-100);
    border: 2px solid var(--color-border-medium);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.option-card label:hover {
    background: var(--color-gray-200);
    border-color: var(--color-text);
}

.option-card input[type="radio"]:checked + label {
    background: #e8f4f8;
    border-color: var(--color-text);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.15);
}

.option-card label strong {
    display: block;
    color: var(--color-text);
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.option-card .option-description {
    display: block;
    font-size: 0.9rem;
    color: var(--color-gray-600);
    font-weight: normal;
}

/* ===============================================
   File Input Styling
   =============================================== */
.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    overflow: hidden;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--color-gray-100);
    border: 2px dashed var(--color-border-medium);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
}

.file-input-label:hover {
    background: var(--color-gray-200);
    border-color: var(--color-text);
}

.file-input-icon {
    font-size: 1.5rem;
}

.file-input-text {
    color: var(--color-gray-600);
    font-size: 0.95rem;
}

.file-input-text strong {
    color: var(--color-text);
}

.image-preview {
    display: none;
    margin-top: 15px;
    max-width: 300px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===============================================
   Form Row (Two Column Layout)
   =============================================== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

/* ===============================================
   Form Actions (Button Container)
   =============================================== */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--color-border-light);
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn-create,
    .form-actions .btn-cancel {
        width: 100%;
    }
}

/* ===============================================
   Details Grid (for confirmation/cancel pages)
   =============================================== */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-item {
    background: var(--color-gray-50);
    padding: 15px;
    border-radius: var(--radius-md);
}

.detail-label {
    font-size: 0.85rem;
    color: var(--color-gray-500);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-gray-800);
}

/* ===============================================
   Message Boxes (warning, info, error, success)
   =============================================== */
.warning-box,
.info-box,
.error-box,
.success-box {
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.warning-box {
    background: var(--color-warning-light);
    border-color: var(--color-warning);
    color: var(--color-warning-text);
}

.info-box {
    background: var(--color-info-light);
    border-color: var(--color-info);
    color: var(--color-info-text);
}

.error-box {
    background: var(--color-danger-light);
    border-color: var(--color-danger);
    color: var(--color-danger-text);
}

.success-box {
    background: var(--color-success-light);
    border-color: var(--color-success);
    color: var(--color-success-text);
}

.box-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.box-content h4 {
    font-weight: 600;
    margin-bottom: 5px;
}

.box-content p {
    margin: 0;
}

/* Public link display & copy button */
.public-link-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.public-link-url {
    background: rgba(255, 255, 255, 0.6);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    word-break: break-all;
    flex: 1;
    min-width: 0;
}

.btn-copy-inline {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text);
    background: white;
    border: 1px solid var(--color-text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.btn-copy-inline:hover {
    background: var(--color-primary);
    color: white;
}

/* Public link in flash messages */
.public-link-message {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.public-link-message .public-link-url {
    background: rgba(255, 255, 255, 0.5);
}

.public-link-message .btn-copy-inline {
    font-size: 0.75rem;
    padding: 4px 10px;
}

/* ===============================================
   Action Pages (Cancel, Confirm, Delete)
   Consistent styling for all action/confirmation pages
   =============================================== */

/* Action container - white card body, paired with .container + .page-header above */
.action-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.action-content {
    padding: 40px;
}

/* Action details — content section inside .action-container, no own card */
.action-details {
    margin-bottom: 30px;
}

.action-details:last-child {
    margin-bottom: 0;
}

.action-details h4 {
    color: var(--color-text);
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--color-border-light);
}

/* Details grid for action pages */
.action-details .details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 0;
}

.action-details .detail-item {
    background: white;
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-medium);
}

.action-details .detail-label {
    font-weight: 600;
    color: var(--color-gray-600);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-details .detail-value {
    color: var(--color-text);
    font-size: 1.05rem;
    font-weight: 500;
}

/* Action form actions - button bar at bottom */
.action-form-actions {
    display: flex;
    gap: 15px;
    padding: 30px 40px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-top: 2px solid var(--color-border-light);
}

.action-form-actions .btn-primary,
.action-form-actions .btn-danger,
.action-form-actions .btn-success,
.action-form-actions .btn-secondary,
.action-form-actions .btn-submit,
.action-form-actions .btn-edit {
    flex: 1;
    padding: 16px 40px;
    font-size: 1.05rem;
    text-align: center;
}

/* Responsive for action pages */
@media (max-width: 768px) {
    .action-page {
        padding: 20px 10px;
    }
    
    .action-header {
        padding: 30px 20px;
    }
    
    .action-header h2 {
        font-size: 1.8rem;
    }
    
    .action-content {
        padding: 30px 20px;
    }
    
    .action-details .details-grid {
        grid-template-columns: 1fr;
    }
    
    .action-form-actions {
        flex-direction: column;
        padding: 20px;
    }
    
    .action-form-actions .btn-primary,
    .action-form-actions .btn-danger,
    .action-form-actions .btn-success,
    .action-form-actions .btn-secondary,
    .action-form-actions .btn-submit,
    .action-form-actions .btn-edit {
        width: 100%;
    }
}

/* ===============================================
   Card Sections (users, groups, timeslots sections)
   =============================================== */
.card-section {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-section-header {
    padding: 25px 30px;
    border-bottom: 2px solid var(--color-border-light);
}

.card-section-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--color-text);
    margin: 0;
}

.card-section-content {
    padding: 0;
}

/* ===============================================
   Form Input Variants
   =============================================== */
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--color-border-medium);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-normal);
    font-family: 'Inter', 'Roboto', sans-serif;
    background: var(--color-bg-white);
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-text);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

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

.form-help {
    font-size: 0.85rem;
    color: var(--color-gray-600);
    margin-top: 5px;
    display: block;
}

/* Inline checkbox + text label inside a `.form-group`. Used on every
   admin form that has a single boolean toggle (e.g. "Active",
   "Track stock", "Allow backorder").

   Specificity note: `.form-group label { display: block }` in this
   stylesheet has specificity 0,1,1 — a plain `.form-checkbox-row`
   (0,1,0) loses to it, so we match with `label.form-checkbox-row`
   (0,1,1) and rely on cascade order. The checkbox itself also has
   to dodge the `.form-group input { width: 100% }` rule below, hence
   the slightly heavier selector for its width reset. Originally
   defined in create_edit_purchase_item.html; promoted here so the
   shipping form (and every future single-checkbox form) can reuse it
   without re-declaring the rules. */
label.form-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.form-group input[type="checkbox"].form-checkbox-row-input,
label.form-checkbox-row input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex: 0 0 auto;
    padding: 0;
    border-width: 0;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-label.required::after {
    content: ' *';
    color: var(--color-danger);
}

/* ===============================================
   Error Lists (for form validation)
   =============================================== */
.errorlist {
    list-style: none;
    padding: 10px 15px;
    background: var(--color-danger-light);
    color: var(--color-danger-text);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

/* Tag-aware variants — `errorlist` is reused for non-error messages
   (e.g. "you have been logged out successfully"); these classes let
   the same container render in green/blue/amber instead of red. */
.errorlist.is-success {
    background: var(--color-success-light);
    color: var(--color-success-text);
}

.errorlist.is-info {
    background: var(--color-info-light);
    color: var(--color-info-text);
}

.errorlist.is-warning {
    background: var(--color-warning-light);
    color: var(--color-warning-text);
}

.errorlist li {
    margin: 5px 0;
}

/* ===============================================
   Account/Role Badges
   =============================================== */
.account-badge {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

.account-admin {
    background: #e8d5f4;
    color: #6f42c1;
}

.account-staff {
    background: var(--color-info-light);
    color: var(--color-info-text);
}

.account-user {
    background: var(--color-success-light);
    color: var(--color-success-text);
}

/* ===============================================
   Member Count Badge
   =============================================== */
.member-count {
    background: #e7f3ff;
    color: #004085;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

/* ===============================================
   Danger Zone (for delete sections)
   =============================================== */
.danger-zone {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--color-border-light);
}

.danger-card {
    background: var(--color-danger-light);
    border: 1px solid var(--color-danger);
    border-radius: var(--radius-md);
    padding: 20px;
}

.danger-card h4 {
    color: var(--color-danger);
    margin-bottom: 10px;
}

.danger-card p {
    color: var(--color-danger-text);
    margin-bottom: 15px;
}

/* ===============================================
   Back Links
   =============================================== */
.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.back-link-container {
    margin-top: 20px;
}

@media (max-width: 768px) {
    .back-link-container .btn-cancel,
    .back-link-container .btn-secondary {
        width: 100%;
    }
}

/* ===============================================
   Bulk Actions Bar (for delete pages, manage pages)
   =============================================== */
.bulk-actions-bar {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    padding: 20px 30px;
    background: var(--color-gray-100);
    border-top: 1px solid var(--color-border-medium);
}

.selected-count {
    color: var(--color-gray-600);
    font-weight: 500;
}

.bulk-actions-spacer {
    flex-grow: 1;
}

/* ===============================================
   Checkbox/Toggle Labels
   =============================================== */
.checkbox-label,
.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"],
.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ===============================================
   Toggle Switch (iOS-style sliding toggle)
   =============================================== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-gray-300);
    border-radius: 20px;
    transition: var(--transition-fast);
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition-fast);
}

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

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

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* Variant: success color when checked */
.toggle-switch.toggle-success input:checked + .toggle-slider {
    background-color: var(--color-success);
}

/* ===============================================
   Header Actions (button groups in page headers)
   =============================================== */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-actions > * {
        width: 100%;
    }
}

/* ===============================================
   Settings Toggle Row (for org settings, etc.)
   =============================================== */
.settings-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--color-gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-gray-200);
}

.settings-toggle-row.disabled {
    background: var(--color-warning-light);
    border-color: var(--color-warning);
}

.settings-toggle-row .toggle-content {
    flex: 1;
}

.settings-toggle-row .toggle-content label {
    font-weight: 600;
    color: var(--color-gray-900);
    cursor: pointer;
    display: block;
}

.settings-toggle-row .toggle-content .toggle-description {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--color-gray-600);
}

/* ===============================================
   Checkbox List (for selecting multiple items)
   =============================================== */
.checkbox-list {
    background: var(--color-gray-100);
    border-radius: var(--radius-md);
    padding: 15px;
}

.checkbox-list .checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
}

.checkbox-list .checkbox-item:not(:last-child) {
    border-bottom: 1px solid var(--color-gray-200);
}

.checkbox-list .checkbox-item input[type="checkbox"] {
    margin-right: 10px;
}

/* ===============================================
   Info Highlight Box (for important messages within content)
   =============================================== */
.info-highlight {
    margin-bottom: 10px;
    padding: 10px;
    background: var(--color-info-light);
    border-radius: 6px;
}

/* ===============================================
   Inline Tags/Badges (small labels)
   =============================================== */
.inline-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.inline-tag-info {
    background: var(--color-info-light);
    color: var(--color-text);
}

.inline-tag-success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.inline-tag-warning {
    background: var(--color-warning-light);
    color: var(--color-warning-text);
}

.inline-tag-muted {
    background: var(--color-gray-100);
    color: var(--color-gray-600);
}

/* ===============================================
   Role Badge (for user roles in cards)
   =============================================== */
.role-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--color-info-light);
    color: var(--color-info);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===============================================
   Invitation Card
   =============================================== */
.invitation-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.invitation-card h4 {
    color: var(--color-text);
    margin-bottom: 10px;
}

.invitation-card .invitation-details {
    font-size: 0.9rem;
    color: var(--color-gray-600);
    margin-bottom: 15px;
}

.invitation-card .invitation-details div {
    margin-bottom: 4px;
}

/* ===============================================
   Invitations Grid
   =============================================== */
.invitations-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

@media (max-width: 768px) {
    .bulk-actions-bar {
        padding: 15px;
        gap: 10px;
    }

    .bulk-actions-spacer {
        display: none;
    }

    .bulk-actions-bar .btn-sm {
        flex: 1;
        min-width: 120px;
    }
}

/* ===============================================
   User Dropdown Menu (Desktop)
   =============================================== */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-dropdown-toggle .user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-dropdown-toggle .dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.user-dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mobile: compact user dropdown - hide name, show only avatar */
@media (max-width: 768px) {
    .user-dropdown-toggle {
        padding: 6px 10px;
        gap: 4px;
    }

    .user-dropdown-toggle .user-name {
        display: none;
    }

    .user-dropdown-toggle .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .user-dropdown-toggle .dropdown-arrow {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .user-dropdown-toggle {
        padding: 5px 8px;
    }

    .user-dropdown-toggle .user-avatar {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999;
}

.user-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 16px;
    background: var(--color-primary);
    color: white;
}

.user-dropdown-header .user-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.user-dropdown-header .user-email {
    font-size: 0.85rem;
    opacity: 0.8;
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.user-dropdown-menu a:last-child {
    border-bottom: none;
}

.user-dropdown-menu a:hover {
    background: #f8f9fa;
    color: var(--color-text);
}

.user-dropdown-menu .logout-link {
    color: #dc3545;
}

.user-dropdown-menu .logout-link:hover {
    background: #fff5f5;
    color: #c82333;
}

/* ===============================================
   Mobile Bottom Navigation
   =============================================== */
.mobile-bottom-nav {
    display: none;
}

.mobile-nav-backdrop {
    display: none;
}

.public-anon-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    /* On mobile the public anon buttons collapse into the floating
       bottom nav rendered by the submenu block — hide the header copy. */
    .public-anon-header-actions {
        display: none;
    }

    /* Show mobile bottom nav */
    .mobile-bottom-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: transparent;
        box-shadow: none;
        z-index: 10000;
        padding: 10px 15px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .mobile-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 12px 20px;
        background: var(--color-primary);
        border: none;
        border-radius: 12px;
        color: white;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }

    .mobile-nav-toggle:hover,
    .mobile-nav-toggle.active {
        background: var(--color-primary-dark);
    }

    .mobile-nav-toggle .nav-icon {
        font-size: 1.2rem;
    }

    .mobile-nav-toggle .nav-arrow {
        transition: transform 0.3s ease;
        font-size: 0.8rem;
    }

    .mobile-nav-toggle.active .nav-arrow {
        transform: rotate(180deg);
    }

    /* Dropup menu */
    .mobile-nav-dropup {
        position: absolute;
        bottom: 100%;
        left: 15px;
        right: 15px;
        background: var(--color-primary);
        border-radius: 16px;
        margin-bottom: 10px;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition: all 0.3s ease;
        pointer-events: none;
    }

    .mobile-nav-dropup.active {
        max-height: 70vh;
        max-height: 70dvh;
        opacity: 1;
        pointer-events: auto;
        overflow-y: auto;
    }

    .mobile-nav-dropup a {
        display: block;
        text-align: center;
        padding: 16px 20px;
        color: rgba(255, 255, 255, 0.9);
        text-decoration: none;
        font-size: 1rem;
        font-weight: 500;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.2s ease;
    }

    .mobile-nav-dropup a:last-child {
        border-bottom: none;
    }

    .mobile-nav-dropup a:hover,
    .mobile-nav-dropup a:active {
        background: rgba(255, 255, 255, 0.1);
    }

    .mobile-nav-dropup a.active {
        background: rgba(66, 153, 225, 0.3);
        color: #fff;
        font-weight: 600;
    }

    /* Add padding to body to account for fixed bottom nav */
    body {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    /* Backdrop overlay when menu is open */
    .mobile-nav-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
    }

    .mobile-nav-backdrop.active {
        display: block;
    }
}

/* ============================================
   CALENDAR COMPONENTS - Unified Styles
   Used by: resource_detail, manage_bookings, send_email
   ============================================ */

/* Calendar Section Container */
.calendar-section {
    margin-bottom: 20px;
}

.calendar-section-inline {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-light);
}

/* Calendar Header Row */
.calendar-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.calendar-header-row h4 {
    margin: 0;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 600;
}

/* Calendar Controls & Navigation */
.calendar-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.calendar-nav,
.month-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
    padding: 15px;
    background: var(--color-gray-100);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.calendar-nav-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Month/Week Display */
.week-display,
.month-display {
    font-weight: 600;
    color: var(--color-text);
    min-width: 160px;
    text-align: center;
    font-size: 1rem;
}

/* Small button variant for calendar navigation */
.btn-sm {
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    white-space: nowrap;
}

/* Calendar Grid Container */
.calendar-grid-container {
    min-height: 150px;
}

/* Calendar Loading State */
.calendar-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--color-gray-600);
}

/* Calendar Table (Week View) */
.calendar-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 450px;
    margin-bottom: 15px;
    overscroll-behavior-x: none;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.calendar-table th,
.calendar-table td {
    border: 1px solid var(--color-border-medium);
    padding: 8px;
    text-align: center;
    vertical-align: top;
}

.calendar-table th {
    background: var(--color-gray-100);
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.85rem;
    position: sticky;
    top: 0;
    z-index: 2;
}

.calendar-table th.date-header {
    min-width: 80px;
}

.calendar-table th.date-header.is-today {
    background: var(--color-info-light);
    color: var(--color-text);
}

.calendar-table th .date-day {
    display: block;
    font-size: 1rem;
}

.calendar-table th .date-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
}

/* Combined site/resource header row (sticky below thead) */
.calendar-table tr.resource-header-row {
    position: sticky;
    z-index: 1;
}

.calendar-table tr.resource-header-row td {
    background: var(--color-gray-50);
    padding: 0;
    border-left: 3px solid var(--color-primary);
    overflow: hidden;
}

.calendar-table tr.resource-header-row .resource-header-content {
    padding: 6px 10px;
    background: var(--color-gray-50);
}

.calendar-table tr.resource-header-row .header-site-name {
    float: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-dark);
}

.calendar-table tr.resource-header-row .header-resource-name {
    float: right;
    font-weight: 500;
    color: var(--color-text);
}

.calendar-table tr.resource-header-row.site-first td {
    border-top: 2px solid var(--color-primary);
}

.calendar-table td.timeslot-cell {
    padding: 4px;
    vertical-align: top;
}

.calendar-table td.timeslot-cell.is-past {
    background: var(--color-gray-100);
    opacity: 0.6;
}

/* Timeslot Chips (Week View) */
.timeslot-chips {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: visible;
}

.timeslot-chip {
    position: relative;
    display: block;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    border: 2px solid transparent;
}

.timeslot-chip:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.timeslot-chip.selected {
    border-color: var(--color-text);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.2);
}

.timeslot-chip.available {
    background: var(--color-success-light);
    color: var(--color-success-text);
}

.timeslot-chip.partial {
    background: var(--color-warning-light);
    color: var(--color-warning-text);
}

.timeslot-chip.full {
    background: var(--color-danger-light);
    color: var(--color-danger-text);
}

.timeslot-chip.paused {
    background: var(--color-gray-200);
    color: var(--color-gray-600);
}

.timeslot-chip .chip-time {
    font-weight: 600;
    display: block;
}

.timeslot-chip .chip-capacity {
    font-size: 0.7rem;
    opacity: 0.85;
}

/* Timeslot Actions Panel (shown when a timeslot is selected) */
.timeslot-actions-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 15px;
    margin-bottom: 15px;
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-md);
}

.timeslot-actions-info {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-dark);
}

.timeslot-actions-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.timeslot-actions-buttons .btn-sm {
    text-decoration: none;
    white-space: nowrap;
}

.timeslot-actions-buttons .btn-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 600px) {
    .timeslot-actions-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .timeslot-actions-buttons {
        flex-wrap: wrap;
    }

    .timeslot-actions-buttons .btn-sm {
        flex: 1;
        text-align: center;
        min-width: 0;
        white-space: normal;
    }
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--color-gray-600);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-dot.available {
    background: var(--color-success-light);
    border: 1px solid var(--color-success);
}

.legend-dot.partial {
    background: var(--color-warning-light);
    border: 1px solid var(--color-warning);
}

.legend-dot.full {
    background: var(--color-danger-light);
    border: 1px solid var(--color-danger);
}

.legend-dot.paused {
    background: var(--color-gray-200);
    border: 1px solid var(--color-gray-500);
}

/* Calendar Empty State */
.calendar-empty {
    text-align: center;
    padding: 40px;
    color: var(--color-gray-600);
}

.no-timeslots {
    color: var(--color-gray-400);
    font-size: 0.8rem;
    font-style: italic;
}

/* Month Calendar Grid (resource_detail) */
.calendar-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 30px;
    margin-top: 20px;
}

.calendar-wrapper {
    background: var(--color-gray-100);
    border-radius: var(--radius-md);
    padding: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.calendar-header {
    text-align: center;
    font-weight: 600;
    color: var(--color-gray-600);
    padding: 10px 5px;
    font-size: 0.85rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: white;
    position: relative;
    min-height: 36px;
}

.calendar-day:hover:not(.calendar-day-empty):not(.calendar-day-past) {
    background: var(--color-info-light);
    transform: scale(1.05);
}

.calendar-day-empty {
    background: transparent;
    cursor: default;
}

.calendar-day-today {
    border: 2px solid var(--color-text);
}

.calendar-day-selected {
    background: var(--color-primary) !important;
    color: white !important;
}

.calendar-day-selected .day-number {
    color: white !important;
}

.calendar-day-selected .slot-indicator {
    background: white !important;
    color: var(--color-text) !important;
}

.calendar-day-past {
    opacity: 0.4;
    cursor: not-allowed;
}

.calendar-day-has-slots {
    background: var(--color-success-light);
}

.day-number {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
}

.slot-indicator {
    font-size: 0.7rem;
    background: var(--color-success);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    margin-top: 3px;
}

/* Day Details Panel (resource_detail) */
.day-details-panel {
    background: var(--color-gray-100);
    border-radius: var(--radius-md);
    padding: 25px;
    min-height: 400px;
}

.day-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--color-gray-300);
}

.day-details-header h3 {
    font-size: 1.3rem;
    color: var(--color-text);
    margin: 0;
}

.day-details-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-gray-500);
    padding: 5px;
    line-height: 1;
}

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

.day-slots-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.select-day-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-gray-500);
}

.select-day-message .icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

/* Calendar Mobile Responsive */
@media (max-width: 768px) {
    .calendar-container {
        grid-template-columns: 1fr;
    }

    .day-details-panel {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .calendar-wrapper {
        padding: 15px;
    }
    
    .calendar-day {
        min-height: 40px;
    }
    
    .day-number {
        font-size: 0.85rem;
    }
    
    .slot-indicator {
        font-size: 0.6rem;
        padding: 1px 4px;
    }
    
    /* Month/week navigation mobile styles */
    .calendar-nav,
    .month-navigation {
        gap: 10px;
        padding: 12px;
    }
    
    .week-display,
    .month-display {
        font-size: 0.9rem;
        min-width: 120px;
    }
    
    /* Hide text labels on mobile, show icons only */
    .calendar-nav .btn-text,
    .month-navigation .btn-text {
        display: none;
    }
    
    .calendar-nav .btn-sm,
    .month-navigation .btn-secondary {
        padding: 10px 14px !important;
    }
}

/* ============================================
   EXTRA SMALL SCREENS (max-width: 480px)
   Tighter padding for very small mobile devices
   ============================================ */
@media (max-width: 480px) {
    /* Reduce action page padding further */
    .action-page {
        padding: 15px 8px;
    }
    
    .action-container {
        padding: 15px;
    }
    
    .action-header {
        padding: 25px 15px;
    }
    
    .action-header h2 {
        font-size: 1.5rem;
    }
    
    .action-header p {
        font-size: 0.9rem;
    }
    
    .action-content {
        padding: 15px 10px;
    }
    
    .action-details {
        padding: 12px;
        margin: 12px 0;
    }
    
    .action-details h4 {
        font-size: 1.1rem;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .action-details .detail-item {
        padding: 12px;
    }
    
    .action-details .detail-label {
        font-size: 0.8rem;
    }
    
    .action-details .detail-value {
        font-size: 0.95rem;
    }
    
    /* Form components */
    .form-content {
        padding: 20px 15px;
    }
    
    .form-header {
        padding: 25px 15px;
    }
    
    .form-container {
        margin: 10px;
    }
    
    /* Timeline/slider container */
    .timeline-container {
        padding: 15px 10px;
    }
    
    /* Booking summary */
    .booking-summary-card {
        padding: 15px;
    }
    
    /* Buttons */
    .action-form-actions {
        padding: 15px;
        gap: 10px;
    }
}

/* ============================================
   TIMESLOT CREATION - Multi-day Options
   ============================================ */

/* Fix for multi-day options container to properly contain
   dynamically generated conflict list content */
#multi-day-options {
    display: flow-root;
}

/* Ensure the multi-day conflict slider container clips its content */
#multi-day-conflict-slider {
    overflow: visible;
}

/* Make the multi-day timeline scrollable when content is too tall */
#multi-day-timeline {
    max-height: 350px;
    overflow-y: auto;
}

/* Refresh button for preview sections */
.refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    background: var(--color-gray-100);
    color: var(--color-gray-600);
    cursor: pointer;
    transition: var(--transition-fast);
    margin-left: 8px;
    vertical-align: middle;
}

.refresh-btn:hover {
    background: var(--color-primary-light);
    border-color: var(--color-text);
    color: var(--color-text);
}

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

.refresh-btn.spinning svg {
    animation: spin 0.8s linear infinite;
}

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

/* Label with refresh button container */
.label-with-refresh {
    display: flex;
    align-items: center;
}

/* ============================================
   AUTH PAGES - Common Styles for Login/Signup
   Used by standalone auth pages (not using base.html)
   ============================================ */

/* Auth page setup - full height html element, also receives the background gradient
   so it always paints the full canvas (works reliably in PWA standalone mode) */
html.auth-page {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Body handles the flexbox centering, overflow hidden prevents page scroll */
html.auth-page body {
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
}

/* Auth container - the white box */
.auth-container {
    background: var(--color-bg-white);
    padding: 35px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: calc(100% - 40px);
    margin: 20px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
}

/* Wider variant for forms with more content */
.auth-container--wide {
    max-width: 500px;
}

/* Auth header - centered title area */
.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--color-text);
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--color-gray-600);
    font-size: 1rem;
}

/* Mobile responsive styles for auth containers */
@media (max-width: 768px) {
    .auth-container {
        padding: 30px 25px;
        margin: 20px;
        width: calc(100% - 40px);
        max-height: calc(100vh - 40px);
        max-height: calc(100dvh - 40px);
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }
}

/* ============================================
   SHARED SOCIAL AUTH BUTTONS
   ============================================ */

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-google,
.btn-microsoft,
.btn-apple {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 16px;
    background: var(--color-bg-white);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-gray-700);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.btn-google:hover,
.btn-microsoft:hover,
.btn-apple:hover {
    background: var(--color-gray-50);
    border-color: var(--color-gray-400);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-google svg,
.btn-microsoft svg,
.btn-apple svg {
    width: 20px;
    height: 20px;
}

/* Email-toggle pill — visually matches social buttons */
.email-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    background: transparent;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-gray-700);
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-normal);
    text-decoration: none;
    box-sizing: border-box;
    margin-top: 10px;
}

.email-toggle:hover {
    background: var(--color-gray-50);
    border-color: var(--color-gray-400);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.email-toggle .toggle-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.7rem;
}

.email-toggle .toggle-arrow.rotated {
    transform: rotate(180deg);
}

/* Slide-toggle wrapper for the email form section */
.auth-section {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

.auth-section.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.auth-section.expanded {
    max-height: 800px;
    opacity: 1;
}

/* Breathing room between the "Sign in with email" toggle button and
   the form fields below. Scoped to the section that immediately
   follows a toggle so the OAuth-buttons section (also `.auth-section`,
   but with no toggle above it) keeps its existing flush-top layout.
   `box-sizing: border-box` lets `max-height: 0` clip the padding
   cleanly when collapsed; the gap only appears once expanded. */
.email-toggle + .auth-section {
    box-sizing: border-box;
    padding-top: 18px;
}

.or-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0 10px;
    color: var(--color-gray-400);
    font-size: 0.8rem;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--color-gray-300);
}

.or-divider::before {
    margin-right: 12px;
}

.or-divider::after {
    margin-left: 12px;
}

/* ============================================
   VARIANT PICKER — per-axis option pills
   Used by the shop card and product detail page so buyers can pick
   each axis (Size, Colour, …) separately. Matches the look-and-feel
   of mainstream e-commerce variant pickers.
   ============================================ */

.option-axis {
    margin-bottom: 12px;
}

.option-axis:last-child {
    margin-bottom: 0;
}

.option-axis-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-gray-600);
    margin-bottom: 6px;
}

.option-axis-label .option-axis-value {
    font-weight: 600;
    color: var(--color-gray-900);
}

.option-axis-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.option-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--color-bg-white);
    border: 1.5px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-gray-800);
    cursor: pointer;
    transition: border-color var(--transition-fast),
                background var(--transition-fast),
                color var(--transition-fast);
    user-select: none;
    line-height: 1.2;
}

.option-pill:hover:not(:disabled):not(.is-selected) {
    border-color: var(--color-text);
    color: var(--color-text);
}

.option-pill.is-selected {
    background: var(--color-text);
    color: var(--color-bg-white);
    border-color: var(--color-text);
}

/* Variant exists but is sold out — clickable so the user can see what
   they picked but the Add button is disabled. */
.option-pill.is-sold-out {
    opacity: 0.6;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    background: repeating-linear-gradient(
        135deg,
        var(--color-bg-white) 0 6px,
        var(--color-gray-100) 6px 12px
    );
}

.option-pill.is-sold-out.is-selected {
    background: var(--color-gray-500);
    color: var(--color-bg-white);
    border-color: var(--color-gray-500);
}

/* No variant exists for this combination — fully disabled. */
.option-pill.is-unavailable {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    background: var(--color-gray-100);
    color: var(--color-gray-500);
}

.option-pill.is-unavailable:hover {
    border-color: var(--color-gray-300);
    color: var(--color-gray-500);
}

/* Compact variant for the shop-card grid where horizontal space is
   tight; pulls font + padding in a notch. */
.option-axis.is-compact {
    margin-bottom: 8px;
}

.option-axis.is-compact .option-axis-label {
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.option-axis.is-compact .option-pill {
    padding: 4px 10px;
    font-size: 0.82rem;
    border-width: 1px;
}

/* ============================================
   UTILITY CLASSES - Common Helpers
   ============================================ */

/* Text Colors */
.text-danger {
    color: var(--color-danger);
}

.text-danger-text {
    color: var(--color-danger-text);
}

.text-success {
    color: var(--color-success);
}

.text-warning {
    color: var(--color-warning-text);
}

.text-info {
    color: var(--color-info);
}

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

/* Text Styles */
.text-bold {
    font-weight: 600;
}

/* Margin/Padding Utilities */
.no-margin {
    margin: 0;
}

.mt-20 {
    margin-top: 20px;
}

/* Section Subtitle */
.section-subtitle {
    color: var(--color-gray-600);
    margin: 0 0 20px 0;
}

/* Detail Item Spaced Variant */
.detail-item--spaced {
    margin-top: 20px;
}

/* Table Container Styled Variant */
.table-container--styled {
    background: white;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
}

/* Warning Box Spaced Variant */
.warning-box--spaced {
    margin-top: 20px;
}

/* ==========================================
   Global Search Modal (Ctrl+K / Cmd+K)
   ========================================== */

.search-trigger {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.search-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    backdrop-filter: blur(2px);
}

.search-modal-backdrop.open {
    display: flex;
}

.search-modal {
    background: white;
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 580px;
    max-width: 94vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: searchModalIn 0.15s ease-out;
}

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

.search-modal-header {
    padding: 4px;
    border-bottom: 1px solid var(--color-gray-200, #e5e7eb);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}

.search-input-icon {
    color: var(--color-gray-400, #9ca3af);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--color-gray-800, #1f2937);
    background: transparent;
    padding: 4px 0;
}

.search-input::placeholder {
    color: var(--color-gray-400, #9ca3af);
}

.search-escape-hint {
    background: var(--color-gray-100, #f3f4f6);
    color: var(--color-gray-500, #6b7280);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--color-gray-200, #e5e7eb);
    font-family: inherit;
    flex-shrink: 0;
}

.search-results {
    overflow-y: auto;
    max-height: calc(70vh - 60px);
}

.search-hint,
.search-empty,
.search-loading {
    padding: 32px 24px;
    text-align: center;
    color: var(--color-gray-500, #6b7280);
}

.search-hint p {
    margin: 0 0 4px 0;
}

.search-hint-shortcut {
    font-size: 0.85rem;
    color: var(--color-gray-400, #9ca3af);
}

.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.search-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--color-gray-200, #e5e7eb);
    border-top: 3px solid var(--color-text, #1e3a5f);
    border-radius: 50%;
    animation: searchSpin 0.7s linear infinite;
}

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

.search-empty p {
    margin: 0;
}

.search-result-group {
    padding: 8px 0;
}

.search-result-group:not(:last-child) {
    border-bottom: 1px solid var(--color-gray-100, #f3f4f6);
}

.search-result-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 16px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gray-500, #6b7280);
}

.search-result-group-icon {
    font-size: 0.85rem;
}

.search-result-group-count {
    margin-left: auto;
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--color-gray-400, #9ca3af);
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.1s ease;
}

.search-result-item:hover,
.search-result-item.selected {
    background: var(--color-gray-50, #f9fafb);
}

.search-result-item.selected {
    background: var(--color-primary-light, #2d5282);
}

.search-result-item-content {
    flex: 1;
    min-width: 0;
}

.search-result-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-gray-800, #1f2937);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item-subtitle {
    font-size: 0.8rem;
    color: var(--color-gray-500, #6b7280);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item-arrow {
    color: var(--color-gray-300, #d1d5db);
    font-size: 1.4rem;
    margin-left: 8px;
    flex-shrink: 0;
}

.search-result-item:hover .search-result-item-arrow,
.search-result-item.selected .search-result-item-arrow {
    color: var(--color-gray-500, #6b7280);
}

@media (max-width: 768px) {
    .search-modal-backdrop {
        padding-top: 5vh;
    }

    .search-modal {
        max-height: 80vh;
    }

    .search-results {
        max-height: calc(80vh - 60px);
    }
}

/* ===== Welcome / Onboarding Modal ===== */
.welcome-modal-root .welcome-modal-backdrop,
.welcome-modal-root .welcome-modal-chip {
    display: none;
}

.welcome-modal-root.is-open .welcome-modal-backdrop {
    display: flex;
}

.welcome-modal-root.is-minimized .welcome-modal-chip {
    display: inline-flex;
}

.welcome-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 10050;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.welcome-modal {
    background: white;
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 560px;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: welcomeModalIn 0.18s ease-out;
}

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

.welcome-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-gray-200);
    background: var(--color-button-light);
}

.welcome-modal-title {
    margin: 0;
    font-size: 1.35rem;
    color: var(--color-text-dark);
    font-weight: 600;
}


.welcome-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
}

.welcome-modal-intro {
    margin: 0 0 18px;
    color: var(--color-gray-700);
    line-height: 1.5;
}

.welcome-modal-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.welcome-modal-checklist li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.welcome-modal-checklist li:hover {
    border-color: var(--color-button);
    background: var(--color-button-light);
}

.welcome-modal-checklist a {
    font-weight: 600;
    color: var(--color-text-dark);
    text-decoration: none;
}

.welcome-modal-checklist a:hover {
    color: var(--color-button-dark);
}

.welcome-modal-item-desc {
    font-size: 0.875rem;
    color: var(--color-gray-600);
    line-height: 1.4;
}

.welcome-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--color-gray-50, #f9fafb);
}

@media (max-width: 600px) {
    .welcome-modal {
        max-height: 95vh;
    }
    .welcome-modal-header,
    .welcome-modal-body,
    .welcome-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    .welcome-modal-title {
        font-size: 1.15rem;
    }
}

/* Minimized chip — pinned to bottom-right of the viewport on desktop,
 * collapsed to a label-less icon button hugging the right edge on mobile. */
.welcome-modal-chip {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10050;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--color-button);
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    animation: welcomeChipIn 0.18s ease-out;
}

.welcome-modal-chip:hover {
    background: var(--color-button-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.welcome-modal-chip svg {
    flex-shrink: 0;
}

.welcome-modal-chip-label {
    white-space: nowrap;
}

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

@media (max-width: 600px) {
    .welcome-modal-chip {
        bottom: 50%;
        right: 0;
        transform: translateY(50%);
        padding: 12px 10px;
        border-radius: var(--radius-md) 0 0 var(--radius-md);
        box-shadow: -4px 4px 16px rgba(0, 0, 0, 0.18);
    }
    .welcome-modal-chip:hover {
        transform: translateY(50%) translateX(-2px);
    }
    .welcome-modal-chip-label {
        display: none;
    }
}

/* Searchable User Select (single- and multi-select variants) */
.user-search-select {
    position: relative;
    width: 100%;
}

.user-search-input {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: border-color var(--transition-fast);
    background-color: var(--color-bg-white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.user-search-input:focus {
    outline: none;
    border-color: var(--color-text);
}

.user-search-input.has-selection {
    border-color: var(--color-success);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2328a745' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.user-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    background: var(--color-bg-white);
    border: 2px solid var(--color-text);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-md);
}

.user-search-dropdown.open {
    display: block;
}

.user-search-option {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition-fast);
}

.user-search-option:last-child {
    border-bottom: none;
}

.user-search-option:hover,
.user-search-option.highlighted {
    background: var(--color-bg-hover);
}

.user-search-option.selected {
    background: var(--color-primary);
    color: white;
}

.user-search-option .user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-search-option .user-email {
    font-size: 0.8rem;
    color: var(--color-gray-500);
}

.user-search-option:hover .user-email,
.user-search-option.highlighted .user-email {
    color: var(--color-gray-600);
}

.user-search-option.selected .user-email {
    color: rgba(255, 255, 255, 0.8);
}

.user-search-no-results {
    padding: 15px;
    text-align: center;
    color: var(--color-gray-500);
    font-style: italic;
}

/* Multi-select chip variant */
.user-search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.user-search-chips:empty {
    display: none;
}

.user-search-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 10px;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.3;
}

.user-search-chip-label {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-search-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background var(--transition-fast);
}

.user-search-chip-remove:hover,
.user-search-chip-remove:focus {
    background: rgba(255, 255, 255, 0.4);
    outline: none;
}

/* ─── Funnel tabs (Phase 4) ───────────────────────────────────
   User-facing booking-funnel switcher (Spaces / Services / Events).
   Sits at the top of each funnel landing page, auto-hidden by the
   _funnel_tabs.html include when fewer than two funnels have content.
   Visual language matches the existing top-level submenu strip but
   sized down to a secondary nav so it doesn't compete with the
   Dashboard / Bookings / Timeslots primary nav. */
.funnel-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--color-gray-200);
    padding-bottom: 0;
    /* `overflow-x: auto` alone implicitly turns overflow-y from
       visible to auto (CSS spec), causing a phantom vertical
       scrollbar even when content fits. Pin overflow-y explicitly
       to hidden so only horizontal scroll fires when tabs overflow
       on narrow screens. */
    overflow-x: auto;
    overflow-y: hidden;
}

.funnel-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: var(--color-gray-700);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--transition-fast),
                border-color var(--transition-fast),
                background var(--transition-fast);
    white-space: nowrap;
}

.funnel-tab:hover {
    color: var(--color-text);
    background: var(--color-gray-100);
}

.funnel-tab--active {
    color: var(--color-text);
    border-bottom-color: var(--color-button);
    font-weight: 600;
}

.funnel-tab--active:hover {
    background: transparent;
}

@media (max-width: 600px) {
    .funnel-tab {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
}

/* Resource card type badge — Phase 4 funnel-as-filter unified
   listing. The badge identifies whether each card is a Space, a
   Service, or an Event so the user can scan a mixed list without
   reading every card. Sits above the card title. */
.resource-type-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.resource-type-badge--resource {
    background: var(--color-info-light);
    color: var(--color-info-text);
}

.resource-type-badge--service {
    background: var(--color-success-light);
    color: var(--color-success-text);
}

.resource-type-badge--event {
    background: var(--color-warning-light);
    color: var(--color-warning-text);
}

.resource-meta {
    font-size: 0.9rem;
    color: var(--color-gray-700);
    margin-bottom: 8px;
}


/* ========================================================================
 * CSP utility classes
 *
 * These replace high-frequency `style="…"` inline attributes so the
 * strict CSP can drop `'unsafe-inline'` from style-src. Patterns here
 * are intentionally small and composable — add a new one when an
 * inline-style pattern shows up more than ~5 times across templates.
 * ====================================================================== */
.u-d-none      { display: none; }
.u-d-block     { display: block; }
.u-d-inline    { display: inline; }
.u-d-flex      { display: flex; }
.u-flex-1      { flex: 1; }
.u-flex-2      { flex: 2; }
.u-flex-shrink-0 { flex-shrink: 0; }
.u-w-100       { width: 100%; }
.u-w-auto      { width: auto; }
.u-w-200       { width: 200px; }
.u-text-center { text-align: center; }
.u-text-right  { text-align: right; }
.u-text-muted  { color: var(--color-gray-600); }
.u-text-light  { color: var(--color-gray-500); }
.u-text-danger { color: var(--color-danger); }
.u-fw-500      { font-weight: 500; }
.u-fw-normal   { font-weight: normal; }
.u-fw-600      { font-weight: 600; }
.u-fs-09       { font-size: 0.9em; }
.u-fs-085      { font-size: 0.85rem; }
.u-cursor-pointer    { cursor: pointer; }
.u-cursor-not-allowed{ cursor: not-allowed; }
.u-mt-4        { margin-top: 4px; }
.u-mt-6        { margin-top: 6px; }
.u-mt-15       { margin-top: 15px; }
.u-mt-20       { margin-top: 20px; }
.u-mb-12       { margin-bottom: 12px; }
.u-mb-16       { margin-bottom: 16px; }
.u-mb-20       { margin-bottom: 20px; }
.u-grid-col-full { grid-column: 1 / -1; }
.u-bg-disabled { background: var(--color-gray-500); cursor: not-allowed; }

/* Round-2 CSP utilities — second-most-frequent inline-style patterns */
.u-p-20        { padding: 20px; }
.u-mt-5        { margin-top: 5px; }
.u-mt-8        { margin-top: 8px; }
.u-mt-10       { margin-top: 10px; }
.u-mb-0        { margin-bottom: 0; }
.u-mb-10       { margin-bottom: 10px; }
.u-fs-08       { font-size: 0.8rem; }
.u-fs-085em    { font-size: 0.85em; }
.u-fw-400      { font-weight: 400; }
.u-fst-italic  { font-style: italic; }
.u-text-primary{ color: var(--color-text); }
.u-text-gray-700 { color: var(--color-gray-700); }
.u-d-none-tight{ display: none; }  /* alias for `display:none;` (no space variant) */
.u-d-flex-row-center{ display: flex; align-items: center; gap: 10px; }
.u-d-flex-row-center-8 { display: flex; align-items: center; gap: 8px; }

/* Reusable layout helpers — promoted from per-template extra_styles
   blocks during the inline-style → class migration. */
.u-flex-between        { display: flex; justify-content: space-between; }
.u-flex-between-center { display: flex; justify-content: space-between; align-items: center; }
.u-flex-center-between { display: flex; align-items: center; justify-content: space-between; }
.u-flex-end            { display: flex; justify-content: flex-end; }
.u-flex-col            { display: flex; flex-direction: column; }
.u-flex-wrap           { display: flex; flex-wrap: wrap; }
.u-flex-1              { flex: 1; }
.u-gap-4               { gap: 4px; }
.u-gap-6               { gap: 6px; }
.u-gap-8               { gap: 8px; }
.u-gap-10              { gap: 10px; }
.u-gap-12              { gap: 12px; }
.u-gap-15              { gap: 15px; }
.u-mt-3                { margin-top: 3px; }
.u-mt-10               { margin-top: 10px; }
.u-mt-16               { margin-top: 16px; }
.u-mb-15               { margin-bottom: 15px; }
.u-mb-30               { margin-bottom: 30px; }
.u-mw-0                { min-width: 0; }
.u-mw-120              { max-width: 120px; }
.u-mw-160              { max-width: 160px; }
.u-mw-200              { max-width: 200px; }
.u-fs-078em            { font-size: 0.78em; }
.u-fs-11em             { font-size: 1.1em; }
.u-fs-115em            { font-size: 1.15em; }
.u-fs-13em             { font-size: 1.3em; }
.u-text-warning        { color: var(--color-warning-text); }
.u-bg-warning-light    { background: var(--color-warning-light); }
.u-pb-12-divider       { padding-bottom: 12px; border-bottom: 1px solid var(--color-gray-200); }
.u-pos-relative        { position: relative; }
.u-pos-absolute        { position: absolute; }
.u-cursor-default      { cursor: default; }
.u-overflow-hidden     { overflow: hidden; }
.u-overflow-y-auto     { overflow-y: auto; }
.u-text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* More common utilities promoted from per-template blocks. */
.u-d-inline-tight  { display: inline; }
.u-text-info       { color: var(--color-info); }
.u-text-warning    { color: var(--color-warning-text); }
.u-mt-12           { margin-top: 12px; }
.u-mt-6            { margin-top: 6px; }
.u-mt-4            { margin-top: 4px; }
.u-mt-2            { margin-top: 2px; }
.u-mt-24           { margin-top: 24px; }
.u-mb-8            { margin-bottom: 8px; }
.u-mb-14           { margin-bottom: 14px; }
.u-mb-24           { margin-bottom: 24px; }
.u-m-0             { margin: 0; }
.u-ml-8            { margin-left: 8px; }
.u-ml-10           { margin-left: 10px; }
.u-p-15            { padding: 15px; }
.u-p-16            { padding: 16px; }
.u-p-40            { padding: 40px; }
.u-w-0pct          { width: 0%; }
.u-fs-07em         { font-size: 0.7em; }
.u-fs-08em         { font-size: 0.8em; }
.u-fs-12em         { font-size: 1.2em; line-height: 1; }
.u-fs-13em         { font-size: 1.3em; line-height: 1; }
.u-fs-075em        { font-size: 0.75em; }
.u-fs-09rem        { font-size: 0.9rem; }
.u-fs-11rem        { font-size: 1.1rem; }
.u-link-inherit    { color: inherit; text-decoration: none; }
.u-text-no-underline { text-decoration: none; }
.u-opacity-50      { opacity: 0.5; }
.u-justify-center  { justify-content: center; }

/* More multi-property classes used in 2+ templates (CSP-safe promotions). */
.logo-120-mb-15           { max-width: 120px; margin-bottom: 15px; }
.u-mt-14-inline-block     { margin-top: 14px; display: inline-block; }
.u-mv-10-6                { margin: 10px 0 6px; }
.u-fs-25-opacity-40       { font-size: 2.5rem; opacity: 0.4; }
.u-mt-8-mb-0              { margin-top: 8px; margin-bottom: 0; }
.u-mt-10-indent-20        { margin: 10px 0 0 0; padding-left: 20px; }
.u-text-left              { text-align: left; }
.u-text-danger            { color: var(--color-danger-text); }
.u-text-gray-400          { color: var(--color-gray-400); }
.u-color-inherit          { color: inherit; }
.u-flex-start-gap-12      { display: flex; gap: 12px; align-items: flex-start; }
.u-flex-center-gap-10-mb-8 { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.u-flex-center-gap-6-sm   { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; }
.u-mr-8                   { margin-right: 8px; }
.u-m-20                   { margin: 20px; }
.u-mt-15                  { margin-top: 15px; }
.u-mt-16                  { margin-top: 16px; }
.u-mt-0                   { margin-top: 0; }
.u-p-20-30                { padding: 20px 30px; }
.u-fs-1rem                { font-size: 1rem; }
.list-no-margin           { margin: 0; padding-left: 20px; }
.centered-520             { max-width: 520px; margin: 0 auto; }
/* Specificity bump: `.form-group label/input/select/small { … }` (0,1,1)
   beats bare utilities (0,1,0), silently undoing the intended style.
   Re-asserting the utility's value with `<element>.u-…` (0,1,1) ties on
   specificity and wins on cascade order. Add new entries here whenever a
   `u-*` utility needs to survive a `.form-group <element>` override. */
label.u-d-flex-row-center,
label.u-d-flex-row-center-8 { display: flex; }
input[type="checkbox"].u-w-auto { width: auto; }
label.u-fw-normal { font-weight: normal; }
label.u-fs-085 { font-size: 0.85rem; }
.form-group input.u-w-200,
.form-group select.u-w-200 { width: 200px; }
small.u-text-danger { color: var(--color-danger); }
.form-group small.alert-warning { color: var(--color-warning-text); }
.form-group small.u-mt-4  { margin-top: 4px; }
.form-group small.u-mt-6  { margin-top: 6px; }
.form-group small.u-mt-8  { margin-top: 8px; }
.form-group small.u-mt-10 { margin-top: 10px; }
.u-bg-disabled-only { background: var(--color-gray-500); }
.u-color-swatch{ width: 40px; height: 28px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.1); }
.u-icon-btn-sm { width: 32px; height: 32px; padding: 0; font-size: 1.2em; }
.u-checkbox-sm { margin-right: 10px; width: 18px; height: 18px; }

/* Provider color dots (used in view_booking, manage_providers, etc.).
 * Backed by `data-style-bg="<hex>"` set by Django/JS; the JS reader in
 * behavior.js applies it on page load (or after a manual
 * window.applyDataStyles() call when the DOM is mutated). */
.provider-dot-sm,
.provider-dot-md,
.provider-dot-lg {
    display: inline-block;
    border-radius: 50%;
    background: var(--color-gray-400);
}
.provider-dot-sm { width: 10px; height: 10px; }
.provider-dot-md { width: 12px; height: 12px; }
.provider-dot-lg { width: 14px; height: 14px; }

/* Reassign-provider list row (view_booking.html provider modal). */
.reassign-provider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid var(--color-gray-100);
}
.reassign-provider-row.is-locked {
    opacity: 0.55;
    cursor: not-allowed;
}
.u-text-success { color: var(--color-success); }
.u-pl-30 { padding-left: 30px; }
.u-w-100px { width: 100px; }

.usage-bar-fill-full { min-width: 4px; }
.usage-bar-fill-empty { min-width: 0; }
.dependant-item-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
}
.dependant-item-row + .dependant-item-row {
    border-top: 1px solid var(--color-gray-200);
}
.purchase-item-booking-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-gray-100);
}
.purchase-item-booking-row.sold-out {
    opacity: 0.55;
    pointer-events: none;
}
.purchase-item-image-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: zoom-in;
}
.new-address-fields-collapsible { margin-top: 12px; }

/* Calendar bar (create_edit_timeslot conflict visualization) */
.conflict-day-col { display: flex; flex-direction: column; align-items: center; height: 100%; }
.conflict-day-bar-track { display: flex; align-items: flex-end; }
.conflict-day-label { font-size: 0.65rem; padding-top: 2px; }
.conflict-day-bar { border-radius: 3px 3px 0 0; }

/* Booking close countdown urgency levels (resource_detail) */
.booking-close-countdown { font-size: 0.8rem; }
.booking-close-countdown.urgency-critical { color: var(--color-danger); }
.booking-close-countdown.urgency-warning  { color: var(--color-warning); }
.booking-close-countdown.urgency-info     { color: var(--color-info); }

/* Timeslot chip cursor (send_email) */
.timeslot-chip.is-empty { cursor: default; }

/* Pattern-badge mode colours (manage_all_timeslots) */
.pattern-badge.mode-service { background: var(--color-button-light); color: var(--color-button-dark); }
.pattern-badge.mode-event   { background: var(--color-warning-light); color: var(--color-warning-text); }
