/* ============================================================
   PONTOFÁCIL — DESIGN SYSTEM INDUSTRIAL DARK
   Fontes: Bebas Neue (títulos) + DM Sans (corpo)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg:#050710; --bg2:#080b18; --card:#0f1428; --card2:#131930;
  --sky:#38bdf8; --blue:#2563eb; --green:#10b981; --red:#ef4444;
  --amber:#f59e0b; --purple:#8b5cf6; --gold:#eab308;
  --text:#e2e8f8; --muted:#64748b; --muted2:#94a3b8;
  --white:#ffffff; --black:#000000;
  --border:#1e2d4a; --border2:#243350;
  --fh:'Bebas Neue',sans-serif; --fb:'DM Sans',sans-serif;
  --radius:12px; --radius-sm:8px;
  --sidebar-w:260px;
  --topbar-h:64px;
  --shadow:0 4px 24px rgba(0,0,0,0.4);
  --glow-blue:0 0 20px rgba(37,99,235,0.3);
  --glow-sky:0 0 20px rgba(56,189,248,0.3);
  --glow-green:0 0 20px rgba(16,185,129,0.3);

  /* ── Aliases para compatibilidade com páginas de empresa ── */
  --r: var(--radius);          /* atalho para --radius */
  --r-sm: var(--radius-sm);   /* atalho para --radius-sm */
  --r-lg: 16px;               /* radius grande */
  --r-xl: 20px;               /* radius extra-grande */
  --b1: var(--border);        /* borda nível 1 */
  --b2: var(--border2);       /* borda nível 2 */
  --card1: var(--card);       /* alias para --card */
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.25);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.55);
  --shadow-xl: 0 20px 64px rgba(0,0,0,0.65);
}

/* ── Tema Claro ───────────────────────────────────── */
[data-theme="light"] {
  --bg:#f1f5f9; --bg2:#e2e8f0; --card:#ffffff; --card2:#f8fafc;
  --text:#0f172a; --muted:#64748b; --muted2:#475569;
  --white:#0f172a; --black:#ffffff;
  --border:#e2e8f0; --border2:#cbd5e1;
  --shadow:0 4px 24px rgba(0,0,0,0.05);
  --glow-blue:0 0 20px rgba(37,99,235,0.1);
  --glow-sky:0 0 20px rgba(56,189,248,0.1);
  --glow-green:0 0 20px rgba(16,185,129,0.1);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 64px rgba(0,0,0,0.08);
}
[data-theme="light"] ::selection { background: rgba(37,99,235,0.2); color: #0f172a; }
[data-theme="light"] .sidebar { background: #ffffff; border-color: #e2e8f0; }
[data-theme="light"] .topbar { background: rgba(255,255,255,0.85); border-color: #e2e8f0; }
[data-theme="light"] .form-input, [data-theme="light"] .form-select { background: #f8fafc; border-color: #e2e8f0; color: #0f172a; }
[data-theme="light"] .form-input:focus, [data-theme="light"] .form-select:focus { background: #fff; border-color: var(--sky); }
[data-theme="light"] .btn-ghost { background: rgba(0,0,0,0.04); border-color: #e2e8f0; color: #334155; }
[data-theme="light"] .btn-ghost:hover { background: rgba(0,0,0,0.08); }
[data-theme="light"] .tb-user-menu { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .tb-menu-item:hover { background: #f1f5f9; }
[data-theme="light"] .sidebar-link:hover, [data-theme="light"] .sidebar-link.active { background: rgba(37,99,235,0.08); }
[data-theme="light"] .toast { background: #fff; border-color: #e2e8f0; color: #0f172a; }

/* ============================================================
   1. RESET & BASE
   ============================================================ */

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) var(--bg);
}

body {
  font-family: var(--fb);
  background: var(--bg);
  color: var(--text);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection {
  background: rgba(56,189,248,0.25);
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: var(--fb);
}

input, select, textarea, button {
  font-family: var(--fb);
}

/* ============================================================
   2. LAYOUT
   ============================================================ */

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* Área principal dentro do app-layout (contém topbar + page-content) */
.app-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;       /* evita overflow em grids */
  overflow-x: hidden;  /* previne scroll horizontal */
  overflow-y: auto;    /* permite scroll vertical do conteúdo */
}

.page-content {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  padding: calc(var(--topbar-h) + 24px) 32px 32px;
}

/* Quando usada dentro de .app-layout > .app-main, o page-content não precisa de margin-left */
.app-layout .app-main .page-content {
  margin-left: 0;
}

/* Alias .table-wrap = .table-container para compatibilidade */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ============================================================
   3. SIDEBAR
   ============================================================ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  font-family: var(--fh);
  font-size: 24px;
  color: var(--sky);
  letter-spacing: 1px;
  line-height: 1;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  padding: 12px 8px 6px;
  font-weight: 600;
  user-select: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 2px;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
}

.nav-item:hover {
  background: rgba(56,189,248,0.08);
  color: var(--sky);
  border-color: rgba(56,189,248,0.1);
}

.nav-item.active {
  background: rgba(56,189,248,0.08);
  color: var(--sky);
  border-color: rgba(56,189,248,0.15);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--sky);
  border-radius: 0 3px 3px 0;
}

.nav-item-icon {
  font-size: 18px;
  width: 20px;
  flex-shrink: 0;
  text-align: center;
  line-height: 1;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.user-pill:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border2);
}

/* ============================================================
   4. TOPBAR
   ============================================================ */

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: rgba(8,11,24,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 99;
}

.topbar-left {
  display: flex;
  flex-direction: column;
}

.topbar-title {
  font-family: var(--fh);
  font-size: 22px;
  letter-spacing: 1px;
  line-height: 1.1;
}

.topbar-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

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

/* ============================================================
   5. BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--fb);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--sky));
  color: white;
  box-shadow: var(--glow-blue);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.5);
  opacity: 0.95;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--muted2);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--sky);
  color: var(--sky);
  background: rgba(56,189,248,0.05);
}

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.3);
}

.btn-danger:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.btn-success {
  background: rgba(16,185,129,0.1);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.3);
}

.btn-success:hover {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.btn-amber {
  background: rgba(245,158,11,0.1);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,0.3);
}

.btn-amber:hover {
  background: var(--amber);
  color: white;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius);
}

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   6. CARDS
   ============================================================ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--border2);
}

.card2 {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
}

.card2:hover {
  border-color: var(--border2);
}

.card-hover {
  cursor: pointer;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border2);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--fh);
  font-size: 18px;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.card-body {
  flex: 1;
}

.card-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

/* ============================================================
   7. KPI CARDS
   ============================================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--kpi-color, var(--blue)), transparent);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border2);
}

.kpi-card:focus,
.kpi-card:focus-visible,
.kpi-card:focus-within {
  outline: none;
  box-shadow: none;
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 600;
}

.kpi-value {
  font-family: var(--fh);
  font-size: 36px;
  letter-spacing: 1px;
  color: var(--text);
  line-height: 1;
}

.kpi-change {
  font-size: 12px;
  margin-top: 6px;
  font-weight: 600;
}

.kpi-change.up {
  color: var(--green);
}

.kpi-change.down {
  color: var(--red);
}

.kpi-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 32px;
  opacity: 0.15;
  pointer-events: none;
}

/* ============================================================
   8. GRIDS
   ============================================================ */

.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.g3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.g4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.gauto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.g-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.g-3-1 {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
}

/* ============================================================
   9. TABLE
   ============================================================ */

.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--card2);
  white-space: nowrap;
  font-weight: 600;
}

tbody td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(30,45,74,0.5);
  vertical-align: middle;
  color: var(--muted2);
}

tbody td:first-child {
  color: var(--text);
  font-weight: 500;
}

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

tbody tr:hover {
  background: rgba(56,189,248,0.03);
}

tbody tr:hover td {
  color: var(--text);
}

/* ============================================================
   10. BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
}

.badge-blue {
  background: rgba(37,99,235,0.15);
  color: #60a5fa;
  border-color: rgba(37,99,235,0.3);
}

.badge-green {
  background: rgba(16,185,129,0.15);
  color: #34d399;
  border-color: rgba(16,185,129,0.3);
}

.badge-red {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border-color: rgba(239,68,68,0.3);
}

.badge-amber {
  background: rgba(245,158,11,0.15);
  color: #fcd34d;
  border-color: rgba(245,158,11,0.3);
}

.badge-purple {
  background: rgba(139,92,246,0.15);
  color: #a78bfa;
  border-color: rgba(139,92,246,0.3);
}

.badge-sky {
  background: rgba(56,189,248,0.15);
  color: #7dd3fc;
  border-color: rgba(56,189,248,0.3);
}

.badge-gray {
  background: rgba(100,116,139,0.15);
  color: var(--muted2);
  border-color: rgba(100,116,139,0.3);
}

.badge-gold {
  background: rgba(234,179,8,0.15);
  color: #fde68a;
  border-color: rgba(234,179,8,0.3);
}

/* ============================================================
   11. MODAL
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  padding: 20px;
}

/* Trava scroll do body enquanto qualquer modal estiver aberto */
body.modal-open { overflow: hidden; }

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s;
  position: relative;
  scrollbar-width: thin;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-lg {
  max-width: 760px;
}

.modal-sm {
  max-width: 420px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title {
  font-family: var(--fh);
  font-size: 22px;
  letter-spacing: 0.5px;
}

.modal-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(239,68,68,0.1);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   12. FORMS — Design Moderno Premium
   ============================================================ */

/* ── Wrapper de campo (suporte a floating label) ── */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

/* ── Label padrão (estático, acima do campo) ── */
.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted2);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: color 0.2s;
}

/* asterisco de obrigatório */
.form-label .req {
  color: var(--red);
  font-size: 14px;
  line-height: 1;
}

/* ── Campo base — aplicado a .form-control e ao seletor global ── */
.form-control {
  width: 100%;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px;
  color: var(--text);
  font-family: var(--fb);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  outline: none;
  box-sizing: border-box;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.form-control::placeholder { color: var(--muted); opacity: 1; }

.form-control:hover:not(:disabled):not(:focus) {
  border-color: var(--border2);
  background: color-mix(in srgb, var(--bg2) 90%, var(--sky) 10%);
}

.form-control:focus {
  outline: none;
  border-color: var(--sky);
  background: color-mix(in srgb, var(--bg2) 92%, var(--sky) 8%);
  box-shadow: 0 0 0 3.5px rgba(56,189,248,0.14), 0 2px 8px rgba(56,189,248,0.08);
}

.form-control:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--bg2);
  border-style: dashed;
}

/* Select custom arrow */
select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2338bdf8' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

select.form-control option {
  background: var(--card);
  color: var(--text);
}

/* Textarea */
textarea.form-control {
  resize: vertical;
  min-height: 110px;
  line-height: 1.65;
  padding-top: 12px;
  padding-bottom: 12px;
}

/* ── Estado de erro ── */
.form-control.is-invalid,
.form-control[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.13);
}

.form-control.is-invalid:focus,
.form-control[aria-invalid="true"]:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3.5px rgba(239,68,68,0.18);
}

/* ── Estado de sucesso ── */
.form-control.is-valid {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.13);
}

/* ── Mensagens abaixo do campo ── */
.form-hint {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.4;
}

.form-error {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 11.5px;
  color: var(--red);
  margin-top: 5px;
  font-weight: 600;
  animation: shake-x 0.3s ease;
}

@keyframes shake-x {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* ── Layouts de grid de formulário ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* ── Campo com ícone (esquerda) ── */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

/* legacy alias */
.input-icon-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 15px;
  line-height: 1;
  z-index: 1;
  transition: color 0.2s;
}

.input-wrap .form-control,
.input-icon-wrap .form-control {
  padding-left: 40px;
}

.input-wrap .form-control:focus ~ .input-icon,
.input-wrap .form-control:focus + .input-icon,
.input-icon-wrap:focus-within .input-icon {
  color: var(--sky);
}

/* ── Ícone à direita (ex: show/hide senha) ── */
.input-icon-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  z-index: 1;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 4px;
  line-height: 1;
}

.input-icon-right:hover { color: var(--sky); }

.input-wrap .form-control.has-icon-right { padding-right: 40px; }

/* ── Pickers de data/hora ── */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator {
  filter: invert(0.65) sepia(0.2) hue-rotate(180deg);
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s;
  border-radius: 4px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover,
input[type="week"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* ── Checkbox / Radio custom ── */
input[type="checkbox"],
input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--sky);
  cursor: pointer;
  border-radius: 4px;
  transition: accent-color 0.2s;
}

/* ── Range slider ── */
input[type="range"] {
  accent-color: var(--sky);
  height: 4px;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
}

/* ============================================================
   12.5  AUTO-STYLE GLOBAL — inputs / selects / textareas raw
   Specificidade baixa via :where() — classes e styles inline
   sobrescrevem naturalmente.
   ============================================================ */

input:where(
  :not([type="checkbox"]):not([type="radio"])
  :not([type="file"]):not([type="submit"])
  :not([type="button"]):not([type="reset"])
  :not([type="hidden"]):not([type="range"])
  :not([type="color"]):not([type="image"])
),
select,
textarea {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px;
  color: var(--text);
  font-family: var(--fb);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  outline: none;
  box-sizing: border-box;
  max-width: 100%;
}

input:where(
  :not([type="checkbox"]):not([type="radio"])
  :not([type="file"]):not([type="submit"])
  :not([type="button"]):not([type="reset"])
  :not([type="hidden"]):not([type="range"])
  :not([type="color"]):not([type="image"])
):focus,
select:focus,
textarea:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3.5px rgba(56,189,248,0.14), 0 2px 8px rgba(56,189,248,0.08);
}

input:where(
  :not([type="checkbox"]):not([type="radio"])
  :not([type="file"]):not([type="submit"])
  :not([type="button"]):not([type="reset"])
  :not([type="hidden"]):not([type="range"])
  :not([type="color"]):not([type="image"])
)::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2338bdf8' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

select option {
  background: var(--card);
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.65;
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-style: dashed;
}

/* ── Tema Claro: overrides de formulário ── */
[data-theme="light"] input:where(
  :not([type="checkbox"]):not([type="radio"])
  :not([type="file"]):not([type="submit"])
  :not([type="button"]):not([type="reset"])
  :not([type="hidden"]):not([type="range"])
  :not([type="color"]):not([type="image"])
),
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: #ffffff;
  border-color: #d0d9e8;
  color: #0f172a;
}

[data-theme="light"] input:where(
  :not([type="checkbox"]):not([type="radio"])
  :not([type="file"]):not([type="submit"])
  :not([type="button"]):not([type="reset"])
  :not([type="hidden"]):not([type="range"])
  :not([type="color"]):not([type="image"])
):hover:not(:disabled):not(:focus),
[data-theme="light"] select:hover:not(:disabled):not(:focus),
[data-theme="light"] textarea:hover:not(:disabled):not(:focus) {
  border-color: #94a3b8;
  background: #f8fafc;
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
  background: #f0f9ff;
  border-color: var(--sky);
  box-shadow: 0 0 0 3.5px rgba(56,189,248,0.16), 0 2px 8px rgba(56,189,248,0.1);
}

[data-theme="light"] .form-control {
  background: #ffffff;
  border-color: #d0d9e8;
  color: #0f172a;
}

[data-theme="light"] .form-control:hover:not(:disabled):not(:focus) {
  border-color: #94a3b8;
  background: #f8fafc;
}

[data-theme="light"] .form-control:focus {
  background: #f0f9ff;
  border-color: var(--sky);
  box-shadow: 0 0 0 3.5px rgba(56,189,248,0.16);
}

[data-theme="light"] .form-label { color: #475569; }

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="month"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="week"]::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.7;
}

[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%232563eb' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ── form-input (alias legacy) — recebe o mesmo design ── */
.form-input {
  width: 100%;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px;
  color: var(--text);
  font-family: var(--fb);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  outline: none;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder { color: var(--muted); }

.form-input:hover:not(:disabled):not(:focus) {
  border-color: var(--border2);
}

.form-input:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3.5px rgba(56,189,248,0.14), 0 2px 8px rgba(56,189,248,0.08);
}

.form-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-style: dashed;
}

[data-theme="light"] .form-input {
  background: #ffffff;
  border-color: #d0d9e8;
  color: #0f172a;
}

[data-theme="light"] .form-input:hover:not(:disabled):not(:focus) {
  border-color: #94a3b8;
  background: #f8fafc;
}

[data-theme="light"] .form-input:focus {
  background: #f0f9ff;
  border-color: var(--sky);
  box-shadow: 0 0 0 3.5px rgba(56,189,248,0.16);
}

select.form-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2338bdf8' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

[data-theme="light"] select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%232563eb' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

textarea.form-input {
  resize: vertical;
  min-height: 110px;
  line-height: 1.65;
}

/* ============================================================
   13. TOAST
   ============================================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  font-size: 14px;
  font-weight: 500;
  min-width: 280px;
  max-width: 400px;
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease both;
  pointer-events: all;
  backdrop-filter: blur(12px);
}

.toast-ok {
  background: var(--card);
  border-color: var(--green);
  color: var(--text);
}

.toast-err {
  background: var(--card);
  border-color: var(--red);
  color: var(--text);
}

.toast-warn {
  background: var(--card);
  border-color: var(--amber);
  color: var(--text);
}

.toast-info {
  background: var(--card);
  border-color: var(--sky);
  color: var(--text);
}

@keyframes toast-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ============================================================
   14. PROGRESS BAR
   ============================================================ */

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  background: linear-gradient(90deg, var(--blue), var(--sky));
}

.progress-fill.warn {
  background: linear-gradient(90deg, var(--amber), var(--red) 100%);
}

.progress-fill.danger {
  background: var(--red);
}

.progress-fill.success {
  background: linear-gradient(90deg, var(--green), #34d399);
}

.progress-sm {
  height: 4px;
}

.progress-lg {
  height: 12px;
}

/* ============================================================
   15. AVATAR
   ============================================================ */

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  font-family: var(--fh);
  letter-spacing: 0.5px;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.avatar-md {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.avatar-xl {
  width: 64px;
  height: 64px;
  font-size: 22px;
  border-radius: 16px;
}

.avatar-square {
  border-radius: var(--radius-sm);
}

.avatar-blue   { background: rgba(37,99,235,0.2);  color: #60a5fa; }
.avatar-sky    { background: rgba(56,189,248,0.2);  color: #38bdf8; }
.avatar-green  { background: rgba(16,185,129,0.2);  color: #34d399; }
.avatar-red    { background: rgba(239,68,68,0.2);   color: #f87171; }
.avatar-amber  { background: rgba(245,158,11,0.2);  color: #fcd34d; }
.avatar-purple { background: rgba(139,92,246,0.2);  color: #a78bfa; }
.avatar-gold   { background: rgba(234,179,8,0.2);   color: #fde68a; }

/* ============================================================
   16. LIVE PILL
   ============================================================ */

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(16,185,129,0.1);
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(16,185,129,0.2);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(16,185,129,0.4);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 0 5px rgba(16,185,129,0);
  }
}

/* ============================================================
   17. SKELETON
   ============================================================ */

.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-text.w-25 { width: 25%; }

.skeleton-circle {
  border-radius: 50%;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ============================================================
   18. ANIMATIONS
   ============================================================ */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-up {
  animation: fadeUp 0.4s ease forwards;
}

.fade-up-1 { animation: fadeUp 0.4s 0.1s ease both; }
.fade-up-2 { animation: fadeUp 0.4s 0.2s ease both; }
.fade-up-3 { animation: fadeUp 0.4s 0.3s ease both; }
.fade-up-4 { animation: fadeUp 0.4s 0.4s ease both; }
.fade-up-5 { animation: fadeUp 0.4s 0.5s ease both; }
.fade-up-6 { animation: fadeUp 0.4s 0.6s ease both; }

.anim-1 { animation: fadeUp 0.5s 0.0s ease both; }
.anim-2 { animation: fadeUp 0.5s 0.08s ease both; }
.anim-3 { animation: fadeUp 0.5s 0.16s ease both; }
.anim-4 { animation: fadeUp 0.5s 0.24s ease both; }
.anim-5 { animation: fadeUp 0.5s 0.32s ease both; }
.anim-6 { animation: fadeUp 0.5s 0.40s ease both; }

/* ============================================================
   19. LANDING PAGE
   ============================================================ */

.landing-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, var(--bg2) 0%, var(--bg) 70%);
  padding: 120px 48px 80px;
}

.hero-title {
  font-family: var(--fh);
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.9;
  letter-spacing: 2px;
  margin-bottom: 24px;
}

.hero-title .accent {
  color: var(--sky);
  display: block;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--muted2);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 80px 48px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border2);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 16px;
}

.feature-title {
  font-family: var(--fh);
  font-size: 20px;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.feature-desc {
  font-size: 14px;
  color: var(--muted2);
  line-height: 1.7;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  padding: 80px 48px;
}

.plan-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  transition: transform 0.2s;
}

.plan-card.featured {
  border-color: var(--sky);
  box-shadow: 0 0 0 1px var(--sky), var(--glow-sky);
}

.plan-card:hover {
  transform: translateY(-4px);
}

.plan-badge {
  position: absolute;
  top: -1px;
  right: 24px;
  background: linear-gradient(135deg, var(--blue), var(--sky));
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 0 0 8px 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.plan-name {
  font-family: var(--fh);
  font-size: 24px;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.plan-price {
  font-family: var(--fh);
  font-size: 48px;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.plan-period {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.plan-features {
  list-style: none;
  margin: 20px 0;
}

.plan-features li {
  padding: 8px 0;
  font-size: 14px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--muted2);
}

.plan-features li:last-child {
  border-bottom: none;
}

.plan-features li::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
}

.plan-features li.disabled {
  opacity: 0.4;
}

.plan-features li.disabled::before {
  content: '×';
  color: var(--muted);
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(5,7,16,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(30,45,74,0.5);
  z-index: 100;
}

.navbar-brand {
  font-family: var(--fh);
  font-size: 26px;
  color: var(--sky);
  letter-spacing: 1px;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.navbar-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted2);
  transition: color 0.2s;
}

.navbar-links a:hover {
  color: var(--text);
}

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

.testimonial-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
}

.testimonial-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}

.testimonial-text {
  font-size: 15px;
  color: var(--muted2);
  line-height: 1.7;
  margin-bottom: 20px;
  font-style: italic;
}

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

.testimonial-stars {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.testimonial-name {
  font-weight: 600;
  font-size: 14px;
}

.testimonial-role {
  font-size: 12px;
  color: var(--muted);
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  gap: 16px;
}

.faq-question:hover {
  color: var(--sky);
}

.faq-toggle {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--muted);
  transition: all 0.2s;
}

.faq-answer {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.faq-answer-inner {
  padding-top: 14px;
  font-size: 14px;
  color: var(--muted2);
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-item.open .faq-toggle {
  border-color: var(--sky);
  color: var(--sky);
  background: rgba(56,189,248,0.1);
}

/* ============================================================
   20. AUTH PAGES
   ============================================================ */

.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-visual {
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.auth-visual-title {
  font-family: var(--fh);
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: 2px;
  line-height: 0.95;
  margin-bottom: 24px;
}

.auth-visual-desc {
  font-size: 16px;
  color: var(--muted2);
  line-height: 1.7;
  max-width: 380px;
}

.auth-visual-features {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-visual-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted2);
}

.auth-visual-feature-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  background: var(--bg);
}

.auth-title {
  font-family: var(--fh);
  font-size: 36px;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 15px;
  color: var(--muted2);
  margin-bottom: 32px;
}

.auth-form {
  max-width: 400px;
  width: 100%;
}

.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  margin-bottom: -1px;
}

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

.tab-btn.active {
  border-bottom-color: var(--sky);
  color: var(--sky);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ============================================================
   21. SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ============================================================
   22. UTILITIES
   ============================================================ */

.text-muted  { color: var(--muted) !important; }
.text-muted2 { color: var(--muted2) !important; }
.text-sky    { color: var(--sky) !important; }
.text-blue   { color: var(--blue) !important; }
.text-green  { color: var(--green) !important; }
.text-red    { color: var(--red) !important; }
.text-amber  { color: var(--amber) !important; }
.text-gold   { color: var(--gold) !important; }
.text-purple { color: var(--purple) !important; }
.text-white  { color: #fff !important; }

.fw-300 { font-weight: 300; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-bold { font-weight: 700 !important; }

.font-heading { font-family: var(--fh) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-4 { margin-top: 4px !important; }
.mt-8 { margin-top: 8px !important; }
.mt-12 { margin-top: 12px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-20 { margin-top: 20px !important; }
.mt-24 { margin-top: 24px !important; }
.mt-32 { margin-top: 32px !important; }
.mt-40 { margin-top: 40px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: 4px !important; }
.mb-8 { margin-bottom: 8px !important; }
.mb-12 { margin-bottom: 12px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mb-20 { margin-bottom: 20px !important; }
.mb-24 { margin-bottom: 24px !important; }
.mb-32 { margin-bottom: 32px !important; }

.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-start    { display: flex; align-items: center; justify-content: flex-start; }
.flex-end      { display: flex; align-items: center; justify-content: flex-end; }
.flex-wrap     { flex-wrap: wrap; }
.align-center  { align-items: center; }
.align-start   { align-items: flex-start; }
.align-end     { align-items: flex-end; }
.flex-1        { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

.w-100 { width: 100% !important; }
.w-50  { width: 50%; }
.w-auto { width: auto; }

.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

.truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rounded    { border-radius: var(--radius) !important; }
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-full { border-radius: 9999px !important; }

.border-top    { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }

.p-0  { padding: 0 !important; }
.p-8  { padding: 8px !important; }
.p-12 { padding: 12px !important; }
.p-16 { padding: 16px !important; }
.p-20 { padding: 20px !important; }
.p-24 { padding: 24px !important; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.cursor-pointer { cursor: pointer; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ============================================================
   23. CHART CONTAINERS
   ============================================================ */

.chart-container {
  position: relative;
  height: 300px;
}

.chart-sm {
  position: relative;
  height: 200px;
}

.chart-lg {
  position: relative;
  height: 420px;
}

.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* ============================================================
   24. COTA INDICATOR
   ============================================================ */

.cota-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  transition: opacity 0.2s;
}

.cota-pill:hover {
  opacity: 0.8;
}

.cota-pill.ok {
  background: rgba(16,185,129,0.1);
  color: var(--green);
  border-color: rgba(16,185,129,0.2);
}

.cota-pill.warn {
  background: rgba(245,158,11,0.1);
  color: var(--amber);
  border-color: rgba(245,158,11,0.2);
}

.cota-pill.danger {
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border-color: rgba(239,68,68,0.2);
}

/* ============================================================
   25. GRID BACKGROUND
   ============================================================ */

.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56,189,248,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.grid-bg-dense {
  background-size: 30px 30px;
}

/* Glow orbs for hero / decorative sections */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.15;
  z-index: 0;
}

.glow-orb-blue   { background: var(--blue); }
.glow-orb-sky    { background: var(--sky); }
.glow-orb-green  { background: var(--green); }
.glow-orb-purple { background: var(--purple); }

/* ============================================================
   26. RESPONSIVE
   ============================================================ */

.sidebar-toggle { display: none; }

@media (max-width: 1280px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,0.5);
  }

  .page-content {
    margin-left: 0;
  }

  .topbar {
    left: 0;
  }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted2);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    flex-shrink: 0;
  }

  .sidebar-toggle:hover {
    border-color: var(--sky);
    color: var(--sky);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    display: none;
    backdrop-filter: blur(2px);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .g-2-1, .g-3-1 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .auth-form-panel {
    padding: 40px 24px;
  }

  .navbar {
    padding: 16px 24px;
  }

  .navbar-links {
    display: none;
  }

  .page-content {
    padding: calc(var(--topbar-h) + 16px) 16px 24px;
  }

  .topbar {
    padding: 0 16px;
  }

  .g2, .g3, .g4, .g-2-1, .g-3-1, .gauto {
    grid-template-columns: 1fr;
  }

  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
  }

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

  .features-grid, .pricing-grid {
    grid-template-columns: 1fr;
    padding: 60px 24px;
  }

  .landing-hero {
    padding: 100px 24px 60px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .modal {
    padding: 24px 20px;
    width: 95%;
  }

  .toast {
    min-width: 240px;
    max-width: calc(100vw - 32px);
  }

  .toast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

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

/* ============================================================
   EXTRA: SPINNER & LOADING STATES
   ============================================================ */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--sky);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5,7,16,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 10;
  backdrop-filter: blur(2px);
}

/* ============================================================
   EXTRA: EMPTY STATE
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-title {
  font-family: var(--fh);
  font-size: 20px;
  color: var(--muted2);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 14px;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ── Onboarding & Instructions ── */
.info-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(56,189,248,0.1);
  border: 1px solid var(--sky);
  color: var(--sky);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  transition: all 0.2s;
  margin-left: 6px;
  vertical-align: middle;
}

.info-trigger:hover {
  background: var(--sky);
  color: #fff;
  box-shadow: var(--glow-sky);
  transform: scale(1.1);
}

.empty-state-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 40px auto;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
}

.empty-state-icon-wrap {
  width: 64px;
  height: 64px;
  background: rgba(56,189,248,0.1);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--sky);
}

.instruction-box {
  background: rgba(37,99,235,0.05);
  border-left: 3px solid var(--blue);
  padding: 16px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  text-align: left;
}


/* ============================================================
   EXTRA: SECTION HEADERS
   ============================================================ */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--fh);
  font-size: 28px;
  letter-spacing: 1px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--muted2);
  margin-top: 4px;
}

/* ============================================================
   EXTRA: STAT ROW
   ============================================================ */

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(30,45,74,0.5);
  font-size: 14px;
}

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

.stat-row-label {
  color: var(--muted2);
}

.stat-row-value {
  font-weight: 600;
  color: var(--text);
}

/* ============================================================
   EXTRA: TIMELINE
   ============================================================ */

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border2);
  border: 2px solid var(--bg2);
}

.timeline-dot.active {
  background: var(--sky);
  box-shadow: var(--glow-sky);
}

.timeline-time {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-content {
  font-size: 14px;
  color: var(--muted2);
}

/* ============================================================
   20. TOOLTIPS & HELP ICONS
   ============================================================ */

.help-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(56,189,248,0.1); border: 1px solid rgba(56,189,248,0.3);
  color: var(--sky); font-size: 10px; font-weight: 800;
  cursor: help; margin-left: 8px; vertical-align: middle;
  transition: all 0.2s; position: relative;
}

.help-icon:hover {
  background: var(--sky); color: white;
}

[data-help] {
  position: relative;
}

[data-help]::after {
  content: attr(data-help);
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(5px);
  width: 220px; padding: 10px 14px; border-radius: 8px;
  background: var(--card2); border: 1px solid var(--border2);
  color: var(--text); font-size: 12px; line-height: 1.5;
  box-shadow: var(--shadow-lg); pointer-events: none;
  opacity: 0; transition: all 0.2s; z-index: 1000;
  text-align: center; text-transform: none; font-family: var(--fb);
  font-weight: 400;
}

[data-help]::before {
  content: '';
  position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--border2);
  opacity: 0; transition: all 0.2s; z-index: 1000;
}

[data-help]:hover::after,
[data-help]:hover::before {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ============================================================
   27. RESPONSIVE — CORREÇÕES MOBILE (QA Guardião 05/06/2026)
   Telas do painel que estouravam a largura no celular:
   tabelas largas eram cortadas, topbar e cards empurravam a página.
   Validado com sonda Playwright em 45 telas @390px (0px de scroll
   horizontal). Tudo escopado em @media — desktop intacto.
   ============================================================ */
@media (max-width: 768px) {
  /* Trava de segurança: nada empurra a página pro lado no celular */
  html, body { overflow-x: hidden; max-width: 100%; }

  /* Qualquer tabela larga rola DENTRO da própria caixa (presa à tela)
     em vez de cortar colunas ou empurrar a página */
  table {
    display: block !important;
    width: 100% !important;
    max-width: calc(100vw - 24px) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Topbar nunca estoura a largura do celular */
  .topbar { gap: 8px; }
  .topbar-left { min-width: 0; flex: 1 1 auto; }
  .topbar-title {
    font-size: 17px;
    max-width: 42vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-subtitle { display: none; }
  .topbar-actions { gap: 6px; min-width: 0; flex-shrink: 1; }
  .topbar-actions .btn { padding: 7px 10px; font-size: 12px; }
  #cota-indicador { display: none; }            /* indicador de cota some no celular */
  .tb-user-info { display: none !important; }   /* mostra só o avatar no celular */
  .tb-user-btn { padding: 4px !important; }

  /* Mapas/mídia não passam da tela */
  .leaflet-container, .leaflet-container img { max-width: 100%; }

  /* Linhas de ação / headers de card quebram em vez de empurrar pro lado */
  .card-header, .card-actions, .filtros, .toolbar, .btn-row, .actions-row {
    flex-wrap: wrap;
  }

  /* Cards e blocos nunca ultrapassam a largura da tela */
  .card { max-width: 100%; }

  /* Telas com vários botões de ação no topo (conciliação, pipeline,
     dashboard-executivo, templates): a faixa de ações rola na horizontal
     em vez de estourar/cortar. O menu do usuário abre FIXO pra não ser
     cortado pela rolagem. Validado: topbar 0px overflow + dropdown na tela. */
  .topbar-actions {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .topbar-actions::-webkit-scrollbar { display: none; }
  .topbar .tb-user-menu {
    position: fixed !important;
    top: calc(var(--topbar-h, 64px) + 4px) !important;
    right: 8px !important;
    left: auto !important;
  }
}
