/* Tema W3 FLEX sobre o Tabler — admin.
   Identidade extraída de w3flex.com.br: ciano #00B5D9, texto #33505B. */
:root {
  --tblr-primary: #00B5D9;
  --tblr-primary-rgb: 0, 181, 217;
  --brand: #00B5D9;
  --brand-strong: #0299b8;
  --brand-ink: #03171C;
  --brand-bg: #EAF6F9;
  --brand-text: #33505B;
}

body {
  background-color: var(--brand-bg);
  color: var(--brand-text);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--brand-text);
}

/* Botões em pílula, como no site da W3 */
.btn { border-radius: 999px; }

.btn-primary {
  --tblr-btn-bg: var(--brand);
  --tblr-btn-border-color: var(--brand);
  --tblr-btn-color: var(--brand-ink);
  --tblr-btn-hover-bg: var(--brand-strong);
  --tblr-btn-hover-border-color: var(--brand-strong);
  --tblr-btn-hover-color: var(--brand-ink);
  --tblr-btn-active-bg: var(--brand-strong);
  --tblr-btn-active-border-color: var(--brand-strong);
  font-weight: 600;
}

/* Link acessível: ciano puro reprova WCAG sobre claro (ver tokens.css) */
a { color: var(--link, #0B7286); }
a:hover { color: var(--link-hover, #0A5A6B); }

/* Foco sempre visível na cor da marca */
:focus-visible { outline: 2px solid var(--ring, rgba(0,181,217,.55)); outline-offset: 2px; }

/* Texto secundário/muted usa o tom auditado (acessível nos 2 fundos) */
.text-secondary, .text-muted { color: var(--fg-muted) !important; }

/* Skip-link (pular para o conteúdo) — visível ao receber foco */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 2000;
  padding: 8px 14px; background: var(--surface); color: var(--link);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-weight: 600;
}
.page-body:focus { outline: none; }

.card { border-radius: var(--radius-lg, 12px); }

/* Página de login centralizada */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card { width: 100%; max-width: 400px; }
.auth-brand {
  text-align: center;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--brand-text);
  margin-bottom: 1.25rem;
  letter-spacing: -.01em;
}
.auth-brand span { color: var(--brand-strong); }

/* Cartão de cliente (grid de clientes) */
.client-card { text-align: center; overflow: hidden; }
.client-card-top { height: 54px; }
.client-avatar,
.client-monogram {
  width: 84px; height: 84px; border-radius: 50%;
  background: #fff; border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(51,80,91,.15);
  margin: -42px auto 0.5rem;
}
.client-avatar { object-fit: cover; }
.client-monogram {
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 1.7rem;
  text-transform: uppercase; line-height: 1;
}
.client-card .card-body { padding: var(--sp-lg); }

/* =====================================================================
   Componentes reutilizáveis (skill frontend-design)
   ===================================================================== */

/* Page header: título + subtítulo muted + ações à direita */
.page-header-row {
  display: flex; flex-wrap: wrap; gap: var(--sp-sm);
  justify-content: space-between; align-items: flex-start;
  margin-bottom: var(--sp-lg);
}
.page-header-row .page-title {
  margin: 0; font-size: var(--fs-2xl); font-weight: 600;
  color: var(--fg-strong); letter-spacing: -.01em;
}
.page-header-row .page-subtitle {
  margin: .15rem 0 0; color: var(--fg-muted); font-size: var(--fs-sm);
}
.crumbs { font-size: var(--fs-xs); color: var(--fg-muted); margin-bottom: var(--sp-2xs); }
.crumbs a { color: var(--fg-muted); }

/* Pílula de status: tint + texto + ícone (nunca só cor) */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.5;
}
.status svg { width: 14px; height: 14px; flex: none; }
.status--neutral { background: var(--status-neutral-bg); color: var(--status-neutral-fg); }
.status--warn    { background: var(--status-warn-bg);    color: var(--status-warn-fg); }
.status--ok      { background: var(--status-ok-bg);      color: var(--status-ok-fg); }
.status--danger  { background: var(--status-danger-bg);  color: var(--status-danger-fg); }

/* Stat / KPI card */
.stat-label {
  color: var(--fg-muted); font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.stat-value {
  color: var(--fg-strong); font-size: var(--fs-3xl); font-weight: 600;
  line-height: 1.1; margin: .15rem 0; font-variant-numeric: tabular-nums;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md); flex: none;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--link);
}
.stat-icon svg { width: 22px; height: 22px; }

/* Estado vazio (substitui o componente) */
.empty-state { text-align: center; padding: var(--sp-3xl) var(--sp-lg); }
.empty-state .empty-icon { width: 44px; height: 44px; color: var(--fg-muted); margin-bottom: var(--sp-sm); }
.empty-state .empty-title { color: var(--fg-strong); font-weight: 600; margin: 0 0 .25rem; }
.empty-state .empty-help { color: var(--fg-muted); margin: 0 0 var(--sp-md); }

/* Tabela do admin: header discreto, números tabulares */
.table thead th {
  color: var(--fg-muted); font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: .03em; font-weight: 600;
}
.table td.num, .table th.num { font-variant-numeric: tabular-nums; text-align: right; }

/* Board de posts (admin) — grade estilo feed do Instagram */
.post-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (min-width: 768px) { .post-board { grid-template-columns: repeat(4, 1fr); } }
.post-cell {
  position: relative; display: block; aspect-ratio: 4/5; overflow: hidden;
  border-radius: var(--radius-sm); background: #0f1a1d; border: 1px solid var(--border);
}
.post-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-cell .post-empty {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: #8aa3ad; text-align: center; padding: var(--sp-xs); font-size: var(--fs-xs);
}
.post-cell .post-type {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.55));
}
.post-cell .post-type svg { width: 100%; height: 100%; }
.post-cell .post-badge { position: absolute; left: 6px; bottom: 6px; }
.post-cell:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.post-pos {
  position: absolute; top: 6px; left: 6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: var(--radius-pill); background: rgba(3,23,28,.6); color: #fff;
  font-size: 11px; font-weight: 600; display: grid; place-items: center;
}
