/* ================================================================
   LocaFácil — Design System
   Ordem: tokens → reset → Bootstrap overrides → componentes →
          layout (sidebar, topbar, main) → utilitários → mobile
   ================================================================ */

/* ── 1. TOKENS — Tema Claro ──────────────────────────────────── */
:root {
  --lf-primary:     #E8572A;
  --lf-primary-rgb: 232, 87, 42;
  --lf-secondary:   #F2295B;
  --lf-accent:      #F97316;
  --lf-indigo:      #6366F1;
  --lf-success:     #10B981;
  --lf-warning:     #FBBF24;
  --lf-danger:      #F2295B;

  --lf-bg:        #F8F9FA;
  --lf-surface:   #FFFFFF;
  --lf-surface-2: #F1F5F9;   /* cards secundários, thead */
  --lf-nav:       #1A1D2E;
  --lf-nav-2:     #252840;   /* hover dentro do nav */
  --lf-text:      #1A1D2E;
  --lf-text-2:    #374151;   /* texto secundário */
  --lf-muted:     #64748B;
  --lf-border:    #E2E8F0;
  --lf-input-bg:  #FFFFFF;

  --lf-shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --lf-shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --lf-shadow-lg: 0 10px 24px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.06);

  --lf-radius:    10px;
  --lf-radius-sm: 6px;
  --lf-radius-lg: 16px;

  --lf-sidebar-w:      240px;
  --lf-topbar-h:       56px;
  --lf-transition:     .18s ease;
  --lf-transition-slow:.3s ease;
}

/* ── 2. TOKENS — Tema Escuro ─────────────────────────────────── */
[data-theme="dark"] {
  --lf-bg:        #0F1117;
  --lf-surface:   #1A1D2E;
  --lf-surface-2: #252840;
  --lf-nav:       #0B0D14;
  --lf-nav-2:     #1A1D2E;
  --lf-text:      #F1F5F9;
  --lf-text-2:    #CBD5E1;
  --lf-muted:     #94A3B8;
  --lf-border:    #2D3748;
  --lf-input-bg:  #252840;

  --lf-shadow:    0 1px 3px rgba(0,0,0,.3),  0 1px 2px rgba(0,0,0,.2);
  --lf-shadow-md: 0 4px 6px rgba(0,0,0,.25), 0 2px 4px rgba(0,0,0,.18);
  --lf-shadow-lg: 0 10px 24px rgba(0,0,0,.4), 0 4px 8px rgba(0,0,0,.25);
}

/* ── 3. RESET BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--lf-bg);
  color: var(--lf-text);
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Transição de tema: só ativada via JS para não piscar no carregamento */
body.lf-theme-ready,
body.lf-theme-ready *:not(script) {
  transition:
    background-color var(--lf-transition-slow),
    border-color     var(--lf-transition),
    color            var(--lf-transition),
    box-shadow       var(--lf-transition);
}

@media (prefers-reduced-motion: reduce) {
  body.lf-theme-ready,
  body.lf-theme-ready * { transition: none !important; }
}

a { color: var(--lf-primary); text-decoration: none; }
a:hover { color: #c9441c; }

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

/* ── 4. BOOTSTRAP OVERRIDES ──────────────────────────────────── */

/* Cores primárias */
.btn-primary {
  --bs-btn-bg:           var(--lf-primary);
  --bs-btn-border-color: var(--lf-primary);
  --bs-btn-hover-bg:           #c9441c;
  --bs-btn-hover-border-color: #c9441c;
  --bs-btn-active-bg:          #b83d19;
  --bs-btn-focus-shadow-rgb:   var(--lf-primary-rgb);
  color: #fff;
}
.btn-outline-primary {
  --bs-btn-color:        var(--lf-primary);
  --bs-btn-border-color: var(--lf-primary);
  --bs-btn-hover-bg:     var(--lf-primary);
  --bs-btn-hover-border-color: var(--lf-primary);
  --bs-btn-active-bg:    #c9441c;
}
.text-primary  { color: var(--lf-primary) !important; }
.bg-primary    { background-color: var(--lf-primary) !important; }
.border-primary{ border-color: var(--lf-primary) !important; }

/* btn-outline-secondary adaptado ao tema */
.btn-outline-secondary {
  --bs-btn-color:              var(--lf-text);
  --bs-btn-border-color:       var(--lf-border);
  --bs-btn-hover-bg:           var(--lf-surface-2);
  --bs-btn-hover-color:        var(--lf-text);
  --bs-btn-hover-border-color: var(--lf-border);
  --bs-btn-active-bg:          var(--lf-border);
  --bs-btn-active-color:       var(--lf-text);
}
[data-theme="dark"] .btn-outline-secondary {
  --bs-btn-color:              var(--lf-text);
  --bs-btn-border-color:       var(--lf-border);
  --bs-btn-hover-bg:           var(--lf-nav-2);
  --bs-btn-hover-color:        #fff;
  --bs-btn-hover-border-color: var(--lf-border);
  --bs-btn-active-bg:          var(--lf-nav-2);
}

/* Dropdown — dark theme */
.dropdown-menu {
  --bs-dropdown-bg:          var(--lf-surface);
  --bs-dropdown-border-color:var(--lf-border);
  --bs-dropdown-color:       var(--lf-text);
  --bs-dropdown-link-color:  var(--lf-text);
  --bs-dropdown-link-hover-bg:   var(--lf-surface-2);
  --bs-dropdown-link-hover-color:var(--lf-text);
  --bs-dropdown-link-active-bg:  rgba(var(--lf-primary-rgb),.1);
  --bs-dropdown-link-active-color:var(--lf-primary);
  --bs-dropdown-divider-bg:  var(--lf-border);
  box-shadow: var(--lf-shadow-lg);
  border-radius: var(--lf-radius);
  border: 1px solid var(--lf-border);
  padding: 6px;
  min-width: 200px;
}
.dropdown-item {
  border-radius: var(--lf-radius-sm);
  font-size: 13.5px;
  padding: 7px 10px;
}
.dropdown-item-text { font-size: 12px; color: var(--lf-muted); padding: 6px 10px; }
.dropdown-divider { margin: 4px 0; }

/* Form controls */
.form-control, .form-select {
  background-color: var(--lf-input-bg);
  border-color: var(--lf-border);
  color: var(--lf-text);
  border-radius: var(--lf-radius-sm);
}
.form-control:focus, .form-select:focus {
  background-color: var(--lf-input-bg);
  color: var(--lf-text);
  border-color: var(--lf-primary);
  box-shadow: 0 0 0 3px rgba(var(--lf-primary-rgb), .15);
  outline: none;
}
.form-control::placeholder { color: var(--lf-muted); opacity: 1; }
.form-label { font-weight: 500; color: var(--lf-text); margin-bottom: 5px; font-size: 13.5px; }
.form-text  { color: var(--lf-muted); font-size: 12px; }

/* Card */
.card {
  background-color: var(--lf-surface);
  border: 1px solid var(--lf-border);
  border-radius: var(--lf-radius);
  box-shadow: var(--lf-shadow);
}
.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--lf-border);
  font-weight: 600;
  color: var(--lf-text);
  padding: 14px 20px;
}
.card-body { padding: 20px; }
.card-footer {
  background-color: transparent;
  border-top: 1px solid var(--lf-border);
  padding: 12px 20px;
}

/* Tabelas */
.table { --bs-table-bg: transparent; color: var(--lf-text); margin-bottom: 0; }
.table thead th {
  background: var(--lf-surface-2);
  color: var(--lf-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  border-bottom: 1px solid var(--lf-border);
  border-top: none;
  padding: 10px 14px;
  white-space: nowrap;
}
.table tbody td {
  border-bottom: 1px solid var(--lf-border);
  border-top: none;
  padding: 12px 14px;
  vertical-align: middle;
  color: var(--lf-text);
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: rgba(0,0,0,.025); }
[data-theme="dark"] .table-hover tbody tr:hover { background: rgba(255,255,255,.03); }
[data-theme="dark"] .table thead th { background: var(--lf-surface-2); }

/* Badges */
.badge { font-weight: 600; font-size: 11px; padding: 4px 8px; border-radius: 20px; }

/* Modal */
.modal-content {
  background: var(--lf-surface);
  border: 1px solid var(--lf-border);
  border-radius: var(--lf-radius-lg);
  box-shadow: var(--lf-shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--lf-border); padding: 16px 20px; }
.modal-footer { border-top:   1px solid var(--lf-border); padding: 12px 20px; }
.modal-title  { font-weight: 700; color: var(--lf-text); }
.btn-close    { filter: none; opacity: .6; }
[data-theme="dark"] .btn-close { filter: invert(1); }
.modal-backdrop { backdrop-filter: blur(2px); }

/* ── 5. SIDEBAR ──────────────────────────────────────────────── */
.lf-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--lf-sidebar-w);
  background: var(--lf-nav);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;           /* overflow-y gerenciado no __nav */
  will-change: transform;
  transform: translateX(0);
  transition: transform var(--lf-transition-slow);
}

/* Scrollbar da lista de nav (Firefox + Chrome/Safari) */
.lf-sidebar__nav {
  flex: 1;
  padding: 8px 10px 4px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
}
.lf-sidebar__nav::-webkit-scrollbar       { width: 4px; }
.lf-sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.lf-sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.14);
  border-radius: 4px;
}
.lf-sidebar__nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }

/* Brand */
.lf-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.lf-brand__logo {
  width: 34px; height: 34px;
  background: var(--lf-primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 900; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(232,87,42,.4);
}
.lf-brand__name {
  font-size: 16.5px;
  font-weight: 700;
  color: #F1F5F9;
  letter-spacing: -.3px;
  line-height: 1;
}
.lf-brand__name em { color: var(--lf-primary); font-style: normal; }

/* Seção de navegação */
.lf-nav-label {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.28);
  padding: 14px 10px 4px;
  user-select: none;
}

.lf-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 1px;
  position: relative;
  transition: background var(--lf-transition), color var(--lf-transition);
  white-space: nowrap;
  overflow: hidden;
}
.lf-nav-link .lf-nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  opacity: .8;
  transition: opacity var(--lf-transition);
}
.lf-nav-link:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}
.lf-nav-link:hover .lf-nav-icon { opacity: 1; }

.lf-nav-link.active {
  background: rgba(var(--lf-primary-rgb), .18);
  color: #fff;
  font-weight: 600;
}
.lf-nav-link.active .lf-nav-icon {
  color: var(--lf-primary);
  opacity: 1;
}
/* Barra lateral do item ativo */
.lf-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--lf-primary);
  border-radius: 0 3px 3px 0;
}

/* Badge de contagem no nav */
.lf-nav-badge {
  margin-left: auto;
  background: var(--lf-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* Footer — usuário */
.lf-sidebar__footer {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.lf-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: default;
  transition: background var(--lf-transition);
}
.lf-user-card:hover { background: rgba(255,255,255,.05); }
.lf-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--lf-indigo);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
.lf-user-name {
  font-size: 13px; font-weight: 600;
  color: #F1F5F9;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.lf-user-role {
  font-size: 11px;
  color: rgba(255,255,255,.38);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Botão sair dentro do footer */
.lf-sidebar-logout {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  padding: 7px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.4);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--lf-transition), color var(--lf-transition);
}
.lf-sidebar-logout:hover {
  background: rgba(242,41,91,.12);
  color: #fca5a5;
}

/* ── 6. TOPBAR ───────────────────────────────────────────────── */
.lf-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--lf-topbar-h);
  background: var(--lf-surface);
  border-bottom: 1px solid var(--lf-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 10px;
  box-shadow: var(--lf-shadow);
}

.lf-topbar__hamburger {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--lf-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 18px;
  transition: background var(--lf-transition), color var(--lf-transition);
}
.lf-topbar__hamburger:hover { background: var(--lf-surface-2); color: var(--lf-text); }

.lf-topbar__title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--lf-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Botão de tema */
.lf-btn-tema {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--lf-border);
  background: var(--lf-surface);
  color: var(--lf-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 15px;
  transition: background var(--lf-transition), border-color var(--lf-transition),
              color var(--lf-transition), transform .2s;
}
.lf-btn-tema:hover {
  background: var(--lf-surface-2);
  border-color: var(--lf-primary);
  color: var(--lf-primary);
  transform: rotate(15deg);
}
[data-theme="dark"] .lf-btn-tema {
  background: var(--lf-surface-2);
}

/* Avatar no topbar */
.lf-topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--lf-indigo);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
  letter-spacing: -.5px;
  cursor: pointer;
}

/* ── 7. MAIN / CONTENT ───────────────────────────────────────── */
.lf-main {
  margin-left: var(--lf-sidebar-w);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--lf-transition-slow);
}

.lf-content {
  flex: 1;
  padding: 24px;
  max-width: 1600px;
}

/* ── 8. COMPONENTES DE CONTEÚDO ──────────────────────────────── */

/* Alertas flash */
.lf-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid transparent;
}
.lf-alert i { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.lf-alert-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  opacity: .6;
  font-size: 13px;
  padding: 0 0 0 8px;
  flex-shrink: 0;
  line-height: 1;
}
.lf-alert-close:hover { opacity: 1; }

.lf-alert-success { background: #ECFDF5; color: #065F46; border-color: #BBF7D0; }
.lf-alert-error   { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.lf-alert-warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.lf-alert-info    { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }

[data-theme="dark"] .lf-alert-success { background: #064E3B33; color: #6EE7B7; border-color: #065F46; }
[data-theme="dark"] .lf-alert-error   { background: #7F1D1D33; color: #FCA5A5; border-color: #7F1D1D; }
[data-theme="dark"] .lf-alert-warning { background: #78350F33; color: #FCD34D; border-color: #78350F; }
[data-theme="dark"] .lf-alert-info    { background: #1E3A5F33; color: #93C5FD; border-color: #1E40AF; }

/* Cabeçalho de página */
.lf-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 20px;
}
.lf-page-header__left h1 {
  font-size: 20px; font-weight: 700;
  color: var(--lf-text); margin: 0 0 2px;
  line-height: 1.2;
}
.lf-page-header__left p {
  font-size: 13px; color: var(--lf-muted); margin: 0;
}
.lf-page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cards de estatística */
.lf-stat-card {
  background: var(--lf-surface);
  border: 1px solid var(--lf-border);
  border-radius: var(--lf-radius);
  padding: 18px 20px;
  box-shadow: var(--lf-shadow);
  display: flex; align-items: flex-start; gap: 14px;
  transition: box-shadow var(--lf-transition), transform var(--lf-transition);
}
.lf-stat-card:hover {
  box-shadow: var(--lf-shadow-md);
  transform: translateY(-1px);
}
.lf-stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.lf-stat-value { font-size: 26px; font-weight: 700; color: var(--lf-text); line-height: 1.1; }
.lf-stat-label { font-size: 12px; color: var(--lf-muted); font-weight: 500; margin-top: 3px; }
.lf-stat-trend { font-size: 11.5px; margin-top: 4px; font-weight: 600; }
.lf-stat-trend.up   { color: var(--lf-success); }
.lf-stat-trend.down { color: var(--lf-danger); }

/* Badges de status */
.lf-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  line-height: 1.4;
}
.lf-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
  flex-shrink: 0;
}
.lf-badge-success { background: rgba(16,185,129,.12);  color: #059669; }
.lf-badge-danger  { background: rgba(239,68,68,.12);   color: #DC2626; }
.lf-badge-warning { background: rgba(251,191,36,.15);  color: #D97706; }
.lf-badge-indigo  { background: rgba(99,102,241,.12);  color: #6366F1; }
.lf-badge-muted   { background: rgba(100,116,139,.12); color: var(--lf-muted); }
.lf-badge-primary { background: rgba(var(--lf-primary-rgb),.12); color: var(--lf-primary); }

[data-theme="dark"] .lf-badge-success { background: rgba(16,185,129,.18);  color: #34D399; }
[data-theme="dark"] .lf-badge-danger  { background: rgba(239,68,68,.18);   color: #F87171; }
[data-theme="dark"] .lf-badge-warning { background: rgba(251,191,36,.18);  color: #FCD34D; }
[data-theme="dark"] .lf-badge-indigo  { background: rgba(99,102,241,.18);  color: #A5B4FC; }

/* Inputs com ícone */
.lf-input-icon { position: relative; }
.lf-input-icon > i:first-child {
  position: absolute;
  left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--lf-muted); font-size: 15px;
  pointer-events: none; z-index: 1;
}
.lf-input-icon .form-control { padding-left: 36px; }

/* Divider com texto */
.lf-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--lf-muted); font-size: 12px; margin: 16px 0;
}
.lf-divider::before, .lf-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--lf-border);
}

/* ── 9. OVERLAY MOBILE ───────────────────────────────────────── */
.lf-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--lf-transition-slow);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.lf-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── 10. BANNER TRIAL ────────────────────────────────────────── */
.lf-trial-banner {
  background: linear-gradient(90deg, #1A1D2E, #2D1B4E);
  color: rgba(255,255,255,.9);
  font-size: 12.5px;
  padding: 8px 20px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  text-align: center;
}
.lf-trial-banner a {
  color: var(--lf-warning);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── 11. RESPONSIVIDADE ──────────────────────────────────────── */
@media (max-width: 991.98px) {
  .lf-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .lf-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--lf-shadow-lg);
  }
  .lf-main { margin-left: 0; }
  .lf-content { padding: 16px; }
}

@media (max-width: 575.98px) {
  .lf-topbar { padding: 0 12px; gap: 8px; }
  .lf-stat-value { font-size: 22px; }
}

/* ── 12. UTILITÁRIOS ─────────────────────────────────────────── */
.text-muted  { color: var(--lf-muted) !important; }
.text-danger { color: var(--lf-danger) !important; }
.text-success{ color: var(--lf-success) !important; }
.text-warning{ color: var(--lf-warning) !important; }

.bg-surface   { background: var(--lf-surface) !important; }
.bg-surface-2 { background: var(--lf-surface-2) !important; }
.border-lf    { border-color: var(--lf-border) !important; }

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

/* Focus ring acessível */
:focus-visible {
  outline: 2px solid var(--lf-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── 13. DASHBOARD — COMPONENTES ESPECÍFICOS ─────────────────── */

/* page-header h1 direto (sem __left) */
.lf-page-header h1 {
  font-size: 22px; font-weight: 700;
  color: var(--lf-text); margin: 0;
  line-height: 1.2;
}

/* Stat card — sub-elementos BEM */
.lf-stat-card__icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.lf-stat-card__value {
  font-size: 26px; font-weight: 700;
  color: var(--lf-text); line-height: 1.1;
}
.lf-stat-card__label {
  font-size: 12px; color: var(--lf-muted); font-weight: 500; margin-top: 2px;
}

/* Stat card — variante de alerta */
.lf-stat-card--alert {
  border-color: rgba(242,41,91,.3);
}
[data-theme="dark"] .lf-stat-card--alert {
  border-color: rgba(242,41,91,.25);
}

/* Barra de progresso customizada */
.lf-progress {
  width: 100%;
  background: var(--lf-border);
  border-radius: 99px;
  overflow: hidden;
}
.lf-progress-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .5s ease;
  min-width: 4px;
}

/* Tabela simplificada para listas no dashboard */
.lf-table {
  font-size: 13px;
}
.lf-table thead th {
  padding: 10px 16px;
}
.lf-table tbody td {
  padding: 10px 16px;
}

/* Acesso rápido */
.lf-quick-link {
  border: 1px solid var(--lf-border);
  background: var(--lf-bg);
  transition: border-color var(--lf-transition), background var(--lf-transition), box-shadow var(--lf-transition);
}
.lf-quick-link:hover {
  border-color: var(--lf-primary);
  background: rgba(var(--lf-primary-rgb), .04);
  box-shadow: var(--lf-shadow);
}
[data-theme="dark"] .lf-quick-link {
  background: var(--lf-surface-2);
}
[data-theme="dark"] .lf-quick-link:hover {
  background: rgba(var(--lf-primary-rgb), .08);
}

/* min-width: 0 utilitário (Bootstrap não tem) */
.min-w-0 { min-width: 0 !important; }

/* ── 14. AUTH PAGES ──────────────────────────────────────────── */

.lf-auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: row;
}

/* ── Painel esquerdo ─────────────────────────────────────────── */
.lf-auth-left {
  width: 56%;
  flex-shrink: 0;
  background: linear-gradient(145deg, #0b0e18 0%, #1A1D2E 55%, #1f2340 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 68px;
  position: relative;
  overflow: hidden;
}

/* Linha de destaque degradê no topo */
.lf-auth-left::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--lf-primary), var(--lf-secondary));
}

/* Círculo decorativo de fundo */
.lf-auth-left::after {
  content: '';
  position: absolute;
  width: 560px; height: 560px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.04);
  bottom: -220px; right: -150px;
  pointer-events: none;
}

/* Brilho laranja decorativo */
.lf-auth-left__glow {
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,87,42,.14) 0%, transparent 70%);
  bottom: 40px; right: 20px;
  pointer-events: none;
}

.lf-auth-left__title {
  font-size: 44px;
  font-weight: 700;
  color: #fff;
  line-height: 1.18;
  letter-spacing: -.6px;
  margin: 0 0 22px;
  position: relative;
  z-index: 1;
}
.lf-auth-left__title em { color: var(--lf-primary); font-style: normal; }

.lf-auth-left__desc {
  font-size: 15px;
  color: rgba(255,255,255,.48);
  line-height: 1.8;
  max-width: 380px;
  margin: 0 0 44px;
  position: relative;
  z-index: 1;
}

.lf-auth-left__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.75);
  background: transparent;
  padding: 11px 26px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-decoration: none;
  transition: border-color .18s, color .18s, background .18s;
  align-self: flex-start;
  position: relative;
  z-index: 1;
}
.lf-auth-left__cta:hover {
  border-color: var(--lf-primary);
  color: #fff;
  background: rgba(232,87,42,.12);
}

.lf-auth-left__nav {
  display: flex;
  gap: 28px;
  position: relative;
  z-index: 1;
}
.lf-auth-left__nav a {
  color: rgba(255,255,255,.25);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .09em;
  text-decoration: none;
  transition: color .18s;
}
.lf-auth-left__nav a:hover { color: rgba(255,255,255,.55); }

/* ── Painel direito ──────────────────────────────────────────── */
.lf-auth-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--lf-surface);
}

.lf-auth-right__top {
  padding: 48px 64px 0;
}

.lf-auth-right__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.lf-auth-right__mark {
  width: 36px; height: 36px;
  background: var(--lf-primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 900; color: #fff;
  box-shadow: 0 3px 10px rgba(232,87,42,.3);
  flex-shrink: 0;
}
.lf-auth-right__name {
  font-size: 20px;
  font-weight: 700;
  color: var(--lf-text);
  letter-spacing: -.3px;
}
.lf-auth-right__name em { color: var(--lf-primary); font-style: normal; }

.lf-auth-right__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 64px;
}

/* Variante para formulários longos: alinha ao topo e não corta */
.lf-auth-right__body--form {
  align-items: flex-start;
  padding-top: 40px;
  padding-bottom: 40px;
}

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

/* Cabeçalho do formulário */
.lf-auth-form__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--lf-text);
  margin: 0 0 4px;
  letter-spacing: -.3px;
}
.lf-auth-form__subtitle {
  font-size: 13.5px;
  color: var(--lf-muted);
  margin: 0 0 32px;
}

/* Campos underline */
.lf-auth-field {
  position: relative;
  margin-bottom: 28px;
}
.lf-auth-field__icon {
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  color: var(--lf-muted);
  font-size: 16px;
  pointer-events: none;
  transition: color var(--lf-transition);
}
.lf-auth-field:focus-within .lf-auth-field__icon {
  color: var(--lf-primary);
}
.lf-auth-field__input {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid var(--lf-border);
  border-radius: 0;
  background: transparent;
  padding: 10px 32px 10px 30px;
  font-size: 14px;
  color: var(--lf-text);
  font-family: inherit;
  outline: none;
  transition: border-color .18s;
}
.lf-auth-field__input::placeholder { color: var(--lf-muted); font-style: italic; }
.lf-auth-field__input:focus        { border-bottom-color: var(--lf-primary); }
.lf-auth-field__input:-webkit-autofill,
.lf-auth-field__input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--lf-surface) inset;
  -webkit-text-fill-color: var(--lf-text);
  transition: background-color 9999s;
}

.lf-auth-field__eye {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--lf-muted); cursor: pointer;
  padding: 0; font-size: 15px; line-height: 1;
  transition: color var(--lf-transition);
}
.lf-auth-field__eye:hover { color: var(--lf-text); }

/* Botão de submit — full width */
.lf-auth-submit {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  padding: 12px 20px;
  background: var(--lf-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background .18s, transform .12s, box-shadow .18s;
  box-shadow: 0 4px 14px rgba(232,87,42,.28);
}
.lf-auth-submit:hover {
  background: #c9441c;
  box-shadow: 0 6px 20px rgba(232,87,42,.38);
  transform: translateY(-1px);
}
.lf-auth-submit:active { transform: scale(.98); box-shadow: none; }

/* Links */
.lf-auth-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  font-size: 13px;
}
.lf-auth-links a { color: var(--lf-primary); }
.lf-auth-links a:hover { color: #c9441c; }
.lf-auth-links__sep { color: var(--lf-border); user-select: none; }

.lf-auth-right__footer {
  padding: 0 64px 32px;
  text-align: center;
  font-size: 11.5px;
  color: var(--lf-muted);
}

/* ── Dark mode ───────────────────────────────────────────────── */
[data-theme="dark"] .lf-auth-left {
  background: linear-gradient(145deg, #06070d 0%, #0F1117 55%, #131726 100%);
}
[data-theme="dark"] .lf-auth-field__input:-webkit-autofill,
[data-theme="dark"] .lf-auth-field__input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #1A1D2E inset;
}

/* ── Responsividade ──────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .lf-auth-left { display: none; }
  .lf-auth-right__top  { padding: 32px 28px 0; }
  .lf-auth-right__body { padding: 32px 28px; }
  .lf-auth-right__footer { padding: 0 28px 28px; }
}

@media (min-width: 768px) and (max-width: 1099.98px) {
  .lf-auth-left { width: 50%; padding: 48px 44px; }
  .lf-auth-left__title { font-size: 34px; }
  .lf-auth-right__top,
  .lf-auth-right__body,
  .lf-auth-right__footer { padding-left: 44px; padding-right: 44px; }
}
