/* ==========================================================================
   Prémios Natação – UI
   Fluid, responsive (mobile → desktop), light & dark themes.
   ========================================================================== */
:root {
  --bg: #f4f7fb;
  --bg-elev: #ffffff;
  --bg-soft: #eef3f9;
  --bg-hover: #e6eef8;
  --border: #dbe4ef;
  --text: #0f1b2d;
  --text-soft: #4a5b72;
  --text-mute: #7a8aa0;
  --primary: #c62828;
  --primary-600: #a51f1f;
  --primary-50: #fdecec;
  --primary-2: #ef5350;
  --primary-dark: #7f0d12;
  --accent: #ff6b4a;
  --blue: #2563eb;
  --blue-50: #e8effd;
  --success: #12a46b;
  --success-50: #e3f6ee;
  --warning: #c98a00;
  --warning-50: #fdf3dc;
  --danger: #b4232f;
  --danger-50: #fce8eb;
  --info: #6750d6;
  --info-50: #efebfd;
  --gold: #e5a900;
  --silver: #8d9bb0;
  --bronze: #c26d3a;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 4px 16px rgba(15, 27, 45, .06);
  --shadow-lg: 0 12px 40px rgba(15, 27, 45, .16);
  --sidebar-w: 264px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --bg-elev: #121b2c; --bg-soft: #172235; --bg-hover: #1c2a41; --border: #24334b;
    --text: #e8eef7; --text-soft: #a9b7cc; --text-mute: #7d8ca3;
    --primary: #f05a5a; --primary-600: #f47c7c; --primary-50: #3a1518; --primary-2: #ff7b72;
    --blue: #6aa0ff; --blue-50: #172848;
    --success-50: #0f2e24; --warning-50: #33280c; --danger-50: #3a1820; --info-50: #241d47;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --bg-elev: #121b2c; --bg-soft: #172235; --bg-hover: #1c2a41; --border: #24334b;
  --text: #e8eef7; --text-soft: #a9b7cc; --text-mute: #7d8ca3;
  --primary: #f05a5a; --primary-600: #f47c7c; --primary-50: #3a1518; --primary-2: #ff7b72;
    --blue: #6aa0ff; --blue-50: #172848;
  --success-50: #0f2e24; --warning-50: #33280c; --danger-50: #3a1820; --info-50: #241d47;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem); }
h2 { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--text-mute); }
.soft { color: var(--text-soft); }
code, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--bg-soft); padding: .1em .4em; border-radius: 6px; }
pre { background: var(--bg-soft); padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto;
      font-family: var(--mono); font-size: .84rem; border: 1px solid var(--border); margin: 0 0 1rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
svg.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2;
           stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: var(--bg-elev); border-right: 1px solid var(--border); padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff;
              background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent); }
.brand-mark svg { width: 20px; height: 20px; }
.brand small { display: block; font-weight: 500; font-size: .75rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute);
             padding: 14px 10px 6px; font-weight: 600; }
.nav .navbtn { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.nav a, .nav .navbtn { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
         color: var(--text-soft); font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover, .nav .navbtn:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--primary-50); color: var(--primary); }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: var(--text); }
.user-chip:hover { background: var(--bg-hover); text-decoration: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
          font-size: .8rem; color: #fff; background: linear-gradient(135deg, var(--primary-dark), var(--primary-2)); flex: none; }
.user-chip .meta { min-width: 0; }
.user-chip .meta b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .meta small { font-size: .75rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 12px clamp(16px, 3vw, 32px); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .spacer { flex: 1; }
.topbar .menu-btn { display: none; }
.content { padding: clamp(16px, 3vw, 32px); max-width: 1320px; width: 100%; margin: 0 auto; flex: 1; }
.footer { padding: 18px clamp(16px, 3vw, 32px); color: var(--text-mute); font-size: .8rem; text-align: center; }

.scrim { display: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: min(84vw, 300px);
             transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(5,12,25,.45); }
  .topbar .menu-btn { display: inline-flex; }
}

/* public header */
.public-header { display: flex; align-items: center; gap: 12px; padding: 14px clamp(16px, 4vw, 48px);
                 position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 85%, transparent);
                 backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.public-header .brand { padding: 0; }
.public-header nav { display: flex; gap: 6px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.public-header nav .btn, .public-header nav .lang-switch { flex: none; }
@media (max-width: 560px) {
  .public-header { padding: 10px 16px; }
  .public-header .brand small, .public-header .hide-sm { display: none; }
  .public-header nav { flex-wrap: nowrap; gap: 4px; }
  .public-header .brand { white-space: nowrap; font-size: .92rem; }
}
.public-main { max-width: 1180px; margin: 0 auto; padding: clamp(16px, 4vw, 48px); }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: clamp(28px, 6vw, 64px);
        color: #fff; background: radial-gradient(1200px 400px at 90% -10%, rgba(255,138,128,.55), transparent 60%),
        linear-gradient(135deg, #6d0b10 0%, #b71c1c 55%, #e53935 100%); box-shadow: var(--shadow-lg); }
.hero h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3rem); max-width: 18ch; }
.hero p { font-size: clamp(1rem, .95rem + .3vw, 1.15rem); max-width: 60ch; opacity: .92; }
.hero .waves { position: absolute; left: 0; right: 0; bottom: -2px; width: 100%; height: 80px; opacity: .25; }
.hero .btn { box-shadow: none; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.08); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.18); }

/* ------------------------------------------------------------------ layout helpers */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
             margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--text-soft); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: clamp(12px, 2vw, 20px); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (min-width: 1081px) { .sticky-side { position: sticky; top: 84px; } }
@media (max-width: 1080px) { .split { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; } .mt { margin-top: 20px !important; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
        box-shadow: var(--shadow); padding: clamp(16px, 2.2vw, 24px); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px;
             flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 18px 20px 0; }

.stat { display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none;
             background: var(--primary-50); color: var(--primary); }
.stat .ico svg { width: 22px; height: 22px; }
.stat .val { font-size: 1.6rem; font-weight: 750; line-height: 1.1; }
.stat .lbl { color: var(--text-soft); font-size: .85rem; }
.stat.success .ico { background: var(--success-50); color: var(--success); }
.stat.warning .ico { background: var(--warning-50); color: var(--warning); }
.stat.danger .ico { background: var(--danger-50); color: var(--danger); }
.stat.info .ico { background: var(--info-50); color: var(--info); }

.bar { height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit;
              background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.bar-row { display: grid; grid-template-columns: 120px 1fr 44px; gap: 10px; align-items: center; margin: 8px 0;
           font-size: .88rem; }

/* ------------------------------------------------------------------ buttons */
.btn { --b: var(--primary); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
       padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600;
       font-size: .9rem; cursor: pointer; background: var(--b); color: #fff; line-height: 1.2;
       transition: transform .08s, background .15s, box-shadow .15s, border-color .15s; white-space: nowrap;
       box-shadow: 0 2px 8px color-mix(in srgb, var(--b) 30%, transparent); }
.btn:hover { text-decoration: none; background: color-mix(in srgb, var(--b) 88%, #000); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--bg-elev); color: var(--text); border-color: var(--border); box-shadow: none; }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger { --b: var(--danger); }
.btn-success { --b: var(--success); }
.btn-light { background: #fff; color: #8e1316; box-shadow: none; }
.btn-light:hover { background: #fdecec; }
.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn-icon { padding: 8px; width: 38px; height: 38px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }

/* ------------------------------------------------------------------ badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px;
         font-size: .75rem; font-weight: 650; background: var(--bg-soft); color: var(--text-soft); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.s-submitted { background: var(--blue-50); color: var(--blue); }
.badge.s-under_review { background: var(--info-50); color: var(--info); }
.badge.s-clarification { background: var(--warning-50); color: var(--warning); }
.badge.s-accepted { background: var(--success-50); color: var(--success); }
.badge.s-rejected { background: var(--danger-50); color: var(--danger); }
.badge.ok { background: var(--success-50); color: var(--success); }
.badge.warn { background: var(--warning-50); color: var(--warning); }
.badge.bad { background: var(--danger-50); color: var(--danger); }
.badge.role-admin { background: var(--primary-50); color: var(--primary); }
.badge.role-trainer { background: var(--info-50); color: var(--info); }
.badge.role-guardian { background: var(--blue-50); color: var(--blue); }

/* ------------------------------------------------------------------ alerts / toasts */
.flashes { position: fixed; z-index: 80; right: 16px; top: 16px; display: flex; flex-direction: column; gap: 10px;
           width: min(420px, calc(100vw - 32px)); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
         border: 1px solid var(--border); background: var(--bg-elev); box-shadow: var(--shadow-lg); font-size: .9rem;
         animation: slidein .25s ease; }
.alert .x { margin-left: auto; background: none; border: 0; color: var(--text-mute); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.alert-success { border-left: 4px solid var(--success); }
.alert-danger { border-left: 4px solid var(--danger); }
.alert-warning { border-left: 4px solid var(--warning); }
.alert-info { border-left: 4px solid var(--blue); }
.callout { padding: 14px 16px; border-radius: 12px; background: var(--blue-50); color: var(--text);
           border: 1px solid color-mix(in srgb, var(--blue) 25%, transparent); font-size: .92rem; }
.callout.warn { background: var(--warning-50); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.callout.ok { background: var(--success-50); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.callout.bad { background: var(--danger-50); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
@keyframes slidein { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ forms */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: .85rem; color: var(--text-soft); }
.field .hint { font-size: .78rem; color: var(--text-mute); }
.req::after { content: " *"; color: var(--danger); }
.input, select, textarea, input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=tel] {
  width: 100%; font: inherit; color: var(--text); background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; min-height: 42px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; padding-right: 34px; background-image:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8aa0' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
input[type=file] { font: inherit; color: var(--text-soft); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); padding: 8px 14px; border-radius: 9px; margin-right: 10px; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border);
         border-radius: 12px; cursor: pointer; background: var(--bg-elev); transition: border-color .15s, background .15s; }
.check:hover { border-color: var(--primary); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.check span { font-size: .9rem; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0;
          border-bottom: 1px solid var(--border); }
.switch:last-child { border-bottom: 0; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--border);
                position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
                       border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }
fieldset { border: 0; padding: 0; margin: 0; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1rem; }
.section-title .num { width: 26px; height: 26px; border-radius: 8px; background: var(--primary-50); color: var(--primary);
                      display: grid; place-items: center; font-size: .8rem; font-weight: 700; }

/* grade rows */
.grades { display: flex; flex-direction: column; gap: 10px; }
.grade-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr) 70px 40px; gap: 8px;
             align-items: center; }
.grade-row .conv { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--primary); }
.grade-row .conv.err { color: var(--danger); }
.grade-head { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-mute); font-weight: 600; }
@media (max-width: 640px) {
  .grade-row { grid-template-columns: 1fr 1fr; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
  .grade-row > :first-child { grid-column: 1 / -1; }
  .grade-head { display: none; }
}
.live-score { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.live-score div { background: var(--bg-soft); border-radius: 12px; padding: 12px; }
.live-score b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
            color: var(--text-mute); font-weight: 650; padding: 11px 14px; border-bottom: 1px solid var(--border);
            background: var(--bg-soft); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table a.rowlink { color: var(--text); font-weight: 600; }
@media (max-width: 720px) {
  table.table.stack-sm thead { display: none; }
  table.table.stack-sm, .stack-sm tbody, .stack-sm tr, .stack-sm td { display: block; width: 100%; }
  .stack-sm tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .stack-sm td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .stack-sm td::before { content: attr(data-label); font-size: .78rem; color: var(--text-mute); font-weight: 600; text-align: left; }
  .stack-sm td.primary { font-size: 1rem; text-align: left; }
  .stack-sm td.primary::before { display: none; }
  .stack-sm .num { text-align: right; }
}

/* ------------------------------------------------------------------ filters */
.filters { display: grid; gap: 10px; grid-template-columns: minmax(200px, 2fr) repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 18px; }
@media (max-width: 640px) { .filters { grid-template-columns: 1fr 1fr; } .filters .search { grid-column: 1 / -1; } }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-mute); }
.search input { padding-left: 38px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-soft); border-radius: 12px; overflow-x: auto;
        margin-bottom: 20px; scrollbar-width: none; }
.tabs a { padding: 8px 14px; border-radius: 9px; color: var(--text-soft); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); }

/* ------------------------------------------------------------------ podium / ranking */
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 12px; align-items: end; margin: 8px 0 18px; }
.podium .place { text-align: center; padding: 16px 10px; border-radius: 16px; background: var(--bg-soft);
                 border: 1px solid var(--border); position: relative; min-width: 0; }
.podium .place.p1 { padding-top: 26px; background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 18%, var(--bg-elev)), var(--bg-elev)); }
.podium .place.p2 { background: linear-gradient(180deg, color-mix(in srgb, var(--silver) 18%, var(--bg-elev)), var(--bg-elev)); }
.podium .place.p3 { background: linear-gradient(180deg, color-mix(in srgb, var(--bronze) 18%, var(--bg-elev)), var(--bg-elev)); }
.medal { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 8px;
         font-weight: 800; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.medal.m1 { background: linear-gradient(135deg, #ffd34d, var(--gold)); }
.medal.m2 { background: linear-gradient(135deg, #c9d2df, var(--silver)); }
.medal.m3 { background: linear-gradient(135deg, #e59a6b, var(--bronze)); }
.medal.sm { width: 28px; height: 28px; font-size: .78rem; margin: 0; display: inline-grid; }
.podium .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.podium .score { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.podium .prize { font-size: .85rem; color: var(--success); font-weight: 700; }
@media (max-width: 560px) {
  .podium { grid-template-columns: 1fr; }
  .podium .p1 { order: -1; }
}
.rank-cell { width: 54px; }

/* ------------------------------------------------------------------ misc */
.kv { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 8px 16px; margin: 0; font-size: .92rem; }
.kv dt { color: var(--text-mute); }
.kv dd { margin: 0; font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.formula { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.formula .term { background: var(--bg-soft); border-radius: 12px; padding: 10px 14px; text-align: center; }
.formula .term b { display: block; font-size: 1.3rem; }
.formula .term small { font-size: .74rem; }
.formula .op { font-size: 1.2rem; color: var(--text-mute); font-weight: 700; }
.formula .term.final { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.formula .term.final small { color: rgba(255,255,255,.85); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
                       background: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.timeline li::after { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li.sys::before { background: var(--text-mute); box-shadow: 0 0 0 4px var(--bg-soft); }
.timeline li.internal::before { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-50); }
.timeline .meta { font-size: .78rem; color: var(--text-mute); }
.timeline .body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; }
.empty { text-align: center; padding: 40px 16px; color: var(--text-mute); }
.empty svg { width: 42px; height: 42px; opacity: .5; margin-bottom: 8px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px;
         grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.steps li { counter-increment: s; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
            padding: 18px; box-shadow: var(--shadow); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
                    background: var(--primary-50); color: var(--primary); font-weight: 800; margin-bottom: 10px; }
.steps li b { display: block; margin-bottom: 4px; }
.steps li span { color: var(--text-soft); font-size: .9rem; }
.token { font-family: var(--mono); background: var(--bg-soft); border: 1px dashed var(--primary); padding: 12px;
         border-radius: 10px; overflow-wrap: anywhere; user-select: all; }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.lang-switch a { padding: 6px 10px; font-size: .8rem; font-weight: 700; color: var(--text-soft); }
.lang-switch a.active { background: var(--primary); color: #fff; }
.lang-switch a:hover { text-decoration: none; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
             background: radial-gradient(900px 500px at 10% 0%, var(--primary-50), transparent 60%), var(--bg); }
.auth-card { width: min(100%, 440px); }
.auth-card .brand { justify-content: center; padding-bottom: 8px; }
.method { display: inline-block; font-family: var(--mono); font-size: .72rem; font-weight: 700; padding: 3px 7px;
          border-radius: 6px; color: #fff; min-width: 56px; text-align: center; }
.method.get { background: var(--success); } .method.post { background: var(--primary); }
.method.patch { background: var(--warning); } .method.delete { background: var(--danger); }

@media print {
  .sidebar, .topbar, .no-print, .flashes, .footer, .public-header { display: none !important; }
  .shell { display: block; } .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; color: #000; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
