:root {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --text: #212529;
    --text-secondary: #6c757d;
    --primary: #0d6efd;
    --primary-hover: #0b5ed7;
    --danger: #dc3545;
    --success: #198754;
    --warning: #ffc107;
    --border: #dee2e6;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Floating card */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.card h1, .card h2, .card h3 { margin-bottom: 16px; }

/* =========================================================================
   BUTTON SYSTEM  (one consistent, premium set used across every page)
   Covers every button class in the app: btn, btn-primary/secondary/danger/
   success/warning/info/outline, btn-blue, btn-analyze/run/apply/save/reset/
   export/view-details, delete-btn, close-detail, btn-sm/lg.
   ========================================================================= */
:root {
    --secondary: #5c6370;
    --secondary-hover: #4a4f59;
    --info: #0aa2c0;
    --info-hover: #0992ad;
    --warning-hover: #e0a800;
    --danger-hover: #bb2d3b;
    --success-hover: #157347;
}

.btn,
button.btn-blue, a.btn-blue,
.btn-analyze, .btn-run, .btn-apply, .btn-save, .btn-reset,
.btn-export, .btn-view-details, .delete-btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 50px;
    border: 1px solid transparent;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    transition: background .15s ease, border-color .15s ease, color .15s ease,
                box-shadow .15s ease, transform .05s ease;
}
.btn:hover, button.btn-blue:hover, a.btn-blue:hover,
.btn-analyze:hover, .btn-run:hover, .btn-apply:hover, .btn-save:hover,
.btn-reset:hover, .btn-export:hover, .btn-view-details:hover, .delete-btn:hover {
    box-shadow: var(--shadow);
}
.btn:active, button.btn-blue:active, .btn-analyze:active, .btn-run:active,
.btn-apply:active, .btn-save:active, .delete-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}
.btn:focus-visible, button.btn-blue:focus-visible, .btn-analyze:focus-visible,
.delete-btn:focus-visible, .btn-run:focus-visible, .btn-apply:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13,110,253,0.35);
}
.btn:disabled, .btn[disabled] { opacity: .6; cursor: not-allowed; box-shadow: none; }

/* Colour variants (also map the page-specific aliases onto the palette) */
.btn-primary, .btn-blue, .btn-run, .btn-apply, .btn-save {
    background: var(--primary); color: #fff;
}
.btn-primary:hover, .btn-blue:hover, .btn-run:hover, .btn-apply:hover, .btn-save:hover {
    background: var(--primary-hover); color: #fff;
}
.btn-secondary, .btn-reset { background: var(--secondary); color: #fff; }
.btn-secondary:hover, .btn-reset:hover { background: var(--secondary-hover); color: #fff; }
.btn-danger, .delete-btn { background: var(--danger); color: #fff; }
.btn-danger:hover, .delete-btn:hover { background: var(--danger-hover); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-hover); color: #fff; }
.btn-warning { background: var(--warning); color: #1f2330; }
.btn-warning:hover { background: var(--warning-hover); color: #1f2330; }
.btn-info, .btn-analyze, .btn-export, .btn-view-details {
    background: var(--info); color: #fff;
}
.btn-info:hover, .btn-analyze:hover, .btn-export:hover, .btn-view-details:hover {
    background: var(--info-hover); color: #fff;
}
.btn-outline {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
/* De-emphasized destructive action (outline red) — for table rows */
.btn-danger-outline {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
    box-shadow: none;
}
.btn-danger-outline:hover { background: var(--danger); color: #fff; }
/* Lowest-emphasis action (no border) — for secondary row links */
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--primary);
    box-shadow: none;
}
.btn-ghost:hover { background: rgba(13,110,253,.08); color: var(--primary); }

/* Sizes */
.btn-sm, .btn-view-details { padding: 5px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 26px; font-size: 1rem; }

/* Groups of buttons never collide: consistent gap + wrap */
.action-buttons, .btn-group, .modal-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Slot-capacity hint on the coaches forms */
.slots-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 2px 0 10px;
    line-height: 1.4;
}

/* Form elements */
input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    margin-bottom: 12px;
    background: #fff;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,110,253,0.1);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    background: #f1f3f5;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
tr:last-child td { border-bottom: none; }

/* Long data tables: bounded height with a sticky header row.
   Wrap any big table in <div class="table-scroll"> so the header stays
   visible while the body scrolls, and the page never becomes a mile long. */
.table-scroll {
    max-height: 70vh;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch;
}
/* overflow:hidden on the table would clip the sticky header — reset it */
.table-scroll table { box-shadow: none; border-radius: 0; overflow: visible; margin: 0; }
.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f1f3f5;
}

/* Schedule grid */
.sched-grid {
    overflow-x: auto;
}
.sched-grid table.sched {
    font-size: 0.75rem;
    min-width: 800px;
}
.sched-grid th, .sched-grid td {
    padding: 6px 8px;
    text-align: center;
    border: 1px solid var(--border);
}
.sched-grid .unavailable { background: #f8d7da; color: #721c24; }
.sched-grid .group_lesson { background: #fff3cd; }
.sched-grid .round { background: #e2e3e5; }
.sched-grid .private { background: #d4edda; }
.sched-grid .highlight { background: #ffffa0; }
.sched-grid .cell { cursor: pointer; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
}
.modal-content {
    background: white;
    margin: 10% auto;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

/* Admin navbar */
.navbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.navbar a {
    padding: 8px 16px;
    background: var(--surface);
    border-radius: 50px;
    border: 1px solid var(--border);
    text-decoration: none;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: 0.2s;
}
.navbar a:hover, .navbar a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    body { padding: 12px; }
}

