/* =============================================
   SwimPortal HoZT – Stylesheet
   ============================================= */

:root {
    --red:       #D62828;
    --red-dark:  #B01F1F;
    --red-light: #fdecea;
    --white:     #ffffff;
    --gray-50:   #f9fafb;
    --gray-100:  #f3f4f6;
    --gray-200:  #e5e7eb;
    --gray-300:  #d1d5db;
    --gray-400:  #9ca3af;
    --gray-500:  #6b7280;
    --gray-600:  #4b5563;
    --gray-700:  #374151;
    --gray-800:  #1f2937;
    --gray-900:  #111827;
    --blue-50:   #eff6ff;
    --blue-100:  #dbeafe;
    --blue-200:  #bfdbfe;
    --blue-700:  #1d4ed8;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow:    0 4px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
    --radius:    10px;
    --radius-lg: 16px;
    --transition: 150ms ease;
    --navbar-h:  64px;
}

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

html { font-size: 16px; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.5;
}

/* ══════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0 2rem;
    height: var(--navbar-h);
    box-shadow: var(--shadow-sm);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo-icon { width: 34px; height: 34px; }

.nav-brand-text {
    font-size: 1.15rem;
    color: var(--gray-900);
    font-weight: 400;
    letter-spacing: -.01em;
}
.nav-brand-text strong { color: var(--red); font-weight: 700; }

.nav-links {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex: 1;
}

.nav-link {
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    color: var(--gray-600);
    padding: .45rem .9rem;
    border-radius: 7px;
    transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-link.active { background: var(--red-light); color: var(--red); }

.nav-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--red);
    color: var(--white);
    font-weight: 700;
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex-shrink: 0;
}

.nav-name {
    font-size: .875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.nav-logout {
    font-size: .8rem;
    color: var(--gray-400);
    text-decoration: none;
    padding: .35rem .7rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    transition: all var(--transition);
}
.nav-logout:hover { border-color: var(--red); color: var(--red); }

/* Hamburger button – hidden on desktop */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    flex-shrink: 0;
    margin-left: auto;
    transition: background var(--transition);
}
.nav-hamburger:hover { background: var(--gray-100); }
.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
    transform-origin: center;
}
.nav-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav panel */
.nav-mobile-panel {
    display: none;
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 2px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    z-index: 99;
    overflow-y: auto;
    max-height: calc(100vh - var(--navbar-h));
}
.nav-mobile-panel.open { display: block; }

.nav-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--navbar-h);
    background: rgba(0,0,0,.25);
    z-index: 98;
}
.nav-mobile-overlay.open { display: block; }

.nav-mobile-links {
    display: flex;
    flex-direction: column;
    padding: .5rem 0;
}

.nav-mobile-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .95rem;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    padding: .875rem 1.5rem;
    border-left: 3px solid transparent;
    transition: background var(--transition), color var(--transition);
}
.nav-mobile-link:hover { background: var(--gray-50); color: var(--gray-900); }
.nav-mobile-link.active { background: var(--red-light); color: var(--red); border-left-color: var(--red); font-weight: 600; }

.nav-mobile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.nav-mobile-user {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.nav-mobile-user-name {
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* ══════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════ */
.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -.02em;
}

.page-subtitle {
    font-size: .875rem;
    color: var(--gray-400);
    margin-top: .25rem;
}

/* ══════════════════════════════════════════
   CARDS
══════════════════════════════════════════ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.card-title .badge {
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: .72rem;
    font-weight: 600;
    padding: .15rem .5rem;
    border-radius: 999px;
}

/* ══════════════════════════════════════════
   GRID
══════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

/* ══════════════════════════════════════════
   STATS
══════════════════════════════════════════ */
.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-400);
    margin-bottom: .4rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -.03em;
    line-height: 1;
}

.stat-meta {
    font-size: .8rem;
    color: var(--gray-400);
    margin-top: .35rem;
}

.stat-best .stat-value { color: var(--red); }

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .875rem;
    font-weight: 600;
    padding: .55rem 1.1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); }

.btn-outline {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-outline:hover { border-color: var(--gray-400); background: var(--gray-50); }

.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }

.btn-danger {
    background: var(--white);
    color: var(--red);
    border: 1px solid var(--red-light);
}
.btn-danger:hover { background: var(--red); color: var(--white); }

.btn-sm { font-size: .8rem; padding: .35rem .8rem; border-radius: 6px; }
.btn-icon { padding: .5rem; border-radius: 7px; }

/* ══════════════════════════════════════════
   FORMS
══════════════════════════════════════════ */
.form-group { margin-bottom: 1.1rem; }

label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: .45rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: .6rem .85rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: .9rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(214, 40, 40, .12);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .85rem center;
    padding-right: 2.5rem;
}

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .75rem; }
.form-hint { font-size: .75rem; color: var(--gray-400); margin-top: .3rem; }

.form-error {
    font-size: .8rem;
    color: var(--red);
    margin-top: .35rem;
    display: flex;
    align-items: center;
    gap: .3rem;
}

/* ══════════════════════════════════════════
   TABLE
══════════════════════════════════════════ */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

table { width: 100%; border-collapse: collapse; font-size: .875rem; }

thead { background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }

th {
    padding: .75rem 1rem;
    text-align: left;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-500);
    white-space: nowrap;
}

td {
    padding: .85rem 1rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

.time-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--gray-900);
    font-size: .95rem;
}

.time-best { color: var(--red); }

.badge-group {
    display: inline-flex;
    align-items: center;
    background: var(--red-light);
    color: var(--red);
    font-size: .72rem;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 999px;
}

.badge-role {
    display: inline-flex;
    align-items: center;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: .72rem;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 999px;
}

.badge-role.admin { background: #fff3cd; color: #92640b; }

/* ══════════════════════════════════════════
   CHART
══════════════════════════════════════════ */
.chart-wrapper { position: relative; height: 320px; }

/* ══════════════════════════════════════════
   TIME INPUTS
══════════════════════════════════════════ */
.time-inputs { display: flex; align-items: flex-start; gap: .5rem; }

.time-input-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 90px;
}
.time-input-col input { text-align: center; }

.time-sep {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-400);
    padding-top: .45rem;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════
   TOGGLE
══════════════════════════════════════════ */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    cursor: pointer;
    user-select: none;
    font-size: .875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0;
}

.toggle-checkbox { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-track {
    position: relative;
    width: 38px;
    height: 22px;
    background: var(--gray-300);
    border-radius: 999px;
    flex-shrink: 0;
    transition: background var(--transition);
}

.toggle-checkbox:checked + .toggle-track { background: var(--red); }

.toggle-thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform var(--transition);
}

.toggle-checkbox:checked + .toggle-track .toggle-thumb { transform: translateX(16px); }

/* ══════════════════════════════════════════
   EQUIPMENT BADGE
══════════════════════════════════════════ */
.badge-equipment {
    display: inline-flex;
    align-items: center;
    font-size: .68rem;
    font-weight: 700;
    padding: .15rem .5rem;
    border-radius: 999px;
    letter-spacing: .02em;
}
.badge-equipment--vinnen { background: #eff6ff; color: #2563eb; }
.badge-equipment--benen  { background: #f0fdf4; color: #15803d; }
.badge-equipment--armen  { background: #fdf4ff; color: #7e22ce; }

/* ══════════════════════════════════════════
   FAB
══════════════════════════════════════════ */
button.fab {
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    z-index: 9999;
    display: inline-flex !important;
    align-items: center;
    gap: .65rem;
    padding: 0 1.6rem 0 1rem;
    height: 54px;
    border-radius: 999px !important;
    background: var(--red) !important;
    color: #fff !important;
    border: none !important;
    outline: none;
    cursor: pointer;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: .925rem;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    text-decoration: none;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 4px 20px rgba(214,40,40,.5), 0 2px 6px rgba(0,0,0,.18) !important;
    transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.fab-icon {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
button.fab:hover {
    background: var(--red-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(214,40,40,.6), 0 2px 8px rgba(0,0,0,.2) !important;
}
button.fab:active {
    transform: translateY(0) scale(.97);
    box-shadow: 0 3px 10px rgba(214,40,40,.4) !important;
}

/* ══════════════════════════════════════════
   BULK SWIMMER LIST
══════════════════════════════════════════ */
.bulk-swimmer-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: .25rem;
}
.bulk-swimmer-row { display: flex; align-items: center; gap: .75rem; }
.bulk-swimmer-name {
    font-size: .875rem;
    font-weight: 500;
    color: var(--gray-800);
    min-width: 140px;
    flex-shrink: 0;
}
.bulk-swimmer-row input[type="text"] { font-size: .875rem; padding: .45rem .75rem; }
.time-smart-input { font-variant-numeric: tabular-nums; font-size: 1rem !important; letter-spacing: .01em; }

/* ══════════════════════════════════════════
   MODAL
══════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(2px);
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn .18s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(.97) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.modal-title { font-size: 1rem; font-weight: 700; color: var(--gray-900); }

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: .2rem .5rem;
    border-radius: 5px;
    line-height: 1;
    transition: background var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }

.modal-body { padding: 1.5rem; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
}

/* ══════════════════════════════════════════
   FLASH MESSAGES
══════════════════════════════════════════ */
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.25rem;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.flash--success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.flash--error   { background: var(--red-light); color: var(--red-dark); border-color: #fca5a5; }
.flash--info    { background: var(--blue-50); color: #1e40af; border-color: var(--blue-200); }

.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: inherit;
    opacity: .6;
    padding: 0 .25rem;
    line-height: 1;
    flex-shrink: 0;
}
.flash-close:hover { opacity: 1; }

/* ══════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-50) 0%, #f0f0f0 100%);
    padding: 1rem;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
}

.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo-icon { width: 56px; height: 56px; margin: 0 auto .75rem; display: block; }

.auth-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    text-align: center;
    margin-bottom: .35rem;
}

.auth-subtitle {
    font-size: .875rem;
    color: var(--gray-400);
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .85rem;
    color: var(--gray-400);
}

.auth-footer a { color: var(--red); text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }
.auth-divider { height: 1px; background: var(--gray-100); margin: 1.5rem 0; }

/* ══════════════════════════════════════════
   SWIMMER CARD
══════════════════════════════════════════ */
.swimmer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }

.swimmer-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    transition: box-shadow var(--transition), border-color var(--transition);
    text-decoration: none;
    color: inherit;
}

.swimmer-card:hover { box-shadow: var(--shadow); border-color: var(--red); }
.swimmer-card-header { display: flex; align-items: center; gap: .85rem; }

.swimmer-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--red-light);
    color: var(--red);
    font-weight: 700;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.swimmer-name { font-weight: 600; font-size: .95rem; color: var(--gray-900); }
.swimmer-meta { font-size: .8rem; color: var(--gray-400); margin-top: .1rem; }

.swimmer-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: .75rem;
    border-top: 1px solid var(--gray-100);
}

/* ══════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════ */
.filter-bar {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.filter-group { display: flex; flex-direction: column; gap: .4rem; min-width: 150px; flex: 1; }
.filter-group label { font-size: .75rem; font-weight: 600; color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; }
.filter-group select { margin-bottom: 0; }

.filter-actions { display: flex; gap: .5rem; align-items: flex-end; flex-shrink: 0; }

/* ══════════════════════════════════════════
   COMPARE
══════════════════════════════════════════ */
.compare-header {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.compare-vs {
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--gray-300);
}

/* ══════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════ */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--gray-400); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 1rem; opacity: .35; }
.empty-state p { font-size: .95rem; margin-top: .5rem; }

/* ══════════════════════════════════════════
   SECTION DIVIDER
══════════════════════════════════════════ */
.section { margin-bottom: 2rem; }
.section + .section { padding-top: 2rem; border-top: 1px solid var(--gray-100); }

/* ══════════════════════════════════════════
   ADMIN
══════════════════════════════════════════ */
.admin-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.75rem;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: .1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-400);
    padding: .5rem 1rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    text-decoration: none;
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}
.admin-tab.active { color: var(--red); border-color: var(--red); }
.admin-tab:hover:not(.active) { color: var(--gray-600); }

/* ══════════════════════════════════════════
   COACH CARD
══════════════════════════════════════════ */
.coach-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.coach-info { flex: 1; min-width: 0; }
.coach-name { font-weight: 600; font-size: .9rem; color: var(--gray-900); }
.coach-email { font-size: .8rem; color: var(--gray-400); margin-top: .1rem; word-break: break-all; }
.coach-groups { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }

/* ══════════════════════════════════════════
   POOL BADGE (wedstrijd)
══════════════════════════════════════════ */
.badge-pool {
    display: inline-flex;
    align-items: center;
    font-size: .68rem;
    font-weight: 800;
    padding: .15rem .5rem;
    border-radius: 999px;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.badge-pool--gb { background: var(--red-light); color: var(--red); }
.badge-pool--kb { background: var(--blue-100); color: var(--blue-700); }

/* ══════════════════════════════════════════
   UTILS
══════════════════════════════════════════ */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.gap-1 { gap: .5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--gray-400); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }


/* ══════════════════════════════════════════
   RESPONSIVE
   Breakpoints:
     860px  tablet landscape
     768px  tablet portrait / hamburger
     600px  medium phone
     480px  small phone
     380px  extra small
══════════════════════════════════════════ */

/* ── 860px ── */
@media (max-width: 860px) {
    .filter-bar { gap: .75rem; padding: 1rem 1.25rem; }
    .filter-group { flex: 0 0 calc(50% - .375rem); min-width: 0; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ── 768px  (hamburger breakpoint) ── */
@media (max-width: 768px) {
    /* Navbar */
    .navbar { padding: 0 1rem; gap: .75rem; }
    .nav-links { display: none; }
    .nav-name { display: none; }
    .nav-hamburger { display: flex; }
    .nav-logout { display: none; } /* moved to mobile panel */

    /* Layout */
    .page-wrapper { padding: 1.25rem 1rem 5rem; }

    /* Page header */
    .page-header { flex-direction: column; align-items: flex-start; gap: .75rem; }
    .page-header > div:last-child { display: flex; flex-wrap: wrap; gap: .5rem; width: 100%; }
    .page-header > div:last-child > .btn,
    .page-header > div:last-child > a.btn,
    .page-header > div:last-child > form { flex: 1; min-width: 140px; }
    .page-header > div:last-child > .btn,
    .page-header > div:last-child > a.btn { justify-content: center; }

    /* Cards */
    .card { padding: 1.1rem; border-radius: var(--radius); }

    /* Grids */
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }

    /* Chart */
    .chart-wrapper { height: 240px; }

    /* Stat */
    .stat-value { font-size: 1.5rem; }
    .stat-card { padding: 1rem 1.1rem; }

    /* Modal – bottom sheet on mobile */
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 92vh;
        animation: modalUp .2s ease;
    }
    @keyframes modalUp {
        from { transform: translateY(30px); opacity: 0; }
        to   { transform: translateY(0);    opacity: 1; }
    }

    /* Compare */
    .compare-header { grid-template-columns: 1fr; }
    .compare-vs { display: none; }

    /* FAB */
    button.fab { bottom: 1.25rem !important; right: 1rem !important; }

    /* Swimmer detail header */
    .swimmer-detail-header { flex-direction: column; align-items: flex-start; }
}

/* ── 600px ── */
@media (max-width: 600px) {
    /* Filter: single column */
    .filter-bar { padding: .875rem 1rem; gap: .6rem; }
    .filter-group { flex: 0 0 100%; min-width: 0; }
    .filter-actions { width: 100%; }
    .filter-actions .btn { flex: 1; justify-content: center; }

    /* All filter-bar trailing div (inline buttons) */
    .filter-bar > div[style*="display:flex"] {
        width: 100%;
    }
    .filter-bar > div[style*="display:flex"] .btn {
        flex: 1;
        justify-content: center;
    }

    /* Grids */
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); gap: .875rem; }
    .grid-2 { grid-template-columns: 1fr; }

    /* Swimmer grid: 2 cols */
    .swimmer-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }

    /* Stat value */
    .stat-value { font-size: 1.3rem; }

    /* Chart */
    .chart-wrapper { height: 200px; }

    /* Modal body/footer padding */
    .modal-body { padding: 1.1rem 1rem; }
    .modal-footer { padding: .875rem 1rem; }
    .modal-header { padding: 1rem; }

    /* Modal footer buttons */
    .modal-footer { flex-direction: column-reverse; }
    .modal-footer .btn { width: 100%; justify-content: center; }

    /* Form row: 1 col on smallest */
    .form-row { grid-template-columns: 1fr 1fr; }

    /* Admin group form */
    .admin-group-form { flex-wrap: wrap; gap: .5rem; }
    .admin-group-form input { width: 100%; flex: none; }
}

/* ── 480px ── */
@media (max-width: 480px) {
    /* Full single column for all grids */
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }

    /* Swimmer grid: 1 col */
    .swimmer-grid { grid-template-columns: 1fr; }

    /* Tables: hide less important cols */
    .col-hide-sm { display: none; }

    /* Form rows: single column */
    .form-row { grid-template-columns: 1fr; }

    /* Navbar */
    .navbar { padding: 0 .875rem; }

    /* Title */
    .page-title { font-size: 1.3rem; }

    /* Card padding */
    .card { padding: .9rem; }

    /* Stat */
    .stat-value { font-size: 1.2rem; }
    .stat-card { padding: .875rem; }

    /* Bulk swimmer name: shorter */
    .bulk-swimmer-name { min-width: 100px; font-size: .8rem; }

    /* Coach card */
    .coach-card { padding: .875rem 1rem; }
}

/* ── 380px ── */
@media (max-width: 380px) {
    .col-hide-xs { display: none; }
    td, th { padding: .6rem .5rem; }
    table { font-size: .8rem; }
    .page-title { font-size: 1.15rem; }
    .btn { font-size: .82rem; padding: .5rem .9rem; }
    .btn-sm { font-size: .75rem; padding: .3rem .65rem; }
    .navbar { padding: 0 .75rem; }
    button.fab { height: 48px !important; font-size: .85rem !important; padding: 0 1.2rem 0 .85rem !important; }
}
