:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #172033;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2952cc;
  --primary-dark: #1d3c9b;
  --success: #0f8a5f;
  --success-bg: #e8f8f0;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --warning: #b7791f;
  --warning-bg: #fff4df;
  --shadow: 0 18px 45px rgba(20, 31, 56, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

.auth-page, .error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top left, #dce8ff, transparent 34%), var(--bg);
}
.auth-card, .error-card {
  width: min(460px, 100%);
  background: var(--surface);
  padding: 34px;
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.auth-card h1, .error-card h1 { margin: 20px 0 8px; }
.auth-card p, .error-card p { color: var(--muted); }

.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #111827;
  color: #f9fafb;
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}
.brand strong { display: block; font-size: 18px; }
.brand span { display: block; color: #9ca3af; font-size: 13px; margin-top: 2px; }
.auth-brand span { color: var(--muted); }

.brand-logo-icon {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
}
.brand-logo-full {
  display: block;
  width: min(100%, 320px);
  height: auto;
  margin: 0 auto;
}
.auth-brand {
  justify-content: center;
  margin-bottom: 10px;
}

.company-switcher {
  padding: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
}
.company-switcher label { color: #cbd5e1; display: block; font-size: 12px; margin-bottom: 8px; }
.company-switcher select {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  color: var(--text);
}
.nav { display: grid; gap: 8px; }
.nav a {
  color: #d1d5db;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
}
.nav a:hover, .nav a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.logout-form { margin-top: auto; }

.main {
  min-width: 0;
  padding: 28px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.topbar small { color: var(--muted); font-weight: 600; }
.topbar h1 { margin: 4px 0 0; font-size: clamp(26px, 3vw, 38px); }
.topbar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 18px;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(20,31,56,0.05);
}
.topbar-card span, .topbar-card strong { display: block; }
.topbar-card span { color: var(--muted); font-size: 13px; }

.panel, .metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(20,31,56,0.05);
}
.panel { padding: 22px; margin-bottom: 22px; }
.panel.narrow { max-width: 920px; }
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.panel-header h2 { margin: 0; font-size: 20px; }
.panel-header p { margin: 6px 0 0; }
.muted { color: var(--muted); }

.cards-grid { display: grid; gap: 16px; margin-bottom: 22px; }
.cards-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cards-grid.compact { margin-top: 18px; margin-bottom: 0; }
.content-grid { display: grid; gap: 22px; }
.content-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric-card { padding: 18px; }
.metric-card span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.metric-card strong { font-size: 24px; }
.success-soft { background: linear-gradient(180deg, var(--success-bg), #fff); }
.danger-soft { background: linear-gradient(180deg, var(--danger-bg), #fff); }
.warning-soft { background: linear-gradient(180deg, var(--warning-bg), #fff); }

.form-grid {
  display: grid;
  gap: 14px;
}
.form-grid.one { grid-template-columns: 1fr; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid label { display: grid; gap: 7px; color: #374151; font-size: 13px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 13px;
  padding: 11px 12px;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(41, 82, 204, 0.1);
}
textarea { resize: vertical; }
.full-line { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 190px 190px auto;
  gap: 12px;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #9f3025; border-color: #9f3025; }
.btn-ghost { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.12); }
.btn-sm { min-height: 34px; padding: 7px 11px; font-size: 13px; border-radius: 11px; }
.full { width: 100%; }
.inline-form { display: inline; }

.alert {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 18px;
  border: 1px solid transparent;
  font-weight: 700;
}
.alert-success { background: var(--success-bg); border-color: #bfe9d3; color: var(--success); }
.alert-error { background: var(--danger-bg); border-color: #f6c7c2; color: var(--danger); }
.hint-box {
  background: var(--surface-2);
  border: 1px dashed #cbd5e1;
  color: #475569;
  border-radius: 14px;
  padding: 14px;
  font-size: 14px;
}

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: #f8fafc; }
td strong { display: block; }
td small { display: block; color: var(--muted); margin-top: 4px; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.small-table table { min-width: 680px; }
.audit-table table { min-width: 1100px; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3949ab;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.muted { background: #f1f5f9; color: #64748b; }
.badge.primary { background: #dbeafe; color: #1d4ed8; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.modal.open { display: flex; }
.modal-content {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 25px 80px rgba(0,0,0,.25);
  padding: 26px;
  position: relative;
}
.modal-content.large { width: min(940px, 100%); }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  cursor: pointer;
  font-size: 22px;
}
pre {
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  overflow: auto;
  max-height: 280px;
}

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 800;
}
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.mini-list { display: grid; gap: 10px; margin-top: 14px; }
.mini-item { padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
.mini-item strong, .mini-item span { display: block; }
.mini-item span { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stacked-form + hr, hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.stacked-form h3 { margin: 0; }

@media (max-width: 1100px) {
  .cards-grid.four, .cards-grid.five, .content-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 18px; }
  .topbar { display: grid; }
  .topbar-card { width: 100%; }
  .cards-grid.four, .cards-grid.five, .content-grid.two, .form-grid.two, .form-grid.three, .filters { grid-template-columns: 1fr; }
}

/* Visual upgrade: menus agrupados, cards comerciais e relatórios */
body {
  background:
    radial-gradient(circle at 15% 0%, rgba(41,82,204,.12), transparent 28%),
    radial-gradient(circle at 95% 10%, rgba(15,138,95,.10), transparent 30%),
    var(--bg);
}
.sidebar {
  background: linear-gradient(180deg, #0b1220 0%, #111827 55%, #0f172a 100%);
  border-right: 1px solid rgba(255,255,255,.08);
  overflow-y: auto;
}
.brand-icon {
  background: linear-gradient(135deg, #4f7cff, #22c55e);
  letter-spacing: -.04em;
}
.nav {
  gap: 18px;
}
.nav-section {
  display: grid;
  gap: 7px;
}
.nav-label {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 0 12px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  border: 1px solid transparent;
}
.nav a span:first-child {
  width: 24px;
  text-align: center;
  filter: saturate(.9);
}
.nav a:hover, .nav a.active {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.09);
  box-shadow: inset 3px 0 0 #60a5fa;
}
.plan-mini-card {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.plan-mini-card strong { color: #fff; font-size: 13px; }
.plan-mini-card span { color: #cbd5e1; font-size: 12px; }
.main {
  background: transparent;
}
.panel, .metric-card, .topbar-card, .auth-card, .error-card {
  backdrop-filter: blur(10px);
}
.metric-card {
  position: relative;
  overflow: hidden;
}
.metric-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 78px;
  height: 78px;
  border-radius: 999px;
  background: rgba(41,82,204,.08);
}
.hero-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
  padding: 28px;
  border-radius: 28px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15,23,42,.96), rgba(30,64,175,.9)),
    radial-gradient(circle at 80% 20%, rgba(34,197,94,.38), transparent 28%);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .18);
  overflow: hidden;
  position: relative;
}
.hero-panel::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -70px;
  bottom: -100px;
  background: rgba(255,255,255,.11);
  border-radius: 999px;
}
.hero-panel h2 {
  margin: 6px 0 8px;
  font-size: clamp(25px, 3vw, 38px);
  letter-spacing: -.04em;
}
.hero-panel p {
  margin: 0;
  color: #dbeafe;
  max-width: 720px;
}
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.hero-panel .btn:not(.btn-primary) {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-color: rgba(255,255,255,.2);
}
.eyebrow {
  display: inline-flex;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.commercial-hero {
  background: linear-gradient(135deg, #111827, #4c1d95 58%, #1e3a8a);
}
.report-hero {
  background: linear-gradient(135deg, #0f172a, #1d4ed8 58%, #0f766e);
}
.report-hero.fleet {
  background: linear-gradient(135deg, #111827, #166534 58%, #1e40af);
}
.admin-hero {
  background: linear-gradient(135deg, #111827, #334155 58%, #1d4ed8);
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.pricing-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 12px 35px rgba(20,31,56,.07);
  position: relative;
  overflow: hidden;
}
.pricing-card.featured {
  border-color: rgba(41,82,204,.45);
  box-shadow: 0 24px 70px rgba(41,82,204,.17);
  transform: translateY(-6px);
}
.plan-ribbon {
  position: absolute;
  top: 18px;
  right: -38px;
  background: var(--primary);
  color: #fff;
  padding: 7px 42px;
  transform: rotate(35deg);
  font-size: 11px;
  font-weight: 900;
}
.pricing-top {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: flex-start;
}
.pricing-top h2 { margin: 4px 0 0; font-size: 28px; }
.pricing-top strong { font-size: 24px; text-align: right; }
.pricing-top small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.plan-limits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.plan-limits div {
  padding: 12px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
}
.plan-limits strong, .plan-limits span { display: block; }
.plan-limits strong { font-size: 20px; }
.plan-limits span { color: var(--muted); font-size: 11px; font-weight: 800; margin-top: 3px; }
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  gap: 9px;
}
.feature-list li {
  color: #334155;
  font-weight: 650;
}
.feature-list li::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 12px;
  font-weight: 900;
}
.usage-line {
  display: grid;
  gap: 7px;
  min-width: 150px;
}
.usage-line span { color: var(--muted); font-size: 12px; font-weight: 800; }
progress {
  width: 100%;
  height: 9px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
}
progress::-webkit-progress-bar { background: #e5e7eb; border-radius: 999px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
.inline-actions {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.report-filters {
  grid-template-columns: minmax(220px, 1fr) 170px 170px 160px 160px auto;
  margin-bottom: 0;
}
.vehicle-report-filters {
  grid-template-columns: minmax(260px, 1fr) 170px 170px auto;
}
@media print {
  .sidebar, .topbar-card, .no-print, .hero-actions, .logout-form { display: none !important; }
  .app-layout { display: block; }
  .main { padding: 0; }
  body { background: #fff; }
  .panel, .metric-card, .hero-panel { box-shadow: none; break-inside: avoid; }
  .hero-panel { color: #111827; background: #fff; border: 1px solid #e5e7eb; }
  .hero-panel p { color: #374151; }
  table { font-size: 12px; }
}
@media (max-width: 1220px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card.featured { transform: none; }
  .report-filters, .vehicle-report-filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .hero-panel { display: grid; padding: 22px; }
  .plan-limits { grid-template-columns: 1fr; }
  .report-filters, .vehicle-report-filters { grid-template-columns: 1fr; }
}


/* Correção do menu lateral: grupos e submenus estáveis */
.app-layout {
  grid-template-columns: 292px minmax(0, 1fr);
}
.sidebar {
  width: 292px;
  padding: 22px 16px;
  gap: 18px;
}
.company-switcher {
  padding: 14px;
}
.nav-menu {
  display: block;
  width: 100%;
}
.nav-menu .nav-group {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.055);
  overflow: hidden;
}
.nav-menu .nav-group summary {
  width: 100%;
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 11px 12px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .01em;
}
.nav-menu .nav-group summary::-webkit-details-marker { display: none; }
.nav-menu .nav-group-icon {
  width: 24px;
  min-width: 24px;
  text-align: center;
}
.nav-menu .nav-chevron {
  margin-left: auto;
  color: #94a3b8;
  transition: transform .15s ease;
}
.nav-menu details:not([open]) .nav-chevron { transform: rotate(-90deg); }
.nav-menu .nav-submenu {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 0 8px 10px 44px;
}
.nav-menu .nav-submenu a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 12px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 750;
  white-space: normal;
  word-break: normal;
}
.nav-menu .nav-submenu a span:first-child {
  width: 22px;
  min-width: 22px;
  text-align: center;
}
.nav-menu .nav-submenu a span:last-child {
  min-width: 0;
}
.nav-menu .nav-submenu a:hover,
.nav-menu .nav-submenu a.active {
  color: #fff;
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.1);
  box-shadow: inset 3px 0 0 #60a5fa;
}
.action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.action-row .btn,
.action-row form {
  margin: 0;
}
.modal-description {
  margin-top: -6px;
  margin-bottom: 18px;
  color: var(--muted);
}
@media (max-width: 820px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { width: 100%; height: auto; position: static; }
  .nav-menu .nav-submenu { padding-left: 14px; }
}

/* Correção dos modais de edição: alguns navegadores prendem position:fixed quando o modal fica dentro de cards com backdrop-filter. */
.panel,
.metric-card,
.topbar-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  display: none !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 24px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: rgba(15, 23, 42, 0.66) !important;
  z-index: 99999 !important;
}

.modal.open {
  display: flex !important;
}

.modal-content {
  width: min(560px, calc(100vw - 48px)) !important;
  max-width: calc(100vw - 48px) !important;
  max-height: none !important;
  overflow: visible !important;
  margin: auto 0 !important;
}

.modal-content.large {
  width: min(900px, calc(100vw - 48px)) !important;
}

.modal-content .form-grid.three {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-content input,
.modal-content select,
.modal-content textarea {
  min-width: 0;
}

.modal-close {
  z-index: 2;
}

@media (max-width: 720px) {
  .modal {
    padding: 12px !important;
  }
  .modal-content,
  .modal-content.large {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    padding: 20px !important;
    border-radius: 18px !important;
  }
  .modal-content .form-grid.two,
  .modal-content .form-grid.three {
    grid-template-columns: 1fr;
  }
}

/* Evolução do controle de frota inspirado em apps de gestão veicular */
.fleet-control-hero {
  background: linear-gradient(135deg, #0f172a, #166534 54%, #0e7490);
}
.fuel-hero {
  background: linear-gradient(135deg, #0f172a, #0369a1 54%, #047857);
}
.maintenance-hero {
  background: linear-gradient(135deg, #0f172a, #92400e 54%, #1d4ed8);
}
.expenses-hero {
  background: linear-gradient(135deg, #0f172a, #7f1d1d 54%, #334155);
}
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.action-tile {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 10px 26px rgba(20,31,56,.05);
  color: var(--text);
  text-decoration: none;
  min-height: 138px;
}
.action-tile:hover {
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 18px 42px rgba(20,31,56,.10);
}
.action-tile span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eef2ff;
  font-size: 22px;
}
.action-tile strong { font-size: 16px; }
.action-tile small { color: var(--muted); line-height: 1.35; }
.vehicle-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.vehicle-summary-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.vehicle-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.vehicle-summary-top strong,
.vehicle-summary-top span { display: block; }
.vehicle-summary-top strong { font-size: 19px; }
.vehicle-summary-top span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.vehicle-summary-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.vehicle-summary-metrics div {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px;
}
.vehicle-summary-metrics span,
.vehicle-summary-metrics strong { display: block; }
.vehicle-summary-metrics span { color: var(--muted); font-size: 12px; font-weight: 800; }
.vehicle-summary-metrics strong { margin-top: 4px; }
.mini-cost-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: #475569;
  font-size: 13px;
  font-weight: 750;
}
.mini-cost-list span {
  padding: 8px 9px;
  border-radius: 12px;
  background: #f1f5f9;
}
.fleet-alert small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.cards-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1220px) {
  .quick-actions-grid,
  .vehicle-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .quick-actions-grid,
  .vehicle-card-grid,
  .cards-grid.three { grid-template-columns: 1fr; }
}

/* Filtros, paginação e cadastros em modal */
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.filters.full-filters {
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  align-items: end;
}
.filters.full-filters .filter-wide {
  grid-column: span 2;
}
.filters label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}
.filters .filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.modal .panelless-form {
  margin-top: 8px;
}
@media (max-width: 1220px) {
  .filters.full-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters.full-filters .filter-wide { grid-column: span 2; }
}
@media (max-width: 820px) {
  .filters.full-filters { grid-template-columns: 1fr; }
  .filters.full-filters .filter-wide { grid-column: auto; }
  .table-footer { justify-content: center; }
}
.inline-check {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  min-height: 42px;
}
.inline-check input[type="checkbox"] {
  width: auto;
}


/* Categorias financeiras e máscaras */
.color-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--dot-color, #2952cc);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15,23,42,.15);
  vertical-align: middle;
  margin-right: 7px;
}
input[type="date"],
input[type="month"],
.date-picker-input {
  cursor: pointer;
}
input[type="color"] {
  min-height: 42px;
  padding: 5px;
}

/* Financeiro unificado: lançamentos únicos, parcelados e fixos */
.cards-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.is-hidden { display: none !important; }
.suggestion-panel { border-left: 4px solid var(--primary); }
@media (max-width: 1220px) {
  .cards-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .cards-grid.six { grid-template-columns: 1fr; }
}
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }

/* Baixa em lote de parcelas */
.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin: 2px 0 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fafc, #fff);
}
.bulk-toolbar strong {
  display: block;
  color: var(--text);
}
.bulk-toolbar small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}
.checkbox-col {
  width: 48px;
  text-align: center;
}
.checkbox-col input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}
.checkbox-col input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: .35;
}
.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: .55;
  transform: none !important;
}
@media (max-width: 720px) {
  .bulk-toolbar {
    align-items: stretch;
  }
  .bulk-toolbar .btn {
    width: 100%;
  }
}

.plan-flags, .permission-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.compact-table table td, .compact-table table th { padding: 9px 10px; }
.text-success { color: #15803d; font-weight: 700; }
.text-danger { color: #b91c1c; font-weight: 700; }
.inline-actions input[type="date"], .inline-actions input[data-money] { max-width: 145px; }
@media print {
  .sidebar, .topbar, .hero-actions, .filters, .btn, .modal { display: none !important; }
  .main { padding: 0 !important; }
  .panel, .metric-card, .hero-panel { box-shadow: none !important; border: 1px solid #ddd !important; }
}


/* Categorias: exclusão individual e em massa */
.category-select-line {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.category-select-line input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--primary);
  cursor: pointer;
}
.category-select-line span {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.category-select-line small {
  display: block;
  color: var(--muted);
}
.category-select-header {
  align-items: center;
  font-weight: 800;
}
.category-select-header input[type="checkbox"] {
  margin-top: 0;
}


.inline-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inline-filter input[type="month"] {
  width: auto;
  min-width: 150px;
}


/* Mobile: menu retrátil e ajustes responsivos */
.sidebar-overlay,
.mobile-menu-button,
.mobile-sidebar-close {
  display: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-title {
  min-width: 0;
}

.topbar-title h1 {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .app-layout {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0;
    width: min(88vw, 340px);
    max-width: 340px;
    height: 100dvh !important;
    z-index: 1001;
    transform: translateX(-105%);
    transition: transform .24s ease;
    padding: 18px;
    gap: 16px;
    box-shadow: 26px 0 80px rgba(2, 6, 23, .35);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, .56);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-sidebar-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-menu-button {
    display: inline-grid;
    place-items: center;
    gap: 4px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(20,31,56,.08);
    cursor: pointer;
  }

  .mobile-menu-button span {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
  }

  .main {
    padding: 16px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: -16px -16px 18px;
    padding: 12px 16px;
    background: rgba(244,246,251,.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226,232,240,.86);
    display: grid;
    gap: 12px;
  }

  .topbar-left {
    width: 100%;
  }

  .topbar-card {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
  }

  .hero-panel {
    display: grid;
    align-items: start;
    padding: 22px;
    border-radius: 22px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 150px;
  }

  .panel {
    padding: 18px;
    border-radius: 18px;
  }

  .panel-header {
    display: grid;
    gap: 12px;
  }

  .panel-header .btn,
  .panel-header .action-row,
  .filters .filter-actions,
  .form-actions {
    width: 100%;
  }

  .filters .filter-actions,
  .form-actions,
  .action-row {
    flex-wrap: wrap;
  }

  .filters .filter-actions .btn,
  .form-actions .btn,
  .action-row .btn {
    flex: 1 1 140px;
  }

  .cards-grid.four,
  .cards-grid.five,
  .cards-grid.six,
  .cards-grid.three,
  .content-grid.two,
  .form-grid.two,
  .form-grid.three,
  .filters {
    grid-template-columns: 1fr !important;
  }

  .table-wrap {
    margin-left: -4px;
    margin-right: -4px;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    min-width: 760px;
  }

  .table-wrap::after {
    content: "Arraste para o lado para ver mais";
    display: block;
    padding: 9px 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    background: #f8fafc;
    border-top: 1px solid var(--border);
  }

  .pagination {
    justify-content: center;
  }

  .inline-filter {
    width: 100%;
  }

  .inline-filter input[type="month"],
  .inline-filter .btn {
    width: 100%;
  }

  .auth-card,
  .error-card {
    padding: 26px;
    border-radius: 22px;
  }
}

@media (max-width: 520px) {
  .main {
    padding: 12px;
  }

  .topbar {
    margin: -12px -12px 16px;
    padding: 10px 12px;
  }

  .topbar h1 {
    font-size: clamp(22px, 8vw, 30px);
  }

  .brand-logo-full {
    width: min(100%, 260px);
  }

  .hero-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .hero-panel h2 {
    font-size: clamp(22px, 8vw, 30px);
  }

  .panel,
  .metric-card {
    border-radius: 16px;
  }

  .panel {
    padding: 16px;
  }

  .btn {
    width: 100%;
  }

  .topbar .mobile-menu-button {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .sidebar {
    width: min(92vw, 330px);
  }

  .modal-content,
  .modal-content.large {
    padding: 16px !important;
  }
}


/* Correção definitiva: menu retrátil no desktop e oculto por padrão no mobile */
.sidebar-overlay {
  display: none;
}

.sidebar-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-sidebar-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.sidebar-toggle-button,
.mobile-menu-button {
  display: inline-grid !important;
  place-items: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(20,31,56,.08);
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.sidebar-toggle-button:hover,
.mobile-menu-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(20,31,56,.12);
}

.sidebar-toggle-button span,
.mobile-menu-button span {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: transform .18s ease, opacity .18s ease;
}

.sidebar-toggle-button.is-active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.sidebar-toggle-button.is-active span:nth-child(2) {
  opacity: 0;
}
.sidebar-toggle-button.is-active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-title {
  min-width: 0;
}

.topbar-title h1 {
  overflow-wrap: anywhere;
}

.app-layout {
  transition: grid-template-columns .22s ease;
}

body.sidebar-collapsed .app-layout {
  grid-template-columns: 1fr !important;
}

body.sidebar-collapsed .sidebar,
body.sidebar-collapsed .sidebar-overlay {
  display: none !important;
}

body.sidebar-collapsed .main {
  width: 100%;
}

/* Mobile precisa iniciar sempre sem menu ocupando a tela */
@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .app-layout {
    display: block !important;
    grid-template-columns: 1fr !important;
    min-height: 100vh;
  }

  .main {
    width: 100%;
    min-width: 0;
    padding: 16px;
  }

  .sidebar {
    display: flex !important;
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: min(88vw, 340px) !important;
    max-width: 340px !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 1001 !important;
    transform: translateX(-110%) !important;
    transition: transform .24s ease !important;
    padding: 18px !important;
    gap: 16px !important;
    overflow-y: auto !important;
    box-shadow: 26px 0 80px rgba(2, 6, 23, .35) !important;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0) !important;
  }

  body.sidebar-collapsed .sidebar {
    display: flex !important;
    transform: translateX(-110%) !important;
  }

  .sidebar-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1000 !important;
    background: rgba(15, 23, 42, .56) !important;
    backdrop-filter: blur(3px);
    opacity: 0;
    display: block !important;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  body.sidebar-open .sidebar-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: -16px -16px 18px;
    padding: 12px 16px;
    background: rgba(244,246,251,.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226,232,240,.86);
    display: grid !important;
    gap: 12px;
  }

  .topbar-left,
  .topbar-card {
    width: 100%;
    min-width: 0;
  }

  .topbar h1 {
    font-size: clamp(22px, 7vw, 32px);
  }

  .hero-panel {
    display: grid !important;
    align-items: start;
    padding: 22px;
    border-radius: 22px;
  }

  .hero-actions,
  .panel-header .btn,
  .panel-header .action-row,
  .filters .filter-actions,
  .form-actions {
    width: 100%;
  }

  .hero-actions .btn,
  .filters .filter-actions .btn,
  .form-actions .btn,
  .action-row .btn {
    flex: 1 1 140px;
  }

  .panel {
    padding: 18px;
    border-radius: 18px;
  }

  .panel-header {
    display: grid !important;
    gap: 12px;
  }

  .cards-grid,
  .cards-grid.four,
  .cards-grid.five,
  .cards-grid.six,
  .cards-grid.three,
  .content-grid.two,
  .form-grid.two,
  .form-grid.three,
  .filters,
  .filters.full-filters,
  .quick-actions-grid,
  .vehicle-card-grid {
    grid-template-columns: 1fr !important;
  }

  .filters.full-filters .filter-wide {
    grid-column: auto !important;
  }

  .table-wrap {
    margin-left: -4px;
    margin-right: -4px;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    min-width: 760px;
  }

  .table-wrap::after {
    content: "Arraste para o lado para ver mais";
    display: block;
    padding: 9px 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    background: #f8fafc;
    border-top: 1px solid var(--border);
  }

  .pagination,
  .table-footer {
    justify-content: center;
  }

  .inline-filter,
  .inline-filter input[type="month"],
  .inline-filter .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .main {
    padding: 12px;
  }

  .topbar {
    margin: -12px -12px 16px;
    padding: 10px 12px;
  }

  .sidebar {
    width: min(92vw, 330px) !important;
  }

  .auth-card,
  .error-card {
    padding: 24px;
    border-radius: 20px;
  }

  .panel {
    padding: 16px;
  }

  .hero-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .btn {
    min-height: 44px;
  }
}


/* Orbyx menu final: regras com maior prioridade para desktop e mobile */
@media (min-width: 901px) {
  html:not(.sidebar-collapsed) .app-layout,
  body:not(.sidebar-collapsed) .app-layout {
    display: grid !important;
    grid-template-columns: 280px 1fr !important;
  }

  html.sidebar-collapsed .app-layout,
  body.sidebar-collapsed .app-layout {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  html.sidebar-collapsed .sidebar,
  body.sidebar-collapsed .sidebar,
  html.sidebar-collapsed .sidebar-overlay,
  body.sidebar-collapsed .sidebar-overlay {
    display: none !important;
  }

  html.sidebar-collapsed .main,
  body.sidebar-collapsed .main {
    width: 100% !important;
    max-width: 100% !important;
  }

  .sidebar-toggle-button {
    display: inline-grid !important;
  }
}

@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden !important;
  }

  .app-layout {
    display: block !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    min-height: 100vh !important;
  }

  .main {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
  }

  .sidebar {
    display: flex !important;
    position: fixed !important;
    left: 0 !important;
    right: auto !important;
    top: 0 !important;
    bottom: 0 !important;
    width: min(88vw, 340px) !important;
    max-width: 340px !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 1001 !important;
    transform: translate3d(-120%, 0, 0) !important;
    visibility: hidden !important;
    pointer-events: none !important;
    overflow-y: auto !important;
    transition: transform .24s ease, visibility .24s ease !important;
  }

  html.sidebar-open .sidebar,
  body.sidebar-open .sidebar {
    transform: translate3d(0, 0, 0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .sidebar-overlay {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 1000 !important;
    background: rgba(15, 23, 42, .56) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity .2s ease !important;
  }

  html.sidebar-open .sidebar-overlay,
  body.sidebar-open .sidebar-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .sidebar-toggle-button,
  .mobile-menu-button {
    display: inline-grid !important;
  }
}


/* Dashboard profissional Orbyx */
.dashboard-main {
  padding-bottom: 42px;
}

.dashboard-hero {
  background:
    linear-gradient(135deg, rgba(15,23,42,.98), rgba(30,64,175,.92) 52%, rgba(15,118,110,.90)),
    radial-gradient(circle at 84% 20%, rgba(34,197,94,.36), transparent 30%);
}

.dashboard-month-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.dashboard-month-form label {
  display: grid;
  gap: 6px;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 900;
}

.dashboard-month-form input[type="month"] {
  min-width: 160px;
  border-color: rgba(255,255,255,.24);
  background: rgba(255,255,255,.12);
  color: #fff;
}

.dashboard-month-form input[type="month"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: .9;
}

.dashboard-metrics .metric-card {
  position: relative;
  overflow: hidden;
}

.dashboard-metrics .metric-card::after {
  content: "";
  position: absolute;
  width: 76px;
  height: 76px;
  right: -28px;
  top: -28px;
  border-radius: 999px;
  background: rgba(41,82,204,.08);
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  gap: 22px;
  margin-bottom: 22px;
}

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

.chart-panel-wide {
  grid-column: span 2;
}

.chart-panel {
  min-width: 0;
}

.chart-panel .panel-header {
  margin-bottom: 10px;
}

.chart-box {
  min-height: 300px;
  width: 100%;
}

.chart-box .apexcharts-canvas {
  margin: 0 auto;
}

.chart-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
}

.alerts-panel {
  display: flex;
  flex-direction: column;
}

.alerts-list {
  display: grid;
  gap: 12px;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.alert-item strong {
  display: block;
  margin-bottom: 4px;
}

.alert-item small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.alert-dot {
  width: 12px;
  height: 12px;
  min-width: 12px;
  border-radius: 999px;
  margin-top: 4px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148,163,184,.14);
}

.alert-item.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.alert-item.success .alert-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(15,138,95,.14);
}

.alert-item.warning {
  background: #fffbeb;
  border-color: #fde68a;
}

.alert-item.warning .alert-dot {
  background: #d97706;
  box-shadow: 0 0 0 4px rgba(217,119,6,.15);
}

.alert-item.danger {
  background: #fef2f2;
  border-color: #fecaca;
}

.alert-item.danger .alert-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(192,57,43,.14);
}

.mini-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.mini-summary-grid div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #f8fafc;
}

.mini-summary-grid span,
.mini-summary-grid strong {
  display: block;
}

.mini-summary-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.mini-summary-grid strong {
  margin-top: 6px;
  font-size: 15px;
}

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

  .chart-panel-wide {
    grid-column: auto;
  }

  .mini-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-month-form,
  .dashboard-month-form label,
  .dashboard-month-form input,
  .dashboard-month-form .btn {
    width: 100%;
  }

  .chart-box {
    min-height: 260px;
  }

  .mini-summary-grid {
    grid-template-columns: 1fr;
  }
}


/* Melhorias financeiras para uso diário */
.advanced-fields {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #f8fafc;
}

.advanced-fields summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--primary);
}

.advanced-fields .form-grid {
  margin-top: 14px;
}

.goal-list {
  display: grid;
  gap: 14px;
}

.goal-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f8fafc;
}

.goal-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.goal-card-head strong,
.goal-card-head small {
  display: block;
}

.goal-card-head small {
  color: var(--muted);
  margin-top: 4px;
}

.goal-progress {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin-bottom: 8px;
}

.goal-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--success));
}

.code-sample {
  white-space: pre-wrap;
  overflow-x: auto;
  padding: 14px;
  border-radius: 14px;
  background: #0f172a;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.5;
}

.btn.danger,
.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.btn.danger:hover,
.btn-danger:hover {
  background: var(--danger-bg);
}

.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .goal-card-head {
    display: grid;
  }

  .goal-card-head .btn {
    width: 100%;
  }
}

.compact-metric {
  margin: 16px 0;
  box-shadow: none;
}
