/* ============================================================
   CARD
   ============================================================ */
.card {
    background: var(--color-card);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

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

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 150ms, border-color 150ms, color 150ms;
    border: 1px solid var(--color-border);
    font-family: var(--font-family);
    line-height: 1.4;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border-color: var(--color-primary);
}

.btn-primary:hover:not(:disabled) {
    background: #1F2229;
}

.btn-accent {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.btn-accent:hover:not(:disabled) {
    background: var(--color-accent-hover);
}

.btn-secondary {
    background: var(--color-card);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-surface);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
}

.btn-success {
    background: var(--color-success);
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: #16A34A;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: var(--font-family);
    background: var(--color-card);
    color: var(--color-text);
    transition: border-color 150ms;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(14,17,22,0.06);
}

.form-input::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.6;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.table-container {
    overflow-x: auto;
}

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

.data-table th {
    background: var(--color-card);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
    user-select: none;
}

.data-table th.sortable {
    cursor: pointer;
}

.data-table th.sortable:hover {
    color: var(--color-text);
}

.data-table th .sort-icon {
    display: inline-block;
    margin-left: 4px;
    opacity: 0.3;
    font-size: 0.7rem;
}

.data-table th.sort-asc .sort-icon,
.data-table th.sort-desc .sort-icon {
    opacity: 1;
    color: var(--color-accent);
}

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

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

.data-table tr.clickable {
    cursor: pointer;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-grade-a { background: #FEF3C7; color: #92400E; }
.badge-grade-a { background: #0E1116; color: #fff; }
.badge-grade-b { background: #3A3D44; color: #fff; }
.badge-grade-c { background: #C9762B; color: #fff; }
.badge-grade-default { background: var(--color-primary-light); color: var(--color-text-secondary); border: 1px solid var(--color-border); }

.badge-boys { background: #DBEAFE; color: #1E40AF; }
.badge-girls { background: #FCE7F3; color: #9D174D; }
.badge-mixed { background: #E0E7FF; color: #3730A3; }

.badge-success { background: var(--color-success-light); color: #166534; }
.badge-danger { background: var(--color-danger-light); color: #991B1B; }
.badge-warning { background: var(--color-warning-light); color: #92400E; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
    text-align: left;
    padding: 18px 20px 20px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
    letter-spacing: -0.035em;
}

.stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

.delta-positive {
    color: var(--color-success);
    font-weight: 600;
}

.delta-negative {
    color: var(--color-danger);
    font-weight: 600;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--color-text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
    max-width: 360px;
    margin: 0 auto;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 28px;
}

.page-header h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    line-height: 1.05;
    letter-spacing: -0.035em;
    font-weight: 600;
}

/* ============================================================
   GRID
   ============================================================ */
.grid {
    display: grid;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 420px;
    animation: toast-slide-in 300ms ease-out;
    border-left: 4px solid var(--color-border);
    font-size: 0.875rem;
}

.toast.toast-success { border-left-color: var(--color-success); }
.toast.toast-error   { border-left-color: var(--color-danger); }
.toast.toast-warning { border-left-color: var(--color-warning); }
.toast.toast-info    { border-left-color: var(--color-accent); }

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.toast.toast-success .toast-icon { color: var(--color-success); }
.toast.toast-error   .toast-icon { color: var(--color-danger); }
.toast.toast-warning .toast-icon { color: var(--color-warning); }
.toast.toast-info    .toast-icon { color: var(--color-accent); }

.toast-message {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 4px;
    line-height: 0;
}

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

.toast-removing {
    animation: toast-slide-out 200ms ease-in forwards;
}

@keyframes toast-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toast-slide-out {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modal-fade-in 150ms ease-out;
}

.modal-content {
    background: var(--color-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 560px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modal-scale-in 200ms ease-out;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
    line-height: 0;
}

.modal-close:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modal-scale-in {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.loading-spinner.lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

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

/* ============================================================
   FILE UPLOAD DROP ZONE
   ============================================================ */
.file-upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 150ms, background-color 150ms;
    background: var(--color-surface);
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.file-upload-zone svg {
    width: 40px;
    height: 40px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.file-upload-zone p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.file-upload-zone .file-upload-label {
    color: var(--color-accent);
    font-weight: 500;
    cursor: pointer;
}

.file-upload-zone .file-name {
    margin-top: 8px;
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.875rem;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-surface);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width 300ms ease;
}

/* ============================================================
   WIZARD STEPS
   ============================================================ */
.wizard-steps {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    position: relative;
}

.wizard-step .step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-border);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.wizard-step.active .step-number {
    background: var(--color-primary);
    color: #fff;
}

.wizard-step.completed .step-number {
    background: var(--color-success);
    color: #fff;
}

.wizard-step.active {
    color: var(--color-text);
    font-weight: 500;
}

.wizard-step-connector {
    width: 40px;
    height: 2px;
    background: var(--color-border);
    align-self: center;
}

.wizard-step-connector.completed {
    background: var(--color-success);
}

.setup-shell {
    max-width: 1180px;
}

.setup-grid {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.setup-summary {
    min-width: 160px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: var(--shadow-sm);
}

.setup-summary strong {
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.setup-summary span {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.setup-rail {
    position: sticky;
    top: 84px;
}

.setup-rail .wizard-steps {
    margin: 0;
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.setup-rail .wizard-step {
    border-radius: var(--radius-md);
    padding: 10px;
}

.setup-rail .wizard-step.active {
    background: var(--color-primary-light);
}

.setup-rail .wizard-step-connector {
    display: none;
}

.setup-panel .panel-body {
    min-height: 420px;
}

.wizard-intro {
    margin-bottom: 18px;
}

.wizard-intro h3 {
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin: 4px 0 8px;
    font-weight: 600;
}

.wizard-intro p {
    max-width: 680px;
    color: var(--muted);
    font-size: 14px;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.preset-card {
    min-height: 92px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    font-family: var(--font-family);
}

.preset-card:hover,
.preset-card:focus {
    border-color: var(--ink);
    background: var(--color-primary-light);
    outline: none;
}

.preset-card strong {
    display: block;
    font-family: var(--font-display);
    font-size: 20px;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.preset-card span {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.chip-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--ink);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
}

.chip:hover,
.chip:focus {
    border-color: var(--ink);
    background: var(--color-primary-light);
    outline: none;
}

.cap-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
}

.cap-preview span {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    padding: 4px 8px;
    font-family: var(--font-mono);
}

/* ============================================================
   INLINE EDITABLE
   ============================================================ */
.inline-edit {
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-family);
    background: transparent;
    width: 80px;
    text-align: center;
}

.inline-edit:hover {
    border-color: var(--color-border);
}

.inline-edit:focus {
    border-color: var(--color-primary);
    outline: none;
    background: var(--color-card);
}

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.toggle input {
    display: none;
}

.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--color-border);
    border-radius: 11px;
    transition: background 200ms;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 200ms;
}

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

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

/* ============================================================
   TEAM LOGO
   ============================================================ */
.team-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-surface);
    border: 2px solid var(--color-border-light);
}

.team-logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 2px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
}

/* ============================================================
   SCORE INPUT
   ============================================================ */
.score-input {
    width: 64px;
    padding: 6px 8px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-variant-numeric: tabular-nums;
}

.score-input:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(14,17,22,0.06);
}

.score-vs {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    font-weight: 600;
    padding: 0 8px;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-bar .form-select {
    width: auto;
    min-width: 180px;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 150ms, border-color 150ms;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-family);
}

.tab:hover {
    color: var(--color-text);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* ============================================================
   AUTOCOMPLETE
   ============================================================ */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.875rem;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: var(--color-surface);
}

/* ============================================================
   RESPONSIVE (minimal - sidebar collapses)
   ============================================================ */
@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        transition: transform 200ms;
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #main {
        margin-left: 0;
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   REDESIGN TRANSLATION: OPS DASHBOARD + SPORTS SURFACES
   ============================================================ */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 28px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 40px;
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin: 0 0 8px;
    font-weight: 600;
}

.page-title em {
    color: var(--accent);
    font-style: normal;
}

.page-sub {
    color: var(--muted);
    font-size: 14px;
    max-width: 680px;
}

.page-head-actions,
.row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.panel-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.panel-h h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.panel-sub {
    font-size: 12px;
    color: var(--muted);
}

.panel-body {
    padding: 18px;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px;
}

.toolbar .form-select,
.toolbar .form-input {
    width: auto;
    min-width: 190px;
}

.csv-progress {
    height: 6px;
    border-radius: 0;
    background: var(--color-border-light);
}

.grow {
    flex: 1;
}

.seg {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.seg button {
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    padding: 5px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
}

.seg button.is-on {
    background: var(--panel);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.seg button:disabled {
    opacity: 0.45;
}

.ribbon {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.ribbon-step {
    display: flex;
    gap: 9px;
    align-items: center;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}

.ribbon-bullet {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    flex: none;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--color-surface);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
}

.ribbon-step.is-done .ribbon-bullet {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
}

.ribbon-label {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ribbon-detail {
    margin-top: 1px;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cascade {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1fr) minmax(420px, 1.35fr);
    gap: 16px;
    align-items: start;
}

.col {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.col-wide {
    min-width: 0;
}

.col-head {
    min-height: 72px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.col-eyebrow {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.col-title {
    font-family: var(--font-display);
    font-size: 21px;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.col-body {
    padding: 12px;
}

.col-body-pad {
    padding: 14px;
}

.org-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    padding: 14px;
}

.org-card-top,
.team-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.org-card-mark,
.team-cell-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: var(--radius-md);
    background: var(--ink);
    color: var(--color-text-inverse);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.03em;
}

.org-card-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.org-card-stats > div {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    padding: 10px;
}

.grade-ladder,
.div-group,
.team-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.grade-rung {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
}

.grade-pill {
    min-width: 30px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    padding: 0 8px;
    background: var(--color-primary-light);
    color: var(--ink);
    border: 1px solid var(--line);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.grade-A,
.grade-a {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--color-text-inverse);
}

.grade-B,
.grade-b {
    background: #3A3D44;
    border-color: #3A3D44;
    color: #fff;
}

.grade-C,
.grade-c {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.div-group + .div-group {
    margin-top: 14px;
}

.div-group-h {
    padding: 0 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.div-row {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    color: var(--ink);
    padding: 9px;
    cursor: pointer;
    font-family: var(--font-family);
    text-align: left;
}

.div-row:hover,
.div-row.is-active {
    border-color: var(--ink);
    background: var(--color-primary-light);
}

.div-row-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    font-size: 13px;
}

.div-row-count {
    color: var(--muted);
    font-size: 11px;
}

.div-row-chev {
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
}

.add-card {
    margin-top: 14px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    padding: 12px;
}

.add-card-h {
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.add-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.team-card {
    min-height: 150px;
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.team-card:hover {
    border-color: var(--ink);
    transform: translateY(-1px);
}

.team-card-stripe {
    min-height: 100%;
}

.team-card-body {
    min-width: 0;
    padding: 12px;
}

.team-card-h {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.team-card-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
    font-size: 14px;
}

.team-card-add {
    display: block;
    min-height: 0;
    cursor: default;
    border-style: dashed;
    background: var(--color-surface);
}

.team-card-add:hover {
    transform: none;
    border-color: var(--line);
}

.div-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.div-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    padding: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.div-card:hover {
    border-color: var(--ink);
    transform: translateY(-1px);
}

.div-card-h {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.div-card-age {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.div-card-name {
    margin-top: 4px;
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1.05;
    letter-spacing: -0.04em;
    font-weight: 600;
}

.div-card-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 20px;
}

.div-card-stats > div {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: 9px;
}

.div-card-stat-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.div-card-stat-value {
    margin-top: 2px;
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.04em;
}

.empty-pop {
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    padding: 24px;
    color: var(--muted);
}

.club-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.club-card {
    min-height: 210px;
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.club-card:hover {
    border-color: var(--ink);
    transform: translateY(-1px);
}

.club-card-stripe {
    min-height: 100%;
}

.club-card-body {
    min-width: 0;
    padding: 14px;
}

.club-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.club-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-weight: 800;
    object-fit: cover;
}

.club-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1.05;
    letter-spacing: -0.04em;
    font-weight: 600;
}

.club-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    margin-right: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--club-a) 0 55%, var(--club-b) 55% 100%);
    vertical-align: -1px;
}

.club-profile {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    overflow: hidden;
}

.club-profile-stripe {
    min-height: 100%;
}

.team-pick-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.team-pick-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    cursor: pointer;
}

.team-pick-row:hover {
    background: var(--color-primary-light);
}

.team-pick-row.is-muted {
    cursor: default;
    opacity: 0.65;
}

.team-pick-row span {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.team-pick-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.team-pick-row small {
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 11px;
}

.team-pick-row em {
    font-style: normal;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.club-chart-wrap {
    height: 320px;
}

.club-mini-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

.club-mini-metrics > div {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: 10px;
}

.club-mini-metrics span {
    display: block;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11px;
}

.club-mini-metrics strong {
    display: block;
    margin-top: 4px;
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.club-mini-metrics small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.divider {
    height: 1px;
    background: var(--line);
}

.text-muted { color: var(--muted); }
.text-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}
.text-serif {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.03em;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.input,
.select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--ink);
    font-size: 13px;
    outline: none;
}

.input:focus,
.select:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(14,17,22,0.06);
}

#sidebar .sidebar-header {
    display: none;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
    gap: 16px;
    margin-bottom: 28px;
}

.hero-panel {
    min-height: 280px;
    border-radius: 10px;
    padding: 32px;
    background:
        linear-gradient(135deg, rgba(14,17,22,0.94), rgba(14,17,22,0.78)),
        radial-gradient(circle at 88% 20%, rgba(201,118,43,0.48), transparent 34%),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 52px);
    color: var(--color-text-inverse);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

.hero-panel::after {
    content: "";
    position: absolute;
    right: 30px;
    bottom: -80px;
    width: 240px;
    height: 240px;
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    box-shadow: inset 0 0 0 42px transparent;
}

.hero-eyebrow,
.page-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

.hero-panel .hero-eyebrow {
    color: rgba(255,255,255,0.62);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 5vw, 4.4rem);
    line-height: 0.96;
    letter-spacing: -0.055em;
    font-weight: 600;
    margin: 12px 0 12px;
    max-width: 680px;
}

.hero-title em,
.page-header h2 em {
    color: var(--color-accent);
    font-style: normal;
}

.hero-copy {
    max-width: 560px;
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
}

.hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.next-card {
    height: 100%;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.next-card h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: -0.03em;
    margin-bottom: 2px;
}

.next-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 18px;
}

.next-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    background: var(--color-surface);
}

.next-num {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
}

.next-item.is-done .next-num {
    background: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
}

.next-item.is-active {
    background: #F7EADC;
    border-color: #E9CFB1;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.activity-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-top: 6px;
    background: var(--color-accent);
}

.activity-meta {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-top: 2px;
}

.bar-cell {
    height: 8px;
    background: var(--color-border-light);
    border-radius: 999px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--color-primary);
}

.issue-panel {
    border-color: var(--color-danger);
    background: var(--color-danger-light);
}

.issue-panel .panel-h,
.issue-panel .panel-body {
    background: var(--color-card);
}

.issue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.issue-row {
    display: grid;
    grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.issue-row strong {
    color: var(--color-danger);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.issue-row span {
    min-width: 0;
    color: var(--ink);
    font-size: 13px;
}

.issue-row em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    white-space: nowrap;
}

.analytics-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.analytics-kpi {
    min-height: 112px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.analytics-chart {
    height: 320px;
    min-width: 0;
}

.analytics-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.analytics-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--ink);
    text-decoration: none;
}

.analytics-row:hover {
    background: var(--color-primary-light);
}

.analytics-row strong,
.analytics-row small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-row strong {
    font-size: 13px;
    font-weight: 700;
}

.analytics-row small {
    color: var(--muted);
    font-size: 11px;
    margin-top: 1px;
}

.analytics-row em {
    flex: none;
    font-family: var(--font-mono);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.analytics-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    overflow: hidden;
}

.analytics-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.score-gap-card,
.consistency-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.score-gap-value {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
}

.score-gap-card strong,
.consistency-card strong {
    display: block;
    font-size: 14px;
}

.score-gap-card span,
.consistency-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.consistency-card {
    justify-content: space-between;
}

.consistency-card em {
    color: var(--color-success);
    font-family: var(--font-mono);
    font-size: 20px;
    font-style: normal;
    font-weight: 800;
}

.report-division {
    margin-bottom: 22px;
}

.report-division:last-child {
    margin-bottom: 0;
}

.report-division-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
}

.report-division-head h4 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: -0.025em;
}

.report-division-head span {
    color: var(--muted);
    font-size: 12px;
}

body.auth-mode #sidebar,
body.auth-mode #topbar {
    display: none;
}

body.auth-mode #main {
    margin-left: 0;
}

body.auth-mode #content {
    padding: 0;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #f6f7f9;
    padding: 24px;
}

.auth-panel {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 16px 48px rgba(14, 17, 22, 0.08);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.auth-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-submit {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

.auth-error {
    min-height: 20px;
    color: var(--color-danger);
    font-size: 0.9rem;
}

.auth-switch {
    margin-top: 18px;
    color: var(--color-muted);
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 980px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .ribbon {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cascade {
        grid-template-columns: 1fr;
    }

    .setup-grid {
        grid-template-columns: 1fr;
    }

    .setup-rail {
        position: static;
    }

    .setup-rail .wizard-steps {
        flex-direction: row;
        overflow-x: auto;
    }

    .setup-rail .wizard-step {
        white-space: nowrap;
        flex: none;
    }

    .preset-grid {
        grid-template-columns: 1fr;
    }

    .topbar-search,
    .breadcrumb {
        display: none;
    }

    .analytics-kpis,
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}
