/* VeiTadaladoFC - Design system mobile-first inspirado no Material 3.
   Variaveis controlam tema; data-theme="dark|light" troca paleta. */

:root {
    --primary: #1976d2;
    --primary-rgb: 25,118,210;
    --primary-dark: #115293;
    --accent:  #ff5722;
    --accent-rgb: 255,87,34;
    --bg:      #f3f5f9;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --on-surface: #1a2433;
    --on-surface-muted: #54667a;
    --border:  #e3e9f1;
    --border-strong: #c9d4e1;
    --shadow-1: 0 1px 2px rgba(20,40,80,.05), 0 2px 4px rgba(20,40,80,.04);
    --shadow-2: 0 4px 8px rgba(20,40,80,.08), 0 2px 4px rgba(20,40,80,.06);
    --shadow-3: 0 12px 24px rgba(20,40,80,.10), 0 4px 8px rgba(20,40,80,.06);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --transition: 200ms cubic-bezier(.4,0,.2,1);
    --header-h: 60px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
    --bg: #0f141c;
    --bg-elevated: #161d29;
    --surface: #1a2230;
    --surface-2: #222b3b;
    --on-surface: #e8eef5;
    --on-surface-muted: #93a4b6;
    --border: #2a3445;
    --border-strong: #3b4759;
    --shadow-1: 0 1px 2px rgba(0,0,0,.5);
    --shadow-2: 0 4px 8px rgba(0,0,0,.55);
    --shadow-3: 0 12px 24px rgba(0,0,0,.65);
}

* { box-sizing: border-box; }
*::selection { background: rgba(var(--primary-rgb), .25); }

html { scroll-behavior: smooth; }
html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--on-surface);
    font-family: 'Inter', 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition), color var(--transition);
}

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

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }

.muted { color: var(--on-surface-muted); }
.small { font-size: .82rem; }

/* ===== App bar ===== */
.app-bar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(var(--primary-rgb), 0);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-1);
}

.app-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--header-h);
}

.brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--on-surface);
    text-decoration: none;
    flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: grid; place-items: center;
    color: #fff; font-weight: 900;
    box-shadow: 0 4px 8px rgba(var(--primary-rgb), .3);
    font-size: 1rem;
}

.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; justify-content: center; }
.nav a {
    padding: 8px 14px;
    color: var(--on-surface-muted);
    border-radius: var(--radius-pill);
    font-weight: 500;
    font-size: .92rem;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}
.nav a:hover { text-decoration: none; background: rgba(var(--primary-rgb),.08); color: var(--primary); }
.nav a.active { background: rgba(var(--primary-rgb),.14); color: var(--primary); }

.app-bar-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* Esconder elementos especificos por viewport */
.hide-on-mobile { display: inline-flex; }
@media (max-width: 720px) { .hide-on-mobile { display: none; } }

/* Theme btn - alterna icone via data-theme */
.theme-btn [data-icon-light] { display: inline-grid; }
.theme-btn [data-icon-dark]  { display: none; }
[data-theme="dark"] .theme-btn [data-icon-light] { display: none; }
[data-theme="dark"] .theme-btn [data-icon-dark]  { display: inline-grid; }

/* Hamburger (admin) */
.hamburger {
    width: 22px; height: 16px; position: relative; display: inline-block;
}
.hamburger i {
    position: absolute; left: 0; width: 100%; height: 2px;
    background: currentColor; border-radius: 2px;
    transition: transform .2s, top .2s, opacity .2s;
}
.hamburger i:nth-child(1) { top: 0; }
.hamburger i:nth-child(2) { top: 7px; }
.hamburger i:nth-child(3) { top: 14px; }
[data-admin-nav-open] .hamburger i:nth-child(1) { top: 7px; transform: rotate(45deg); }
[data-admin-nav-open] .hamburger i:nth-child(2) { opacity: 0; }
[data-admin-nav-open] .hamburger i:nth-child(3) { top: 7px; transform: rotate(-45deg); }

@media (max-width: 720px) {
    .nav-desktop { display: none; }
    .brand-text { font-size: .95rem; max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    body:not(.auth-page) { padding-bottom: calc(72px + var(--safe-bottom)); }
}

/* ===== Bottom nav (mobile) ===== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 8px rgba(0,0,0,.06);
    z-index: 50;
    padding: 6px 4px calc(6px + var(--safe-bottom));
    justify-content: space-around;
    align-items: stretch;
    gap: 2px;
}
[data-theme="dark"] .bottom-nav { box-shadow: 0 -2px 12px rgba(0,0,0,.3); }
.bottom-nav a, .bottom-nav button {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    background: transparent; border: none;
    color: var(--on-surface-muted);
    text-decoration: none;
    font-size: .68rem; font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition), transform var(--transition);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.bottom-nav a:hover, .bottom-nav button:hover { text-decoration: none; color: var(--on-surface); }
.bottom-nav a.active {
    color: var(--primary);
    background: rgba(var(--primary-rgb),.10);
}
.bottom-nav a.active::before {
    content: ""; position: absolute; top: 2px;
    width: 24px; height: 3px;
    background: var(--primary); border-radius: 2px;
}
.bottom-nav svg { width: 22px; height: 22px; }
.bottom-nav span { line-height: 1; }
@media (max-width: 720px) { .bottom-nav { display: flex; } }

/* ===== Bottom sheet ===== */
.bottom-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 40px rgba(0,0,0,.18);
    z-index: 70;
    padding: 8px 16px calc(20px + var(--safe-bottom));
    transform: translateY(110%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    max-height: 70vh;
    overflow-y: auto;
}
[data-sheet-open] .bottom-sheet { transform: translateY(0); }
.sheet-handle {
    width: 40px; height: 4px;
    background: var(--border-strong);
    border-radius: 2px;
    margin: 8px auto 14px;
}
.sheet-title { margin: 0 0 12px; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--on-surface-muted); }
.sheet-list { display: flex; flex-direction: column; gap: 4px; }
.sheet-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 12px;
    border-radius: var(--radius-sm);
    background: transparent; border: none;
    color: var(--on-surface);
    font-size: 1rem; text-align: left;
    cursor: pointer;
    transition: background var(--transition);
    text-decoration: none;
    width: 100%;
}
.sheet-item:hover { background: var(--surface-2); text-decoration: none; }
.sheet-item svg { color: var(--primary); flex-shrink: 0; }

.sheet-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 65;
    opacity: 0; pointer-events: none;
    transition: opacity .2s;
}
[data-sheet-open] .sheet-backdrop { opacity: 1; pointer-events: auto; }

/* ===== Banner DB offline ===== */
.db-offline-banner {
    background: linear-gradient(90deg, rgba(255,152,0,.18), rgba(255,87,34,.16));
    color: #b3590e;
    border-bottom: 1px solid rgba(255,152,0,.35);
    padding: 8px 16px;
    font-size: .85rem;
    text-align: center;
    display: flex; gap: 10px; justify-content: center; align-items: center;
    flex-wrap: wrap;
}
.db-offline-banner .dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: #ff9800;
    animation: pulse 1.4s ease-in-out infinite;
}
[data-theme="dark"] .db-offline-banner { color: #ffb86b; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ===== Container e secoes ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 14px 48px;
}
@media (min-width: 600px) { .container { padding: 28px 20px 56px; } }

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    padding: 18px;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.card.hoverable:hover {
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
    border-color: var(--border-strong);
}
.card h3 { margin-bottom: 10px; }

/* ===== Grids ===== */
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid.cards-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 1000px) {
    .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
    .grid.cards-grid { grid-template-columns: 1fr; }
}

/* ===== Hero ===== */
.hero {
    border-radius: var(--radius);
    padding: 28px 24px;
    background:
        radial-gradient(circle at 20% 0%, rgba(var(--accent-rgb),.18), transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(var(--primary-rgb),.25), transparent 55%),
        linear-gradient(135deg, rgba(var(--primary-rgb),.10), rgba(var(--accent-rgb),.10));
    border: 1px solid var(--border);
    margin-bottom: 24px;
    overflow: hidden;
    position: relative;
}
.hero h1 { margin: 0 0 8px; font-size: clamp(1.5rem, 2.2vw + 1rem, 2.4rem); }
.hero .lead { color: var(--on-surface-muted); max-width: 64ch; }
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 18px;
}
.stat {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.stat .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--on-surface-muted); }
.stat .value { font-weight: 700; font-size: 1.4rem; margin-top: 4px; }

/* ===== Botoes ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: .92rem;
    cursor: pointer;
    background: transparent;
    color: var(--on-surface);
    transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
    text-decoration: none;
    -webkit-appearance: none;
    appearance: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-primary {
    background: var(--primary); color: #fff;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb),.30);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 6px 16px rgba(var(--primary-rgb),.4); }
.btn-outline { border-color: var(--border-strong); }
.btn-outline:hover { background: rgba(var(--primary-rgb),.06); border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #d32f2f; color: #fff; }
.btn-danger:hover { background: #9a0007; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }

.icon-btn {
    background: transparent;
    border: none;
    color: var(--on-surface-muted);
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.05rem;
    display: grid; place-items: center;
    transition: background var(--transition), color var(--transition);
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
}
.icon-btn:hover { background: rgba(0,0,0,.06); color: var(--on-surface); }
[data-theme="dark"] .icon-btn:hover { background: rgba(255,255,255,.08); }

/* ===== Forms ===== */
.field { display: block; margin-bottom: 14px; }
.field > span {
    display: block;
    font-size: .82rem;
    color: var(--on-surface-muted);
    margin-bottom: 5px;
    font-weight: 500;
}
.field input, .field select, .field textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-elevated);
    color: var(--on-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.18);
}

.checkbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    cursor: pointer;
    user-select: none;
    font-size: .9rem;
}
.checkbox-pill input { width: auto; margin: 0; }

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: .92rem;
    border: 1px solid transparent;
    display: flex; gap: 10px; align-items: flex-start;
}
.alert-error   { background: #fde7e9; color: #b00020; border-color: #f8c2c8; }
.alert-success { background: #e6f4ea; color: #1b5e20; border-color: #b8e0c2; }
.alert-info    { background: #e3f2fd; color: #0d47a1; border-color: #bbdefb; }
[data-theme="dark"] .alert-error   { background: #3b1d22; color: #ff8a96; border-color: #5a2a32; }
[data-theme="dark"] .alert-success { background: #1d3a25; color: #88e1a3; border-color: #2c5237; }
[data-theme="dark"] .alert-info    { background: #1b2c45; color: #82b1ff; border-color: #2c4670; }

/* ===== Status pill ===== */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: .82rem;
    font-weight: 600;
    background: rgba(0,0,0,.06);
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255,255,255,.3); }
.status-pill.aberto { background: rgba(46,160,67,.15); color: #2ea043; }
.status-pill.fechado { background: rgba(244,67,54,.15); color: #f44336; }
.status-pill.atualizando { background: rgba(255,152,0,.15); color: #ff9800; }
.status-pill.manutencao { background: rgba(96,125,139,.18); color: #607d8b; }

/* ===== Listas ===== */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: background var(--transition), transform var(--transition), border-color var(--transition);
}
.list-item:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
    transform: translateX(2px);
}
.list-item .avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--bg);
    display: grid; place-items: center;
    overflow: hidden;
    flex: 0 0 44px;
    border: 1px solid var(--border);
}
.list-item .avatar.square { border-radius: var(--radius-sm); }
.list-item .avatar img { width: 100%; height: 100%; object-fit: contain; }
.list-item .meta { flex: 1; min-width: 0; }
.list-item .meta .title {
    font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    display: flex; align-items: center; gap: 6px;
}
.list-item .meta .sub { color: var(--on-surface-muted); font-size: .82rem; }
.list-item .right { text-align: right; flex-shrink: 0; }
.list-item .right strong { font-size: 1.05rem; }

/* ===== Chips ===== */
.chip {
    display: inline-flex; align-items: center;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    background: rgba(0,0,0,.06);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--on-surface-muted);
}
[data-theme="dark"] .chip { background: rgba(255,255,255,.10); }
.chip.gol { background: rgba(255,193,7,.20); color: #ffa000; }
.chip.zag, .chip.lat { background: rgba(33,150,243,.20); color: #1976d2; }
.chip.mei { background: rgba(156,39,176,.20); color: #8e24aa; }
.chip.ata { background: rgba(244,67,54,.22); color: #d32f2f; }
.chip.tec { background: rgba(96,125,139,.20); color: #546e7a; }

/* ===== Skeleton loading ===== */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--surface-2) 37%, var(--border) 63%);
    background-size: 400% 100%;
    animation: skel 1.4s ease infinite;
    border-radius: var(--radius-sm);
}
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--on-surface-muted);
}

/* ===== Footer ===== */
.footer {
    padding: 24px 16px calc(24px + var(--safe-bottom));
    color: var(--on-surface-muted);
    font-size: .85rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
    background: var(--surface);
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    text-align: center;
}

/* ===== Auth ===== */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 10%, rgba(var(--accent-rgb),.15), transparent 50%),
        radial-gradient(circle at 80% 90%, rgba(var(--primary-rgb),.20), transparent 50%),
        var(--bg);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-3);
    padding: 32px;
}
.auth-card h1 { margin-bottom: .25em; }
.auth-card .btn { width: 100%; margin-top: 4px; }

/* ===== Tabela ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
table.data {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
table.data th, table.data td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
table.data th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--on-surface-muted); background: var(--surface-2); }
table.data tbody tr:hover { background: var(--surface-2); }

/* ===== Search ===== */
.search { position: relative; }
.search input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    color: var(--on-surface);
    font-size: .95rem;
}
.search::before {
    content: "🔍";
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: .55;
    font-size: .9rem;
}

.toolbar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.toolbar > * { flex: 1 1 auto; }
.toolbar .field { margin: 0; }
.toolbar select { width: auto; }
.toolbar .search { min-width: 220px; flex: 2 1 220px; }
@media (max-width: 560px) {
    .toolbar > * { flex: 1 1 100%; }
}

/* ===== Match card (redesign) - grid 4 colunas ===== */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
@media (max-width: 1200px) { .matches-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 900px)  { .matches-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 540px)  { .matches-grid { grid-template-columns: 1fr; gap: 10px; } }

.match {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px 16px;
    display: flex; flex-direction: column; gap: 12px;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.match:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.match::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--border);
    transition: background var(--transition);
}
.match:hover {
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
    border-color: var(--border-strong);
}
.match[data-status="live"]::before     { background: linear-gradient(180deg, #ef5350, #e53935); }
.match[data-status="finished"]::before { background: linear-gradient(180deg, var(--primary), var(--accent)); }
.match[data-status="upcoming"]::before { background: var(--border-strong); }

.match-header {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
    font-size: .8rem;
    color: var(--on-surface-muted);
}
.match-header .meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.match-header .meta svg { width: 14px; height: 14px; }
.match-header .grow { flex: 1; }

.match-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: .7rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
}
.match-status.upcoming { background: rgba(var(--primary-rgb),.12); color: var(--primary); }
.match-status.live     { background: rgba(229,57,53,.15); color: #e53935; }
.match-status.live .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }
.match-status.finished { background: rgba(46,160,67,.15); color: #2ea043; }

.match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
}
.match-team { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.match-team img {
    width: 52px; height: 52px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.1));
}
.match-team .name {
    font-weight: 700;
    font-size: .92rem;
    text-align: center;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 100%;
}
.match-team .form {
    display: flex; gap: 3px;
    margin-top: 2px;
}
.match-team .form i {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--border);
    display: inline-block;
}
.match-team .form i.v { background: #2ea043; }
.match-team .form i.e { background: #ff9800; }
.match-team .form i.d { background: #e53935; }

.match-center {
    text-align: center;
    min-width: 80px;
    display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.match-score {
    font-size: 1.7rem; font-weight: 900;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--on-surface);
    display: flex; align-items: center; gap: 8px;
}
.match-score .x { color: var(--on-surface-muted); font-weight: 600; font-size: 1rem; }
.match-vs {
    font-size: .8rem; font-weight: 700;
    color: var(--on-surface-muted);
    letter-spacing: .1em;
}
.match-time {
    font-size: 1.15rem; font-weight: 800;
    color: var(--on-surface);
    line-height: 1.1;
}
.match-date {
    font-size: .72rem;
    color: var(--on-surface-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.match-stadium {
    font-size: .78rem;
    color: var(--on-surface-muted);
    display: flex; align-items: center; gap: 5px;
    justify-content: center;
}
.match-stadium svg { width: 13px; height: 13px; }

@media (max-width: 380px) {
    .match { padding: 12px; }
    .match-team img { width: 42px; height: 42px; }
    .match-team .name { font-size: .82rem; }
    .match-score { font-size: 1.4rem; }
    .match-time { font-size: 1rem; }
    .match-center { min-width: 60px; }
}

/* ===== Atleta tile (visual com foto grande) ===== */
.tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--transition), transform var(--transition);
}
.tile:hover { box-shadow: var(--shadow-2); transform: translateY(-3px); }
.tile-photo {
    aspect-ratio: 1 / 1;
    background:
        radial-gradient(circle at 50% 0%, rgba(var(--primary-rgb),.12), transparent 70%),
        var(--surface-2);
    display: grid; place-items: center;
    position: relative;
    overflow: hidden;
}
.tile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tile-photo .pos-chip { position: absolute; top: 8px; left: 8px; }
.tile-body { padding: 12px 14px; }
.tile-body .title {
    font-weight: 700;
    font-size: .98rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile-body .sub { color: var(--on-surface-muted); font-size: .8rem; }
.tile-stats {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.tile-stats .stat-cell .label { font-size: .68rem; text-transform: uppercase; color: var(--on-surface-muted); }
.tile-stats .stat-cell .value { font-weight: 700; font-size: .95rem; }

/* ===== Pagination ===== */
.pager {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.page-controls {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    margin: 14px 0;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.page-controls .label { color: var(--on-surface-muted); font-size: .85rem; }
.page-controls .grow { flex: 1; }
.page-controls select {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    color: var(--on-surface);
    font-size: .9rem;
}

/* ===== KV ===== */
.kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 16px;
    font-size: .92rem;
    margin: 0;
}
.kv dt { color: var(--on-surface-muted); }
.kv dd { margin: 0; font-weight: 500; text-align: right; }

/* ===== Animacoes ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .3s ease both; }

/* ===== Mito da rodada ===== */
.mito-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb),.10), rgba(var(--accent-rgb),.10));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}
.mito-trophy { font-size: 2rem; flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); }
.mito-info { flex: 1; min-width: 0; }
.mito-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--on-surface-muted); font-weight: 700; }
.mito-name  { font-size: 1.1rem; font-weight: 800; line-height: 1.15; }
.mito-sub   { font-size: .82rem; color: var(--on-surface-muted); }
.mito-escudo { width: 44px; height: 44px; flex-shrink: 0; }
.mito-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ===== Pontuado item ===== */
.pontuado-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.pontuado-item:hover { box-shadow: var(--shadow-1); border-color: var(--border-strong); }
.pontuado-item.is-bench { opacity: .6; }
.pontuado-item .avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.pontuado-item .avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pontuado-item .meta { min-width: 0; }
.pontuado-item .title { font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pontuado-item .sub { color: var(--on-surface-muted); font-size: .82rem; }

.scout-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.scout-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: .72rem;
    font-weight: 600;
    color: var(--on-surface-muted);
}
.scout-chip strong { color: var(--on-surface); font-weight: 800; }

.muted-chip { background: var(--surface-2); color: var(--on-surface-muted); border: 1px solid var(--border); font-size: .65rem; padding: 2px 8px; }

.pontuado-score {
    display: flex; flex-direction: column; align-items: flex-end;
    flex-shrink: 0;
    text-align: right;
}
.pontuado-score strong { font-size: 1.3rem; font-weight: 900; line-height: 1; }
.pontuado-score.positive strong { color: #2ea043; }
.pontuado-score.negative strong { color: #e53935; }
.pontuado-score.neutral strong  { color: var(--on-surface); }

@media (max-width: 480px) {
    .pontuado-item { padding: 10px 12px; gap: 10px; }
    .pontuado-item .avatar { width: 40px; height: 40px; }
    .pontuado-score strong { font-size: 1.1rem; }
}

/* ===== Match modal ===== */
.match-modal {
    position: fixed; inset: 0;
    z-index: 80;
    display: none;
    align-items: center; justify-content: center;
    padding: 16px;
}
.match-modal[aria-hidden="false"] { display: flex; }
.match-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
    animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.match-modal-card {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-3);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: slideUp .22s cubic-bezier(.4,0,.2,1);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.match-modal-close {
    position: absolute; top: 10px; right: 10px;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--surface-2);
    color: var(--on-surface);
    font-size: 1.4rem; cursor: pointer;
    z-index: 2;
    transition: background var(--transition);
}
.match-modal-close:hover { background: var(--border); }
.match-modal-header {
    padding: 20px 18px 14px;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(circle at 20% 0%, rgba(var(--primary-rgb),.10), transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(var(--accent-rgb),.10), transparent 60%);
}
.match-modal-header .teams-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px; align-items: center;
}
.match-modal-header .team-block { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.match-modal-header .team-block img { width: 56px; height: 56px; }
.match-modal-header .team-block .name { font-weight: 700; text-align: center; }
.match-modal-header .center {
    text-align: center; min-width: 90px;
}
.match-modal-header .center .score { font-size: 2rem; font-weight: 900; line-height: 1; }
.match-modal-header .center .x { color: var(--on-surface-muted); font-size: 1.1rem; }
.match-modal-header .center .meta { font-size: .78rem; color: var(--on-surface-muted); margin-top: 4px; }
.match-modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
    overflow-x: auto;
}
.match-modal-tabs button {
    background: transparent; border: none;
    padding: 12px 14px;
    font-size: .9rem; font-weight: 600;
    color: var(--on-surface-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
}
.match-modal-tabs button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.match-modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 14px;
}
.match-modal-body .list { gap: 6px; }
.match-modal-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    display: flex; gap: 10px; align-items: center;
    font-size: .8rem; color: var(--on-surface-muted);
    background: var(--surface-2);
}
.live-indicator {
    display: inline-flex; align-items: center; gap: 6px;
    color: #e53935; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; font-size: .72rem;
}
.live-indicator::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: currentColor; animation: pulse 1.4s ease-in-out infinite;
}

@media (max-width: 540px) {
    .match-modal { padding: 0; align-items: stretch; }
    .match-modal-card { max-width: none; max-height: 100vh; border-radius: 0; }
}

/* ===== Atleta detalhe (server-rendered) ===== */
.atleta-hero {
    display: flex; gap: 18px; align-items: center;
    padding: 22px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb),.10), rgba(var(--accent-rgb),.10));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.atleta-hero .photo {
    width: 96px; height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface);
    border: 2px solid var(--surface);
    box-shadow: var(--shadow-2);
    flex-shrink: 0;
}
.atleta-hero .photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.atleta-hero .info { flex: 1; min-width: 200px; }
.atleta-hero .info h1 { font-size: 1.6rem; margin: 0 0 6px; }
.atleta-hero .info .sub { color: var(--on-surface-muted); font-size: .92rem; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.atleta-hero .summary { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.atleta-hero .summary .stat {
    padding: 10px 14px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-align: center;
    min-width: 90px;
}

/* SVG line chart */
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 18px;
}
.chart-card h3 { margin: 0 0 12px; }
.chart-svg-wrap { width: 100%; overflow-x: auto; }
.chart-svg {
    display: block;
    width: 100%;
    min-width: 560px;
    height: 240px;
}
.chart-svg .axis  { stroke: var(--border); stroke-width: 1; }
.chart-svg .grid  { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; opacity: .6; }
.chart-svg .area  { fill: rgba(var(--primary-rgb),.14); }
.chart-svg .line  { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .dot   { fill: var(--surface); stroke: var(--primary); stroke-width: 2; }
.chart-svg .dot.pos { stroke: #2ea043; }
.chart-svg .dot.neg { stroke: #e53935; }
.chart-svg .label { fill: var(--on-surface-muted); font-size: 10px; font-family: inherit; }
.chart-svg .value { fill: var(--on-surface); font-size: 11px; font-weight: 700; font-family: inherit; }
.chart-svg .zero  { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 2 3; }

/* Tabela de rodadas (atleta) */
.rounds-table th, .rounds-table td { white-space: nowrap; }
.rounds-table .pts.pos { color: #2ea043; font-weight: 800; }
.rounds-table .pts.neg { color: #e53935; font-weight: 800; }
.rounds-table .pts.zero { color: var(--on-surface-muted); font-weight: 600; }

/* Clube detalhe */
.clube-hero {
    display: flex; gap: 18px; align-items: center;
    padding: 22px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb),.10), rgba(var(--accent-rgb),.10));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.clube-hero .escudo {
    width: 88px; height: 88px;
    flex-shrink: 0;
}
.clube-hero .escudo img { width: 100%; height: 100%; object-fit: contain; }
.clube-hero h1 { margin: 0; font-size: 1.7rem; }
.clube-hero .sub { color: var(--on-surface-muted); }

/* Cards de clube clicaveis */
.club-card-link { text-decoration: none; color: inherit; display: block; }
.club-card-link:hover { text-decoration: none; }

/* Atletas tile clicavel */
.tile.clickable { cursor: pointer; }
.tile.clickable:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Tabela com num */
table.data th.num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Scouts table input num */
.scouts-table .num-input {
    width: 90px;
    padding: 6px 8px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--bg-elevated);
    color: var(--on-surface);
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
