/* ==========================================================================
   SISTEM INFORMASI MANAJEMEN DATA ATLET POPB DKI JAKARTA
   Modern Sports Management Dashboard — Navy, White, Red & Royal Blue Accent
   ========================================================================== */

:root {
    --navy-950: #091326;
    --navy-900: #0f1e3a;
    --navy-800: #162b52;
    --navy-700: #1e3a6e;
    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --primary-soft: #eff6ff;
    --accent: #dc2626;
    --accent-hover: #b91c1c;
    --accent-soft: #fef2f2;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --info: #0284c7;
    --info-soft: #f0f9ff;
    --purple: #7c3aed;
    --purple-soft: #f5f3ff;

    --bg: #f3f6fb;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-muted: #64748b;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 4px 14px rgba(15, 30, 58, .06);
    --shadow-lg: 0 12px 32px rgba(15, 30, 58, .12);
    --sidebar-w: 268px;
    --topbar-h: 64px;
    --transition: .18s cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; }
code { background: #e2e8f0; padding: 2px 6px; border-radius: 4px; font-size: .88em; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-2 { margin-bottom: .75rem; }
.mt-2 { margin-top: .75rem; }
.d-block { display: block; }
.inline-form { display: inline-flex; margin: 0; }
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: #fd4929;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(15, 23, 42, .14);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .22);
}
.brand-logo {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    object-fit: contain;
    background: #ffffff;
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .14);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: .95rem; color: #fff; letter-spacing: .01em; line-height: 1.2; }
.brand-text small { font-size: .74rem; color: rgba(255, 255, 255, .85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-close {
    display: none;
    margin-left: auto;
    background: transparent;
    border: 0;
    color: #ffffff;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .35) transparent;
}
.nav-section {
    font-size: .69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .75);
    padding: 14px 12px 5px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .92);
    font-size: .88rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}
.nav-link .icon { width: 17px; height: 17px; opacity: .92; }
.nav-link:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.nav-link.active {
    background: #ffffff;
    color: #fd4929;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .16);
}
.nav-link.active .icon { opacity: 1; }

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, .22);
}
.cabor-pill {
    display: block;
    text-align: center;
    font-size: .78rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    padding: 6px 12px;
}
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(9, 19, 38, .55); z-index: 35; }

.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    z-index: 20;
}
.topbar-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 8px;
    cursor: pointer;
    color: var(--navy-900);
}
.topbar-title { font-weight: 700; font-size: 1.02rem; color: var(--navy-900); }
.topbar-meta { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: .83rem; }
.topbar-date { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); }
.topbar-logos {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 10px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 999px;
}
.topbar-logos img {
    height: 26px;
    width: auto;
    object-fit: contain;
    display: block;
}
.topbar-cabor {
    background: var(--navy-900);
    color: #fff;
    padding: 5px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: .78rem;
}

.content { flex: 1; padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; }
.app-footer {
    padding: 14px 24px;
    text-align: center;
    font-size: .8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* ---------- Page Header ---------- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-title { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--navy-900); letter-spacing: -.01em; }
.page-subtitle { margin: 4px 0 0; color: var(--text-muted); font-size: .9rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Grids ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.grid { display: grid; gap: 18px; margin-bottom: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }

/* ---------- Stat Cards ---------- */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.stat-icon .icon { width: 22px; height: 22px; }
.stat-primary .stat-icon { background: var(--primary-soft); color: var(--primary); }
.stat-accent .stat-icon { background: var(--accent-soft); color: var(--accent); }
.stat-success .stat-icon { background: var(--success-soft); color: var(--success); }
.stat-warning .stat-icon { background: var(--warning-soft); color: var(--warning); }
.stat-info .stat-icon { background: var(--info-soft); color: var(--info); }
.stat-purple .stat-icon { background: var(--purple-soft); color: var(--purple); }
.stat-danger .stat-icon { background: var(--danger-soft); color: var(--danger); }
.stat-body { min-width: 0; }
.stat-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.stat-value { font-size: 1.65rem; font-weight: 800; color: var(--navy-900); line-height: 1.15; margin-top: 2px; }
.stat-sub { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}
.grid .card { margin-bottom: 0; display: flex; flex-direction: column; }
.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy-900);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.card-title .icon { color: var(--primary); }
.card-hint { font-size: .78rem; color: var(--text-muted); }
.card-body { padding: 20px; flex: 1; }
.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}
.card-note { font-size: .78rem; color: var(--text-muted); margin: 12px 0 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: .88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; box-shadow: 0 4px 12px rgba(29, 78, 216, .25); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--accent-hover); color: #fff; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.btn-danger-soft:hover { background: var(--danger); color: #fff; }
.btn-light { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-light:hover { background: #f1f5f9; color: var(--navy-900); }
.btn-sm { padding: 6px 11px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 7px; }
.btn-icon .icon { width: 16px; height: 16px; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-accent  { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }
.badge-info    { background: var(--info-soft); color: var(--info); }
.badge-purple  { background: var(--purple-soft); color: var(--purple); }
.badge-gray    { background: #f1f5f9; color: #475569; }
.badge-demo    { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; font-size: .68rem; }

/* ---------- Alerts ---------- */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: .89rem;
    border: 1px solid transparent;
    flex-wrap: wrap;
}
.alert > span { flex: 1; min-width: 200px; }
.alert-success { background: var(--success-soft); color: #166534; border-color: #bbf7d0; }
.alert-error   { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.alert-warning { background: var(--warning-soft); color: #92400e; border-color: #fde68a; }
.alert-info    { background: var(--info-soft); color: #075985; border-color: #bae6fd; }
.alert-demo    { background: #fffbeb; color: #78350f; border-color: #fcd34d; }
.alert-close { background: transparent; border: 0; color: inherit; cursor: pointer; padding: 4px; opacity: .7; }
.alert-close:hover { opacity: 1; }

/* ---------- Tables ---------- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.table th {
    text-align: left;
    padding: 11px 16px;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8fafc; }
.table-sm th, .table-sm td { padding: 9px 12px; font-size: .84rem; }
.row-actions { display: inline-flex; gap: 5px; justify-content: flex-end; }
.w-rank { width: 48px; }

/* ---------- Avatars & Person ---------- */
.person { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.person:hover strong { color: var(--primary); }
.person small { display: block; color: var(--text-muted); font-size: .78rem; }
.avatar {
    border-radius: 50%;
    object-fit: cover;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    font-weight: 700;
}
.avatar-sm { width: 32px; height: 32px; font-size: .74rem; }
.avatar-md { width: 38px; height: 38px; font-size: .82rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 1.9rem; margin: 0 auto 12px; }
.avatar-initials { background: linear-gradient(135deg, var(--navy-800), var(--primary)); color: #fff; }

/* ---------- Filter Bar & Pagination ---------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    align-items: center;
}
.filter-search { flex: 1 1 220px; }
.filter-bar select.form-control { width: auto; min-width: 155px; }
.filter-actions { display: flex; gap: 8px; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; width: 16px; height: 16px; }
.input-icon .form-control { padding-left: 34px; }

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
    font-size: .84rem;
    color: var(--text-muted);
}
.pagination { display: flex; gap: 4px; }
.page-link {
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: inline-grid;
    place-items: center;
    color: var(--text);
    background: #fff;
    font-weight: 500;
}
.page-link:hover { background: #f1f5f9; }
.page-link.active { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.page-link.disabled { opacity: .45; pointer-events: none; }

/* ---------- Forms ---------- */
.form-section-title {
    margin: 22px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-size: .95rem;
    font-weight: 700;
    color: var(--navy-900);
}
.form-section-title:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.col-span-2 { grid-column: span 2; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: .85rem; font-weight: 600; color: var(--navy-900); }
.req { color: var(--danger); }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: .9rem;
    color: var(--text);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 78, 216, .14); }
.form-control.is-invalid { border-color: var(--danger); }
textarea.form-control { resize: vertical; }
.form-help { font-size: .78rem; color: var(--text-muted); }
.invalid-feedback { font-size: .8rem; color: var(--danger); font-weight: 500; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }

.photo-field { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.photo-preview {
    width: 84px;
    height: 84px;
    border-radius: 12px;
    border: 1px dashed var(--border-strong);
    background: #f8fafc;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { width: 28px; height: 28px; color: var(--text-muted); }
.photo-input { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; cursor: pointer; }

/* Checklist */
.checklist { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.checklist.is-invalid { border-color: var(--danger); }
.checklist-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.checklist-toolbar .input-icon { flex: 1; }
.checklist-count { font-size: .8rem; font-weight: 600; color: var(--primary); white-space: nowrap; }
.checklist-items { max-height: 260px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; padding: 10px; }
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}
.checklist-item:hover { background: var(--primary-soft); border-color: #bfdbfe; }
.checklist-item input { margin-top: 3px; }
.checklist-text { display: flex; flex-direction: column; }
.checklist-name { font-size: .86rem; font-weight: 600; }
.checklist-meta { font-size: .75rem; color: var(--text-muted); }
.checklist-empty { grid-column: 1 / -1; text-align: center; color: var(--text-muted); margin: 12px 0; font-size: .86rem; }

/* ---------- Detail & Profile ---------- */
.profile-card .profile-name { margin: 4px 0 8px; font-size: 1.15rem; color: var(--navy-900); }
.profile-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.detail-list { margin: 0; }
.detail-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { font-size: .84rem; font-weight: 600; color: var(--text-muted); }
.detail-row dd { margin: 0; font-size: .9rem; color: var(--text); }

.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 10px; margin-top: 12px; }
.mini-stats > div { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px; text-align: center; }
.mini-stats span { display: block; font-size: .75rem; color: var(--text-muted); }
.mini-stats strong { font-size: 1.15rem; color: var(--navy-900); }

/* ---------- Schedule & Progress ---------- */
.schedule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.schedule-list li {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fbfdff;
    align-items: center;
}
.schedule-time {
    min-width: 78px;
    text-align: center;
    font-weight: 700;
    font-size: .84rem;
    color: var(--navy-900);
    background: var(--primary-soft);
    border-radius: 8px;
    padding: 6px 8px;
}
.schedule-time small { display: block; font-weight: 500; font-size: .72rem; color: var(--text-muted); }
.schedule-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.schedule-body span { font-size: .8rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.progress-summary { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.progress-summary li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 9px;
    font-weight: 600;
}
.progress-summary li strong { margin-left: auto; font-size: 1.2rem; }
.ps-up { background: var(--success-soft); color: #166534; }
.ps-flat { background: #f1f5f9; color: #334155; }
.ps-down { background: var(--danger-soft); color: #991b1b; }

/* ---------- Ranking ---------- */
.rank {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: .82rem;
    background: #f1f5f9;
    color: var(--navy-900);
}
.rank-1 { background: #fef08a; color: #854d0e; }
.rank-2 { background: #e2e8f0; color: #334155; }
.rank-3 { background: #fed7aa; color: #9a3412; }
.delta { font-weight: 700; font-size: .84rem; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--text-muted); }

/* ---------- Charts ---------- */
.chart-svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: #e2e8f0; stroke-width: 1; }
.chart-axis { font-size: 11px; fill: #64748b; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 10px; font-size: .8rem; color: var(--text-muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.donut-svg { width: 140px; height: 140px; flex-shrink: 0; }
.donut-center { font-size: 7.5px; font-weight: 800; fill: var(--navy-900); }
.donut-sub { font-size: 3.8px; fill: var(--text-muted); }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 7px; font-size: .84rem; }
.donut-legend li { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-legend span { flex: 1; color: var(--text-muted); }
.donut-legend em { font-style: normal; color: var(--text-muted); font-size: .78rem; min-width: 44px; text-align: right; }

.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar-label { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 5px; }
.hbar-track { height: 10px; background: #e8edf5; border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }

/* Radar Chart (Profil Hasil Tes Atlet) */
.profile-chart {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: left;
}
.profile-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.profile-chart-head h3 {
    margin: 0;
    font-size: .88rem;
    font-weight: 700;
    color: var(--navy-900);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.profile-chart-head h3 .icon { width: 15px; height: 15px; color: #fd4929; }
.radar-wrap { width: 100%; max-width: 360px; margin: 0 auto; }
.radar-svg { width: 100%; height: auto; display: block; overflow: visible; }
.radar-label { font-size: 9.5px; font-weight: 600; fill: #334155; }
.radar-scale { font-size: 8px; fill: #94a3b8; }
.profile-chart-empty {
    background: #f8fafc;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    padding: 16px 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: .82rem;
}
.profile-chart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: .8rem;
}
.profile-chart-summary strong { color: var(--navy-900); font-size: .92rem; }

/* ---------- Evaluation SWOT Boxes ---------- */
.sws-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sws-box { padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border); }
.sws-box h4 { margin: 0 0 6px; font-size: .86rem; text-transform: uppercase; letter-spacing: .04em; }
.sws-box p { margin: 0; font-size: .88rem; }
.sws-strength { background: var(--success-soft); border-color: #bbf7d0; }
.sws-strength h4 { color: #166534; }
.sws-weakness { background: var(--danger-soft); border-color: #fecaca; }
.sws-weakness h4 { color: #991b1b; }
.sws-solusi { background: var(--primary-soft); border-color: #bfdbfe; }
.sws-solusi h4 { color: #1e40af; }

/* ---------- Gallery (Dokumentasi) ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; padding: 18px; }
.gallery-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: transform var(--transition), box-shadow var(--transition); }
.gallery-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.gallery-thumb { height: 170px; background: #eef2f7; display: grid; place-items: center; overflow: hidden; color: var(--text-muted); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.gallery-body h3 { margin: 0; font-size: .96rem; color: var(--navy-900); }
.gallery-meta { font-size: .78rem; color: var(--text-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gallery-footer { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 6px; background: #f8fafc; }

/* ---------- Dynamic Repeater ---------- */
.repeater-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    margin-bottom: 10px;
}

/* ---------- Empty State & Modal & Install ---------- */
.empty-state { text-align: center; padding: 34px 20px; color: var(--text-muted); }
.empty-icon { width: 42px; height: 42px; color: #94a3b8; margin-bottom: 10px; }
.empty-state h3 { margin: 0 0 6px; font-size: 1rem; color: var(--navy-900); }
.empty-state p { margin: 0 0 14px; font-size: .88rem; }

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9, 19, 38, .55); }
.modal-dialog {
    position: relative;
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.modal-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); display: grid; place-items: center; margin: 0 auto 12px; }
.modal-dialog h3 { margin: 0 0 8px; color: var(--navy-900); }
.modal-dialog p { margin: 0 0 18px; color: var(--text-muted); font-size: .9rem; }
.modal-actions { display: flex; justify-content: center; gap: 10px; }

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-800) 100%);
}
.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 460px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}
.auth-card-wide { max-width: 560px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo { width: 78px; height: auto; object-fit: contain; margin-bottom: 10px; }
.auth-brand h1 { margin: 0 0 4px; font-size: 1.35rem; color: var(--navy-900); }
.auth-brand p { margin: 0; color: var(--text-muted); font-size: .88rem; }
.install-info { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 16px; font-size: .85rem; display: flex; flex-direction: column; gap: 4px; }
.checkbox-card { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--border-strong); border-radius: 10px; margin-bottom: 16px; cursor: pointer; background: #fbfdff; }
.error-card { text-align: center; }
.error-code { font-size: 3.2rem; font-weight: 800; color: var(--accent); line-height: 1; margin-bottom: 8px; }
.error-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2-1, .grid-1-2, .grid-3, .sws-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close, .topbar-toggle { display: inline-flex; }
    .sidebar.open + .sidebar-backdrop { display: block; }
    .main { margin-left: 0; }
    .topbar-date { display: none; }
}
@media (max-width: 680px) {
    .content { padding: 16px; }
    .topbar { padding: 0 14px; }
    .stats-grid, .grid-2, .form-grid, .repeater-row { grid-template-columns: 1fr; }
    .col-span-2 { grid-column: auto; }
    .detail-row { grid-template-columns: 1fr; gap: 2px; }
    .topbar-cabor { display: none; }
}
@media print {
    .sidebar, .topbar, .page-actions, .app-footer, .alert, .filter-bar, .row-actions { display: none !important; }
    .main { margin-left: 0 !important; }
    .card { box-shadow: none; border-color: #cbd5e1; break-inside: avoid; }
}
