/* ============================================================
   AgroInsights — Design System v6 (light green refresh)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* Brand — verde claro, fresco e atual */
  --green-950: #06210f;
  --green-900: #0d3a1c;
  --green-800: #135427;
  --green-700: #1a7236;
  --green-600: #1fa350;
  --green-500: #34c26c;
  --green-400: #6fdb9a;
  --green-300: #a4edc4;
  --green-200: #cff6df;
  --green-100: #e7fbee;
  --green-50:  #f4fef8;

  /* Neutral */
  --gray-950: #030712;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;

  /* Semantic */
  --sidebar-bg: #0a2015;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-xs: 0 1px 2px rgba(10,30,18,.04);
  --shadow-sm: 0 2px 5px rgba(10,30,18,.06), 0 1px 2px rgba(10,30,18,.04);
  --shadow:    0 6px 14px rgba(10,30,18,.07), 0 2px 5px rgba(10,30,18,.05);
  --shadow-md: 0 14px 28px rgba(10,30,18,.10), 0 4px 8px rgba(10,30,18,.05);
  --shadow-lg: 0 26px 44px rgba(10,30,18,.12), 0 10px 16px rgba(10,30,18,.05);
  --shadow-xl: 0 32px 64px rgba(10,30,18,.18);

  /* Transitions */
  --transition: 150ms ease;
  --transition-md: 220ms cubic-bezier(.2,.7,.3,1);
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: #f2f9f4;
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── Typography ────────────────────────────────────────────── */
.text-xs  { font-size: .75rem !important; }
.text-sm  { font-size: .875rem !important; }
.text-base{ font-size: 1rem !important; }
.fw-500   { font-weight: 500 !important; }
.fw-600   { font-weight: 600 !important; }
.fw-700   { font-weight: 700 !important; }
.fw-800   { font-weight: 800 !important; }
.fw-900   { font-weight: 900 !important; }
.tracking-tight { letter-spacing: -.02em; }
.tracking-wide  { letter-spacing: .05em; }

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  background: #fff;
  height: var(--topbar-h);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1030;
  border-bottom: 1px solid var(--green-100);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(10,30,18,.05);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--green-800);
  letter-spacing: -.03em;
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-brand .brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--green-600), var(--green-400));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem;
  box-shadow: 0 4px 10px rgba(31,163,80,.3);
}
.topbar-search {
  flex: 1;
  max-width: 380px;
}
.topbar-search .input-search {
  background: var(--gray-100);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: .45rem .85rem .45rem 2.25rem;
  font-size: .875rem;
  width: 100%;
  transition: all var(--transition);
  color: var(--gray-900);
}
.topbar-search .input-search:focus {
  background: #fff;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(52,194,108,.14);
  outline: none;
}
.topbar-search .search-icon {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: .875rem;
  pointer-events: none;
}
.topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* Trial badge */
.trial-badge {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 20px;
  padding: 3px 12px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  display: flex; align-items: center; gap: .35rem;
}

/* Avatar button */
.avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(31,163,80,.28);
}
.avatar-btn:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(31,163,80,.38); }

/* Icon button */
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-600);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: .9rem;
  text-decoration: none;
}
.icon-btn:hover { background: var(--green-50); color: var(--green-800); border-color: var(--green-300); }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: var(--topbar-h);
  left: 0; bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1020;
  border-right: 1px solid rgba(255,255,255,.05);
  /* hidden on mobile, visible on desktop via media query */
  display: none;
  flex-direction: column;
}
@media (min-width: 992px) {
  .sidebar { display: flex; }
}
.sidebar-offcanvas {
  background: var(--sidebar-bg) !important;
  width: min(var(--sidebar-w), 84vw) !important;
  color: #fff;
}

/* Sidebar section label */
.sidebar-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: 1.25rem 1.25rem .4rem;
}

/* Sidebar nav */
.sidebar-nav { padding: .5rem 0; flex: 1; }
.sidebar-nav .nav-link {
  color: rgba(255,255,255,.6);
  padding: .55rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .845rem;
  font-weight: 500;
  transition: all var(--transition);
  border-radius: 0;
  position: relative;
  margin: 1px .625rem;
  border-radius: var(--radius-sm);
}
.sidebar-nav .nav-link:hover {
  color: #fff;
  background: rgba(111,219,154,.12);
}
.sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(52,194,108,.18);
  font-weight: 600;
}
.sidebar-nav .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--green-400);
  border-radius: 0 3px 3px 0;
  margin-left: -.625rem;
}
.sidebar-nav .nav-link .bi { font-size: .95rem; width: 1.1rem; flex-shrink: 0; }

/* Upgrade nav link */
.nav-link-upgrade {
  color: #fbbf24 !important;
  font-weight: 600 !important;
}
.nav-link-upgrade:hover { background: rgba(251,191,36,.1) !important; }

/* Sidebar footer */
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: .8rem;
  color: rgba(255,255,255,.4);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: pointer;
}
.sidebar-user:hover { background: rgba(255,255,255,.07); }
.sidebar-user .user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-600), var(--green-400));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { color: rgba(255,255,255,.88); font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-status { font-size: .68rem; color: rgba(255,255,255,.4); }

/* ── App layout ────────────────────────────────────────────── */
.app-layout {
  padding-top: var(--topbar-h);
  min-height: 100vh;
}
@media (min-width: 992px) {
  .app-layout { padding-left: var(--sidebar-w); }
}
.main-content {
  min-height: calc(100vh - var(--topbar-h));
  padding: 1.75rem;
  max-width: 100%;
}
@media (max-width: 767px) {
  .main-content { padding: 1.125rem; }
}
@media (max-width: 575px) {
  .main-content { padding: .875rem; }
}

/* ── Page header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.page-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -.025em;
  line-height: 1.2;
  margin: 0;
  word-break: break-word;
}
.page-subtitle {
  font-size: .85rem;
  color: var(--gray-500);
  margin: .25rem 0 0;
}
@media (max-width: 575px) {
  .page-header { margin-bottom: 1.25rem; }
  .page-header > .d-flex.gap-2,
  .page-header > .btn { width: 100%; }
  .page-header .btn { justify-content: center; }
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--transition-md), border-color var(--transition-md);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
  padding: 1.125rem 1.375rem;
  border-bottom: 1px solid var(--gray-100);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.card-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.card-body { padding: 1.375rem; }
.card-footer {
  padding: .875rem 1.375rem;
  border-top: 1px solid var(--gray-100);
  background: var(--green-50);
}
@media (max-width: 575px) {
  .card-header { padding: 1rem 1.125rem; }
  .card-body   { padding: 1.125rem; }
}

/* Card glass effect */
.card-glass {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.6);
}

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.375rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-md);
}
.stat-card:hover { box-shadow: var(--shadow-md); border-color: var(--green-200); transform: translateY(-2px); }
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.green::after  { background: linear-gradient(90deg, var(--green-600), var(--green-400)); }
.stat-card.blue::after   { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.stat-card.amber::after  { background: linear-gradient(90deg, #d97706, #fbbf24); }
.stat-card.red::after    { background: linear-gradient(90deg, #dc2626, #f87171); }
.stat-card.purple::after { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.stat-icon.green  { background: var(--green-100); color: var(--green-700); }
.stat-icon.blue   { background: #eff6ff; color: #2563eb; }
.stat-icon.amber  { background: #fffbeb; color: #d97706; }
.stat-icon.red    { background: #fef2f2; color: #dc2626; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }

.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--gray-900); letter-spacing: -.03em; }
.stat-label { font-size: .75rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .06em; margin-top: .35rem; }
.stat-change { font-size: .8rem; font-weight: 600; margin-top: .5rem; display: flex; align-items: center; gap: .25rem; }
.stat-change.up   { color: var(--green-600); }
.stat-change.down { color: #dc2626; }
@media (max-width: 575px) {
  .stat-value { font-size: 1.6rem; }
  .stat-card  { padding: 1.125rem; }
}

/* ── Cotação cards ─────────────────────────────────────────── */
.cotacao-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  transition: all var(--transition-md);
  position: relative;
  overflow: hidden;
}
.cotacao-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--green-300);
}
.cotacao-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-500), var(--green-400));
  opacity: 0;
  transition: opacity var(--transition);
}
.cotacao-card:hover::before { opacity: 1; }
.cotacao-cultura { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-500); }
.cotacao-valor { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); letter-spacing: -.025em; margin: .35rem 0; }
.cotacao-badge { font-size: .7rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.badge-alta    { background: var(--green-100); color: var(--green-800); }
.badge-baixa   { background: #fee2e2; color: #991b1b; }
.badge-estavel { background: #fef3c7; color: #92400e; }

/* ── Tables ────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table thead th {
  background: var(--green-50);
  color: var(--green-800);
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.table tbody td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--green-50); }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  font-weight: 600;
  font-size: .875rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  border: 1.5px solid transparent;
  line-height: 1.4;
  white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid rgba(52,194,108,.4); outline-offset: 2px; }

.btn-primary, .btn-primary-ag {
  background: linear-gradient(135deg, var(--green-600), var(--green-700));
  color: #fff;
  border-color: var(--green-700);
}
.btn-primary:hover, .btn-primary-ag:hover {
  background: linear-gradient(135deg, var(--green-700), var(--green-800));
  border-color: var(--green-800);
  color: #fff;
  box-shadow: 0 4px 12px rgba(27,122,58,.3);
  transform: translateY(-1px);
}
.btn-primary:active, .btn-primary-ag:active {
  background: var(--green-900);
  transform: translateY(0);
}

.btn-secondary {
  background: #fff;
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn-secondary:hover {
  background: var(--green-50);
  color: var(--green-800);
  border-color: var(--green-300);
}

.btn-outline-success {
  background: transparent;
  color: var(--green-700);
  border-color: var(--green-600);
}
.btn-outline-success:hover {
  background: var(--green-50);
  color: var(--green-800);
  border-color: var(--green-700);
}

.btn-outline-secondary {
  background: transparent;
  color: var(--gray-600);
  border-color: var(--gray-300);
}
.btn-outline-secondary:hover {
  background: var(--gray-100);
  color: var(--gray-800);
  border-color: var(--gray-400);
}

.btn-outline-danger {
  background: transparent;
  color: #dc2626;
  border-color: #fca5a5;
}
.btn-outline-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #dc2626;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.btn-danger:hover {
  background: #b91c1c;
  color: #fff;
  box-shadow: 0 4px 12px rgba(220,38,38,.3);
  transform: translateY(-1px);
}

.btn-sm {
  font-size: .8rem;
  padding: .35rem .75rem;
}
.btn-lg {
  font-size: 1rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
}

.btn-icon {
  padding: .5rem;
  border-radius: var(--radius-sm);
}
.btn-icon.btn-sm { padding: .35rem; }

.btn:disabled, .btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Form controls ─────────────────────────────────────────── */
.form-control, .form-select {
  display: block;
  width: 100%;
  padding: .55rem .85rem;
  font-size: .9rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--gray-900);
  background: #fff;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(52,194,108,.16);
  outline: none;
  background: #fff;
}
.form-control::placeholder { color: var(--gray-400); }
.form-control:disabled, .form-select:disabled {
  background: var(--gray-50);
  color: var(--gray-500);
  cursor: not-allowed;
}
.form-control-sm, .form-select-sm {
  font-size: .8rem;
  padding: .35rem .65rem;
}
.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: .375rem;
}
.form-text { font-size: .78rem; color: var(--gray-500); margin-top: .25rem; }
.form-check-input:checked {
  background-color: var(--green-600);
  border-color: var(--green-600);
}
.input-group-text {
  background: var(--green-50);
  border: 1.5px solid var(--gray-300);
  color: var(--gray-500);
  font-size: .875rem;
}
.input-group .form-control:focus { z-index: 3; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 20px;
  letter-spacing: .03em;
}
.badge-ativo, .badge-ativa { background: var(--green-100); color: var(--green-800); }
.badge-trial               { background: #dbeafe; color: #1d4ed8; }
.badge-inativo, .badge-cancelada, .badge-cancelado { background: #fee2e2; color: #b91c1c; }
.badge-inadimplente        { background: #fef9c3; color: #854d0e; }
.badge-expirada, .badge-expirado { background: var(--gray-200); color: var(--gray-600); }
.badge-pendente            { background: #fff7ed; color: #c2410c; }
.badge-aprovado, .badge-pago { background: var(--green-100); color: var(--green-800); }
.badge-recusado            { background: #fee2e2; color: #b91c1c; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  border: none;
  border-radius: var(--radius);
  padding: .875rem 1.125rem;
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  font-size: .875rem;
  line-height: 1.5;
}
.alert-success { background: var(--green-100); color: var(--green-900); }
.alert-danger  { background: #fee2e2; color: #7f1d1d; }
.alert-warning { background: #fef3c7; color: #78350f; }
.alert-info    { background: #dbeafe; color: #1e3a5f; }
.alert-dismissible .btn-close { margin-left: auto; align-self: flex-start; }

/* ── Auth pages ────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 768px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero  { display: none; }
}
.auth-hero {
  background: linear-gradient(160deg, rgba(13,58,28,.94) 0%, rgba(19,84,39,.84) 55%, rgba(13,90,43,.66) 100%), url('../images/hero.jpg') 80% center / cover no-repeat, var(--green-900);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem;
  color: #fff;
}
.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(52,194,108,.14) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(31,163,80,.09) 0%, transparent 50%);
}
.auth-hero-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.auth-hero-shapes::before,
.auth-hero-shapes::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.08);
}
.auth-hero-shapes::before { width: 400px; height: 400px; top: -100px; right: -100px; }
.auth-hero-shapes::after  { width: 600px; height: 600px; bottom: -200px; left: -200px; }
.auth-hero-content { position: relative; z-index: 1; }
.auth-hero-logo {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin-bottom: 3rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.auth-hero-logo .logo-icon {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.auth-hero h2 { font-size: 2.4rem; font-weight: 900; line-height: 1.15; letter-spacing: -.04em; margin-bottom: 1rem; }
.auth-hero p  { font-size: 1rem; opacity: .78; margin-bottom: 2.5rem; line-height: 1.6; }
.auth-hero-features { display: flex; flex-direction: column; gap: .875rem; }
.auth-hero-feature {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .9rem;
  opacity: .88;
}
.auth-hero-feature .feat-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: .9rem;
}
.auth-panel {
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem;
  overflow-y: auto;
}
@media (max-width: 992px) { .auth-panel { padding: 2.5rem 2rem; } }
@media (max-width: 575px) { .auth-panel { padding: 2rem 1.25rem; } }
.auth-panel-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--green-800);
  letter-spacing: -.02em;
  margin-bottom: 2.5rem;
}
.auth-panel-logo .logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--green-600), var(--green-400));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .9rem;
  box-shadow: 0 4px 10px rgba(31,163,80,.3);
}
.auth-form-title { font-size: 1.75rem; font-weight: 900; letter-spacing: -.03em; color: var(--gray-900); margin-bottom: .375rem; }
.auth-form-sub   { font-size: .9rem; color: var(--gray-500); margin-bottom: 2rem; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--gray-400);
  font-size: .8rem;
  font-weight: 500;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ── Onboarding ─────────────────────────────────────────────── */
.step-indicator { display: flex; align-items: center; gap: .5rem; justify-content: center; margin-bottom: 2.5rem; flex-wrap: wrap; }
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  background: var(--gray-100);
  color: var(--gray-500);
  border: 2px solid var(--gray-200);
  transition: all var(--transition-md);
}
.step-line { height: 2px; width: 40px; background: var(--gray-200); border-radius: 2px; flex-shrink: 0; }
.step-dot.active  {
  background: var(--green-700);
  color: #fff;
  border-color: var(--green-700);
  box-shadow: 0 0 0 5px rgba(27,122,58,.15);
}
.step-dot.done    { background: var(--green-50); color: var(--green-700); border-color: var(--green-300); }
.step-line.done   { background: var(--green-400); }

/* ── Plan cards ─────────────────────────────────────────────── */
.plan-card {
  background: #fff;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-md);
  height: 100%;
}
@media (max-width: 575px) { .plan-card { padding: 1.5rem; } }
.plan-card:hover {
  border-color: var(--green-400);
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}
.plan-card.popular {
  border-color: var(--green-600);
  background: linear-gradient(180deg, #effaf2 0%, #fff 38%);
  box-shadow: 0 0 0 4px rgba(31,163,80,.12), 0 14px 40px rgba(31,163,80,.25);
}
.plan-card.popular:hover { box-shadow: 0 20px 40px rgba(31,163,80,.2); }
.plan-badge {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .06em;
  box-shadow: 0 2px 8px rgba(31,163,80,.3);
}
.plan-price {
  font-size: 3.25rem;
  font-weight: 900;
  color: var(--gray-900);
  line-height: 1;
  letter-spacing: -.04em;
}
.plan-price sup { font-size: 1.25rem; font-weight: 700; vertical-align: top; margin-top: .5rem; color: var(--gray-600); }
.plan-price .period { font-size: 1rem; font-weight: 400; color: var(--gray-500); }
.plan-feature { display: flex; align-items: center; gap: .625rem; padding: .4rem 0; font-size: .875rem; color: var(--gray-700); }
.plan-feature .bi-check-circle-fill { color: var(--green-600); }
.plan-feature .bi-x-circle { color: var(--gray-300); }

/* ── Payment form ───────────────────────────────────────────── */
.payment-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.payment-tabs { display: flex; gap: .5rem; border-bottom: none; flex-wrap: wrap; }
.payment-tab {
  flex: 1;
  min-width: 120px;
  padding: .625rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--gray-600);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
}
.payment-tab:hover { border-color: var(--green-400); color: var(--green-700); background: var(--green-50); }
.payment-tab.active {
  border-color: var(--green-600);
  background: var(--green-50);
  color: var(--green-800);
}
#stripe-card-element {
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 44px;
}
#stripe-card-element.StripeElement--focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(52,194,108,.16);
}
#stripe-card-element.StripeElement--invalid { border-color: #dc2626; }

/* ── Subscription / billing ─────────────────────────────────── */
.billing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: .875rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.billing-row:last-child { border-bottom: none; }
.billing-row label { color: var(--gray-600); }
.billing-row .value { font-weight: 600; color: var(--gray-900); }

/* Subscription status card */
.subscription-card {
  background: linear-gradient(135deg, var(--green-50), #fff);
  border: 2px solid var(--green-200);
  border-radius: var(--radius-xl);
  padding: 2rem;
}
@media (max-width: 575px) { .subscription-card { padding: 1.25rem; } }
.subscription-card.inactive {
  background: linear-gradient(135deg, var(--gray-50), #fff);
  border-color: var(--gray-200);
}

/* ── Admin header ───────────────────────────────────────────── */
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--green-100);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1030;
  box-shadow: 0 1px 3px rgba(10,30,18,.05);
}
.admin-sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  position: fixed;
  top: var(--topbar-h); left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 1020;
  border-right: 1px solid rgba(255,255,255,.05);
}
.admin-content {
  margin-left: 240px;
  margin-top: var(--topbar-h);
  padding: 2rem;
  min-height: calc(100vh - var(--topbar-h));
  max-width: 100%;
}
@media (max-width: 991px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform var(--transition-md); }
  .admin-sidebar.show { transform: translateX(0); }
  .admin-content { margin-left: 0; padding: 1.25rem; }
}
@media (max-width: 575px) {
  .admin-content { padding: 1rem; }
  .admin-topbar { padding: 0 1rem; }
}

/* ── Admin sidebar nav ──────────────────────────────────────── */
.admin-nav { padding: 1rem 0; }
.admin-nav-group { margin-bottom: 1.5rem; }
.admin-nav-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: 0 1.25rem .5rem;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .55rem 1rem;
  margin: 1px .625rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.6);
  font-size: .845rem;
  font-weight: 500;
  transition: all var(--transition);
}
.admin-nav-link:hover {
  background: rgba(111,219,154,.12);
  color: #fff;
}
.admin-nav-link.active {
  background: rgba(52,194,108,.18);
  color: #fff;
  font-weight: 600;
}
.admin-nav-link .bi { font-size: .9rem; width: 1rem; }
.admin-nav-link .nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
  font-size: .65rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* ── Metric cards (admin) ───────────────────────────────────── */
.metric-card {
  border-radius: var(--radius);
  padding: 1.375rem;
  position: relative;
  overflow: hidden;
  border: none;
}
.metric-card.green  { background: linear-gradient(135deg, var(--green-700), var(--green-500)); }
.metric-card.blue   { background: linear-gradient(135deg, #1d4ed8, #60a5fa); }
.metric-card.amber  { background: linear-gradient(135deg, #c2410c, #fb923c); }
.metric-card.red    { background: linear-gradient(135deg, #b91c1c, #f87171); }
.metric-card.purple { background: linear-gradient(135deg, #6d28d9, #a78bfa); }
.metric-card::after {
  content: '';
  position: absolute;
  bottom: -20px; right: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.metric-value { font-size: 2.25rem; font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.metric-label { font-size: .75rem; font-weight: 600; opacity: .78; text-transform: uppercase; letter-spacing: .06em; margin-top: .375rem; }
.metric-sub   { font-size: .8rem; opacity: .88; margin-top: .25rem; font-weight: 500; }
@media (max-width: 575px) { .metric-value { font-size: 1.75rem; } }

/* ── Chat widget ────────────────────────────────────────────── */
.chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
}
.chat-toggle-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px rgba(27,122,58,.4);
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition-md);
}
.chat-toggle-btn:hover { transform: scale(1.1); box-shadow: 0 12px 30px rgba(27,122,58,.5); }
.chat-panel {
  position: absolute;
  bottom: 70px; right: 0;
  width: 360px;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(10,30,18,.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  max-height: 520px;
}
.chat-panel.open { display: flex; }
.chat-header {
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: .75rem;
  min-height: 200px; max-height: 320px;
}
.chat-msg {
  max-width: 85%; padding: .6rem .9rem;
  border-radius: 12px; font-size: .875rem; line-height: 1.45;
}
.chat-msg.user {
  background: var(--green-700); color: #fff;
  align-self: flex-end; border-bottom-right-radius: 3px;
}
.chat-msg.bot {
  background: var(--gray-100); color: var(--gray-900);
  align-self: flex-start; border-bottom-left-radius: 3px;
}
.chat-footer {
  padding: .75rem 1rem; border-top: 1px solid var(--gray-100);
  display: flex; gap: .5rem;
}
.chat-footer input {
  flex: 1; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  padding: .5rem .75rem; font-size: .875rem; font-family: inherit;
  outline: none; transition: border-color var(--transition);
}
.chat-footer input:focus { border-color: var(--green-500); }
.chat-send-btn {
  background: var(--green-700); border: none; color: #fff;
  border-radius: var(--radius-sm); padding: .5rem .75rem;
  cursor: pointer; transition: background var(--transition);
}
.chat-send-btn:hover { background: var(--green-800); }
@media (max-width: 480px) {
  .chat-panel { width: calc(100vw - 2rem); right: -1rem; }
  .chat-widget { bottom: 1rem; right: 1rem; }
  .chat-toggle-btn { width: 50px; height: 50px; font-size: 1.2rem; }
}

/* ── News items ──────────────────────────────────────────────── */
.noticia-item {
  padding: .75rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gray-200);
  margin-bottom: .5rem;
  transition: background var(--transition);
}
.noticia-item:hover { background: var(--green-50); }
.noticia-item.positivo { border-color: var(--green-500); }
.noticia-item.neutro   { border-color: #fbbf24; }
.noticia-item.negativo { border-color: #f87171; }
.noticia-item .titulo  { font-size: .875rem; font-weight: 600; color: var(--gray-900); line-height: 1.3; }
.noticia-item .resumo  { font-size: .8rem; color: var(--gray-500); margin-top: 2px; }

/* ── Termômetro ──────────────────────────────────────────────── */
.termometro-bar { height: 10px; border-radius: 20px; overflow: hidden; display: flex; background: var(--gray-100); }
.termometro-pos { background: linear-gradient(90deg, var(--green-500), var(--green-400)); }
.termometro-neu { background: linear-gradient(90deg, #fbbf24, #fcd34d); }
.termometro-neg { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ── Spinner ─────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin .7s linear infinite; }

/* ── Utilities ───────────────────────────────────────────────── */
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.text-green  { color: var(--green-700) !important; }
.bg-green-50 { background: var(--green-50) !important; }
.bg-green    { background: var(--green-600) !important; }
.divider     { height: 1px; background: var(--gray-100); margin: 1rem 0; }
.chart-wrapper { position: relative; height: 220px; }
@media (max-width: 575px) { .chart-wrapper { height: 180px; } }

/* ── Scrollable table body ───────────────────────────────────── */
.table-scroll { max-height: 420px; overflow-y: auto; }

/* ── Toast container ─────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-h) + 1rem);
  right: 1rem;
  left: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
  pointer-events: none;
}
.toast-item {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  min-width: 280px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  font-size: .875rem;
  pointer-events: all;
  animation: slideIn .2s ease;
}
@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}
@media (max-width: 480px) {
  .toast-item { min-width: 0; }
}
.toast-item.success .toast-icon { color: var(--green-600); }
.toast-item.danger  .toast-icon { color: #dc2626; }
.toast-item.warning .toast-icon { color: #d97706; }
.toast-item.info    .toast-icon { color: #2563eb; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  color: var(--gray-500);
}
@media (max-width: 575px) { .empty-state { padding: 2.25rem 1rem; } }
.empty-state-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  color: var(--green-200);
}
.empty-state h6 { font-weight: 700; color: var(--gray-700); margin-bottom: .5rem; }

/* ── Modals ──────────────────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}
.modal-header {
  border-bottom: 1px solid var(--gray-100);
  padding: 1.375rem;
}
.modal-footer {
  border-top: 1px solid var(--gray-100);
  padding: 1rem 1.375rem;
}
.modal-body { padding: 1.375rem; }
@media (max-width: 575px) {
  .modal-header, .modal-footer { padding: 1rem; }
  .modal-body { padding: 1rem; }
}

/* ── Dropdown ────────────────────────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .375rem;
  font-size: .875rem;
}
.dropdown-item {
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: all var(--transition);
}
.dropdown-item:hover { background: var(--green-50); color: var(--green-800); }
.dropdown-item.text-danger:hover { background: #fee2e2; }
.dropdown-divider { border-color: var(--gray-100); margin: .25rem 0; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination { gap: .25rem; flex-wrap: wrap; }
.page-link {
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-size: .8rem;
  padding: .375rem .625rem;
  font-weight: 500;
  transition: all var(--transition);
}
.page-link:hover { background: var(--green-50); border-color: var(--green-300); color: var(--green-800); }
.page-item.active .page-link { background: var(--green-700); border-color: var(--green-700); }

/* ── Responsive fixes ────────────────────────────────────────── */
@media (max-width: 991px) {
  :root { --topbar-h: 58px; }
  .topbar-search { display: none; }
}
@media (max-width: 767px) {
  .plan-price { font-size: 2.75rem; }
  .page-title { font-size: 1.2rem; }
}
@media (max-width: 575px) {
  .plan-price { font-size: 2.25rem; }
  .auth-panel { padding: 2rem 1.5rem; }
  .page-title { font-size: 1.1rem; }
  .btn-lg { font-size: .9rem; padding: .65rem 1.25rem; }
}
/* Evita overflow horizontal em telas muito estreitas */
@media (max-width: 400px) {
  .main-content, .admin-content { padding-left: .75rem; padding-right: .75rem; }
}

/* ── Bootstrap compatibility (não redefinir d-none/d-flex para não quebrar d-lg-*) ── */

.bg-white { background: #fff !important; }
.text-muted { color: var(--gray-500) !important; }
.text-danger { color: #dc2626 !important; }
.text-success { color: var(--green-700) !important; }
.text-warning { color: #d97706 !important; }
.text-primary { color: #2563eb !important; }

.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-normal { font-weight: 400 !important; }
.small { font-size: .875em !important; }
.fs-1 { font-size: 2.5rem !important; }
.fs-2 { font-size: 2rem !important; }
.fs-3 { font-size: 1.75rem !important; }
.fs-4 { font-size: 1.5rem !important; }
.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.mw-100 { max-width: 100% !important; }
.text-center { text-align: center !important; }
.text-end    { text-align: right !important; }

.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

.p-0 { padding: 0 !important; }
.p-2 { padding: .5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.mt-1 { margin-top: .25rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.ms-auto { margin-left: auto !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }

.position-relative { position: relative !important; }
.position-fixed    { position: fixed !important; }
.overflow-hidden   { overflow: hidden !important; }
.flex-shrink-0     { flex-shrink: 0 !important; }
.align-items-center{ align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center  { justify-content: center !important; }
.flex-wrap  { flex-wrap: wrap !important; }
.flex-grow-1{ flex-grow: 1 !important; }
.min-w-0    { min-width: 0 !important; }
.col-auto { flex: 0 0 auto; width: auto; }

/* ── Sticky ─────────────────────────────────────────────────── */
.sticky-top { position: sticky; top: calc(var(--topbar-h) + 1rem); }

/* ── Modal scrollable com form dentro do modal-content ─────── */
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
}
.modal-dialog-scrollable .modal-content > form > .modal-footer {
  flex-shrink: 0;
}

/* ── DataTables — integração com o design system ─────────────── */
.dataTables_wrapper { overflow-x: auto; padding: 1.25rem 1.5rem; }
.dataTables_wrapper .row:first-child { margin-bottom: 1rem !important; }
.dataTables_wrapper .row:last-child  { margin-top: 1rem !important; }
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: .3rem .65rem;
  font-size: .82rem;
  margin-left: .5rem;
  outline: none;
  transition: border-color .15s;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(52,194,108,.14);
}
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: .2rem .5rem;
  font-size: .82rem;
  margin: 0 .35rem;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length {
  font-size: .78rem;
  color: var(--gray-400);
  padding-top: .5rem;
}
.dataTables_wrapper .pagination .page-link {
  font-size: .78rem;
  padding: .3rem .6rem;
  border-color: var(--gray-200);
  color: var(--green-700);
}
.dataTables_wrapper .pagination .page-item.active .page-link {
  background: var(--green-700);
  border-color: var(--green-700);
}
/* Evita conflito de borda dupla com cards */
table.dataTable thead th {
  border-bottom: 2px solid var(--gray-200) !important;
}
table.dataTable.no-footer {
  border-bottom: none;
}
/* Ícone de ordenação sutil */
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
  opacity: .4;
}

/* ── Fluidez geral em telas pequenas ──────────────────────────── */
@media (max-width: 575px) {
  .row > * { min-width: 0; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.15rem; }
  .dataTables_wrapper { padding: 1rem; }
  .table thead th, .table tbody td { padding: .75rem .9rem; }
}

/* ── DataTables 2.x (dt-*) — espaçamentos e alinhamento ──────────
   A v2 mudou as classes (dt-container, dt-layout-row, dt-length,
   dt-search, dt-info, dt-paging); as regras .dataTables_* acima só
   valiam para a v1. */
div.dt-container { padding: 0; }
div.dt-container > div.dt-layout-row,
div.dt-container > .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 0; /* sem gap horizontal: as colunas col-sm-* somam 100% */
  margin: 0;
  padding: 1rem 1.25rem;
}
/* Barra superior (exibir / pesquisar) e inferior (info / paginação) */
div.dt-container > div.dt-layout-row:first-child { border-bottom: 1px solid var(--gray-100, #f1f3f2); }
div.dt-container > div.dt-layout-row:last-child  { border-top: 1px solid var(--gray-100, #f1f3f2); }
/* Linha da tabela: sem padding lateral extra, rola na horizontal se precisar */
div.dt-container > div.dt-layout-row.dt-layout-table,
div.dt-container > .row:has(> div > table) {
  padding: 0;
  border: 0;
  display: block;
}
div.dt-container .dt-layout-cell,
div.dt-container .dt-layout-start,
div.dt-container .dt-layout-end { padding: 0; margin: 0; }
div.dt-container div.dt-layout-start > *:not(:last-child),
div.dt-container div.dt-layout-end > *:not(:first-child) { margin: 0; }

div.dt-container .dt-length,
div.dt-container .dt-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: var(--gray-600, #5f6b66);
  white-space: nowrap;
}
div.dt-container .text-end .dt-search,
div.dt-container .dt-layout-end .dt-search { justify-content: flex-end; }
div.dt-container .dt-length label,
div.dt-container .dt-search label { margin: 0; font-size: .82rem; font-weight: 500; }
div.dt-container .dt-length select,
div.dt-container div.dt-length select.dt-input {
  width: auto;
  min-width: 4.25rem;
  margin: 0 !important;
  padding: .3rem 1.75rem .3rem .65rem;
  font-size: .82rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background-color: #fff;
}
div.dt-container .dt-search input,
div.dt-container div.dt-search input.dt-input {
  width: 15rem;
  max-width: 100%;
  margin: 0 !important;
  padding: .4rem .75rem;
  font-size: .82rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
div.dt-container .dt-search input:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(52,194,108,.14);
}
div.dt-container .dt-info {
  font-size: .78rem;
  color: var(--gray-500, #77837d);
  padding: 0;
}
/* Paginação */
div.dt-container .dt-paging { display: flex; justify-content: flex-end; margin: 0; }
div.dt-container .dt-paging nav,
div.dt-container .dt-paging .pagination { gap: .25rem; margin: 0 !important; flex-wrap: wrap; }
div.dt-container .dt-paging .page-link,
div.dt-container .dt-paging button.dt-paging-button {
  font-size: .78rem;
  padding: .35rem .7rem;
  margin: 0;
  border: 1px solid var(--gray-200);
  border-radius: 8px !important;
  color: var(--green-700);
  background: #fff;
  line-height: 1.3;
}
div.dt-container .dt-paging .page-item.active .page-link,
div.dt-container .dt-paging button.dt-paging-button.current {
  background: var(--green-700);
  border-color: var(--green-700);
  color: #fff;
}
div.dt-container .dt-paging .page-item.disabled .page-link,
div.dt-container .dt-paging button.dt-paging-button.disabled { opacity: .5; }

/* Células: respiro consistente */
table.dataTable > thead > tr > th,
table.dataTable > tbody > tr > td { padding: .8rem 1.25rem; vertical-align: middle; }
table.dataTable > thead > tr > th { padding-top: .9rem; padding-bottom: .9rem; }
table.dataTable td.dt-empty { padding: 1.75rem 1rem !important; color: var(--gray-500, #77837d); }

@media (max-width: 575px) {
  div.dt-container > div.dt-layout-row,
  div.dt-container > .row { padding: .75rem 1rem; flex-direction: column; align-items: stretch; }
  div.dt-container .dt-search input { width: 100%; }
  div.dt-container .dt-length,
  div.dt-container .dt-search { justify-content: space-between; }
  div.dt-container .dt-paging { justify-content: center; }
  div.dt-container .dt-info { text-align: center; }
}

/* Módulo/grupo atual do menu em destaque */
.sidebar-nav .nav-link.nav-group-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(52,194,108,.38), rgba(52,194,108,.12));
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--green-400, #4ade80);
}
.sidebar-nav .nav-link.nav-group-active > span > .bi,
.sidebar-nav .nav-link.nav-group-active > .bi:first-child { color: var(--green-400, #4ade80); }
.sidebar-nav .collapse.show > div { border-left: 2px solid rgba(74,222,128,.35); margin-left: 1.15rem; padding-left: .25rem !important; }
.sidebar-nav .collapse .nav-link.active {
  background: rgba(52,194,108,.28);
  color: #fff;
  font-weight: 700;
}
.sidebar-nav .collapse .nav-link.active::before { margin-left: -.35rem; }
.sidebar-nav .nav-link:focus, .sidebar-nav .nav-link:focus-visible { outline: none; box-shadow: none; }

/* ═══ Responsividade global (painel do usuário e admin) ═══════════════════════ */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, svg, canvas, iframe { max-width: 100%; }
img, video { height: auto; }
.card, .card-body, .page-header > *, .d-flex > * { min-width: 0; }
.card-body, .page-title, .page-subtitle, td, th, .topbar-brand { overflow-wrap: anywhere; }
pre, code { white-space: pre-wrap; word-break: break-word; }
/* tabelas nunca estouram a tela: envolvidas por JS em .table-responsive-auto */
.table-responsive-auto { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive-auto > table { margin-bottom: 0; }
.dataTables_wrapper { max-width: 100%; overflow-x: auto; }
/* não sobrepor o max-width do Bootstrap (--bs-modal-width): modais mantêm o tamanho sm/md/lg/xl */
.modal-dialog:not(.modal-fullscreen) { max-width: min(var(--bs-modal-width, 500px), calc(100vw - 1rem)); }
.dropdown-menu { max-width: calc(100vw - 1rem); }

@media (max-width: 991px) {
  .page-header { flex-wrap: wrap; gap: .75rem; }
  .page-header > .btn, .page-header > a.btn { margin-left: 0; }
  .main-content, .content, main { padding-left: 1rem; padding-right: 1rem; }
}
@media (max-width: 767px) {
  .row > [class*="col-"]:not([class*="col-6"]):not([class*="col-sm-"]) { flex: 0 0 100%; max-width: 100%; }
  .card-header { flex-wrap: wrap; gap: .5rem; }
  .btn-group { flex-wrap: wrap; }
  .nav-tabs, .nav-pills { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .nav-tabs .nav-link, .nav-pills .nav-link { white-space: nowrap; }
  .page-title { font-size: 1.25rem; }
  .modal-dialog { margin: .5rem auto; }
  .form-control, .form-select { font-size: 16px; } /* evita zoom automático no iOS */
}
@media (max-width: 575px) {
  .d-flex.justify-content-between.flex-wrap > .d-flex { width: 100%; flex-wrap: wrap; }
  .btn-lg { padding: .6rem 1rem; }
  h1, .h1 { font-size: 1.5rem; } h2, .h2 { font-size: 1.3rem; }
}

/* Pesquisa global (barra superior) */
.topbar-search .input-search::-webkit-search-cancel-button { cursor: pointer; }
.busca-drop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 320px; max-height: 70vh; overflow-y: auto; z-index: 1050;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.16); padding: .35rem; }
.busca-drop[hidden] { display: none; }
.busca-grupo { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); padding: .5rem .6rem .2rem; }
.busca-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: 8px; color: var(--gray-900); text-decoration: none; font-size: .86rem; }
.busca-item i { color: var(--green-600); width: 1.1rem; text-align: center; flex-shrink: 0; }
.busca-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.busca-item .s { color: var(--gray-500); font-size: .74rem; white-space: nowrap; }
.busca-item:hover, .busca-item.ativo { background: var(--green-50, #f0fdf4); color: var(--green-800, #14532d); }
.busca-vazio { padding: .9rem; color: var(--gray-500); font-size: .85rem; text-align: center; }

/* Telas de login/cadastro em largura intermediária (hero e painel lado a lado, com as duas logos visíveis):
   ancora as duas colunas no topo para as logos ficarem na mesma altura e com o mesmo tamanho. */
@media (min-width: 769px) and (max-width: 991.98px) {
  .auth-hero, .auth-panel { justify-content: flex-start; padding-top: 3.5rem; }
  .auth-panel-logo { margin-bottom: 3rem !important; display: flex; align-items: center; min-height: 44px; }
  .auth-panel-logo img { height: 44px !important; }
}
