/* ============================================================
   Bethel Tracker – Main Stylesheet
   ============================================================ */

/* ----------------------------------------------------------
   Custom Properties
   ---------------------------------------------------------- */
:root {
    /* Brand colours */
    --color-sidebar:        #1e3a5f;
    --color-sidebar-hover:  #2a4f7c;
    --color-sidebar-active: #2563eb;
    --color-primary:        #2563eb;
    --color-primary-dark:   #1d4ed8;
    --color-primary-light:  #dbeafe;

    /* Status colours */
    --color-paid:           #16a34a;
    --color-paid-light:     #dcfce7;
    --color-partial:        #ea580c;
    --color-partial-light:  #ffedd5;
    --color-unpaid:         #dc2626;
    --color-unpaid-light:   #fee2e2;

    /* Neutral palette */
    --color-bg:             #f1f5f9;
    --color-white:          #ffffff;
    --color-border:         #e2e8f0;
    --color-text:           #1e293b;
    --color-text-muted:     #64748b;
    --color-text-light:     #94a3b8;

    /* Sidebar dimensions */
    --sidebar-width:        260px;

    /* Spacing */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl: 3rem;

    /* Typography */
    --font-family:   'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-size-xs:  0.75rem;
    --font-size-sm:  0.875rem;
    --font-size-base:1rem;
    --font-size-lg:  1.125rem;
    --font-size-xl:  1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;

    /* Borders & shadows */
    --radius-sm:    4px;
    --radius-md:    8px;
    --radius-lg:    12px;
    --radius-xl:    16px;
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:    0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg:    0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl:    0 20px 25px rgba(0,0,0,0.1), 0 8px 10px rgba(0,0,0,0.04);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
}

/* ----------------------------------------------------------
   Reset & Base
   ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; }

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

ul, ol { list-style: none; }

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

/* ----------------------------------------------------------
   Sidebar
   ---------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--color-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform var(--transition-base);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-xl) var(--space-lg);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    background: var(--color-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-brand-icon svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
}

.sidebar-brand-name {
    display: block;
    color: #fff;
    font-weight: 700;
    font-size: var(--font-size-lg);
    line-height: 1.2;
}
.sidebar-brand-sub {
    display: block;
    color: rgba(255,255,255,0.5);
    font-size: var(--font-size-xs);
    line-height: 1.2;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-lg) var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0.65rem var(--space-md);
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.7);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: background var(--transition-fast), color var(--transition-fast);
    text-decoration: none;
}
.nav-item:hover {
    background: var(--color-sidebar-hover);
    color: #fff;
    text-decoration: none;
}
.nav-item.active {
    background: var(--color-sidebar-active);
    color: #fff;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.nav-label { line-height: 1; }

.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    color: rgba(255,255,255,0.35);
    font-size: var(--font-size-xs);
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ----------------------------------------------------------
   Main Content
   ---------------------------------------------------------- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    padding: var(--space-xl) var(--space-2xl);
    max-width: 1200px;
    width: 100%;
}

/* ----------------------------------------------------------
   Page Header
   ---------------------------------------------------------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    gap: var(--space-md);
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.page-subtitle {
    margin-top: var(--space-xs);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* ----------------------------------------------------------
   Cards
   ---------------------------------------------------------- */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

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

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text);
}

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

/* ----------------------------------------------------------
   Summary / Stat Cards
   ---------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.stat-card.stat-total::before    { background: var(--color-primary); }
.stat-card.stat-paid::before     { background: var(--color-paid); }
.stat-card.stat-partial::before  { background: var(--color-partial); }
.stat-card.stat-unpaid::before   { background: var(--color-unpaid); }

.stat-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.1;
}

.stat-sub {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* ----------------------------------------------------------
   Progress Bar
   ---------------------------------------------------------- */
.progress-card {
    margin-bottom: var(--space-xl);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-sm);
}

.progress-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
}

.progress-value {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.progress-bar-wrapper {
    height: 12px;
    background: var(--color-bg);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-paid));
    transition: width 0.6s ease;
    min-width: 0;
}

.progress-percent {
    margin-top: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-align: right;
}

/* ----------------------------------------------------------
   Tables
   ---------------------------------------------------------- */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

thead {
    background: var(--color-bg);
}

thead th {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition-fast);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

tbody td {
    padding: var(--space-md) var(--space-md);
    color: var(--color-text);
    vertical-align: middle;
}

td.text-muted { color: var(--color-text-muted); }
td.amount     { font-variant-numeric: tabular-nums; font-weight: 600; }
td.actions    { white-space: nowrap; }

/* ----------------------------------------------------------
   Badges / Status
   ---------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.badge-paid    { background: var(--color-paid-light);    color: var(--color-paid); }
.badge-partial { background: var(--color-partial-light); color: var(--color-partial); }
.badge-unpaid  { background: var(--color-unpaid-light);  color: var(--color-unpaid); }
.badge-info    { background: var(--color-primary-light); color: var(--color-primary); }
.badge-neutral { background: #f1f5f9; color: var(--color-text-muted); }

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--transition-fast), border-color var(--transition-fast),
                color var(--transition-fast), box-shadow var(--transition-fast),
                opacity var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn svg { width: 15px; height: 15px; stroke: currentColor; flex-shrink: 0; }

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }

.btn-success {
    background: var(--color-paid);
    color: #fff;
    border-color: var(--color-paid);
}
.btn-success:hover { background: #15803d; border-color: #15803d; }

.btn-danger {
    background: var(--color-unpaid);
    color: #fff;
    border-color: var(--color-unpaid);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-secondary {
    background: var(--color-white);
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-secondary:hover { background: var(--color-bg); }

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

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--color-bg); color: var(--color-text); }

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: var(--font-size-xs);
}
.btn-sm svg { width: 13px; height: 13px; }

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-base);
}

.btn-icon {
    padding: 0.4rem;
    border-radius: var(--radius-sm);
}
.btn-icon svg { width: 16px; height: 16px; }

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

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

.form-control {
    width: 100%;
    padding: 0.6rem 0.875rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}
.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-control::placeholder { color: var(--color-text-light); }
.form-control[readonly]  { background: var(--color-bg); cursor: default; }

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

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

.form-error {
    margin-top: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--color-unpaid);
}

/* ----------------------------------------------------------
   Modals
   ---------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: var(--space-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(12px) scale(0.98);
    transition: transform var(--transition-base);
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-lg { max-width: 780px; }
.modal-xl { max-width: 960px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: var(--color-white);
    z-index: 1;
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.modal-close {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--color-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}
.modal-close:hover { background: var(--color-border); color: var(--color-text); }
.modal-close svg { width: 16px; height: 16px; stroke: currentColor; }

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

.modal-footer {
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    background: var(--color-bg);
}

/* ----------------------------------------------------------
   Tabs
   ---------------------------------------------------------- */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--space-xl);
}

.tab-btn {
    padding: var(--space-sm) var(--space-lg);
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    white-space: nowrap;
}
.tab-btn:hover { color: var(--color-text); }
.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ----------------------------------------------------------
   Assign Modal – Participant rows
   ---------------------------------------------------------- */
.assign-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 360px;
    overflow-y: auto;
    padding: var(--space-sm) 0;
}

.assign-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.assign-row.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.assign-row-info { font-size: var(--font-size-sm); }
.assign-row-name { font-weight: 600; }
.assign-row-status { font-size: var(--font-size-xs); color: var(--color-text-muted); }

.assign-row-amount { width: 90px; }
.assign-row-amount input {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    text-align: right;
}

.assign-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
    font-size: var(--font-size-sm);
}
.assign-summary strong { font-variant-numeric: tabular-nums; }
.assign-summary .over-budget { color: var(--color-unpaid); }

/* ----------------------------------------------------------
   Auto-match suggestions
   ---------------------------------------------------------- */
.suggestion-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 400px;
    overflow-y: auto;
}

.suggestion-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
}

.suggestion-info { flex: 1; min-width: 0; }
.suggestion-booking {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.suggestion-match { font-size: var(--font-size-sm); font-weight: 600; }
.suggestion-confidence {
    font-size: var(--font-size-xs);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.conf-high   { background: var(--color-paid-light);    color: var(--color-paid); }
.conf-medium { background: var(--color-partial-light); color: var(--color-partial); }
.conf-low    { background: #f1f5f9;                    color: var(--color-text-muted); }

.suggestion-actions { display: flex; gap: var(--space-xs); }

/* ----------------------------------------------------------
   CSV Preview Table
   ---------------------------------------------------------- */
.csv-preview-wrapper {
    overflow-x: auto;
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
}

.csv-preview-wrapper table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 1;
}

/* ----------------------------------------------------------
   Empty State
   ---------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
    color: var(--color-text-muted);
}
.empty-state svg {
    width: 48px; height: 48px;
    margin: 0 auto var(--space-md);
    stroke: var(--color-text-light);
}
.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}
.empty-state-text { font-size: var(--font-size-sm); }

/* ----------------------------------------------------------
   Toast Notifications
   ---------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid;
    font-size: var(--font-size-sm);
    font-weight: 500;
    pointer-events: all;
    min-width: 260px;
    max-width: 400px;
    animation: slideInToast 0.3s ease, fadeOutToast 0.4s ease 3.6s forwards;
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }

.toast-success { border-left-color: var(--color-paid); }
.toast-success svg { stroke: var(--color-paid); }

.toast-error { border-left-color: var(--color-unpaid); }
.toast-error svg { stroke: var(--color-unpaid); }

.toast-info { border-left-color: var(--color-primary); }
.toast-info svg { stroke: var(--color-primary); }

@keyframes slideInToast {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeOutToast {
    from { opacity: 1; }
    to   { opacity: 0; transform: translateY(8px); }
}

/* ----------------------------------------------------------
   File Drop Zone
   ---------------------------------------------------------- */
.file-drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
    background: var(--color-bg);
}
.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}
.file-drop-zone svg {
    width: 36px; height: 36px;
    margin: 0 auto var(--space-sm);
    stroke: var(--color-text-muted);
}
.file-drop-zone p { font-size: var(--font-size-sm); color: var(--color-text-muted); }
.file-drop-zone strong { color: var(--color-primary); }

/* ----------------------------------------------------------
   Utility classes
   ---------------------------------------------------------- */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }
.text-small  { font-size: var(--font-size-sm); }
.font-mono   { font-family: 'Courier New', monospace; font-size: var(--font-size-xs); }

.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-sm       { gap: var(--space-sm); }
.gap-md       { gap: var(--space-md); }
.justify-between { justify-content: space-between; }

.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }

.w-100 { width: 100%; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

.divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-lg) 0;
}

.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Booking text truncation */
.booking-text-cell {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 900px) {
    :root { --sidebar-width: 220px; }
    .content-wrapper { padding: var(--space-lg); }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .modal { max-width: 100%; }
    .modal-lg, .modal-xl { max-width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .content-wrapper { padding: var(--space-md); }
}
