/* =========================================================
   Área da organização: usa os tokens e botões de css/style.css
   ========================================================= */
body.adm { background: var(--mist); color: var(--ink); font-size: 1rem; }
.adm [hidden] { display: none !important; }
.adm h1, .adm h2 { margin: 0; font-variation-settings: "wdth" 120; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.adm button { font-family: inherit; }

/* ---------- Entrada ---------- */
.login { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.login__card { width: min(100%, 420px); display: grid; gap: 16px; justify-items: start; padding: clamp(28px, 5vw, 44px); border-radius: 8px; background: var(--paper); }
.login__card h1 { font-size: 2rem; margin-top: 6px; }
.login__card > p { margin: 0; color: var(--muted-dark); }
.login__card .field { width: 100%; }
.login__card .btn { width: 100%; justify-content: center; }
.field--senha input { padding-right: 104px; }
.senha__ver { position: absolute; right: 6px; top: 50%; translate: 0 -50%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--royal); font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.senha__ver:hover { text-decoration: underline; }
.senha__ver:focus-visible { outline: 2px solid var(--royal); outline-offset: -2px; }
.login__card .form__error { min-height: 1.2em; font-size: 0.85rem; color: var(--danger); }
.login__card .login__demo { padding: 12px 14px; border-radius: 6px; background: oklch(0.86 0.16 92 / 0.28); color: var(--ink); font-size: 0.85rem; line-height: 1.4; }
.login__back { font-size: 0.9rem; font-weight: 600; color: var(--royal); }

/* ---------- Topo ---------- */
.app__top { display: flex; align-items: center; gap: 12px 24px; padding: 14px var(--gutter); background: var(--ink); color: var(--paper); }
.app__brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-variation-settings: "wdth" 125; font-weight: 900; letter-spacing: -0.03em; }
.app__brand b { color: var(--cyan); }
.app__title { color: var(--muted-light); font-size: 0.9rem; }
.app__nav { margin-left: auto; display: flex; align-items: center; gap: 20px; font-size: 0.92rem; font-weight: 600; }
.app__nav a { color: inherit; text-decoration: none; }
.app__nav button { padding: 0; border: 0; background: none; color: var(--steel); font-weight: 700; cursor: pointer; }
.app__nav a:hover, .app__nav button:hover { text-decoration: underline; }

/* ---------- Abas: cada tipo de cadastro tem a sua cor ---------- */
.tabs { --insc: var(--royal); --pat: var(--steel-deep); display: flex; gap: 4px; padding: 0 var(--gutter); background: var(--ink); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px; border: 0; border-radius: 8px 8px 0 0; background: none; color: var(--muted-light); font-size: 0.95rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.tab:hover { color: var(--paper); }
.tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: -4px; }
.tab[aria-selected="true"] { background: var(--mist); color: var(--ink); }
.tab__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tab-cor); }
.tab b { min-width: 1.9em; padding: 0.1em 0.55em; border-radius: 999px; background: color-mix(in oklch, var(--tab-cor) 30%, transparent); font-size: 0.8rem; text-align: center; font-variant-numeric: tabular-nums; }
.tab b:empty { display: none; }
.tab--insc { --tab-cor: var(--insc); }
.tab--pat { --tab-cor: var(--pat); }
.tab--insc[aria-selected="true"] b { background: var(--insc); color: var(--paper); }
.tab--pat[aria-selected="true"] b { background: var(--steel); color: var(--ink); }

/* a faixa no topo da lista repete a cor da aba */
.view--insc .list__head, .view--pat .list__head { padding-top: 14px; border-top: 4px solid var(--view-cor); }
.view--insc { --view-cor: var(--royal); }
.view--pat { --view-cor: var(--steel-deep); }
.view--pat .list__total { color: var(--steel-deep); }
.table .nowrap { white-space: nowrap; }

/* ---------- Contato de patrocínio ---------- */
.lead-card .tag { font-size: 0.82rem; }
.lead-card__empresa { margin-top: 10px; font-size: 1.6rem; overflow-wrap: anywhere; }
.lead-card__nome { margin: 6px 0 0; color: var(--muted-dark); }
.lead-card .badge__actions .btn { text-decoration: none; }

/* ---------- Painel ---------- */
.app__main { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start; padding: 28px var(--gutter) 56px; }
.list { min-width: 0; }
.list__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 20px; }
.list__head h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.list__total { margin: 0; font-weight: 700; color: var(--royal); }
.list__counts { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; list-style: none; font-size: 0.9rem; color: var(--muted-dark); }
.list__counts b { color: var(--ink); }

.list__tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 16px; }
.tool { display: grid; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--muted-dark); }
.tool--search { flex: 1 1 260px; }
.tool input, .tool select { width: 100%; height: 46px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: 1rem; font-weight: 400; box-shadow: inset 0 0 0 1px var(--line-dark); }
.tool input:focus, .tool select:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--royal); }
.list__tools .btn { height: 46px; padding-block: 0; }

.list__scroll { overflow-x: auto; border-radius: 8px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-dark); }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { padding: 12px 14px; text-align: left; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-dark); white-space: nowrap; border-bottom: 1px solid var(--line-dark); }
.table td { padding: 12px 14px; vertical-align: top; border-bottom: 1px solid var(--line-dark); }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-selected td { background: oklch(0.49 0.21 263 / 0.09); }
.table .num { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .sub { display: block; color: var(--muted-dark); font-size: 0.82rem; }
.table .name { padding: 0; border: 0; background: none; color: var(--royal); font-weight: 700; text-align: left; cursor: pointer; }
.table .name:hover { text-decoration: underline; }
.table .name:focus-visible { outline: 2px solid var(--royal); outline-offset: 2px; }
.tag { display: inline-block; padding: 0.15em 0.6em; border-radius: 999px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; background: color-mix(in oklch, var(--cat) 30%, transparent); }
.list__empty { margin: 16px 0 0; color: var(--muted-dark); }

/* ---------- Crachá ---------- */
.badge { position: sticky; top: 20px; padding: 22px; border-radius: 8px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-dark); }
.badge__blank h2 { font-size: 1.4rem; margin-bottom: 6px; }
.badge__blank p { margin: 0; color: var(--muted-dark); }
.badge__close { display: none; position: absolute; z-index: 2; top: 10px; right: 10px; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: var(--paper); }
.badge__close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.badge .credential { margin: 0 auto; }
.badge__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.badge__actions .btn { flex: 1 1 auto; justify-content: center; }
.badge__data { margin: 18px 0 0; font-size: 0.9rem; }
.badge__data div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-dark); }
.badge__data dt { color: var(--muted-dark); }
.badge__data dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.badge__danger { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-dark); }
.badge__delete { min-height: 44px; padding: 0; border: 0; background: none; color: var(--danger); font-size: 0.92rem; font-weight: 700; cursor: pointer; }
.badge__delete:hover { text-decoration: underline; }
.badge__delete:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }
.badge__confirm { padding: 14px; border-radius: 6px; background: oklch(0.6 0.2 25 / 0.1); font-size: 0.92rem; }
.badge__confirm p { margin: 0; }
.badge__confirm .form__error { margin-top: 6px; color: var(--danger); font-size: 0.85rem; }
.badge__confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.badge__confirm-actions .btn { flex: 1 1 auto; justify-content: center; padding-block: 0.8em; }
.btn--perigo { --bg: var(--danger); --fg: var(--paper); }
.list__aviso { margin: 0 0 16px; padding: 10px 14px; border-radius: 6px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-dark); font-size: 0.92rem; font-weight: 600; }

@media (max-width: 1080px) {
  .app__main { grid-template-columns: minmax(0, 1fr); }
  .badge { display: none; position: fixed; inset: 0; z-index: 20; overflow-y: auto; border-radius: 0; padding: 64px 16px 24px; }
  .badge.is-open { display: block; }
  .badge__close { display: grid; }
  .badge__blank { display: none; }
}
@media (max-width: 640px) {
  .app__title { display: none; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 12px 14px; border-bottom: 1px solid var(--line-dark); }
  .table tr:last-child { border-bottom: 0; }
  .table td { padding: 2px 0; border: 0; }
  .list__tools .btn { width: 100%; justify-content: center; }
  .table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted-dark); }
  .tab { padding: 0 14px; }
}
