/* =====================================================================
   IPTV PANEL PRO — Design System
   Tema Dark-Pro minimalista — 2.7.9 (neutro, plano, sem brilhos)
   Inspirado em TailAdmin / Tabler / Bootstrap Pro Dashboard
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Tokens de design
   --------------------------------------------------------------------- */
:root {
  /* Superfícies */
  --bg-base:        #08081a;
  --bg-surface:     #0e0e28;
  --bg-card:        #141436;
  --bg-elevated:    #1a1a44;
  --bg-hover:       #242452;
  --bg-input:       #0c0c22;
  --bg-sidebar:     #070716;
  --bg-overlay:     rgba(4, 4, 18, .72);

  /* Bordas */
  --border:         #26265c;
  --border-soft:    #1c1c46;
  --border-strong:  #3a3a7c;

  /* Texto */
  --text:           #f2f1ff;
  --text-soft:      #bcbce0;
  --text-muted:     #8a8aae;
  --text-inverse:   #14092e;

  /* Marca */
  --accent:         #9f7bff;
  --accent-hover:   #8b5cf6;
  --accent-soft:    rgba(159, 123, 255, .14);
  --accent-border:  rgba(159, 123, 255, .38);

  /* Status */
  --success:        #34d399;
  --success-soft:   rgba(52, 211, 153, .12);
  --warning:        #fbbf24;
  --warning-soft:   rgba(251, 191, 36, .13);
  --danger:         #fb7185;
  --danger-soft:    rgba(251, 113, 133, .13);
  --info:           #38bdf8;
  --info-soft:      rgba(56, 189, 248, .12);
  --purple:         #e879f9;
  --purple-soft:    rgba(232, 121, 249, .12);

  /* Métricas */
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      14px;
  --radius-xl:      20px;

  --shadow-sm:      0 1px 2px rgba(0, 0, 0, .35);
  --shadow:         0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg:      0 18px 48px rgba(0, 0, 0, .48);
  --shadow-accent:  0 0 0 1px var(--accent-border), 0 8px 28px rgba(159, 123, 255, .20);

  --sidebar-w:      268px;
  --sidebar-w-min:  76px;
  --topbar-h:       64px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --transition: .18s cubic-bezier(.4, 0, .2, 1);
}

/* ---------------------------------------------------------------------
   2. Reset e base
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-base);
  background-image:
    radial-gradient(1100px 520px at 12% -12%, rgba(159, 123, 255, .10), transparent 62%),
    radial-gradient(900px 460px at 92% 4%, rgba(34, 211, 238, .07), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.32rem; }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }
p  { margin: 0 0 .75rem; }
a  { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
ul, ol { margin: 0 0 .75rem; padding-left: 1.15rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
code, pre { font-family: var(--mono); font-size: .86em; }

::selection { background: rgba(159, 123, 255, .30); color: #fff; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-border); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------------
   3. Layout — Sidebar
   --------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}

.sidebar__brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 0 1.1rem;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.sidebar__logo {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  display: grid; place-items: center;
  color: var(--text-inverse);
  font-weight: 800;
  font-size: .95rem;
  box-shadow: 0 4px 14px rgba(159, 123, 255, .38);
}

.sidebar__title {
  font-weight: 700;
  font-size: .98rem;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__subtitle {
  font-size: .68rem;
  color: var(--text-muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .85rem .6rem 1.5rem;
}

.sidebar__section {
  padding: .95rem .65rem .4rem;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .58rem .7rem;
  margin-bottom: 2px;
  border-radius: var(--radius);
  color: var(--text-soft);
  font-weight: 500;
  font-size: .875rem;
  white-space: nowrap;
  position: relative;
  transition: background var(--transition), color var(--transition);
}

.nav-link svg { width: 18px; height: 18px; flex: 0 0 18px; stroke-width: 1.9; }
.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -.6rem; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.nav-link__badge {
  margin-left: auto;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .68rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 999px;
}

.sidebar__footer {
  padding: .8rem;
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.sidebar__user {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .6rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  white-space: nowrap;
  overflow: hidden;
}

/* Sidebar recolhido */
.app.is-collapsed .sidebar { width: var(--sidebar-w-min); flex-basis: var(--sidebar-w-min); }
.app.is-collapsed .sidebar__title,
.app.is-collapsed .sidebar__subtitle,
.app.is-collapsed .nav-link span,
.app.is-collapsed .sidebar__section,
.app.is-collapsed .sidebar__user-info { display: none; }
.app.is-collapsed .nav-link { justify-content: center; padding-inline: .6rem; }
.app.is-collapsed .sidebar__brand { justify-content: center; padding: 0; }
.app.is-collapsed .sidebar__user { justify-content: center; }

/* ---------------------------------------------------------------------
   4. Layout — Topbar e conteúdo
   --------------------------------------------------------------------- */
.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  transition: margin var(--transition);
}
.app.is-collapsed .main { margin-left: var(--sidebar-w-min); }

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 0 1.25rem;
  background: rgba(11, 19, 34, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__toggle {
  background: transparent; border: 0; color: var(--text-soft);
  cursor: pointer; padding: .4rem; border-radius: var(--radius-sm);
  display: grid; place-items: center; transition: background var(--transition);
}
.topbar__toggle:hover { background: var(--bg-hover); color: var(--text); }
.topbar__toggle svg { width: 20px; height: 20px; }

.topbar__title { font-size: .95rem; font-weight: 600; margin: 0; }
.topbar__crumb { font-size: .74rem; color: var(--text-muted); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.content { padding: 1.35rem 1.5rem 3rem; flex: 1; }
.content--flush { padding: 0; }

.page-head {
  display: flex; align-items: flex-start; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.25rem;
}
.page-head__text { min-width: 0; }
.page-head h1 { margin: 0 0 .18rem; }
.page-head p { color: var(--text-muted); font-size: .86rem; margin: 0; }
.page-head__actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   5. Cards
   --------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card { margin-top: 1rem; }

.card__header {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent);
}
.card__title { font-size: .95rem; font-weight: 600; margin: 0; }
.card__subtitle { font-size: .76rem; color: var(--text-muted); margin: 0; }
.card__actions { margin-left: auto; display: flex; gap: .4rem; align-items: center; }
.card__body { padding: 1.1rem; }
.card__body--flush { padding: 0; }
.card__footer { padding: .85rem 1.1rem; border-top: 1px solid var(--border-soft); background: rgba(0, 0, 0, .14); }

/* ---------------------------------------------------------------------
   6. Stat cards (KPIs)
   --------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.15rem;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.stat-card::after {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--accent);
  opacity: .85;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.stat-card--success::after { background: var(--success); }
.stat-card--warning::after { background: var(--warning); }
.stat-card--danger::after  { background: var(--danger); }
.stat-card--info::after    { background: var(--info); }
.stat-card--purple::after { background: var(--purple); }
.stat-card--primary::after { background: var(--accent); }

.stat-card__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.stat-card__label {
  font-size: .72rem; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-muted);
}
.stat-card__icon {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.stat-card__icon svg { width: 19px; height: 19px; }
.stat-card--success .stat-card__icon { background: var(--success-soft); color: var(--success); }
.stat-card--warning .stat-card__icon { background: var(--warning-soft); color: var(--warning); }
.stat-card--danger  .stat-card__icon { background: var(--danger-soft);  color: var(--danger); }
.stat-card--info    .stat-card__icon { background: var(--info-soft);    color: var(--info); }
.stat-card--purple  .stat-card__icon { background: var(--purple-soft);  color: var(--purple); }

.stat-card__value {
  font-size: 1.85rem; font-weight: 700; line-height: 1.1;
  letter-spacing: -.03em; margin: .55rem 0 .2rem;
  font-variant-numeric: tabular-nums;
}
.stat-card__meta { font-size: .78rem; color: var(--text-muted); display: flex; align-items: center; gap: .35rem; }
.trend { font-weight: 700; font-size: .76rem; }
.trend--up   { color: var(--success); }
.trend--down { color: var(--danger); }

.stat-card--live { border-color: var(--accent-border); box-shadow: var(--shadow-accent); }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34, 224, 127, .6);
  animation: pulse-live 2s infinite;
}
@keyframes pulse-live {
  0%   { box-shadow: 0 0 0 0 rgba(34, 224, 127, .55); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 224, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 224, 127, 0); }
}

/* ---------------------------------------------------------------------
   7. Botões
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .52rem .95rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: inherit; font-size: .85rem; font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  line-height: 1.35;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .55; pointer-events: none; }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--text-inverse);
  box-shadow: 0 3px 12px rgba(159, 123, 255, .30);
}
.btn--primary:hover { color: var(--text-inverse); box-shadow: 0 6px 20px rgba(159, 123, 255, .40); }

.btn--secondary { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.btn--secondary:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-strong); }

.btn--outline { background: transparent; color: var(--text-soft); border-color: var(--border-strong); }
.btn--outline:hover { background: var(--bg-elevated); color: var(--text); border-color: var(--accent-border); }

.btn--ghost { background: transparent; color: var(--text-soft); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn--success { background: var(--success); color: var(--text-inverse); }
.btn--success:hover { color: var(--text-inverse); filter: brightness(1.08); }
.btn--danger { background: var(--danger); color: var(--text-inverse); }
.btn--danger:hover { color: var(--text-inverse); filter: brightness(1.08); }
.btn--warning { background: var(--warning); color: var(--text-inverse); }
.btn--warning:hover { color: var(--text-inverse); filter: brightness(1.08); }
.btn--ghost-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(251, 77, 106, .28); }
.btn--ghost-danger:hover { background: var(--danger); color: var(--text-inverse); }

.btn--sm { padding: .34rem .65rem; font-size: .78rem; border-radius: var(--radius-sm); }
.btn--sm svg { width: 14px; height: 14px; }
.btn--lg { padding: .7rem 1.3rem; font-size: .95rem; }
.btn--block { width: 100%; }

.btn--icon {
  padding: .38rem; width: 32px; height: 32px;
  border-radius: var(--radius-sm); background: transparent; color: var(--text-soft);
  border: 1px solid transparent;
}
.btn--icon:hover { background: var(--bg-hover); color: var(--text); }
.btn--icon.is-danger:hover { background: var(--danger-soft); color: var(--danger); }

.btn-group { display: inline-flex; gap: .3rem; }

/* ---------------------------------------------------------------------
   8. Formulários
   --------------------------------------------------------------------- */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block; margin-bottom: .35rem;
  font-size: .8rem; font-weight: 600; color: var(--text-soft);
}
.form-label .req { color: var(--danger); margin-left: .15rem; }
.form-hint { font-size: .74rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { font-size: .76rem; color: var(--danger); margin-top: .3rem; }

.form-control, .form-select {
  width: 100%;
  padding: .55rem .8rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: .87rem;
  line-height: 1.45;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg-surface);
}
.form-control:disabled, .form-select:disabled { opacity: .55; cursor: not-allowed; }
.form-control.is-invalid { border-color: var(--danger); }
textarea.form-control { min-height: 90px; resize: vertical; }
select.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  padding-right: 2.1rem;
}
.form-select option { background: var(--bg-card); color: var(--text); }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 1rem; }
.form-row--3 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.input-group { display: flex; gap: .5rem; align-items: stretch; }
.input-group .form-control { flex: 1; }

.checkbox, .radio {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .85rem; cursor: pointer; color: var(--text-soft);
  user-select: none;
}
.checkbox input, .radio input {
  width: 16px; height: 16px; accent-color: var(--accent);
  cursor: pointer; margin: 0; flex-shrink: 0;
}

.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; }
.switch input { display: none; }
.switch__track {
  width: 40px; height: 22px; border-radius: 999px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  position: relative; transition: background var(--transition), border-color var(--transition);
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--transition), background var(--transition);
}
.switch input:checked + .switch__track { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(18px); background: var(--accent); }

.form-actions {
  display: flex; gap: .6rem; flex-wrap: wrap;
  padding-top: 1rem; margin-top: .5rem;
  border-top: 1px solid var(--border-soft);
}

fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
legend { font-size: .8rem; font-weight: 600; color: var(--text-soft); padding: 0 .4rem; }

/* ---------------------------------------------------------------------
   9. Tabelas
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: .7rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  text-align: left; padding: .65rem .9rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td {
  overflow-wrap: anywhere;
  padding: .68rem .9rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: rgba(159, 123, 255, .05); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table__empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.table__empty svg { width: 40px; height: 40px; opacity: .35; margin: 0 auto .6rem; }
.table--compact tbody td { padding: .48rem .7rem; }
.table--compact thead th { padding: .5rem .7rem; }

.cell-primary { font-weight: 600; color: var(--text); }
.cell-muted { color: var(--text-muted); font-size: .8rem; }
.mono { font-family: var(--mono); font-size: .82em; }

.copy-field {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--bg-input); border: 1px solid var(--border);
  padding: .18rem .45rem; border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: .78rem;
  max-width: 100%; overflow: hidden;
}
.copy-field code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn {
  background: none; border: 0; color: var(--text-muted);
  cursor: pointer; padding: 0; display: grid; place-items: center;
  flex-shrink: 0;
}
.copy-btn:hover { color: var(--accent); }

/* ---------------------------------------------------------------------
   10. Badges e chips
   --------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .71rem; font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--success  { background: var(--success-soft); color: var(--success); border-color: rgba(34, 224, 127, .25); }
.badge--danger   { background: var(--danger-soft);  color: var(--danger);  border-color: rgba(251, 77, 106, .25); }
.badge--warning  { background: var(--warning-soft); color: var(--warning); border-color: rgba(251, 191, 36, .25); }
.badge--info     { background: var(--info-soft);    color: var(--info);    border-color: rgba(96, 165, 250, .25); }
.badge--primary  { background: var(--accent-soft);  color: var(--accent);  border-color: var(--accent-border); }
.badge--secondary{ background: var(--bg-elevated);  color: var(--text-soft); border-color: var(--border); }
.badge--purple   { background: var(--purple-soft);  color: var(--purple);  border-color: rgba(167, 139, 250, .25); }
.badge--muted    { background: var(--bg-elevated);  color: var(--text-muted); border-color: var(--border); }

.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .65rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .78rem; color: var(--text-soft);
}
.chip--active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }

/* ---------------------------------------------------------------------
   11. Alertas / Flash
   --------------------------------------------------------------------- */
.alert {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  margin-bottom: 1rem;
  font-size: .86rem;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: .1rem; }
.alert--success { background: var(--success-soft); border-color: rgba(34, 224, 127, .3); color: var(--success); }
.alert--danger  { background: var(--danger-soft);  border-color: rgba(251, 77, 106, .3); color: var(--danger); }
.alert--warning { background: var(--warning-soft); border-color: rgba(251, 191, 36, .3); color: var(--warning); }
.alert--info    { background: var(--info-soft);    border-color: rgba(96, 165, 250, .3); color: var(--info); }
.alert strong { color: inherit; }

/* ---------------------------------------------------------------------
   12. Modal
   --------------------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal.is-open { display: flex; animation: fade-in .16s ease; }
.modal__box {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 2rem);
  display: flex; flex-direction: column;
  animation: modal-in .2s cubic-bezier(.2, .8, .3, 1);
}
.modal__box--lg { max-width: 820px; }
.modal__box--xl { max-width: 1100px; }
.modal__header {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
}
.modal__title { font-size: 1rem; font-weight: 600; margin: 0; }
.modal__close {
  margin-left: auto; background: none; border: 0;
  color: var(--text-muted); cursor: pointer; padding: .3rem;
  border-radius: var(--radius-sm); display: grid; place-items: center;
}
.modal__close:hover { background: var(--bg-hover); color: var(--text); }
.modal__body { padding: 1.25rem; overflow-y: auto; flex: 1; }
.modal__footer {
  padding: .9rem 1.25rem;
  border-top: 1px solid var(--border-soft);
  display: flex; gap: .6rem; justify-content: flex-end;
  background: rgba(0, 0, 0, .15);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------------------------------------------------------------------
   13. Toasts
   --------------------------------------------------------------------- */
.toast-container {
  position: fixed; top: 1rem; right: 1rem; z-index: 400;
  display: flex; flex-direction: column; gap: .6rem;
  max-width: min(380px, calc(100vw - 2rem));
}
.toast {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .8rem .95rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .85rem;
  animation: toast-in .22s cubic-bezier(.2, .8, .3, 1);
  pointer-events: auto;
}
.toast.is-leaving { animation: toast-out .2s ease forwards; }
.toast--success { border-left-color: var(--success); }
.toast--danger  { border-left-color: var(--danger); }
.toast--warning { border-left-color: var(--warning); }
.toast--info    { border-left-color: var(--info); }
.toast__icon { flex-shrink: 0; margin-top: .05rem; }
.toast--success .toast__icon { color: var(--success); }
.toast--danger  .toast__icon { color: var(--danger); }
.toast--warning .toast__icon { color: var(--warning); }
.toast--info    .toast__icon { color: var(--info); }
.toast__icon svg { width: 18px; height: 18px; }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-weight: 600; margin-bottom: .1rem; }
.toast__msg { color: var(--text-soft); font-size: .8rem; word-break: break-word; }
.toast__close {
  background: none; border: 0; color: var(--text-muted);
  cursor: pointer; padding: 0; flex-shrink: 0;
}
.toast__close:hover { color: var(--text); }

@keyframes toast-in  { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(26px); } }

/* ---------------------------------------------------------------------
   14. Paginação
   --------------------------------------------------------------------- */
.pagination { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.pagination-list { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.pagination-list li { margin: 0; }
.pagination-list a, .pagination-list span {
  display: grid; place-items: center;
  min-width: 32px; height: 32px; padding: 0 .45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-soft);
  font-size: .8rem; font-weight: 600;
  transition: all var(--transition);
}
.pagination-list a:hover { border-color: var(--accent-border); color: var(--accent); }
.pagination-list .active a,
.pagination-list a.active {
  background: var(--accent); border-color: var(--accent); color: var(--text-inverse);
}
.pagination-list .disabled a,
.pagination-list a.disabled { opacity: .4; pointer-events: none; }
.pagination-ellipsis { border: 0 !important; background: transparent !important; color: var(--text-muted) !important; }
.pagination-info { font-size: .8rem; color: var(--text-muted); }
.pagination .form-select { width: auto; padding: .32rem 1.9rem .32rem .6rem; font-size: .8rem; }

/* ---------------------------------------------------------------------
   15. Gráficos
   --------------------------------------------------------------------- */
.chart-box { position: relative; width: 100%; }
.chart-box--sm  { height: 210px; }
.chart-box--md  { height: 300px; }
.chart-box--lg  { height: 380px; }
.chart-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .85rem; font-size: .8rem; color: var(--text-soft); }
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------------------------------------------------------------------
   16. Dropdown / tabs
   --------------------------------------------------------------------- */
.dropdown { position: relative; }
.dropdown__menu {
  position: absolute; top: calc(100% + .4rem); right: 0;
  min-width: 190px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .3rem;
  z-index: 100;
  display: none;
}
.dropdown.is-open .dropdown__menu { display: block; animation: fade-in .12s ease; }
.dropdown__item {
  display: flex; align-items: center; gap: .55rem;
  padding: .48rem .65rem;
  border-radius: var(--radius-sm);
  color: var(--text-soft); font-size: .84rem;
  transition: background var(--transition);
}
.dropdown__item:hover { background: var(--bg-hover); color: var(--text); }
.dropdown__item--danger { color: var(--danger); }
.dropdown__item--danger:hover { background: var(--danger-soft); }
.dropdown__divider { height: 1px; background: var(--border); margin: .3rem 0; }

.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); margin-bottom: 1.1rem; overflow-x: auto; }
.tab {
  padding: .6rem .95rem;
  border: 0; background: none;
  color: var(--text-muted); font-family: inherit;
  font-size: .85rem; font-weight: 600;
  border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.tab:hover { color: var(--text-soft); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------------
   17. Avatares, progresso e diversos
   --------------------------------------------------------------------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  color: var(--text-inverse);
  font-weight: 700; font-size: .8rem;
  flex-shrink: 0;
}
.avatar--lg { width: 54px; height: 54px; font-size: 1.05rem; }
.avatar--sm { width: 26px; height: 26px; font-size: .7rem; }
.avatar--purple { background: linear-gradient(135deg, var(--purple), #8b5cf6); }
.avatar--green  { background: linear-gradient(135deg, var(--success), #10b981); }
.avatar--gray   { background: linear-gradient(135deg, #475569, #334155); }

.progress { height: 6px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); border-radius: 999px; transition: width .4s ease; }
.progress__bar--success { background: linear-gradient(90deg, var(--success), #34d399); }
.progress__bar--warning { background: linear-gradient(90deg, var(--warning), #f59e0b); }
.progress__bar--danger  { background: linear-gradient(90deg, var(--danger), #f43f5e); }

.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.empty-state svg { width: 52px; height: 52px; opacity: .3; margin: 0 auto .9rem; }
.empty-state h3 { color: var(--text-soft); margin-bottom: .3rem; }

.kbd {
  font-family: var(--mono); font-size: .74rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px; padding: .1rem .35rem; color: var(--text-soft);
}

.divider { height: 1px; background: var(--border); margin: 1.1rem 0; }
.text-muted { color: var(--text-muted); }
.text-soft  { color: var(--text-soft); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent  { color: var(--accent); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-capitalize { text-transform: capitalize; }
.text-uppercase { text-transform: uppercase; }
.overflow-hidden { overflow: hidden; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: .76rem; }
.fs-13 { font-size: .82rem; }
.fs-14 { font-size: .87rem; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.p-0 { padding: 0 !important; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-none { display: none !important; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.align-items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.ms-auto { margin-left: auto; }
.me-auto { margin-right: auto; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-content-center { justify-content: center; }
.gap-1 { gap: .35rem; }
.gap-2 { gap: .6rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.4rem; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.tab-panel { display: block; }

/* ---------------------------------------------------------------------
   18. Login
   --------------------------------------------------------------------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.auth__box {
  width: 100%; max-width: 420px;
}
.auth__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.auth__card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple), var(--accent));
}
.auth__logo {
  width: 54px; height: 54px; border-radius: 15px;
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  display: grid; place-items: center; margin: 0 auto 1rem;
  color: var(--text-inverse); font-weight: 800; font-size: 1.3rem;
  box-shadow: 0 8px 26px rgba(159, 123, 255, .35);
}
.auth__title { text-align: center; font-size: 1.3rem; margin-bottom: .25rem; }
.auth__subtitle { text-align: center; color: var(--text-muted); font-size: .84rem; margin-bottom: 1.5rem; }
.auth__footer { text-align: center; margin-top: 1.25rem; font-size: .78rem; color: var(--text-muted); }
.auth .form-control { padding: .65rem .85rem; }
.auth__input { position: relative; }
/* 2.7.6: SÓ o ícone da esquerda é absoluto. Antes, ".auth__input svg"
   pegava também o olho dentro do botão .auth__toggle: o botão ficava
   sem conteúdo em fluxo (colapsava) e o olho saía do lugar. */
.auth__input > svg {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-muted); pointer-events: none;
}
.auth__toggle svg { position: static; transform: none; width: 17px; height: 17px; }
.auth__input .form-control { padding-left: 2.3rem; }
.auth__toggle {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--text-muted); cursor: pointer;
  padding: .3rem; border-radius: var(--radius-sm); display: grid; place-items: center;
}
.auth__toggle:hover { color: var(--accent); background: var(--bg-hover); }

/* ---------------------------------------------------------------------
   19. Responsivo
   --------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .content { padding: 1.15rem 1.1rem 3rem; }
}

@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .app.is-mobile-open .sidebar { transform: translateX(0); }
  .main { margin-left: 0 !important; }
  .app.is-collapsed .sidebar { width: var(--sidebar-w); flex-basis: var(--sidebar-w); }
  .app.is-collapsed .sidebar__title,
  .app.is-collapsed .sidebar__subtitle,
  .app.is-collapsed .nav-link span,
  .app.is-collapsed .sidebar__section,
  .app.is-collapsed .sidebar__user-info { display: initial; }
  .app.is-collapsed .nav-link { justify-content: flex-start; padding-inline: .7rem; }
  .app.is-collapsed .sidebar__brand { justify-content: flex-start; padding: 0 1.1rem; }
  .app.is-collapsed .sidebar__user { justify-content: flex-start; }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .55);
    z-index: 55; display: none;
  }
  .app.is-mobile-open .sidebar-backdrop { display: block; }
}

@media (max-width: 640px) {
  .topbar { height: auto; min-height: var(--topbar-h); flex-wrap: wrap; padding: .6rem .85rem; }
  .topbar > .overflow-hidden { flex: 1 1 180px; min-width: 0; }
  .topbar__crumb { display: none; }
  .topbar__actions { flex-wrap: wrap; }
  .topbar__prefs { flex-wrap: wrap; }
  .card[style] { min-width: 0 !important; }
  .content { padding: 1rem .85rem 2.5rem; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; }
  .stat-card { padding: .85rem .9rem; }
  .stat-card__value { font-size: 1.5rem; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head__actions { margin-left: 0; }
  .card__body { padding: .85rem; }
  .modal__box { max-height: calc(100vh - 1rem); }
  .modal__body { padding: 1rem; }
  .toast-container { left: .75rem; right: .75rem; max-width: none; }
  .table thead th, .table tbody td { padding: .55rem .6rem; }
  .topbar__breadcrumb { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .auth__card { padding: 1.5rem 1.25rem; }
}

/* ---------------------------------------------------------------------
   20. Impressão
   --------------------------------------------------------------------- */
@media print {
  .sidebar, .topbar, .page-head__actions, .toast-container { display: none !important; }
  .main { margin-left: 0 !important; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; box-shadow: none; }
}

/* =====================================================================
   21. Layout avançado — 2.7.4-layout (SÓ VISUAL)
   Acrescenta ao design system acima, sem remover classes antigas:
   contraste, hierarquia, sidebar/drawer, tabelas, formulários, login.
   Nenhuma classe Tailwind, nenhum CDN, nenhuma fonte externa.
   ===================================================================== */

/* Contraste: textos secundários um pouco mais claros sobre o fundo escuro */
:root {
  --text:        #f2f1ff;
  --text-soft:   #bcbce0;
  --text-muted:  #8a8aae;
  --radius:      12px;
  --radius-lg:   16px;
  --shadow:      0 6px 20px rgba(0, 0, 0, .38);
}

/* Acessibilidade: pular direto para o conteúdo (só aparece com teclado) */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 500;
  background: var(--accent); color: var(--text-inverse);
  font-weight: 700; font-size: .85rem; padding: .55rem .9rem;
  border-radius: var(--radius-sm); text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--text-inverse); }

/* Foco visível mais evidente em teclado (mouse não é afetado) */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
a:focus-visible, button:focus-visible, .nav-link:focus-visible { outline-offset: 1px; }

/* ---- Hierarquia de página ---- */
.page-head { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-soft); }
.page-head h1 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); letter-spacing: -.02em; }
.page-head p { font-size: .88rem; }
.content { padding-top: 1.5rem; }

/* ---- Topbar: breadcrumb + sombra ao rolar (classe via app.js) ---- */
.topbar__head { min-width: 0; }
.topbar__breadcrumb { font-size: .72rem; color: var(--text-muted); margin-bottom: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__breadcrumb a { color: var(--text-soft); }
.topbar__breadcrumb a:hover { color: var(--accent); }
.topbar__breadcrumb span[aria-current="page"] { color: var(--text-soft); font-weight: 600; }
.topbar.is-scrolled { box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.topbar__title { font-size: 1rem; }

/* ---- Sidebar: ativo mais claro, seções com linha, botão fechar mobile ---- */
.sidebar__section { display: flex; align-items: center; gap: .6rem; color: var(--text-muted); }
.sidebar__section::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }
.nav-link { padding: .62rem .7rem; border: 1px solid transparent; }
.nav-link.is-active {
  background: linear-gradient(90deg, var(--accent-soft), rgba(159, 123, 255, .05));
  border-color: var(--accent-border);
  color: var(--accent);
}
.nav-link.is-active svg { color: var(--accent); }
.nav-link.is-active::before { left: -.6rem; height: 26px; width: 4px; }
.sidebar__close {
  display: none; margin-left: auto; background: transparent; border: 0;
  color: var(--text-soft); cursor: pointer; padding: .4rem; border-radius: var(--radius-sm); flex-shrink: 0;
}
.sidebar__close:hover { background: var(--bg-hover); color: var(--text); }
.app.is-collapsed .nav-link.is-active::before { left: 0; }
/* Nota: o rótulo da sidebar recolhida aparece via atributo title (app.js),
   porque um tooltip em CSS seria cortado pelo overflow:hidden da sidebar. */

/* ---- Cards e grade dividida (dashboard e telas de 2 colunas) ---- */
.card { border-radius: var(--radius-lg); }
.card__header { padding: 1rem 1.15rem; }
.card__title { letter-spacing: -.01em; }
.split { display: flex; flex-wrap: wrap; gap: 1rem; align-items: stretch; }
.split > .card { flex: 1 1 320px; min-width: 0; }
/* Trava de segurança global: nenhum card com min-width inline estoura a tela */
.card[style*="min-width"] { min-width: min(340px, 100%) !important; }

/* ---- Estatísticas: número maior, sem estourar em tela pequena ---- */
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stat-card { padding: 1.15rem 1.2rem; }
.stat-card::after { height: 3px; }
.stat-card__value { font-size: clamp(1.45rem, 3.2vw, 1.9rem); overflow-wrap: anywhere; }
.stat-card__icon { width: 42px; height: 42px; border-radius: 12px; }
.stat-card__meta { overflow-wrap: anywhere; }

/* ---- Tabelas: zebra, cabeçalho fixo em listas longas, ações sem apertar ---- */
.table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .014); }
.table tbody tr:hover { background: rgba(159, 123, 255, .06); }
.table-wrap { scrollbar-width: thin; }
.table-wrap--scroll { max-height: min(72vh, 760px); overflow: auto; }
.table-wrap--scroll thead th { position: sticky; top: 0; z-index: 3; box-shadow: 0 1px 0 var(--border); }
.table .actions { white-space: normal; }
.table .actions .btn-group { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem; max-width: 220px; }
.table td .mono, .table td code { overflow-wrap: anywhere; word-break: break-word; }
.copy-field { max-width: min(100%, 420px); }
.copy-field code { overflow-wrap: anywhere; }

/* ---- Formulários e botões: foco, altura mínima, grupo sem quebrar ---- */
.btn { min-height: 38px; }
.btn--sm { min-height: 30px; }
.btn--primary { box-shadow: 0 4px 16px rgba(159, 123, 255, .32); }
.btn--primary:hover { transform: translateY(-1px); }
.form-control, .form-select { border-radius: var(--radius); }
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
.form-actions { gap: .6rem; }
.input-group { flex-wrap: wrap; }

/* ---- Modal e toast: cantos e legibilidade ---- */
.modal__box { border-radius: var(--radius-xl); }
.toast { border-radius: var(--radius); }
.toast__msg { color: var(--text-soft); }

/* ---- Lista de atividade do dashboard (antes: estilos inline) ---- */
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-item { display: flex; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--border-soft); }
.activity-item:last-child { border-bottom: 0; }

/* ---- Login: mesmo padrão visual, sem imagem externa ---- */
.auth { position: relative; overflow: hidden; }
.auth::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(520px 300px at 18% 12%, rgba(159, 123, 255, .16), transparent 65%),
    radial-gradient(520px 300px at 84% 88%, rgba(232, 121, 249, .14), transparent 65%);
}
.auth__box { position: relative; z-index: 1; }
.auth__card { border-radius: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); padding: 2.1rem 2rem; }
.auth__title { font-size: 1.45rem; letter-spacing: -.02em; overflow-wrap: anywhere; }
.auth__subtitle, .auth__footer { overflow-wrap: anywhere; }
.auth__input:has(> .auth__toggle) .form-control { padding-right: 2.3rem; }
/* 2.7.6: NÃO usar shorthand "padding" aqui. O shorthand anterior
   (.7rem .85rem) vinha DEPOIS da regra de padding-left: 2.3rem, tinha
   a mesma especificidade e zerava o espaço do ícone: o texto ficava
   por cima do ícone de usuário/senha. padding-block só mexe na
   vertical e preserva o espaço dos ícones. */
.auth .form-control { padding-block: .7rem; }
.auth__input .form-control { padding-left: 2.3rem; }
.auth__input:has(> .auth__toggle) .form-control { padding-right: 2.3rem; }
.auth .btn--primary { min-height: 46px; font-size: .92rem; }

/* ---- Responsivo ---- */
@media (max-width: 992px) {
  .sidebar__close { display: grid; place-items: center; }
}
@media (max-width: 768px) {
  .content { padding: 1.1rem 1rem 2.5rem; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; }
  .split { flex-direction: column; }
  .split > .card { flex-basis: auto; }
  .card__body { padding: 1rem; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head__actions { margin-left: 0; }
  .page-head__actions .btn { flex: 1 1 auto; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .form-control, .form-select { font-size: 1rem; }
  .topbar { gap: .6rem; padding: .6rem .85rem; }
  .topbar__actions { gap: .35rem; }
  .stat-card { padding: .9rem .95rem; }
  .stat-card__value { font-size: 1.4rem; }
  .table thead th, .table tbody td { padding: .55rem .6rem; }
  .topbar__breadcrumb { display: none; }
  .table-wrap--scroll { max-height: none; }
  .auth__card { padding: 1.6rem 1.25rem; }
  .modal__box { border-radius: 16px; }
}
@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .topbar__prefs select { font-size: .74rem; }
}

/* Movimento reduzido: respeita a preferência do sistema */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* =====================================================================
   22. Cores bonitas — 2.7.8 (SÓ VISUAL)
   Paleta "aurora violeta": fundo noite violeta, acento violeta lavanda
   com degradê para ciano (logo, botões primários, avatares), status em
   menta / âmbar / rosa / céu. Nenhuma rota, regra ou banco mudou.
   Para voltar às cores antigas, restaure o app.css da 2.7.7.
   ===================================================================== */
:root {
  --bg-base: #08081a;
  --bg-surface: #0e0e28;
  --bg-card: #141436;
  --bg-elevated: #1a1a44;
  --bg-hover: #242452;
  --bg-sidebar: #070716;
  --border: #26265c;
  --border-soft: #1c1c46;
  --border-strong: #3a3a7c;
  --text: #f2f1ff;
  --text-soft: #bcbce0;
  --text-muted: #8a8aae;
  --accent: #9f7bff;
  --accent-hover: #8b5cf6;
  --accent-soft: rgba(159, 123, 255, .14);
  --accent-border: rgba(159, 123, 255, .38);
  --success: #34d399;
  --danger: #fb7185;
  --info: #38bdf8;
  --purple: #e879f9;
}

/* =====================================================================
   23. Tema Dark-Pro minimalista — 2.7.9 (SÓ VISUAL)
   Regra do projeto: a seção final vence as anteriores em mesma
   especificidade, como já faziam as seções 21 e 22. Por isso a paleta
   nova vive aqui, sem reescrever o arquivo inteiro.
   O que é "minimalista" aqui, na prática:
   - Superfícies neutras grafite (sem azul, sem violeta no fundo),
     separadas só por borda fina, não por sombra ou brilho.
   - Um único acento contido: índigo claro (#a5b4fc), texto escuro
     sobre ele nos botões, para manter o contraste.
   - Sem degradês, sem halos "aurora", sem sombras coloridas:
     logo, avatar, botões primários, barras de progresso e a barra
     do card de login viram cor chapada.
   - Sombras reduzidas a um nível só e cantos um pouco menores.
   - Status mantidos, mas suavizados (menta / âmbar / rosa / céu).
   Para voltar às cores da 2.7.8, restaure o app.css da 2.7.8.
   ===================================================================== */
:root {
  --bg-base:        #0a0a0b;
  --bg-surface:     #111113;
  --bg-card:        #141416;
  --bg-elevated:    #1a1a1e;
  --bg-hover:       #1f1f24;
  --bg-input:       #111113;
  --bg-sidebar:     #0a0a0b;
  --bg-overlay:     rgba(0, 0, 0, .72);

  --border:         #26262c;
  --border-soft:    #1e1e23;
  --border-strong:  #33333a;

  --text:           #fafafa;
  --text-soft:      #a1a1aa;
  --text-muted:     #71717a;
  --text-inverse:   #18181b;

  --accent:         #a5b4fc;
  --accent-hover:   #818cf8;
  --accent-soft:    rgba(165, 180, 252, .10);
  --accent-border:  rgba(165, 180, 252, .28);

  --success:        #4ade80;
  --success-soft:   rgba(74, 222, 128, .10);
  --warning:        #facc15;
  --warning-soft:   rgba(250, 204, 21, .10);
  --danger:         #f87171;
  --danger-soft:    rgba(248, 113, 113, .10);
  --info:           #7dd3fc;
  --info-soft:      rgba(125, 211, 252, .10);
  --purple:         #c4b5fd;
  --purple-soft:    rgba(196, 181, 253, .10);

  --radius-sm:      6px;
  --radius:         8px;
  --radius-lg:      12px;
  --radius-xl:      16px;

  --shadow-sm:      0 1px 2px rgba(0, 0, 0, .30);
  --shadow:         0 2px 8px rgba(0, 0, 0, .30);
  --shadow-lg:      0 8px 24px rgba(0, 0, 0, .40);
  --shadow-accent:  0 0 0 1px var(--accent-border);
}

/* Sem halos de fundo na página e no login */
body { background-image: none; }
.auth::before { background: none; }

/* Cor chapada no lugar de todo degradê de marca */
.sidebar__logo, .avatar, .auth__logo {
  background: var(--accent);
  box-shadow: none;
}
.avatar--purple { background: var(--purple); }
.avatar--green  { background: var(--success); }
.avatar--gray   { background: #3f3f46; }

.btn--primary { background: var(--accent); box-shadow: none; }
.btn--primary:hover { box-shadow: none; transform: none; }

.nav-link.is-active { background: var(--accent-soft); }
.nav-link.is-active::before { box-shadow: none; }

.card__header { background: transparent; }

.progress__bar { background: var(--accent); }
.progress__bar--success { background: var(--success); }
.progress__bar--warning { background: var(--warning); }
.progress__bar--danger  { background: var(--danger); }

/* Login: barra fina chapada, card sem sombra grande */
.auth__card::before { background: var(--accent); height: 2px; }
.auth__card { box-shadow: none; border: 1px solid var(--border); border-radius: 16px; }

/* Cartões e topbar: sem elevação chamativa */
.stat-card:hover { transform: none; box-shadow: var(--shadow-sm); }
.topbar.is-scrolled { box-shadow: 0 1px 0 var(--border); }

/* =====================================================================
   24. Refinamento sóbrio — 2.7.12 (SÓ VISUAL)
   Sobre o Dark-Pro (seção 23), sem refazer componentes, sem mudar
   rotas, textos de função ou permissões, sem Tailwind e sem CDN:
   - Hierarquia mais calma: sidebar um tom acima da base (separação
     por superfície, não por sombra), títulos de seção do menu em
     caixa-alta discreta, cabeçalhos de card sem fundo.
   - Foco visível de teclado (acessibilidade): anel do acento em
     links, botões e campos — o Dark-Pro não definia :focus-visible.
   - Botões: primário mantém índigo claro com texto escuro (contraste
     preservado); hover apenas escurece um tom, sem elevação; botões
     de perigo/ícone ganham hover contido em vez de salto.
   - Tabelas: linha sob o cursor um tom acima, sem listras; números
     e badges mantêm o tamanho atual (nada de densidade nova).
   - Login: card com borda um tom mais forte e logo com anel sutil;
     o resto do login (layout, textos, campos) não muda.
   - CORES DE STATUS NÃO MUDAM (success/warning/danger/info/purple
     continuam os da seção 23): só superfícies, acento de hover e
     foco foram ajustados, para não reensinar o significado das cores.
   Para voltar ao Dark-Pro puro da 2.7.9, remova esta seção.
   ===================================================================== */
:root {
  --bg-sidebar:     #0e0e10;
  --bg-hover:       #1d1d22;
  --border-strong:  #3a3a41;
}

.sidebar { border-right: 1px solid var(--border); }
.sidebar__section {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted);
}
.topbar { border-bottom: 1px solid var(--border); background: var(--bg-base); }
.card__header { background: transparent; border-bottom: 1px solid var(--border-soft); }
.stat-card { border: 1px solid var(--border); }
.stat-card__label {
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted);
}

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, .nav-link:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn--primary:hover { background: var(--accent-hover); color: var(--text-inverse); transform: none; box-shadow: none; }
.btn--icon:hover { background: var(--bg-hover); transform: none; }
.btn--danger:hover { background: var(--danger-soft); }

.table tbody tr:hover, table tbody tr:hover { background: var(--bg-hover); }

.auth__card { border-color: var(--border-strong); }
.auth__logo, .sidebar__logo { box-shadow: 0 0 0 1px var(--accent-border); }

/* =====================================================================
   25. Visual Pro — 2.7.21 (SÓ VISUAL)
   Polimento sobre o Dark-Pro minimalista (seções 23–24), sem refazer
   componentes, sem mudar rotas, textos de função, permissões ou banco,
   sem Tailwind, sem CDN e sem fonte externa (a pilha "Inter" continua
   caindo para a fonte do sistema, como nas seções anteriores).
   O que muda, na prática:
   - Legibilidade: texto secundário/muted um tom mais claro (#71717a
     era escuro demais para ler confortavelmente); superfícies com
     separação um pouco mais nítida (card um tom acima da base).
   - Topbar fosca de verdade: a seção 24 a deixou opaca (o blur da
     base não fazia efeito) e a cor original era azul-marinho, resto
     da aurora 2.7.8 — agora é grafite translúcido + blur.
   - Hierarquia: títulos de página e de card com respiro, tabelas com
     cabeçalho mais firme e alinhamento interno nos cards flush.
   - Componentes com acabamento: chip de ícone do KPI com borda do
     próprio tom, badges com bordas no tom atual de cada status
     (a base usava rgba dos tons antigos), dropdown/modal/toast com
     raio e sombra do mesmo nível discreto, login com card mais
     presente (borda forte + sombra suave) sem tocar nos paddings
     dos campos (lição 2.7.6: padding de input com ícone não se mexe).
   - Nada de degradê, halo ou elevação nova: o minimalismo da 2.7.9
     continua — o brilho é só nitidez, não efeito.
   Para voltar ao visual da 2.7.20, remova esta seção.
   ===================================================================== */

/* ---- Tokens: leitura e separação ---- */
:root {
  --bg-card:        #131316;
  --bg-elevated:    #1b1b20;
  --bg-input:       #101013;
  --border:         #2a2a31;
  --border-soft:    #202026;
  --text-soft:      #b3b3bc;
  --text-muted:     #8f8f98;
  --accent-soft:    rgba(165, 180, 252, .13);
  --accent-border:  rgba(165, 180, 252, .35);
  --shadow-lg:      0 12px 40px rgba(0, 0, 0, .45);
}

::selection { background: rgba(165, 180, 252, .28); color: #fff; }
::-webkit-scrollbar-thumb { background: #3a3a41; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-border); }

/* ---- Topbar fosca (grafite translúcido + blur) ---- */
.topbar {
  background: rgba(10, 10, 11, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.topbar__title { font-size: 1rem; letter-spacing: -.01em; }
.topbar__crumb { font-variant-numeric: tabular-nums; }
.topbar__toggle { width: 36px; height: 36px; }

/* ---- Sidebar: marca, navegação e usuário ---- */
.sidebar__brand { padding: 0 1rem; }
.sidebar__logo { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; font-size: 1rem; }
.sidebar__title { font-size: 1rem; }
.sidebar__subtitle { letter-spacing: .1em; }
.sidebar__nav { padding: .85rem .65rem 1.5rem; }
.sidebar__section { padding: 1.1rem .7rem .45rem; letter-spacing: .13em; }
.nav-link { padding: .6rem .75rem; border-radius: 9px; }
.nav-link svg { color: var(--text-muted); }
.nav-link:hover svg { color: var(--text); }
.nav-link.is-active { box-shadow: inset 0 0 0 1px var(--accent-border); }
.nav-link.is-active svg { color: var(--accent); }
.nav-link__badge { border: 1px solid var(--accent-border); }
.sidebar__footer { padding: .75rem; }
.sidebar__user { border: 1px solid var(--border); background: var(--bg-surface); padding: .55rem .65rem; }
.avatar { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10); }

/* ---- Cabeçalho de página ---- */
.page-head { margin-bottom: 1.4rem; }
.page-head h1 { letter-spacing: -.025em; }
.page-head p { margin-top: .15rem; }

/* ---- Cards ---- */
.card { box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.card__header { padding: 1rem 1.25rem; }
.card__title { font-size: .95rem; font-weight: 650; letter-spacing: -.01em; }
.card__body { padding: 1.25rem; }
.card__body--flush { padding: 0; }
.card__footer { padding: .9rem 1.25rem; }

/* ---- KPIs: chip com borda do tom, número com presença ---- */
.stat-card { padding: 1.15rem 1.2rem; }
.stat-card__icon {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--accent-border);
}
.stat-card--success .stat-card__icon { border-color: rgba(74, 222, 128, .30); }
.stat-card--warning .stat-card__icon { border-color: rgba(250, 204, 21, .30); }
.stat-card--danger .stat-card__icon { border-color: rgba(248, 113, 113, .30); }
.stat-card--info .stat-card__icon { border-color: rgba(125, 211, 252, .30); }
.stat-card--purple .stat-card__icon { border-color: rgba(196, 181, 253, .30); }
.stat-card__value { font-size: 1.9rem; margin: .6rem 0 .25rem; }
.stat-card__meta { gap: .4rem; }

/* ---- Tabelas: cabeçalho firme, alinhamento em card flush ---- */
.table thead th {
  letter-spacing: .09em;
  padding: .7rem .9rem;
  background: var(--bg-surface);
}
.table tbody td { padding: .72rem .9rem; }
.card__body--flush .table thead th:first-child,
.card__body--flush .table tbody td:first-child { padding-left: 1.25rem; }
.card__body--flush .table thead th:last-child,
.card__body--flush .table tbody td:last-child { padding-right: 1.25rem; }
.table__empty { padding: 2.75rem 1rem; }

/* ---- Badges: bordas no tom atual de cada status ---- */
.badge { font-weight: 650; letter-spacing: .02em; padding: .2rem .55rem; }
.badge--success { border-color: rgba(74, 222, 128, .28); }
.badge--danger  { border-color: rgba(248, 113, 113, .28); }
.badge--warning { border-color: rgba(250, 204, 21, .28); }
.badge--info    { border-color: rgba(125, 211, 252, .28); }

/* ---- Botões e campos ---- */
.btn { letter-spacing: .01em; }
.btn--icon { width: 34px; height: 34px; }
.btn--icon:hover { border-color: var(--border-strong); }
.form-control, .form-select { min-height: 42px; }
.form-label { letter-spacing: .01em; }
.auth__input .form-control { border-radius: 10px; }

/* ---- Dropdown, modal, toast, abas e paginação ---- */
.dropdown__menu { min-width: 230px; border-radius: 12px; padding: .4rem; }
.dropdown__item { padding: .55rem .7rem; border-radius: 8px; font-size: .875rem; }
.modal__box { border-radius: 16px; }
.modal__header { padding: 1.1rem 1.25rem; }
.modal__title { letter-spacing: -.01em; }
.toast { border-radius: 12px; }
.tab { padding: .65rem 1rem; }
.pagination-list a, .pagination-list span { border-radius: 8px; }

/* ---- Login: card mais presente, campos intactos ---- */
.auth__card {
  border-color: var(--border-strong);
  border-radius: 18px;
  padding: 2.25rem 2rem 1.75rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.auth__title { font-size: 1.35rem; letter-spacing: -.02em; }
.auth__subtitle { margin-bottom: 1.75rem; }
.auth__footer { border-top: 1px solid var(--border-soft); padding-top: 1rem; margin-top: 1.5rem; }

/* ---- Respiro em telas largas ---- */
@media (min-width: 1600px) {
  .content { padding: 1.75rem 2.25rem 3rem; }
}

/* =====================================================================
   26. Fundo do login — 2.7.24/2.7.25/2.7.26/2.7.27 (SÓ VISUAL, só a tela de login)
   Antes: o login era cor chapada (#0a0a0b) — a seção 23 tinha removido
   os halos da seção 22 e não havia nenhuma imagem de fundo.
   Agora: imagem `assets/img/login-bg.jpg` (2048x1152, JPG, ~254 KB,
   malha de conexões em violeta nas laterais e centro limpo e escuro
   para o card, sem texto na imagem — opção "Rede digital" escolhida
   pelo DANILO em 05/11/2026, substituindo a cidade à noite da 2.7.25
   e a parede de telas da 2.7.24) + véu escuro por cima para o card e
   os campos continuarem legíveis. O resto do painel NÃO muda: a regra
   é só `.auth` / `.auth__card`, e o `body` continua sem imagem.
   Fallback: se o JPG não subir ou falhar, o fundo continua só
   `var(--bg-base)` (grafite chapado) — nunca fica tela branca nem
   fundo quebrado. O padrão SVG de grade + play que ficava por cima
   da foto foi REMOVIDO na 2.7.27 a pedido do DANILO: agora só a
   imagem Rede digital aparece, sem nenhum quadradinho de play.
   Para trocar a imagem: substitua `login-bg.jpg` por outro JPG com
   o mesmo nome (recomendado 1920x1080 ou maior, escuro, centro
   livre). Para voltar ao fundo chapado: apague esta seção 26 e o
   arquivo `login-bg.jpg`.
   ===================================================================== */
.auth {
  background-color: var(--bg-base);
  background-image:
    linear-gradient(rgba(10, 10, 11, .58), rgba(10, 10, 11, .68)),
    url('../img/login-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.auth__box { position: relative; z-index: 1; }
/* Card levemente translúcido + blur: o fundo aparece nas bordas,
   mas o texto e os campos continuam sobre superfície quase chapada. */
.auth__card {
  background: rgba(20, 20, 22, .93);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@media (max-width: 768px) {
  /* `fixed` trava/treme em celular: rola junto com a página. O centro
     da foto é livre, então o recorte vertical não cobre o card. */
  .auth { background-attachment: scroll; background-position: 50% center; }
}
