/* =====================================================================
   Futevôlei Lifestyle — Sistema de Gestão
   Identidade: preto / branco / vermelho · placar esportivo · beira de quadra
   ===================================================================== */

:root {
  --ink: #121316;          /* chrome escuro (sidebar, topbar, nav) */
  --ink-2: #1a1c21;        /* superfícies dentro do escuro */
  --ink-3: #24272e;
  --ink-line: rgba(255,255,255,.09);
  --ink-text: #f4f5f7;
  --ink-muted: #9aa0a8;

  --paper: #eceef1;        /* fundo do conteúdo (cinza-quadra, não creme) */
  --card: #ffffff;
  --line: #e0e3e8;
  --line-soft: #eaedf1;
  --text: #15171c;
  --text-2: #3c414a;
  --muted: #6b727b;

  --red: #e10600;          /* vermelho de performance */
  --red-600: #bd0500;
  --red-tint: rgba(225,6,0,.09);

  --ok: #0f8f47;    --ok-bg: rgba(15,143,71,.12);
  --warn: #a86400;  --warn-bg: rgba(224,150,0,.16);
  --danger: #cf1400;--danger-bg: rgba(207,20,0,.11);
  --muted-tone: #6b727b; --muted-bg: #e9ebef;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,18,22,.06), 0 6px 18px rgba(16,18,22,.06);
  --shadow-lg: 0 12px 40px rgba(16,18,22,.16);

  --sidebar-w: 244px;
  --sans: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cond: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--cond); font-weight: 700; letter-spacing: .2px; }
a { color: inherit; }

/* ===================== APP SHELL ===================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---- Sidebar (desktop) ---- */
.sidebar {
  background: var(--ink);
  color: var(--ink-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--ink-line);
}
.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--ink-line);
}
.sidebar-logo img { width: 100%; max-width: 172px; display: block; }
.sidebar-logo .sub { margin-top: 8px; font-family: var(--cond); text-transform: uppercase; letter-spacing: 2px; font-size: 11px; color: var(--ink-muted); }

.nav { padding: 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  color: var(--ink-muted); cursor: pointer; border: none; background: none;
  font-size: 15px; text-align: left; width: 100%;
  position: relative; transition: color .15s, background .15s;
}
.nav-item .ico svg { width: 20px; height: 20px; }
.nav-item:hover { color: var(--ink-text); background: var(--ink-2); }
.nav-item.active { color: #fff; background: var(--ink-2); }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  background: var(--red); border-radius: 0 3px 3px 0;
}
.nav-foot { padding: 12px; border-top: 1px solid var(--ink-line); }
.nav-school { font-family: var(--cond); font-size: 15px; color: var(--ink-text); text-transform: uppercase; letter-spacing: .5px; }
.nav-school small { display:block; font-family: var(--sans); text-transform: none; letter-spacing: 0; color: var(--ink-muted); font-size: 12px; }

/* ---- Main ---- */
.main { min-width: 0; display: flex; flex-direction: column; }
.content { padding: 26px 30px 90px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ---- Topbar (mobile) ---- */
.topbar { display: none; }

/* ===================== PAGE HEADER ===================== */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 30px; text-transform: uppercase; letter-spacing: .5px; }
.page-head-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn .ico svg { width: 18px; height: 18px; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-600); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: #f6f7f9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: #f6f7f9; color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

/* ===================== CARDS / SCOREBOARD ===================== */
.grid { display: grid; gap: 14px; }
.stat-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }

.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 14px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat .label { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.stat .num { font-family: var(--cond); font-weight: 700; font-size: 44px; line-height: 1.02; margin-top: 6px; letter-spacing: .5px; }
.stat .foot { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.accent::after { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--red); }
.stat.tone-ok .num { color: var(--ok); }
.stat.tone-warn .num { color: var(--warn); }
.stat.tone-danger .num { color: var(--danger); }
.num-money { font-variant-numeric: tabular-nums; }

/* ===================== BADGES ===================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.tone-ok { color: var(--ok); background: var(--ok-bg); }
.tone-warn { color: var(--warn); background: var(--warn-bg); }
.tone-danger { color: var(--danger); background: var(--danger-bg); }
.tone-muted { color: var(--muted-tone); background: var(--muted-bg); }
.chip { display:inline-flex; align-items:center; gap:6px; padding:3px 9px; border-radius:999px; font-size:12px; font-weight:600; background: var(--muted-bg); color: var(--text-2); }
.chip.red { background: var(--red-tint); color: var(--red-600); }

/* ===================== SEARCH ===================== */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 11px;
  padding: 0 12px; height: 44px; box-shadow: var(--shadow);
}
.search .ico { color: var(--muted); display: flex; }
.search input { border: none; outline: none; background: none; font-size: 15px; width: 100%; height: 100%; color: var(--text); }
.search input::placeholder { color: var(--muted); }

/* ===================== SEGMENTED / FILTERS ===================== */
.segmented { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; box-shadow: var(--shadow); flex-wrap: wrap; }
.segmented button { border: none; background: none; padding: 7px 13px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented button.active { background: var(--ink); color: #fff; }
.filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.custom-range { display: none; gap: 8px; align-items: center; }
.custom-range.show { display: flex; }
.custom-range input { height: 38px; }

/* ===================== STUDENT LIST ===================== */
.list { display: flex; flex-direction: column; gap: 10px; }
.student {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; padding: 12px 14px;
}
.student-main { min-width: 0; flex: 1; cursor: pointer; }
.student-name { font-family: var(--cond); font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: .3px; line-height: 1.1; }
.student-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dot-sep::before { content: "•"; margin: 0 2px; color: var(--line); }

.student-counts { display: flex; gap: 18px; text-align: center; }
.count-box .n { font-family: var(--cond); font-weight: 700; font-size: 26px; line-height: 1; }
.count-box .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.count-box.used .n { color: var(--text-2); }
.count-box.left .n { color: var(--red); }

.student-venc { text-align: right; min-width: 118px; }
.student-venc .d { font-family: var(--cond); font-weight: 600; font-size: 17px; }
.student-venc .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }

/* ---- Botão + (o gesto principal) ---- */
.btn-plus {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  background: var(--red); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(225,6,0,.34); transition: transform .12s, background .2s;
}
.btn-plus .ico svg { width: 26px; height: 26px; }
.btn-plus:hover { transform: scale(1.06); }
.btn-plus:active { transform: scale(.94); }
.btn-plus.done { background: var(--ok); box-shadow: 0 6px 16px rgba(15,143,71,.34); }
.btn-plus.pulse { animation: plusPulse .5s ease; }
@keyframes plusPulse { 0% { transform: scale(1);} 40%{ transform: scale(1.18);} 100%{ transform: scale(1);} }
.count-flash { animation: flash .5s ease; }
@keyframes flash { 0%{ color: var(--red); transform: scale(1.25);} 100%{ transform: scale(1);} }

/* ===================== TABLES ===================== */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl thead th { text-align: left; font-family: var(--cond); text-transform: uppercase; letter-spacing: .6px; font-size: 12.5px; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #fafbfc; }
.tbl .num-cell { font-variant-numeric: tabular-nums; font-weight: 600; }
.tbl .right { text-align: right; }
.link-name { font-family: var(--cond); font-weight: 600; font-size: 16px; text-transform: uppercase; letter-spacing: .2px; cursor: pointer; }
.link-name:hover { color: var(--red); }

/* ===================== RANKING ===================== */
.rank-list { display: flex; flex-direction: column; }
.rank-row { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-bottom: 1px solid var(--line-soft); }
.rank-row:last-child { border-bottom: none; }
.rank-pos { font-family: var(--cond); font-weight: 700; font-size: 22px; width: 34px; text-align: center; color: var(--muted); }
.rank-row.top1 .rank-pos { color: var(--red); }
.rank-row.top2 .rank-pos, .rank-row.top3 .rank-pos { color: var(--text); }
.rank-name { flex: 1; font-family: var(--cond); font-weight: 600; font-size: 18px; text-transform: uppercase; letter-spacing: .2px; }
.rank-val { font-family: var(--cond); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.rank-bar { height: 6px; border-radius: 3px; background: var(--red); opacity: .85; }
.rank-bar-track { flex: 1; max-width: 220px; background: var(--muted-bg); border-radius: 3px; }

/* ===================== ALERTS (dashboard) ===================== */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert-item { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 14px; }
.alert-item .ico { display: flex; }
.alert-item.warn { border-color: rgba(224,150,0,.4); background: var(--warn-bg); color: var(--warn); }
.alert-item.danger { border-color: rgba(207,20,0,.35); background: var(--danger-bg); color: var(--danger); }
.alert-item strong { font-weight: 700; }

/* ===================== PROFILE ===================== */
.profile-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; font-weight: 600; }
.section-title { font-family: var(--cond); text-transform: uppercase; letter-spacing: .6px; font-size: 15px; color: var(--muted); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.big-plan-num { font-family: var(--cond); font-weight: 700; font-size: 40px; line-height: 1; }

/* ===================== FORMS ===================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--muted); }
.inp {
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 14.5px;
  font-family: inherit; background: var(--card); color: var(--text); width: 100%; outline: none;
}
.inp:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
select.inp { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b727b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,11,13,.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 200;
  opacity: 0; transition: opacity .2s;
}
.modal-overlay.show { opacity: 1; }
.modal {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-height: 90vh; display: flex; flex-direction: column;
  transform: translateY(8px) scale(.99); transition: transform .2s;
}
.modal-overlay.show .modal { transform: none; }
.modal-sm { max-width: 420px; } .modal-md { max-width: 560px; } .modal-lg { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 21px; text-transform: uppercase; letter-spacing: .3px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.confirm-msg { margin: 0; font-size: 15px; color: var(--text-2); }

/* ===================== TOAST ===================== */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 300; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 9px; background: var(--ink); color: #fff;
  padding: 11px 16px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
  opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; max-width: 90vw;
}
.toast.show { opacity: 1; transform: none; }
.toast.tone-ok .ico { color: #4ade80; }
.toast.tone-danger .ico { color: #ff6b5e; }
.toast.tone-warn .ico { color: #fbbf24; }

/* ===================== EMPTY ===================== */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty p { margin: 4px 0; }
.empty-sub { font-size: 13px; }

/* ===================== MISC ===================== */
.row-actions { display: flex; gap: 6px; }
.muted { color: var(--muted); }
.mt { margin-top: 16px; } .mt-lg { margin-top: 24px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
hr.court { border: none; border-top: 2px solid var(--line); margin: 22px 0; position: relative; }
hr.court::after { content: ""; position: absolute; left: 50%; top: -5px; width: 8px; height: 8px; border: 2px solid var(--line); border-radius: 50%; background: var(--paper); transform: translateX(-50%); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 50;
  }
  .topbar img { height: 30px; }
  .topbar .spacer { flex: 1; }
  .topbar .search { flex: 1; height: 40px; background: var(--ink-2); border-color: var(--ink-line); box-shadow: none; }
  .topbar .search input { color: #fff; }
  .topbar .search .ico { color: var(--ink-muted); }
  .content { padding: 18px 16px 96px; }
  .page-title { font-size: 25px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--ink);
    border-top: 1px solid var(--ink-line); z-index: 60; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .bottom-nav button {
    background: none; border: none; color: var(--ink-muted); display: flex; flex-direction: column;
    align-items: center; gap: 3px; font-size: 10px; padding: 5px 8px; cursor: pointer; flex: 1; border-radius: 9px;
  }
  .bottom-nav button .ico svg { width: 22px; height: 22px; }
  .bottom-nav button.active { color: #fff; }
  .bottom-nav button.active .ico { color: var(--red); }
  .more-sheet { position: fixed; inset: 0; z-index: 120; }

  .profile-grid, .two-col, .form-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .stat .num { font-size: 38px; }

  /* Lista de alunos empilha melhor no celular, mas o + continua grande */
  .student { flex-wrap: wrap; }
  .student-main { flex-basis: 100%; }
  .student-counts { gap: 22px; }
  .student-venc { text-align: left; min-width: 0; flex: 1; }
  .btn-plus { width: 60px; height: 60px; }
  .kv { grid-template-columns: 110px 1fr; }
}
.bottom-nav { display: none; }

/* Acessibilidade / movimento reduzido */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
