/* ============================================================
   FullContab - Design Premium v4.0
   Inter + Dark Sidebar + Glass Effects + Motion
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* ── Paleta FullContab ── */
  --fc-blue-dark: #003B73;
  --fc-blue: #005FAF;
  --fc-blue-light: #0A84D6;
  --fc-green: #009879;
  --fc-green-dark: #007A63;
  --fc-green-light: #16BFA3;
  --fc-bg: #FFFFFF;
  --fc-bg-soft: #F4F8FB;
  --fc-bg-soft-green: #EAF7F4;
  --fc-border: #DCE7EF;
  --fc-text: #1F2933;
  --fc-text-muted: #6B7280;
  --fc-success: #009879;
  --fc-warning: #F59E0B;
  --fc-danger: #DC2626;
  --fc-shadow: rgba(0,59,115,0.08);

  /* ── Variáveis funcionais (mapeadas para a paleta FC) ── */
  --primary: #005FAF;
  --primary-dark: #003B73;
  --primary-light: #0A84D6;
  --primary-glow: rgba(0,95,175,.18);
  --green: #009879;
  --green-light: #EAF7F4;
  --red: #DC2626;
  --red-light: #FEE2E2;
  --yellow: #F59E0B;
  --yellow-light: #FEF3C7;
  --blue: #0A84D6;
  --blue-light: #E8F4FD;
  --cyan: #16BFA3;
  --cyan-light: #D0F5EF;
  --sidebar-bg: #003B73;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(10,132,214,0.22);
  --sidebar-text: #A8C8E8;
  --sidebar-text-active: #FFFFFF;
  --topbar-h: 64px;
  --sidebar-w: 260px;
  --body-bg: #F4F8FB;
  --card-bg: #FFFFFF;
  --border: #DCE7EF;
  --text: #1F2933;
  --text-muted: #6B7280;
  /* Aliases used by searchable selects and explicit accessible foregrounds */
  --white: #FFFFFF;
  --gray-500: #64748B;
  --gray-800: #1F2933;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --success-text: #006B57;
  --warning-text: #854D0E;
  --info-text: #075985;
  --cyan-text: #087568;
  --success: #007A63;
  --warning: #B45309;
  --danger: #DC2626;
  --border-color: #DCE7EF;
  --shadow: 0 1px 3px rgba(0,59,115,.06), 0 1px 2px rgba(0,59,115,.04);
  --shadow-md: 0 4px 16px rgba(0,59,115,.10);
  --shadow-lg: 0 10px 40px rgba(0,59,115,.14);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --trans: all 0.2s cubic-bezier(.4,0,.2,1);
  --trans-fast: all 0.15s cubic-bezier(.4,0,.2,1);
  --trans-slow: all 0.35s cubic-bezier(.4,0,.2,1);
}

/* Dark Mode */
[data-theme="dark"] {
  --body-bg: #0D1B2E;
  --card-bg: #132236;
  --border: #1E3A5F;
  --text: #F0F6FC;
  --text-muted: #A8C8E8;
  --white: #132236;
  --gray-500: #A8C8E8;
  --gray-800: #F0F6FC;
  --gray-50: #0D1B2E;
  --gray-100: #1E3A5F;
  --gray-200: #294766;
  --gray-300: #3D5F80;
  --gray-400: #A8C8E8;
  --gray-600: #C7DDF0;
  --gray-700: #DFECF7;
  --success-text: #6EE7C8;
  --warning-text: #FCD34D;
  --info-text: #7DD3FC;
  --cyan-text: #5EEAD4;
  --success: #6EE7C8;
  --warning: #FCD34D;
  --danger: #FCA5A5;
  --border-color: #1E3A5F;
  --blue-light: #102F4A;
  --green-light: #103A32;
  --red-light: #451F28;
  --yellow-light: #422D12;
  --cyan-light: #123D3A;
  --shadow: 0 1px 3px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.18);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35);
  --sidebar-bg: #001F40;
}
[data-theme="dark"] .table tbody tr:hover { background: #1E293B; }
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea { background: #0D1B2E; border-color: #1E3A5F; color: #F0F6FC; }
[data-theme="dark"] .modal-content { background: #1E293B; }
[data-theme="dark"] .topbar { background: #1E293B; }
[data-theme="dark"] .stat-card { background: #1E293B; }
[data-theme="dark"] .badge-default { background: #1E3A5F; color: #A8C8E8; }

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

/* Global Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569; }

/* Selection */
::selection { background: var(--primary); color: #fff; }

/* Scrollbar com cores da marca */
::-webkit-scrollbar-thumb { background: #A8C8E8 !important; }
::-webkit-scrollbar-thumb:hover { background: #005FAF !important; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--body-bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==============================
   ANIMATIONS
   ============================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes subtlePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}
.animate-in { animation: fadeInUp .4s cubic-bezier(.4,0,.2,1) both; }
.animate-in-1 { animation-delay: .05s; }
.animate-in-2 { animation-delay: .1s; }
.animate-in-3 { animation-delay: .15s; }
.animate-in-4 { animation-delay: .2s; }
.animate-in-5 { animation-delay: .25s; }

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; width: 60%; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 40%; margin-bottom: 12px; }
.skeleton-card { height: 120px; border-radius: var(--radius); }

/* LAYOUT */
.container { display: flex; min-height: 100vh; }
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ==============================
   SIDEBAR — Premium Glass Effect
   ============================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  background-image: linear-gradient(180deg, rgba(10,132,214,.10) 0%, transparent 50%);
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 200; display: flex; flex-direction: column; overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }

.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-decoration: none;
  background: linear-gradient(180deg, rgba(255,255,255,.05) 0%, rgba(255,255,255,.02) 100%);
}
.sidebar-logo-wordmark {
  width: 182px;
  max-width: 100%;
  height: auto;
  display: block;
}
.sidebar-logo-icon {
  width: 52px; height: 52px;
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(240,248,255,.94) 100%);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 10px 26px rgba(0,26,54,.22);
  transition: var(--trans);
}
.sidebar-logo-icon img { width: 40px; height: 40px; display: block; }
.sidebar-logo:hover .sidebar-logo-icon {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,26,54,.24);
}
.sidebar-logo-text {
  color: #fff; font-size: 22px; font-weight: 700; line-height: 1;
  letter-spacing: -.4px;
  text-shadow: 0 1px 10px rgba(0,0,0,.18);
}
.sidebar-logo-text span {
  display: block; font-size: 10px; color: #D9ECFA; font-weight: 700;
  margin-top: 6px; letter-spacing: 1.5px; text-transform: uppercase;
}

.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: #9FC1DF;
  padding: 16px 12px 6px; margin-top: 4px;
}

.sidebar-nav { flex: 1; padding: 8px 12px; }
.sidebar-nav ul { list-style: none; }
.sidebar-nav ul li { margin-bottom: 2px; }
.sidebar-nav ul li a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); text-decoration: none;
  font-size: 13.5px; font-weight: 500; transition: var(--trans);
  position: relative;
}
.sidebar-nav ul li a:hover { background: var(--sidebar-hover); color: #D4E8F5; }
.sidebar-nav ul li a.active {
  background: var(--sidebar-active); color: var(--sidebar-text-active);
  box-shadow: inset 3px 0 0 var(--fc-blue-light), 0 0 20px rgba(0,95,175,.12);
  font-weight: 600;
}
.sidebar-nav ul li a .nav-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; line-height: 1.3; min-width: 20px; text-align: center;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }

.sidebar-user {
  padding: 16px; border-top: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.15);
}
.sidebar-user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,95,175,.3);
}
.sidebar-user-info { flex: 1; min-width: 0; overflow: hidden; }
.sidebar-user-name { color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: var(--sidebar-text); font-size: 11px; }
.sidebar-user-logout {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  color: var(--sidebar-text); border-radius: var(--radius-sm); transition: var(--trans);
  text-decoration: none;
}
.sidebar-user-logout:hover { background: rgba(255,255,255,.12); color: #FCA5A5; }
.sidebar-user-info a { color: var(--sidebar-text); font-size: 11px; text-decoration: none; transition: var(--trans); }
.sidebar-user-info a:hover { color: #FCA5A5; }

/* ==============================
   TOPBAR — Glassmorphism
   ============================== */
.topbar {
  height: var(--topbar-h);
  background: rgba(241,243,245,.95); 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 28px; position: sticky; top: 0; z-index: 100;
}
[data-theme="dark"] .topbar { background: rgba(30,41,59,.85); }
.topbar-left { display: flex; flex-direction: column; }
.topbar-title { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.2; }
.topbar-breadcrumb { display: flex; gap: 6px; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.topbar-breadcrumb span:not(:last-child)::after { content: '›'; margin-left: 6px; color: #CBD5E1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.topbar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 8px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--trans); white-space: nowrap;
  text-decoration: none; box-shadow: 0 2px 8px rgba(0,95,175,.25);
}
.topbar-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,95,175,.35); }

/* Theme Toggle */
.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--card-bg);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--text-muted); transition: var(--trans);
}
.theme-toggle:hover { background: var(--body-bg); color: var(--text); }

/* PAGE BODY */
.page-body { padding: 28px 32px; flex: 1; animation: fadeIn .3s ease; }

/* ==============================
   CARDS — Elevated Design
   ============================== */
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 20px;
  transition: var(--trans);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(241,245,249,.5) 0%, transparent 100%);
}
[data-theme="dark"] .card-header { background: linear-gradient(180deg, rgba(15,23,42,.3) 0%, transparent 100%); }
.card-header h2 {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px; margin: 0;
}
.card-header h3 {
  font-size: 14px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px; margin: 0;
}
.card-header-icon {
  font-size: 16px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #E8F4FD; border-radius: 8px; color: var(--primary);
  flex-shrink: 0;
}
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--body-bg); }

/* ==============================
   STATS GRID — Premium Cards
   ============================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: flex-start; gap: 14px;
  position: relative; overflow: hidden; box-shadow: var(--shadow);
  transition: var(--trans);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card.blue::before  { background: linear-gradient(90deg, var(--blue), #38BDF8); }
.stat-card.green::before { background: linear-gradient(90deg, var(--green), #34D399); }
.stat-card.red::before   { background: linear-gradient(90deg, var(--red), #F87171); }
.stat-card.yellow::before{ background: linear-gradient(90deg, var(--yellow), #FBBF24); }
.stat-card.cyan::before  { background: linear-gradient(90deg, var(--cyan), #22D3EE); }

/* Icon wrap inside stat card */
.stat-icon-wrap {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0; transition: var(--trans);
}
.stat-card.blue .stat-icon-wrap   { background: var(--blue-light); color: var(--blue); }
.stat-card.green .stat-icon-wrap  { background: var(--green-light); color: var(--success-text); }
.stat-card.red .stat-icon-wrap    { background: var(--red-light); color: var(--red); }
.stat-card.yellow .stat-icon-wrap { background: var(--yellow-light); color: var(--warning-text); }
.stat-card.cyan .stat-icon-wrap   { background: var(--cyan-light); color: var(--cyan-text); }
.stat-card:hover .stat-icon-wrap  { transform: scale(1.08); }

.stat-content { flex: 1; min-width: 0; }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; margin-top: 2px; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Legacy stat-card class names fallback */
.stat-card-icon { font-size: 28px; margin-bottom: 4px; }
.stat-card-label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-card-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-card.blue .stat-card-value   { color: var(--blue); }
.stat-card.green .stat-card-value  { color: var(--success-text); }
.stat-card.red .stat-card-value    { color: var(--red); }
.stat-card.yellow .stat-card-value { color: var(--warning-text); }
.stat-card.cyan .stat-card-value   { color: var(--cyan-text); }
.stat-card-sub { font-size: 11px; color: var(--text-muted); }

/* ==============================
   TABLES — Refined
   ============================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead tr { background: linear-gradient(180deg, #F4F8FB 0%, #EBF2F8 100%); }
[data-theme="dark"] .table thead tr { background: linear-gradient(180deg, #132236 0%, #0D1B2E 100%); }
.table th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; transition: background .15s; }
.table tbody tr { transition: var(--trans-fast); }
.table tbody tr:hover { background: rgba(0,95,175,.04); }
[data-theme="dark"] .table tbody tr:hover { background: rgba(0,95,175,.10); }
.table tbody tr:last-child td { border-bottom: none; }
.td-bold { font-weight: 600; color: var(--text); }
.td-bold small { display: block; font-weight: 400; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.table-actions { display: flex; gap: 6px; align-items: center; }
.empty-row td { text-align: center; padding: 48px 20px !important; color: var(--text-muted); font-size: 14px; }
.empty-row td i { display: block; font-size: 32px; margin-bottom: 8px; opacity: .4; }

/* ==============================
   BUTTONS — Polished
   ============================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: none; transition: var(--trans); white-space: nowrap; text-decoration: none;
  position: relative; overflow: hidden;
}
.btn:active { transform: scale(.97); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-primary   { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(0,95,175,.25); }
.btn-primary:hover  { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,95,175,.35); }
.btn-success   { background: #007A63; color: #fff; box-shadow: 0 2px 6px rgba(5,150,105,.25); }
.btn-success:hover  { background: #047857; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5,150,105,.35); }
.btn-danger    { background: var(--red); color: #fff; box-shadow: 0 2px 6px rgba(220,38,38,.25); }
.btn-danger:hover   { background: #B91C1C; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(220,38,38,.35); }
.btn-warning   { background: var(--yellow); color: #422006; box-shadow: 0 2px 6px rgba(217,119,6,.25); }
.btn-warning:hover  { background: #B45309; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(217,119,6,.35); }
.btn-secondary { background: var(--card-bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover{ background: var(--body-bg); border-color: #CBD5E1; }
.btn-ghost     { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover    { background: var(--body-bg); color: var(--text); border-color: #CBD5E1; }

.btn-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; font-size: 14px; transition: var(--trans); background: transparent;
}
.btn-icon:active { transform: scale(.9); }
.btn-icon.edit   { background: #EFF6FF; border-color: #BFDBFE; color: #2563EB; }
.btn-icon.edit:hover  { background: #2563EB; color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.3); }
.btn-icon.delete { background: var(--red-light); border-color: #FECACA; color: var(--red); }
.btn-icon.delete:hover{ background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,.3); }
.btn-icon.view   { background: #F0FDF4; border-color: #BBF7D0; color: var(--green); }
.btn-icon.view:hover  { background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(5,150,105,.3); }

/* ==============================
   BADGES — Refined
   ============================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  letter-spacing: .2px;
}
.badge-default { background: #F4F8FB; color: var(--text-muted); border: 1px solid var(--border); }
.badge-primary { background: #E8F4FD; color: var(--primary); border: 1px solid rgba(0,95,175,.15); }
.badge-success { background: var(--green-light); color: var(--success-text); border: 1px solid rgba(5,150,105,.25); }
.badge-danger  { background: var(--red-light); color: var(--red); border: 1px solid rgba(220,38,38,.15); }
.badge-warning { background: var(--yellow-light); color: var(--warning-text); border: 1px solid rgba(217,119,6,.25); }
.badge-info    { background: var(--blue-light); color: var(--info-text); border: 1px solid rgba(14,165,233,.25); }
.badge i { font-size: 10px; }
/* ==============================
   FORMS — Accessible & Polished
   ============================== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 4px; }
.req { color: var(--red); margin-left: 2px; }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; color: var(--text);
  background: var(--card-bg); outline: none; transition: var(--trans);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--gray-500); opacity: 1; }
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover { border-color: #CBD5E1; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: 2px solid transparent; outline-offset: 2px;
}
.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
  background: var(--body-bg); color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted); opacity: 1; cursor: not-allowed;
}
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.form-error { font-size: 11px; color: var(--red); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.form-section-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 12px 0 8px; border-bottom: 1px solid var(--border);
  margin-bottom: 14px; margin-top: 8px;
  display: flex; align-items: center; gap: 8px;
}

/* ==============================
   MODALS — Refined with Glass Backdrop
   ============================== */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal.active { display: flex; animation: fadeIn .2s ease; }
.modal-content {
  background: var(--card-bg); border-radius: var(--radius-lg);
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.1);
  animation: modalIn .25s cubic-bezier(.4,0,.2,1);
}
.modal-lg { max-width: 700px; }
@keyframes modalIn { from { opacity:0; transform: scale(.95) translateY(-10px); } to { opacity:1; transform: none; } }

.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
}
.modal-title-wrap { display: flex; align-items: center; gap: 12px; }
.modal-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: #E8F4FD; display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.2; }
.modal-header h2 small { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.modal-close {
  width: 32px; height: 32px; border: none; background: var(--body-bg);
  border-radius: 8px; cursor: pointer; font-size: 18px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; transition: var(--trans); flex-shrink: 0;
}
.modal-close:hover { background: var(--red-light); color: var(--red); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-top: 1px solid var(--border);
  background: var(--body-bg); border-radius: 0 0 var(--radius) var(--radius);
}
.ml-auto { margin-left: auto; display: flex; gap: 8px; }

/* ==============================
   TABS — Smooth
   ============================== */
.tabs-wrap {
  display: flex; gap: 4px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); overflow-x: auto; flex-wrap: wrap;
}
.tab-btn {
  padding: 7px 16px; border: 1px solid transparent; border-radius: 20px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--text-muted); transition: var(--trans); white-space: nowrap;
}
.tab-btn:hover { background: var(--body-bg); color: var(--text); }
.tab-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,95,175,.25);
}
.tab-pane { display: none; padding: 20px; animation: fadeIn .3s ease; }
.tab-pane.active { display: block; }

/* ==============================
   ALERTS — Enhanced
   ============================== */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 16px; border: 1px solid transparent;
  animation: fadeInUp .3s ease;
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-info    { background: var(--blue-light); color: #0369A1; border-color: #BAE6FD; }
.alert-success { background: var(--green-light); color: #065F46; border-color: #A7F3D0; }
.alert-error   { background: var(--red-light); color: #991B1B; border-color: #FECACA; }
.alert-warning { background: var(--yellow-light); color: #92400E; border-color: #FDE68A; }

/* ==============================
   REPORT CARDS — Hover Effects
   ============================== */
.report-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: var(--trans); display: flex; flex-direction: column;
  cursor: pointer;
}
.report-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(0,95,175,.25); }
.report-card-icon {
  height: 80px; display: flex; align-items: center; justify-content: center; font-size: 36px;
  transition: var(--trans); color: #fff;
}
.report-card:hover .report-card-icon { transform: scale(1.1); }
.report-card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.report-card-body h3 { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; }
.report-card-body p { font-size: 13px; color: var(--text-muted); margin: 0; flex: 1; line-height: 1.5; }

/* ==============================
   LOGIN PAGE — Premium Glass
   ============================== */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #001F40 0%, #003B73 35%, #005FAF 65%, #0A84D6 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  position: relative; overflow: hidden;
}
.login-bg::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-bg::after {
  content: ''; position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(10,132,214,.18) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(0,152,121,.15) 0%, transparent 50%);
  animation: subtlePulse 8s ease-in-out infinite;
}
.login-card {
  background: rgba(255,255,255,.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 20px; padding: 40px 36px;
  width: 100%; max-width: 420px;
  box-shadow: 0 30px 80px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.2) inset;
  position: relative; z-index: 1;
  animation: fadeInUp .5s cubic-bezier(.4,0,.2,1);
  color: #1F2933;
}
.login-card .form-group label, .login-card .login-logo-name { color: #1F2933; }
.login-card .login-logo-sub, .login-card .form-hint { color: #64748B; }
.login-card .form-group input,
.login-card .form-group select,
.login-card .form-group textarea { background: #fff; color: #1F2933; }
.login-logo { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 32px; }
.login-logo-wordmark { width: 220px; max-width: 100%; height: auto; display: block; }
.login-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  box-shadow: 0 8px 20px rgba(0,95,175,.4);
}
.login-logo-icon img { width: 40px; height: 40px; display: block; border-radius: 12px; }
.login-logo-name { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1; }
.login-logo-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ==============================
   PARTIDAS LANCAMENTOS
   ============================== */
.partida-item {
  display: grid; grid-template-columns: 2fr 1fr 1fr 2fr auto;
  gap: 8px; align-items: end;
  background: var(--body-bg); padding: 12px;
  border-radius: var(--radius-sm); margin-bottom: 8px; border: 1px solid var(--border);
}
@media (max-width: 700px) { .partida-item { grid-template-columns: 1fr 1fr; } }
.totalizador {
  display: grid; grid-template-columns: 2fr 1fr 1fr 2fr auto; gap: 8px;
  background: var(--primary); color: #fff;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 13px; margin-top: 8px;
}
.partidas-container { margin-bottom: 8px; }

/* ==============================
   LOG ENTRIES
   ============================== */
.log-entry {
  padding: 10px 12px; border-left: 3px solid var(--border); margin-bottom: 8px;
  font-size: 13px; background: var(--body-bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.log-entry strong { color: var(--text); display: block; }
.log-entry small { color: var(--text-muted); }

/* ==============================
   DASHBOARD — Premium
   ============================== */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--fc-green) 100%);
  color: #fff; border-radius: var(--radius); padding: 24px 28px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0,59,115,.28);
  position: relative; overflow: hidden;
}
.welcome-banner::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-banner h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; position: relative; }
.welcome-banner p  { font-size: 13px; opacity: .85; position: relative; }
.welcome-banner .btn { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(8px); }
.welcome-banner .btn:hover { background: rgba(255,255,255,.3); }
.dashboard-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: 1fr; } }

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .3s cubic-bezier(.4,0,.2,1); }
  .sidebar.open { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.3); }
  .main-content { margin-left: 0; }
  .page-body { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .partida-item, .totalizador { grid-template-columns: 1fr 1fr; }
  .modal-content { margin: 12px; border-radius: var(--radius); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-row, .form-row.cols-2 { grid-template-columns: 1fr; }
  .topbar-date { display: none; }
  .login-card { padding: 28px 20px; }
}

/* ==============================
   FOCUS / ACCESSIBILITY
   ============================== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible, .tab-btn:focus-visible, .btn-icon:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--primary-glow);
}
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ==============================
   TOOLTIPS
   ============================== */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: #1E293B; color: #fff; font-size: 11px; font-weight: 500;
  padding: 5px 10px; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 500;
}
[data-tooltip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==============================
   PROGRESS BAR
   ============================== */
.progress { height: 6px; background: var(--body-bg); border-radius: 10px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 10px; transition: width .6s cubic-bezier(.4,0,.2,1);
  background: linear-gradient(90deg, var(--primary) 0%, var(--fc-green) 100%);
}
.progress-bar.green { background: linear-gradient(90deg, var(--green) 0%, #34D399 100%); }
.progress-bar.red   { background: linear-gradient(90deg, var(--red) 0%, #F87171 100%); }
.progress-bar.yellow{ background: linear-gradient(90deg, var(--yellow) 0%, #FBBF24 100%); }

/* ==============================
   EMPTY STATE
   ============================== */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px; opacity: .3; margin-bottom: 16px;
}
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state-text { font-size: 14px; margin-bottom: 20px; }

/* ==============================
   DIVIDER
   ============================== */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 12px; font-weight: 500;
  margin: 20px 0;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ==============================
   AVATAR GROUP
   ============================== */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-primary { background: linear-gradient(135deg, var(--primary), var(--fc-green)); }
.avatar-green { background: linear-gradient(135deg, var(--green), #34D399); }
.avatar-blue { background: linear-gradient(135deg, var(--blue), #38BDF8); }

/* ==============================
   STATUS DOT
   ============================== */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.status-dot.offline { background: #CBD5E1; }
.status-dot.warning { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-light); }
.status-dot.danger { background: var(--red); box-shadow: 0 0 0 3px var(--red-light); }

/* ==============================
   UTILITY CLASSES
   ============================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success-text); }
.text-danger { color: var(--red); }
.text-warning { color: var(--warning-text); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-sm { font-size: 12px; }
.fs-lg { font-size: 16px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ── Searchable company selects ── */
.empresa-search-wrapper {
  position: relative;
  flex: 1;
  min-width: min(100%, 280px);
}
.empresa-search-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 38px 9px 12px;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.empresa-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,95,175,.12);
}
.empresa-search-wrapper::after {
  content: "\f002";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 12px;
  right: 13px;
  color: var(--gray-500);
  font-size: 13px;
  pointer-events: none;
}
.empresa-search-wrapper select.empresa-search {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
}
.empresa-search-results {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 14px 30px rgba(15, 23, 42, .14);
  padding: 6px;
}
.empresa-search-results[hidden] {
  display: none;
}
.empresa-search-option {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--gray-800);
  cursor: pointer;
  font: inherit;
  line-height: 1.35;
  padding: 9px 10px;
  text-align: left;
}
.empresa-search-option:hover,
.empresa-search-option.is-active {
  background: rgba(0, 95, 175, .09);
  color: var(--primary-dark);
}
.empresa-search-option.is-selected {
  font-weight: 600;
}
.empresa-search-empty {
  color: var(--gray-500);
  padding: 10px;
  font-size: 14px;
}

/* ==============================
   PRINT STYLES
   ============================== */
@media print {
  .sidebar, .topbar, .topbar-btn, .btn, .table-actions,
  .sidebar-user, .modal, .theme-toggle { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-body { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .stat-card { box-shadow: none !important; }
  body { background: #fff !important; color: #000 !important; font-size: 12pt; }
  .table th, .table td { padding: 6px 8px !important; }
  a { color: inherit !important; text-decoration: none !important; }
}

/* ── Impersonation Banner ── */
.impersonate-banner {
  background: linear-gradient(135deg, #7C3AED, #6D28D9);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 2px solid rgba(255,255,255,.2);
}
.impersonate-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.impersonate-info i { font-size: 16px; opacity: .9; }
.impersonate-info strong { font-weight: 700; }
.impersonate-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(255,255,255,.2);
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
  text-align: center;
  justify-content: center;
}
.impersonate-back:hover { background: rgba(255,255,255,.35); }

/* ── Modo Demo Banner ── */
.demo-banner {
  background: linear-gradient(135deg, #065f46, #047857);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 2px solid rgba(255,255,255,.2);
}
.demo-banner-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.demo-banner-info i { font-size: 15px; opacity: .9; }
.demo-banner-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.demo-banner-signup {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: #fff;
  color: #065f46;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s;
}
.demo-banner-signup:hover { background: #d1fae5; }
.demo-banner-exit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(255,255,255,.18);
  color: #fff;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.demo-banner-exit:hover { background: rgba(255,255,255,.32); }

/* ============================================================
   DARK MODE — Compatibility for legacy and inline components
   ============================================================ */
[data-theme="dark"] body,
[data-theme="dark"] .main-content,
[data-theme="dark"] .page-body { background-color: var(--body-bg); color: var(--text); }

[data-theme="dark"] .card,
[data-theme="dark"] .report-card,
[data-theme="dark"] .help-panel,
[data-theme="dark"] .help-card,
[data-theme="dark"] .help-faq,
[data-theme="dark"] .demo-guide,
[data-theme="dark"] .empty-help,
[data-theme="dark"] .help-search {
  background: var(--card-bg);
  color: var(--text);
}

[data-theme="dark"] .profile-item,
[data-theme="dark"] .help-meta,
[data-theme="dark"] .demo-steps a,
[data-theme="dark"] .step-list a,
[data-theme="dark"] .help-actions .secondary,
[data-theme="dark"] .import-zone {
  background: var(--body-bg);
  color: var(--text);
}

[data-theme="dark"] .alert-info { background: var(--blue-light); color: var(--info-text); border-color: #285B7D; }
[data-theme="dark"] .alert-success { background: var(--green-light); color: var(--success-text); border-color: #256B5A; }
[data-theme="dark"] .alert-error { background: var(--red-light); color: #FECACA; border-color: #7F3440; }
[data-theme="dark"] .alert-warning { background: var(--yellow-light); color: var(--warning-text); border-color: #76521D; }

[data-theme="dark"] .badge-default,
[data-theme="dark"] .status-cancelado,
[data-theme="dark"] .role-assistente,
[data-theme="dark"] .action-btn.cancelar { background: #263B52; color: #D5E5F3; border-color: #3D5F80; }
[data-theme="dark"] .badge-primary,
[data-theme="dark"] .badge-info,
[data-theme="dark"] .role-admin,
[data-theme="dark"] .role-admin_escritorio { background: var(--blue-light); color: var(--info-text); border-color: #285B7D; }
[data-theme="dark"] .badge-success,
[data-theme="dark"] .status-ativo,
[data-theme="dark"] .role-contador,
[data-theme="dark"] .action-btn.ativar { background: var(--green-light); color: var(--success-text); border-color: #256B5A; }
[data-theme="dark"] .badge-warning,
[data-theme="dark"] .status-trial,
[data-theme="dark"] .action-btn.trial { background: var(--yellow-light); color: var(--warning-text); border-color: #76521D; }
[data-theme="dark"] .badge-danger,
[data-theme="dark"] .status-suspenso,
[data-theme="dark"] .role-super_admin,
[data-theme="dark"] .action-btn.suspender { background: var(--red-light); color: #FECACA; border-color: #7F3440; }

[data-theme="dark"] .btn-icon.edit { background: #102F4A; border-color: #285B7D; color: #93C5FD; }
[data-theme="dark"] .btn-icon.delete { background: #451F28; border-color: #7F3440; color: #FCA5A5; }
[data-theme="dark"] .btn-icon.view { background: #103A32; border-color: #256B5A; color: #6EE7C8; }
[data-theme="dark"] .card-header-icon,
[data-theme="dark"] .modal-icon { background: #102F4A; color: #7DD3FC; }

/* Override fixed light surfaces used by landing/help/table fragments. */
[data-theme="dark"] section[style*="background:#fff"],
[data-theme="dark"] section[style*="background: #fff"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:#F8FAFC"],
[data-theme="dark"] [style*="background: #F8FAFC"],
[data-theme="dark"] [style*="background: #f5f5f5"] {
  background: var(--card-bg) !important;
  color: var(--text) !important;
}

/* Fixed muted/dark inline text must follow the active theme. These selectors
   also cover rows and empty states injected later by JavaScript. */
[data-theme="dark"] [style*="color:#0F172A"],
[data-theme="dark"] [style*="color: #0F172A"],
[data-theme="dark"] [style*="color:#1F2933"],
[data-theme="dark"] [style*="color: #1F2933"],
[data-theme="dark"] [style*="color:#1e293b"],
[data-theme="dark"] [style*="color: #1e293b"] { color: var(--text) !important; }

[data-theme="dark"] [style*="color:#64748B"],
[data-theme="dark"] [style*="color: #64748B"],
[data-theme="dark"] [style*="color:#64748b"],
[data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] [style*="color:#7f8c8d"],
[data-theme="dark"] [style*="color: #7f8c8d"],
[data-theme="dark"] [style*="color:#94A3B8"],
[data-theme="dark"] [style*="color: #94A3B8"],
[data-theme="dark"] [style*="color:#94a3b8"],
[data-theme="dark"] [style*="color: #94a3b8"] { color: var(--text-muted) !important; }

[data-theme="dark"] .table tfoot tr { background: var(--body-bg) !important; color: var(--text); }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea { color-scheme: dark; }

/* ============================================================
   PWA / NATIVE MOBILE EXPERIENCE
   ============================================================ */
html {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--body-bg);
}
body {
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  padding-right: env(safe-area-inset-right);
  padding-left: env(safe-area-inset-left);
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}
button, a, input, select, textarea { touch-action: manipulation; }
input, select, textarea { font-size: max(16px, 1em); }
img, video, canvas, audio, iframe { max-width: 100%; }

.pwa-connectivity {
  position: fixed; z-index: 2500; top: env(safe-area-inset-top); left: 50%;
  max-width: calc(100% - 24px); transform: translate(-50%, -120%);
  padding: 8px 14px; border-radius: 0 0 10px 10px;
  font-size: 12px; font-weight: 700; text-align: center;
  transition: transform .25s ease; pointer-events: none;
}
.pwa-connectivity.offline { transform: translate(-50%, 0); background: #991B1B; color: #fff; }
.pwa-connectivity.online { transform: translate(-50%, 0); background: #006B57; color: #fff; }

.pwa-app-toast {
  position: fixed; z-index: 2600; right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  max-width: min(420px, calc(100vw - 36px));
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px 13px 16px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--card-bg); color: var(--text); box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 600;
  opacity: 0; transform: translateY(16px); transition: var(--trans-slow);
}
.pwa-app-toast.show { opacity: 1; transform: none; }
.pwa-app-toast span { flex: 1; }
.pwa-app-toast button {
  min-height: 38px; padding: 0 13px; border: 0; border-radius: 9px;
  background: var(--primary); color: #fff; font-weight: 700; cursor: pointer;
}
.pwa-app-toast .pwa-toast-close {
  min-width: 32px; padding: 0; background: transparent; color: var(--text-muted); font-size: 20px;
}

.mobile-app-nav, .sidebar-overlay { display: none; }
.pwa-quick-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 8px 12px; border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.08);
}
.pwa-quick-actions button {
  min-height: 38px; border: 1px solid rgba(255,255,255,.10); border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255,255,255,.07); color: #D9ECFA;
  font: 600 10px/1.1 inherit; cursor: pointer;
}
.pwa-quick-actions button:hover { background: rgba(255,255,255,.14); color: #fff; }
.pwa-quick-actions button[hidden] { display: none; }

@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
  .sidebar { padding-top: env(safe-area-inset-top); }
}

@media (max-width: 768px) {
  :root { --mobile-nav-h: 66px; }
  body { padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom)); }
  .container, .main-content, .page-body,
  .card, .card-header, .card-body, .card-footer,
  .form-group, .form-row, .table-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .main-content { min-width: 0; overflow-x: clip; overflow-y: visible; }
  .page-body { padding: 14px 12px 20px; }
  .topbar { min-height: 58px; height: auto; padding: 9px 12px; gap: 8px; }
  .topbar-left { min-width: 0; flex: 1; }
  .topbar-title { font-size: 15px; }
  .topbar-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-breadcrumb { display: none; }
  .topbar-right { min-width: 0; max-width: 64%; gap: 7px; flex-shrink: 0; }
  .topbar-btn { padding: 9px 11px; }

  .mobile-app-nav {
    position: fixed; z-index: 900; display: grid;
    grid-template-columns: repeat(5, 1fr);
    left: 0; right: 0; bottom: 0;
    min-height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));
    padding: 6px 6px env(safe-area-inset-bottom);
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--card-bg) 94%, transparent);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 -8px 24px rgba(0,26,54,.10);
  }
  .mobile-app-nav a, .mobile-app-nav button {
    min-width: 0; min-height: 52px; border: 0; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: transparent; color: var(--text-muted); text-decoration: none;
    font: 600 10px/1.1 inherit;
  }
  .mobile-app-nav i { font-size: 18px; }
  .mobile-app-nav a.active { background: var(--blue-light); color: var(--primary-light); }

  .sidebar {
    width: min(88vw, 320px); padding-bottom: env(safe-area-inset-bottom);
    visibility: hidden; transition: transform .28s ease, visibility .28s;
  }
  .sidebar.open { visibility: visible; }
  .sidebar-overlay {
    position: fixed; z-index: 850; display: block; inset: 0;
    border: 0; background: rgba(2,12,27,.62);
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
  }
  body.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
  body.sidebar-open { overflow: hidden; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-value, .stat-card-value { font-size: 19px; }
  .card { border-radius: 11px; margin-bottom: 14px; }
  .card-header { padding: 13px 14px; }
  .card-body { padding: 14px; }

  .form-row, .form-row.cols-2, .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr; gap: 4px; }
  .page-body [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .page-body [style*="min-width"] { min-width: 0 !important; }
  .page-body [style*="width:220px"],
  .page-body [style*="width: 220px"],
  .page-body [style*="width:250px"],
  .page-body [style*="width: 250px"] { width: 100% !important; max-width: 100% !important; }
  .page-body [style*="display:flex"],
  .page-body [style*="display: flex"] { max-width: 100%; }
  .page-body select, .page-body input, .page-body textarea { max-width: 100%; }
  .page-body form { max-width: 100%; }
  .form-group input, .form-group select, .form-group textarea { min-height: 46px; }
  .btn {
    min-height: 44px; max-width: 100%; justify-content: center;
    white-space: normal; text-align: center; overflow-wrap: anywhere;
  }
  .card-header { gap: 10px; flex-wrap: wrap; }
  .card-header > * { min-width: 0; }
  .card-header h2, .card-header h3 { overflow-wrap: anywhere; }
  .btn-icon { width: 42px; height: 42px; }
  .modal, .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    justify-content: center; background: rgba(15,23,42,.66);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  }
  .modal-content, .modal-overlay .modal-content {
    width: 100%; max-width: none; max-height: min(92dvh, 860px);
    margin: 0; border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    overflow-y: auto; overscroll-behavior: contain;
  }
  .modal-content::before {
    content: ''; display: block; width: 42px; height: 5px;
    margin: 8px auto 0; border-radius: 5px; background: var(--border);
  }

  /* Tabelas com rótulos se tornam cartões legíveis no celular. */
  .table-wrap { overflow: visible; }
  .table.responsive-cards, .table { display: block; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody { display: grid; gap: 10px; }
  .table tbody tr {
    padding: 10px 12px; border: 1px solid var(--border);
    border-radius: 12px; background: var(--card-bg); box-shadow: var(--shadow);
  }
  .table tbody td {
    min-height: 34px; padding: 7px 0; border-bottom: 1px solid var(--border);
    display: grid; grid-template-columns: minmax(92px, 38%) 1fr;
    gap: 10px; align-items: center; text-align: right !important;
    min-width: 0; overflow-wrap: anywhere;
  }
  .table tbody td > * { min-width: 0; max-width: 100%; }
  .table tbody td::before {
    content: attr(data-label); color: var(--text-muted); font-size: 10px;
    font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-align: left;
  }
  .table tbody td:last-child { border-bottom: 0; }
  .table tbody td[colspan] { display: block; text-align: center !important; }
  .table tbody td[colspan]::before { content: none; }
  .table-actions { justify-content: flex-end; flex-wrap: wrap; }

  .pwa-app-toast {
    left: 12px; right: 12px;
    bottom: calc(var(--mobile-nav-h) + 12px + env(safe-area-inset-bottom));
    max-width: none;
  }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 104px; align-items: center; }
  .stat-card .stat-icon-wrap { width: 36px; height: 36px; }
  .stat-card .stat-label { font-size: 9px; letter-spacing: .025em; }
  .stat-card .stat-value, .stat-card .stat-card-value { font-size: 16px; overflow-wrap: anywhere; }
  .stat-card .stat-sub { font-size: 9px; line-height: 1.25; }
  .topbar-date { display: none; }
  .topbar-right .topbar-btn {
    width: 42px; min-width: 42px; max-width: 42px;
    padding: 0; overflow: hidden; font-size: 0;
  }
  .topbar-right .topbar-btn i,
  .topbar-right .topbar-btn span:first-child { font-size: 15px; }
}

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

/* Central de suporte e ajuda assistida */
.support-assistant-dock { position: fixed; right: 22px; bottom: 22px; z-index: 1080; display: flex; gap: 9px; align-items: center; cursor: grab; user-select: none; -webkit-user-select: none; }
.support-assistant-dock.is-dragging { cursor: grabbing; }
.support-assistant-dock.is-dragging .support-ai-button,
.support-assistant-dock.is-dragging .support-bug-button { transform: scale(.97); box-shadow: 0 6px 18px rgb(0 32 67 / .22); }
.support-ai-button, .support-bug-button { border: 0; min-height: 48px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; box-shadow: 0 10px 28px rgb(0 32 67 / .28); }
.support-ai-button, .support-bug-button { touch-action: none; }
.support-ai-button { padding: 0 18px; background: var(--primary); color: #fff; font-weight: 800; }
.support-bug-button { width: 48px; background: var(--card-bg); color: var(--danger); border: 1px solid var(--border); }
.support-ai-panel { position: absolute; right: 0; bottom: 60px; width: min(390px, calc(100vw - 24px)); height: min(570px, calc(100vh - 110px)); background: var(--card-bg); color: var(--text-primary); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: 0 22px 60px rgb(0 20 45 / .32); }
.support-ai-panel[hidden] { display: none; }
.support-ai-panel header { height: 66px; padding: 13px 16px; color: #fff; background: linear-gradient(135deg, var(--primary), #0877c9); display: flex; align-items: center; justify-content: space-between; }
.support-ai-panel header div { display: grid; gap: 2px; }
.support-ai-panel header small { color: rgb(255 255 255 / .8); }
.support-ai-panel header button { border: 0; background: transparent; color: #fff; font-size: 26px; cursor: pointer; }
.support-ai-messages { height: calc(100% - 155px); padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: var(--body-bg); }
.support-ai-message { max-width: 90%; padding: 10px 12px; border-radius: 13px; line-height: 1.45; font-size: 13px; white-space: normal; }
.support-ai-message.assistant { align-self: flex-start; background: var(--card-bg); color: var(--text-primary); border: 1px solid var(--border); }
.support-ai-message.user { align-self: flex-end; background: var(--primary); color: #fff; }
.support-ai-message.loading { color: var(--text-muted); }
.support-ai-message nav { display: grid; gap: 6px; margin-top: 10px; }
.support-ai-message nav a { padding: 8px 9px; border-radius: 8px; background: var(--primary-light); color: var(--primary); font-weight: 750; text-decoration: none; }
.support-ai-message nav i { margin-right: 7px; }
.support-ai-form { height: 57px; padding: 8px 10px; display: flex; gap: 7px; border-top: 1px solid var(--border); background: var(--card-bg); }
.support-ai-form textarea { flex: 1; border: 1px solid var(--border); border-radius: 10px; resize: none; padding: 8px 10px; color: var(--text-primary); background: var(--input-bg, var(--body-bg)); }
.support-ai-form button { width: 40px; border: 0; border-radius: 10px; color: #fff; background: var(--primary); cursor: pointer; }
.support-ai-report { height: 32px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text-muted); background: var(--card-bg); font-size: 11px; text-decoration: none; }

.support-page { max-width: 1500px; margin: 0 auto; }
.support-intro { margin-bottom: 20px; padding: 24px; border-radius: 18px; display: flex; justify-content: space-between; align-items: center; color: #fff; background: linear-gradient(135deg, #003b73, #0877c9); }
.support-intro h1 { margin: 4px 0 6px; font-size: clamp(24px, 3vw, 36px); }
.support-intro p { max-width: 760px; margin: 0; color: rgb(255 255 255 / .83); line-height: 1.55; }
.support-intro > i { font-size: 54px; opacity: .25; }
.support-eyebrow { font-size: 11px; font-weight: 900; letter-spacing: .13em; }
.support-layout { display: grid; grid-template-columns: minmax(410px, .9fr) minmax(520px, 1.35fr); gap: 20px; align-items: start; }
.support-report-shell { width: min(100%, 820px); margin: 0 auto; }
.support-tickets-shell { width: min(100%, 1120px); margin: 0 auto; }
.support-ticket-intro { align-items: center; }
.support-intro-action { flex: 0 0 auto; background: #fff; color: #075ba8; border: 0; box-shadow: 0 8px 22px rgba(0, 25, 61, .18); }
.support-intro-action:hover { background: #edf6ff; color: #034883; }
.support-feedback a { color: inherit; font-weight: 800; text-decoration: underline; }
.support-form-card form { padding: 18px; }
.support-report-methods { margin-bottom: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.support-report-methods button { min-height: 54px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); color: var(--text); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; font: 750 11px/1.2 inherit; cursor: pointer; }
.support-report-methods button i { color: var(--primary); font-size: 16px; }
.support-report-methods button:active { transform: scale(.97); }
.support-evidence { margin: 15px 0; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--body-bg); }
.support-evidence-head { margin-bottom: 11px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.support-evidence-head > div { display: grid; gap: 3px; }
.support-evidence-head strong { color: var(--text-primary); }
.support-evidence-head small, .support-evidence > small { color: var(--text-muted); }
.support-capture-preview { min-height: 130px; border: 1px dashed var(--border); border-radius: 11px; background: var(--card-bg); color: var(--text-muted); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; overflow: hidden; position: relative; }
.support-capture-preview > i { font-size: 30px; opacity: .55; }
.support-capture-preview img { display: block; width: 100%; max-height: 260px; object-fit: contain; }
.support-capture-preview button { position: absolute; top: 7px; right: 7px; width: 30px; height: 30px; border: 0; border-radius: 50%; color: #fff; background: rgb(0 0 0 / .66); cursor: pointer; font-size: 20px; }
.support-file-alternative { margin: 10px 0 6px; display: block; color: var(--text-muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.support-record-button { width: 100%; min-height: 43px; color: #b91c1c; border: 1px solid #fecaca; background: #fff7f7; }
.support-record-button.is-recording { color: #fff; background: #dc2626; border-color: #dc2626; animation: support-record-pulse 1.4s infinite; }
.support-record-button i { margin-right: 6px; }
.support-audio-timer { color: var(--text-muted); font-variant-numeric: tabular-nums; font-weight: 850; }
.support-audio-preview { width: 100%; margin-top: 10px; height: 42px; }
.support-audio-preview[hidden] { display: none; }
.support-transcription-state { margin-top: 11px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--card-bg); color: var(--text-muted); display: flex; align-items: flex-start; gap: 8px; font-size: 11px; line-height: 1.45; }
.support-transcription-state i { margin-top: 2px; color: var(--primary); }
.support-transcription-state.is-success { border-color: #86efac; background: #f0fdf4; color: #166534; }
.support-transcription-state.is-warning { border-color: #fed7aa; background: #fff7ed; color: #9a3412; }
[data-theme="dark"] .support-transcription-state.is-success { border-color: #166534; background: #052e16; color: #bbf7d0; }
[data-theme="dark"] .support-transcription-state.is-warning { border-color: #9a3412; background: #431407; color: #fed7aa; }
@keyframes support-record-pulse { 50% { box-shadow: 0 0 0 5px rgb(220 38 38 / .16); } }
.support-consent { margin: 12px 0 18px; display: flex; gap: 8px; align-items: flex-start; color: var(--text-secondary); font-size: 13px; }
.support-feedback { min-height: 24px; margin-top: 12px; color: var(--primary); }
.support-list-header { gap: 12px; }
.support-list-header select { width: 170px; }
.support-filters { padding: 14px 16px 8px; display: grid; grid-template-columns: minmax(190px, 1.4fr) repeat(3, minmax(120px, .8fr)); gap: 8px; border-bottom: 1px solid var(--border); }
.support-summary { padding: 10px 16px; display: flex; gap: 8px; flex-wrap: wrap; background: var(--body-bg); border-bottom: 1px solid var(--border); }
.support-summary span { padding: 6px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); background: var(--card-bg); font-size: 11px; }
.support-summary b { color: var(--text-primary); }
.problem-list { padding: 8px 16px 16px; max-height: 680px; overflow: auto; }
.problem-item { width: 100%; padding: 13px 4px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text-primary); display: flex; justify-content: space-between; align-items: center; gap: 14px; text-align: left; cursor: pointer; }
.problem-item:hover { color: var(--primary); }
.problem-item-main { display: grid; gap: 4px; }
.problem-item-main small { color: var(--text-muted); }
.problem-item-evidence { display: flex; gap: 8px; min-height: 12px; color: var(--primary); font-size: 11px; }
.problem-empty { padding: 34px 12px; text-align: center; color: var(--text-muted); }
.support-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 850; white-space: nowrap; background: var(--primary-light); color: var(--primary); }
.status-resolvida { background: #dcfce7; color: #166534; }
.status-em_correcao { background: #ffedd5; color: #9a3412; }
.status-arquivada { background: var(--gray-100); color: var(--gray-600); }
.support-dialog { width: min(720px, calc(100vw - 24px)); max-height: 88vh; padding: 24px; border: 1px solid var(--border); border-radius: 18px; color: var(--text-primary); background: var(--card-bg); }
.support-dialog::backdrop { background: rgb(2 12 27 / .7); backdrop-filter: blur(3px); }
.support-dialog-close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; color: var(--text-primary); font-size: 28px; cursor: pointer; }
.support-detail-head h2 { margin: 10px 0 3px; }
.support-detail-head small { color: var(--text-muted); }
.support-detail-grid { margin: 18px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.support-detail-grid > div { padding: 10px; border-radius: 10px; background: var(--body-bg); display: grid; gap: 3px; }
.support-detail-grid b { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.support-description { white-space: pre-wrap; line-height: 1.6; }
.support-transcription { margin: 15px 0; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--body-bg); }
.support-transcription p { margin: 7px 0 0; white-space: pre-wrap; line-height: 1.55; color: var(--text-secondary); }
.support-transcription-warning { border-color: #fed7aa; background: #fff7ed; color: #9a3412; }
.dark-theme .support-transcription-warning, [data-theme="dark"] .support-transcription-warning { border-color: #9a3412; background: #431407; color: #fed7aa; }
.support-detail-evidence { margin: 16px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.support-detail-evidence figure, .support-detail-audio { margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: 11px; background: var(--body-bg); }
.support-detail-evidence img { display: block; width: 100%; max-height: 260px; object-fit: contain; border-radius: 7px; background: #0f172a; }
.support-detail-evidence figcaption { margin-top: 7px; color: var(--text-muted); font-size: 11px; }
.support-detail-audio { display: grid; gap: 10px; align-content: start; }
.support-detail-audio audio { width: 100%; }
.support-codex-download { margin-top: 16px; }
.support-answer { margin-top: 16px; padding: 14px; border-left: 4px solid #16a34a; border-radius: 8px; background: #f0fdf4; color: #14532d; }
.support-admin-form { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); display: grid; gap: 12px; }
.support-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.support-admin-form label { display: grid; gap: 6px; font-weight: 700; }

@media (max-width: 900px) {
  .support-layout { grid-template-columns: 1fr; }
  .support-filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .support-assistant-dock {
    display: flex; right: 12px;
    bottom: calc(var(--mobile-nav-h, 66px) + 12px + env(safe-area-inset-bottom));
  }
  .support-ai-button span { display: none; }
  .support-ai-button { width: 48px; padding: 0; }
  .support-ai-panel { position: fixed; right: 12px; bottom: calc(var(--mobile-nav-h, 66px) + 72px); height: min(600px, calc(100vh - 160px)); }
  .support-detail-grid, .support-admin-grid { grid-template-columns: 1fr; }
  .support-filters { grid-template-columns: 1fr; }
  .support-evidence-head { align-items: flex-start; flex-direction: column; }
  .support-intro > i { display: none; }
  .support-page { padding-bottom: 18px; }
  .support-intro { margin-bottom: 12px; padding: 16px; border-radius: 14px; }
  .support-ticket-intro { align-items: stretch; flex-direction: column; gap: 14px; }
  .support-intro-action { width: 100%; min-height: 44px; }
  .support-intro h1 { font-size: 23px; line-height: 1.2; }
  .support-intro p { margin-top: 6px; font-size: 12px; line-height: 1.45; }
  .support-form-card form { padding: 14px; }
  .support-report-methods { position: sticky; top: 67px; z-index: 20; margin: -2px 0 12px; padding: 6px 0; background: var(--card-bg); }
  #problemDescription, #problemCaptureSection, #problemAudioSection { scroll-margin-top: 138px; }
}
