/* =====================================================================
   DoubleM Basquete — estilos base (app.css)
   ===================================================================== */

:root {
    /* Paleta grafite/prata — combinando com a logo */
    --primary: #cfd6dc;
    --primary-dark: #aab3bb;
    --primary-soft: rgba(207, 214, 220, .14);
    --primary-contrast: #13161a;

    --ink: #e5e8eb;          /* texto principal (cinza claro) */
    --ink-soft: #c4c9ce;     /* texto secundário */
    --muted: #8d939a;
    --muted-soft: #6d737a;

    --bg: #17191c;           /* fundo da página (grafite) */
    --surface: #1f2226;      /* cards */
    --surface-2: #1a1d20;    /* inputs e faixas */
    --surface-3: #272b30;    /* hover / realce */
    --sidebar: #121417;      /* barra lateral */
    --sidebar-2: #171a1d;

    --border: #3a3f46;       /* bordas mais claras */
    --border-strong: #4e545c;

    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, .16);
    --success-text: #86efac;
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, .16);
    --danger-text: #fca5a5;
    --info: #38bdf8;
    --info-soft: rgba(56, 189, 248, .16);
    --info-text: #7dd3fc;
    --warning: #f59e0b;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 12px 34px rgba(0, 0, 0, .5);
    --sidebar-w: 264px;
    --topbar-h: 72px;
    --footer-h: 58px;
    --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background-color: var(--bg);
    /* Fundo "pedra" mesclado com a logo (textura sutil + luz suave) */
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.2'/%3E%3C/svg%3E"),
        radial-gradient(1200px 700px at 18% -10%, rgba(255, 255, 255, .05), transparent 60%),
        radial-gradient(1000px 600px at 100% 110%, rgba(255, 255, 255, .035), transparent 60%);
    background-attachment: fixed, fixed, fixed;
    background-size: 180px 180px, cover, cover;
    background-repeat: repeat, no-repeat, no-repeat;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.25;
    color: var(--ink);
}

p {
    margin: 0;
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

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

.app__main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.page {
    flex: 1 1 auto;
    padding: 28px clamp(16px, 3vw, 36px);
    display: flex;
    flex-direction: column;
    gap: 22px;
    width: 100%;
}

/* Sidebar ------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--ink);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--topbar-h);
    padding: 0 20px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar__logo {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 12px;
    flex: 0 0 auto;
}

.sidebar__brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar__brand-text strong {
    color: #fff;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__brand-text small {
    color: var(--muted-soft);
    font-size: 12px;
}

.sidebar__nav {
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.nav-link .icon {
    width: 19px;
    height: 19px;
    opacity: .85;
}

.nav-link:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
    text-decoration: none;
}

.nav-link.is-active {
    background: var(--primary);
    color: #fff;
}

.nav-link.is-active .icon {
    opacity: 1;
}

.nav-link.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* Submenu (ex.: Financeiro > Planos) ---------------------------------- */
.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
}

.nav-group__title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted-soft);
}

.nav-group__title .icon {
    width: 16px;
    height: 16px;
    opacity: .8;
}

.nav-link--sub {
    padding-left: 44px;
    font-size: 13.5px;
    position: relative;
}

.nav-link--sub::before {
    content: "";
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-strong);
}

.nav-link--sub.is-active::before {
    background: var(--primary-contrast);
}

.nav-link__soon {
    margin-left: auto;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: rgba(255, 255, 255, .12);
    padding: 2px 7px;
    border-radius: 20px;
}

.sidebar__footer {
    display: flex;
    align-items: center;
    min-height: var(--footer-h);
    padding: 0 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 12px;
    color: var(--muted-soft);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 35;
}

/* Topbar -------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: var(--topbar-h);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px clamp(16px, 3vw, 36px);
}

.topbar__toggle {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 10px;
    padding: 8px;
    color: var(--ink);
    cursor: pointer;
}

.topbar__heading {
    flex: 1 1 auto;
    min-width: 0;
}

.topbar__heading h1 {
    font-size: 19px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__heading p {
    font-size: 12.5px;
    color: var(--muted);
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-chip__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
}

.user-chip__meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-chip__meta strong {
    font-size: 14px;
}

.user-chip__meta small {
    color: var(--muted);
    font-size: 12px;
}

/* Footer -------------------------------------------------------------- */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: var(--footer-h);
    padding: 0 clamp(16px, 3vw, 36px);
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12.5px;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------------------
   Botões
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn .icon {
    width: 17px;
    height: 17px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

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

.btn-secondary:hover {
    background: var(--ink-soft);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--border-strong);
}

.btn-ghost:hover {
    background: var(--bg);
    color: var(--ink);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 13px 20px;
    font-size: 15px;
}

.btn-sm {
    padding: 7px 11px;
    font-size: 13px;
}

.btn-sm .icon {
    width: 15px;
    height: 15px;
}

/* ---------------------------------------------------------------------
   Cabeçalho de página
   --------------------------------------------------------------------- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-head h2 {
    font-size: 22px;
}

.page-head p {
    color: var(--muted);
    font-size: 14px;
    margin-top: 3px;
}

.page-head__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.card__head h3 {
    font-size: 16px;
}

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

/* ---------------------------------------------------------------------
   Formulários
   --------------------------------------------------------------------- */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

.field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.field__icon {
    position: absolute;
    left: 12px;
    color: var(--muted-soft);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.field__control .field__icon + input {
    padding-left: 40px;
}

.field__prefix {
    position: absolute;
    left: 13px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
}

.field__control .field__prefix + input {
    padding-left: 40px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

textarea {
    resize: vertical;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.field--span-2 {
    grid-column: span 2;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid var(--border);
    margin: 0;
}

.form-section__title {
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
    padding: 0 8px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.form-actions--inline {
    margin-top: 4px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Filtros ------------------------------------------------------------- */
.filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 18px;
}

.filters__field {
    min-width: 150px;
}

.filters__field--grow {
    flex: 1 1 240px;
}

/* ---------------------------------------------------------------------
   Tabelas
   --------------------------------------------------------------------- */
.card--table {
    padding: 0;
    overflow: hidden;
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead th {
    text-align: left;
    padding: 14px 18px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: #fafcff;
}

.table__link {
    font-weight: 600;
    color: var(--ink);
}

.table__sub {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
}

.table__actions {
    text-align: right;
    white-space: nowrap;
}

.table__check {
    width: 44px;
    text-align: center;
}

.table__check input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
}

.table__actions .btn {
    padding: 6px;
}

/* ---------------------------------------------------------------------
   Avatares e badges
   --------------------------------------------------------------------- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    display: inline-grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
    flex: 0 0 auto;
    overflow: hidden;
}

.avatar--img {
    object-fit: cover;
}

.avatar--md {
    width: 54px;
    height: 54px;
    font-size: 17px;
}

.avatar-initials {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-weight: 700;
}

.avatar-initials--lg {
    font-size: 34px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg);
    color: var(--ink-soft);
    white-space: nowrap;
}

.badge--success { background: var(--success-soft); color: #166534; }
.badge--muted   { background: #e2e8f0; color: #475569; }
.badge--primary { background: var(--primary-soft); color: var(--primary-dark); }
.badge--info    { background: var(--info-soft); color: #1e40af; }
.badge--danger  { background: var(--danger-soft); color: #991b1b; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
}

.chip .icon {
    width: 15px;
    height: 15px;
}

/* ---------------------------------------------------------------------
   Alertas
   --------------------------------------------------------------------- */
.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid transparent;
}

.alert .icon {
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.alert--success {
    background: var(--success-soft);
    color: #166534;
    border-color: #bbf7d0;
}

.alert--error {
    background: var(--danger-soft);
    color: #991b1b;
    border-color: #fecaca;
}

.alert--info {
    background: var(--info-soft);
    color: #1e40af;
    border-color: #bfdbfe;
}

.alert__list {
    margin: 0;
    padding-left: 18px;
}

/* ---------------------------------------------------------------------
   Listas e estados vazios
   --------------------------------------------------------------------- */
.list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.list__item:last-child {
    border-bottom: none;
}

.list__main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.list__title {
    font-weight: 600;
    color: var(--ink);
}

.list__meta {
    font-size: 12.5px;
    color: var(--muted);
}

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* ---------------------------------------------------------------------
   Estatísticas / dashboard
   --------------------------------------------------------------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.stat-card__icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--bg);
    color: var(--ink-soft);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.stat-card--primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: transparent;
    color: #fff;
}

.stat-card--primary .stat-card__icon {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.stat-card--primary .stat-card__label,
.stat-card--primary .stat-card__hint {
    color: rgba(255, 255, 255, .9);
}

.stat-card__body {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.stat-card__value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
}

.stat-card__label {
    font-size: 14px;
    font-weight: 600;
}

.stat-card__hint {
    font-size: 12px;
    color: var(--muted);
}

.bar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bar-list__head {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    margin-bottom: 6px;
}

.bar {
    height: 9px;
    background: var(--bg);
    border-radius: 20px;
    overflow: hidden;
}

.bar span {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: 20px;
}

/* ---------------------------------------------------------------------
   CRUD (níveis, categorias, usuários)
   --------------------------------------------------------------------- */
.crud-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.crud-create {
    position: sticky;
    top: calc(var(--topbar-h) + 20px);
}

.crud-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crud-row {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: #fcfdff;
}

.crud-row.is-inactive {
    opacity: .62;
}

.crud-row--stack {
    flex-direction: column;
    align-items: stretch;
}

.crud-row__form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex: 1 1 420px;
    flex-wrap: wrap;
}

.crud-row__fields {
    display: flex;
    gap: 12px;
    flex: 1 1 320px;
    flex-wrap: wrap;
}

.crud-row__fields .field--grow {
    flex: 1 1 150px;
}

.crud-row__fields .field--ordem {
    width: 90px;
    flex: 0 0 auto;
}

.crud-row__meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-row__head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.user-row__info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.user-row__link {
    font-size: 13px;
    color: var(--muted);
}

.row-edit {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    background: var(--surface);
}

.row-edit summary {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ink-soft);
    list-style: none;
}

.row-edit summary::-webkit-details-marker {
    display: none;
}

.row-edit[open] summary {
    margin-bottom: 14px;
}

.row-edit .icon {
    width: 16px;
    height: 16px;
}

/* ---------------------------------------------------------------------
   Dados (dl) e perfil
   --------------------------------------------------------------------- */
.data-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.data-list > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.data-list > div:last-child {
    border-bottom: none;
}

.data-list dt {
    color: var(--muted);
    font-size: 13.5px;
}

.data-list dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.data-list--2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.profile-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.profile-card__photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-soft);
    color: var(--primary-dark);
    display: grid;
    place-items: center;
}

.profile-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card__sub {
    color: var(--muted);
    font-size: 13.5px;
    margin-top: -6px;
}

.profile-card__tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.profile-card__login {
    font-size: 13px;
    color: var(--ink-soft);
}

.profile-card__login--muted {
    color: var(--muted);
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.prose {
    color: var(--ink-soft);
    font-size: 14px;
}

/* ---------------------------------------------------------------------
   Página de erro
   --------------------------------------------------------------------- */
.error-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.error-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 40px;
    max-width: 460px;
    text-align: center;
}

.error-card__code {
    font-size: 52px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.error-card h1 {
    margin: 12px 0 8px;
    font-size: 22px;
}

.error-card p {
    color: var(--muted);
    margin-bottom: 22px;
}

.error-card__actions {
    display: flex;
    justify-content: center;
}

/* ---------------------------------------------------------------------
   Responsivo
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crud-layout,
    .profile-grid,
    .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }

    .crud-create {
        position: static;
    }
}

@media (max-width: 860px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-md);
    }

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

    .topbar__toggle {
        display: inline-flex;
    }

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

    .field--span-2 {
        grid-column: span 2;
    }
}

@media (max-width: 620px) {
    .page {
        padding: 20px 15px;
        gap: 18px;
    }

    .topbar__heading p {
        display: none;
    }

    .user-chip__meta {
        display: none;
    }

    .btn__label {
        display: none;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filters__field {
        min-width: 0;
    }

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

    .field--span-2 {
        grid-column: span 1;
    }

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

    .data-list--2col {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-footer {
        flex-direction: column;
    }
}

/* =====================================================================
   TEMA ESCURO (ajustes sobre os componentes base)
   ===================================================================== */
a {
    color: var(--primary);
}

a:hover {
    color: var(--primary);
}

/* Barra superior e navegação ------------------------------------------ */
.topbar {
    background: rgba(23, 25, 28, .88);
    border-bottom: 1px solid var(--border);
}

.topbar__toggle {
    background: var(--surface-2);
    color: var(--ink);
    border-color: var(--border-strong);
}

.sidebar {
    background: var(--sidebar);
}

.nav-link {
    color: #b7bcc2;
}

.nav-link.is-active {
    color: var(--primary-contrast);
}

.nav-link.is-active .icon {
    opacity: 1;
}

/* Botões --------------------------------------------------------------- */
.btn-primary {
    color: var(--primary-contrast);
}

.btn-primary:hover {
    color: var(--primary-contrast);
}

.btn-secondary {
    background: var(--surface-3);
    color: var(--ink);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    background: #1f303b;
    color: var(--ink);
}

.btn-ghost {
    color: var(--ink);
    border-color: var(--border-strong);
}

.btn-ghost:hover {
    background: var(--surface-3);
    color: var(--ink);
}

/* Formulários ---------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="color"],
select,
textarea {
    background: var(--surface-2);
    color: var(--ink);
    border-color: var(--border-strong);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted-soft);
}

select option {
    background: var(--surface-2);
    color: var(--ink);
}

/* Cards e blocos ------------------------------------------------------- */
.card {
    background: var(--surface);
    border-color: var(--border);
}

.crud-row {
    background: var(--surface-2);
    border-color: var(--border);
}

.row-edit {
    background: var(--surface-2);
}

/* Cards de estatística ------------------------------------------------- */
.stat-card {
    background: var(--surface);
    border-color: var(--border);
}

.stat-card__icon {
    background: var(--surface-3);
    color: var(--primary);
}

.stat-card--primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--primary-contrast);
}

.stat-card--primary .stat-card__icon {
    background: rgba(0, 0, 0, .16);
    color: var(--primary-contrast);
}

.stat-card--primary .stat-card__label,
.stat-card--primary .stat-card__hint {
    color: rgba(19, 22, 26, .82);
}

/* Tabelas -------------------------------------------------------------- */
.table thead th {
    background: var(--surface-2);
    color: var(--muted);
    border-bottom-color: var(--border);
}

.table tbody td {
    border-bottom-color: var(--border);
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, .02);
}

.table__link {
    color: var(--ink);
}

/* Badges --------------------------------------------------------------- */
.badge {
    background: var(--surface-3);
    color: var(--ink-soft);
}

.badge--primary { background: var(--primary-soft); color: var(--primary); }
.badge--success { background: var(--success-soft); color: var(--success-text); }
.badge--muted   { background: var(--surface-3);    color: var(--muted); }
.badge--info    { background: var(--info-soft);    color: var(--info-text); }
.badge--danger  { background: var(--danger-soft);  color: var(--danger-text); }

/* Alertas -------------------------------------------------------------- */
.alert--success { background: var(--success-soft); color: var(--success-text); border-color: rgba(34, 197, 94, .3); }
.alert--error   { background: var(--danger-soft);  color: var(--danger-text);  border-color: rgba(239, 68, 68, .3); }
.alert--info    { background: var(--info-soft);    color: var(--info-text);    border-color: rgba(56, 189, 248, .3); }

/* Avatares ------------------------------------------------------------- */
.avatar {
    background: var(--primary-soft);
    color: var(--primary);
}

.user-chip__avatar {
    background: var(--primary-soft);
    color: var(--primary);
}

.profile-card__photo {
    background: var(--primary-soft);
    color: var(--primary);
}

/* Barras e listas ------------------------------------------------------ */
.bar {
    background: var(--surface-3);
}

.list__item {
    border-bottom-color: var(--border);
}

.list__title {
    color: var(--ink);
}

.data-list > div {
    border-bottom-color: var(--border);
}

/* Rodapé --------------------------------------------------------------- */
.app-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
}

.filters {
    background: var(--surface);
}

/* ---------------------------------------------------------------------
   Abas laterais (formulários em seções)
   --------------------------------------------------------------------- */
.vtabs {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.vtabs__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: var(--surface-2);
    border-right: 1px solid var(--border);
}

.vtab {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-soft);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.vtab .icon {
    width: 18px;
    height: 18px;
    opacity: .85;
    flex: 0 0 auto;
}

.vtab:hover {
    background: var(--surface-3);
    color: var(--ink);
}

.vtab.is-active {
    background: var(--primary-soft);
    color: var(--primary);
    border-left-color: var(--primary);
}

.vtabs__panels {
    padding: clamp(18px, 2.5vw, 28px);
    min-width: 0;
}

.vpanel {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.vpanel.is-active {
    display: flex;
}

.vpanel__title {
    font-size: 17px;
}

.vpanel__hint {
    color: var(--muted);
    font-size: 13.5px;
    margin-top: -8px;
}

@media (max-width: 860px) {
    .vtabs {
        grid-template-columns: minmax(0, 1fr);
    }

    .vtabs__nav {
        flex-direction: row;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding: 10px;
        align-items: center;
    }

    .vtabs__profile {
        flex: 0 0 auto;
        flex-direction: row;
        padding: 0 12px 0 0;
        margin: 0;
        border-bottom: 0;
        border-right: 1px solid var(--border);
    }

    .photo-circle {
        width: 54px;
        height: 54px;
    }

    .photo-circle__initials {
        font-size: 20px;
    }

    .photo-circle__camera {
        width: 22px;
        height: 22px;
    }

    .photo-circle__camera .icon {
        width: 12px;
        height: 12px;
    }

    .vtabs__profile-name,
    .photo-circle__remove {
        display: none;
    }

    .vtab {
        width: auto;
        white-space: nowrap;
        border-left: 0;
        border-bottom: 3px solid transparent;
    }

    .vtab.is-active {
        border-left: 0;
        border-bottom-color: var(--primary);
    }
}

/* ---------------------------------------------------------------------
   Foto do atleta no topo do menu lateral (abas)
   --------------------------------------------------------------------- */
.vtabs__profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.photo-circle {
    position: relative;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.photo-circle__media {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--surface-3);
    border: 3px solid var(--primary-soft);
    color: var(--primary);
    transition: border-color .15s ease, opacity .15s ease;
}

.photo-circle:hover .photo-circle__media {
    border-color: var(--primary);
}

.photo-circle__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-circle__initials {
    font-size: 34px;
    font-weight: 700;
}

.photo-circle__placeholder {
    width: 42px;
    height: 42px;
    opacity: .6;
}

.photo-circle__camera {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-contrast);
    display: grid;
    place-items: center;
    border: 3px solid var(--surface-2);
}

.photo-circle__camera .icon {
    width: 16px;
    height: 16px;
}

.vtabs__profile-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-circle__remove {
    font-size: 12px;
    color: var(--muted);
}

.photo-circle__remove .icon {
    width: 14px;
    height: 14px;
}

.photo-circle__remove input:checked + span {
    color: var(--danger-text);
}

.photo-circle:has(#removerFoto:checked) .photo-circle__media {
    opacity: .35;
}

/* Vínculo atleta × treinos (lista de atletas) ------------------------- */
.link-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.link-tags .badge {
    font-weight: 600;
}

.link-tags .badge small {
    opacity: .75;
    font-weight: 700;
}

.link-tags .color-dot {
    margin-right: 2px;
}

/* Botão "+" de vincular treinos --------------------------------------- */
.picker-trigger {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    border: 1px dashed var(--border-strong);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    flex: 0 0 auto;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.picker-trigger:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.picker-trigger .icon {
    width: 16px;
    height: 16px;
}

/* Botões de ação sem borda (visualizar/editar) ------------------------ */
.btn-plain {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 9px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.btn-plain:hover {
    background: var(--surface-3);
    color: var(--ink);
    text-decoration: none;
}

.btn-plain .icon {
    width: 18px;
    height: 18px;
}

.btn-plain--danger:hover {
    background: var(--danger-soft);
    color: var(--danger-text);
}

.table__actions .btn-plain + .btn-plain {
    margin-left: 2px;
}

/* Seletor moderno de treinos (popover com checkboxes) ----------------- */
.picker-pop {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    padding: 0;
    width: min(380px, 94vw);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.picker-pop::backdrop {
    background: rgba(0, 0, 0, .55);
}

.picker-pop__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.picker-pop__title {
    font-weight: 700;
    font-size: 15px;
}

.picker-pop__sub {
    color: var(--muted);
    font-size: 12.5px;
}

.picker-pop__body {
    max-height: 46vh;
    overflow: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.picker-pop__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 9px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .12s ease, border-color .12s ease;
}

.picker-pop__option:hover {
    background: var(--surface-3);
}

.picker-pop__option:has(input:checked) {
    background: var(--primary-soft);
    border-color: rgba(207, 214, 220, .45);
}

.picker-pop__option input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

.picker-pop__name {
    flex: 1 1 auto;
    font-size: 14px;
    font-weight: 600;
}

.picker-pop__meta {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

.picker-pop__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.picker-pop__foot .muted {
    font-size: 12px;
}

/* Permissões de perfil ------------------------------------------------- */
.perm-group {
    margin-bottom: 18px;
}

.perm-group:last-child {
    margin-bottom: 0;
}

.perm-group__title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.perm-item {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    transition: border-color .15s ease, background .15s ease;
}

.perm-item:hover {
    border-color: var(--border-strong);
}

.perm-item:has(input:checked) {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.perm-row {
    flex: 1 1 320px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.perm-row__head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.perm-row__meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Notas de avaliação (formulário) ------------------------------------- */
.score-list {
    display: flex;
    flex-direction: column;
}

.score-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 108px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.score-row:last-child {
    border-bottom: none;
}

.score-row__name {
    font-size: 14px;
    font-weight: 600;
}

.score-row__nota {
    text-align: center;
}

.columns-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 16px;
}

.columns-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
}

.columns-list__idx {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    flex: 0 0 auto;
}

@media (max-width: 620px) {
    .columns-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 620px) {
    .score-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }
}

/* Mostrar/ocultar senha (olho) ---------------------------------------- */
input.has-toggle {
    padding-right: 44px;
}

.field__toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    padding: 7px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}

.field__toggle:hover {
    color: var(--ink);
    background: var(--surface-3);
}

.field__toggle .icon {
    width: 18px;
    height: 18px;
}

.field__toggle-off {
    display: none;
}

.field__toggle.is-on {
    color: var(--primary);
}

.field__toggle.is-on .field__toggle-on {
    display: none;
}

.field__toggle.is-on .field__toggle-off {
    display: grid;
}

/* ---------------------------------------------------------------------
   Abas horizontais (modernas)
   --------------------------------------------------------------------- */
.tabs__nav {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color .15s ease, border-color .15s ease;
}

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

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

.tab__count {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    border-radius: 20px;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
}

.tab.is-active .tab__count {
    background: var(--primary-soft);
    color: var(--primary);
}

.tabs__panels {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: clamp(16px, 2.5vw, 24px);
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
    animation: tab-fade .18s ease;
}

@keyframes tab-fade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------
   Modal (dialog nativo)
   --------------------------------------------------------------------- */
.modal {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    padding: 0;
    width: min(560px, 94vw);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.modal::backdrop {
    background: rgba(0, 0, 0, .55);
}

.modal form {
    display: flex;
    flex-direction: column;
}

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

.modal__head h3 {
    font-size: 16px;
}

.modal__body {
    padding: 18px 20px;
}

.modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

/* Lista de seleção múltipla (checkboxes) ------------------------------ */
.check-list {
    display: flex;
    flex-direction: column;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    padding: 6px;
}

.check-list__item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s ease;
}

.check-list__item:hover {
    background: var(--surface-3);
}

.check-list__item:has(input:checked) {
    background: var(--primary-soft);
}

.check-list__item input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

.check-list__name {
    flex: 1 1 auto;
    font-size: 14px;
    font-weight: 600;
}

.check-list__vagas {
    flex: 0 0 auto;
}

.check-list__meta {
    font-size: 12px;
    color: var(--muted);
    text-align: right;
}
