:root {
  --bg: #f4f7f4;
  --panel: #ffffff;
  --panel-2: #f8fbf8;
  --ink: #1f2923;
  --muted: #637067;
  --line: #dbe4dd;
  --primary: #18794e;
  --primary-2: #0f5f3b;
  --accent: #d17b0f;
  --cyan: #177e89;
  --red: #b64242;
  --violet: #6554c0;
  --shadow: 0 18px 45px rgba(27, 44, 34, 0.12);
  --radius: 8px;
  --sidebar: #15261c;
  --sidebar-2: #20362a;
}

/* Dashboard premium e shell SaaS */
:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #15803d;
  --primary-2: #166534;
  --accent: #f59e0b;
  --cyan: #0284c7;
  --violet: #7c3aed;
  --red: #dc2626;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --sidebar: #ffffff;
  --sidebar-2: #f8fafc;
}

body {
  background:
    radial-gradient(circle at 16% 0%, rgba(21, 128, 61, 0.09), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(2, 132, 199, 0.08), transparent 28%),
    var(--bg);
}

.app-shell {
  grid-template-columns: 282px minmax(0, 1fr);
  transition: grid-template-columns 300ms ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 86px minmax(0, 1fr);
}

.sidebar {
  color: var(--ink);
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  border-right: 1px solid var(--line);
  box-shadow: 14px 0 38px rgba(15, 23, 42, 0.04);
}

.brand {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
  padding: 8px 6px 18px;
  border-bottom: 0;
}

.brand img,
.login-brand img {
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(21, 128, 61, 0.14);
}

.brand strong {
  color: var(--primary-2);
  font-size: 16px;
  line-height: 1.15;
}

.brand span,
.sidebar-user span {
  color: var(--muted);
}

.sidebar-collapse-btn {
  color: var(--primary-2);
  background: #ecfdf5;
  border-color: #bbf7d0;
}

body.sidebar-collapsed .brand {
  grid-template-columns: 48px;
  justify-content: center;
}

body.sidebar-collapsed .brand div,
body.sidebar-collapsed .sidebar-collapse-btn,
body.sidebar-collapsed .nav-btn span,
body.sidebar-collapsed .sidebar-user > div:first-child {
  display: none;
}

.side-nav {
  gap: 8px;
}

.nav-btn {
  position: relative;
  min-height: 48px;
  border-radius: 12px;
  color: var(--ink);
  padding: 11px 13px;
  transition: transform 200ms ease, background 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.nav-btn:hover {
  color: var(--primary-2);
  background: #ecfdf5;
  transform: translateX(2px);
}

.nav-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #15803d, #047857);
  box-shadow: 0 14px 28px rgba(21, 128, 61, 0.22);
}

body.sidebar-collapsed .nav-btn {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .nav-btn:hover::after {
  content: attr(title);
  position: absolute;
  left: 62px;
  z-index: 30;
  min-width: max-content;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-user {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.sidebar-user-actions .icon-btn {
  color: var(--primary-2);
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.sidebar-user-actions .icon-btn:hover {
  background: #dcfce7;
}

body.sidebar-collapsed .sidebar-user {
  justify-content: center;
  padding: 10px 6px;
}

body.sidebar-collapsed .sidebar-user-actions {
  display: grid;
}

.topbar {
  min-height: 86px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  background: rgba(248, 250, 252, 0.88);
}

.topbar h1 {
  font-size: 26px;
  font-weight: 800;
}

.topbar-actions {
  align-items: center;
}

.notification-btn {
  position: relative;
  border-radius: 12px;
}

.notification-btn em {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--primary);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.topbar-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #15803d);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.16);
  font-weight: 800;
}

.content {
  width: min(1540px, 100%);
}

.btn,
.icon-btn,
input,
select,
textarea {
  border-radius: 12px;
}

.btn {
  min-height: 42px;
  font-weight: 750;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.btn-primary {
  border-color: var(--primary);
  background: linear-gradient(135deg, #15803d, #047857);
  box-shadow: 0 14px 26px rgba(21, 128, 61, 0.18);
}

.dashboard-surface {
  display: grid;
  gap: 18px;
  animation: dashboardEnter 420ms ease both;
}

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

.dashboard-command-bar,
.dash-card,
.dash-kpi {
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.dashboard-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-command-bar h2 {
  margin: 5px 0 4px;
  font-size: 28px;
}

.dashboard-command-bar p {
  margin: 0;
  color: var(--muted);
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.period-control {
  min-width: 154px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.period-control select {
  min-height: 40px;
  border: 0;
  padding-inline: 2px;
  box-shadow: none;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 16px;
}

.dash-kpi {
  position: relative;
  min-height: 172px;
  overflow: hidden;
  padding: 20px;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.dash-kpi:hover,
.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.11);
}

.dash-kpi-top {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.dash-kpi-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--primary);
  background: #dcfce7;
}

.dash-kpi-blue .dash-kpi-icon {
  color: #2563eb;
  background: #dbeafe;
}

.dash-kpi-cyan .dash-kpi-icon {
  color: #0284c7;
  background: #e0f2fe;
}

.dash-kpi-violet .dash-kpi-icon {
  color: #7c3aed;
  background: #ede9fe;
}

.dash-kpi-amber .dash-kpi-icon {
  color: #d97706;
  background: #fef3c7;
}

.dash-kpi strong {
  display: block;
  margin-top: 14px;
  font-size: 26px;
}

.dash-kpi p {
  min-height: 20px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dash-delta {
  font-weight: 800;
}

.dash-delta.positive {
  color: var(--primary);
}

.dash-delta.negative {
  color: var(--red);
}

.sparkline {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 12px;
  width: calc(100% - 36px);
  height: 42px;
}

.sparkline polyline,
.sparkline path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.4;
}

.sparkline-blue polyline {
  stroke: #2563eb;
}

.sparkline-cyan polyline {
  stroke: #0284c7;
}

.sparkline-violet polyline {
  stroke: #7c3aed;
}

.sparkline-amber polyline {
  stroke: #f59e0b;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr);
  gap: 18px;
}

.dashboard-insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) minmax(0, 1.18fr);
  gap: 18px;
}

.dash-card {
  min-width: 0;
  padding: 20px;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

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

.dash-card-head.compact {
  align-items: center;
}

.dash-card h3 {
  margin: 0;
  font-size: 17px;
}

.dash-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dash-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.link-button {
  border: 0;
  color: var(--primary-2);
  background: transparent;
  font-weight: 800;
}

.chart-legend {
  display: flex;
  gap: 18px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.legend-line {
  width: 28px;
  height: 6px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 999px;
  vertical-align: middle;
}

.legend-line.green {
  background: var(--primary);
}

.legend-line.blue {
  background: #2563eb;
}

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

.chart-gridline {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.line-area {
  fill: url(#litersArea);
}

.line-path {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-path.green,
.chart-point.green {
  stroke: var(--primary);
  fill: var(--primary);
}

.line-path.blue,
.chart-point.blue {
  stroke: #2563eb;
  fill: #2563eb;
}

.chart-point {
  stroke: #ffffff;
  stroke-width: 2;
}

.alert-stack,
.dash-bar-list,
.driver-ranking {
  display: grid;
  gap: 14px;
}

.alert-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
}

.alert-item > div {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #2563eb;
}

.alert-item.success > div {
  background: var(--primary);
}

.alert-item.warning > div {
  background: #f59e0b;
}

.alert-item.neutral > div {
  background: #7c3aed;
}

.alert-item strong,
.alert-item small {
  display: block;
}

.alert-item small {
  margin-top: 4px;
  color: var(--muted);
}

.dash-doughnut-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.dash-doughnut {
  width: 144px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.dash-doughnut span {
  width: 86px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  text-align: center;
}

.dash-doughnut strong,
.dash-doughnut small {
  display: block;
}

.dash-doughnut small {
  color: var(--muted);
  font-size: 11px;
}

.dash-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
}

.dash-bar-label span {
  color: var(--ink);
  font-weight: 800;
}

.dash-bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.dash-bar-track span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--primary);
}

.driver-ranking article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.rank-medal {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e2e8f0;
  font-weight: 900;
}

.rank-1 {
  background: #fef3c7;
  color: #92400e;
}

.rank-2 {
  background: #e2e8f0;
  color: #334155;
}

.rank-3 {
  background: #fed7aa;
  color: #9a3412;
}

.driver-ranking b {
  white-space: nowrap;
}

.dash-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.dashboard-search {
  max-width: 460px;
  min-width: 280px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.dashboard-search input {
  border: 0;
  box-shadow: none;
}

.dashboard-table-wrap {
  border-radius: 14px;
}

.dashboard-table th button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.dashboard-table tbody tr {
  transition: background 160ms ease;
}

.dashboard-table tbody tr:hover {
  background: #f8fafc;
}

.dash-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.dash-pagination > div {
  display: flex;
  gap: 8px;
}

@media (max-width: 1180px) {
  .dashboard-kpi-grid,
  .dashboard-main-grid,
  .dashboard-insights-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-main-grid .dash-card-large,
  .dashboard-table-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body.sidebar-collapsed .app-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-command-bar,
  .dash-table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-toolbar,
  .dashboard-kpi-grid,
  .dashboard-main-grid,
  .dashboard-insights-grid {
    grid-template-columns: 1fr;
  }

  .dash-doughnut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(24, 121, 78, 0.08), transparent 240px),
    var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(21, 38, 28, 0.86), rgba(24, 121, 78, 0.74)),
    var(--login-bg-image, url("./assets/semed.jpg")) center / cover;
}

.login-panel {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand img,
.brand img {
  width: 58px;
  height: 48px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  padding: 3px;
}

.login-brand strong,
.brand strong {
  display: block;
  font-size: 18px;
}

.login-brand span,
.brand span {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.login-link {
  width: fit-content;
  justify-self: center;
  border: 0;
  color: var(--primary-2);
  background: transparent;
  padding: 2px 4px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-link:hover {
  color: var(--primary);
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  padding: 9px 10px;
  outline: none;
}

input[readonly] {
  cursor: not-allowed;
  color: var(--primary-2);
  background: var(--panel-2);
  border-style: dashed;
  font-weight: 700;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 121, 78, 0.14);
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.is-field-invalid {
  color: var(--red) !important;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"],
.is-field-invalid-control {
  border-color: var(--red) !important;
  background: #fff7f7 !important;
  box-shadow: 0 0 0 3px rgba(239, 63, 59, 0.16) !important;
}

.field-error-message {
  display: block;
  grid-column: 1 / -1;
  margin-top: 6px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.field-with-action + .field-error-message,
.vehicle-lookup-field + .field-error-message,
.location-combo + .field-error-message {
  margin-top: 4px;
}

.login-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.remember-login {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -2px;
  color: var(--primary-2);
  font-size: 13px;
  font-weight: 700;
}

.remember-login input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.remember-login[hidden] {
  display: none !important;
}

.developer-credit {
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
}

.login-credit {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--primary-2);
  text-align: center;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 16px;
  color: #eef6ef;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
}

.brand {
  padding: 6px 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand span {
  color: rgba(238, 246, 239, 0.72);
}

.side-nav {
  display: grid;
  gap: 5px;
}

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  padding: 9px 11px;
  text-align: left;
}

.nav-btn:hover,
.nav-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.nav-btn.active {
  box-shadow: inset 3px 0 0 #ffc857;
}

.nav-btn svg,
.btn svg,
.icon-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke: currentColor;
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
}

.sidebar-user span {
  color: rgba(238, 246, 239, 0.72);
  font-size: 12px;
}

.sidebar-user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-user-actions .icon-btn {
  color: #eef6ef;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-user-actions .icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 78px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 247, 244, 0.92);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

body[data-environment]:not([data-environment="producao"]) .topbar h1::after {
  content: "TESTE";
  display: inline-flex;
  margin-left: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #7a4300;
  background: rgba(209, 123, 15, 0.16);
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar .main-credit {
  margin-top: 3px;
  color: var(--primary-2);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.content {
  width: min(1440px, 100%);
  padding: 24px 28px 42px;
}

.btn,
.icon-btn {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  min-height: 38px;
  padding: 8px 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn:disabled,
.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.btn-primary {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-2);
}

.btn-danger {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.72);
}

.btn-soft {
  border-color: rgba(24, 121, 78, 0.18);
  color: var(--primary-2);
  background: rgba(24, 121, 78, 0.1);
}

.icon-btn {
  width: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.toolbar,
.filter-bar,
.page-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-heading {
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-heading h2 {
  margin: 0;
  font-size: 20px;
}

.page-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.filter-bar {
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.filter-bar label {
  min-width: 170px;
  flex: 1;
}

.search-field {
  min-width: 260px;
  flex: 1 1 280px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.kpi-card,
.panel,
.stat-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 26px rgba(35, 51, 41, 0.06);
}

.kpi-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.kpi-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
}

.kpi-icon.green {
  background: var(--primary);
}

.kpi-icon.amber {
  background: var(--accent);
}

.kpi-icon.cyan {
  background: var(--cyan);
}

.kpi-icon.violet {
  background: var(--violet);
}

.kpi-icon.red {
  background: var(--red);
}

.kpi-card span {
  color: var(--muted);
  font-size: 12px;
}

.kpi-card strong {
  display: block;
  margin-top: 2px;
  font-size: 24px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
}

.dashboard-grid-requests {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.dashboard-request-list {
  display: grid;
  gap: 10px;
}

.dashboard-request-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.dashboard-request-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
}

.dashboard-request-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.dashboard-request-title strong {
  font-size: 14px;
}

.dashboard-request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-request-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ranking-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ranking-grid h4 {
  margin: 0 0 12px;
  font-size: 13px;
}

.panel {
  padding: 16px;
  min-width: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-header h3 {
  margin: 0;
  font-size: 16px;
}

.panel-header span {
  color: var(--muted);
  font-size: 12px;
}

.chart-wrap {
  min-height: 240px;
  display: grid;
  align-items: end;
}

.bar-chart {
  width: 100%;
  height: 260px;
}

.chart-axis {
  fill: var(--muted);
  font-size: 11px;
}

.fuel-dashboard-grid {
  display: grid;
  gap: 16px;
}

.fuel-dashboard-grid h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 13px;
}

.fuel-dashboard-grid .donut-row {
  grid-template-columns: 128px 1fr;
  gap: 14px;
}

.fuel-dashboard-grid .donut {
  width: 122px;
}

.fuel-dashboard-grid .donut span {
  width: 76px;
  font-size: 12px;
}

.donut-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 18px;
  align-items: center;
}

.donut {
  width: 160px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0 60%, var(--accent) 60% 82%, var(--cyan) 82% 100%);
}

.donut span {
  width: 92px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--panel);
  font-weight: 700;
}

.legend {
  display: grid;
  gap: 9px;
}

.legend-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

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

.hbar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.hbar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2ed;
}

.hbar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  color: var(--muted);
  background: #f6faf6;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.ticket-list {
  display: grid;
  gap: 10px;
}

.ticket-list-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.ticket-id,
.ticket-info-grid div {
  min-width: 0;
}

.ticket-id span,
.ticket-info-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.ticket-id strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.ticket-id small {
  display: inline-flex;
  margin-top: 7px;
}

.ticket-status {
  min-height: 22px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef3ef;
  font-size: 11px;
  font-weight: 700;
}

.ticket-status.pending {
  color: #7a4300;
  background: rgba(209, 123, 15, 0.15);
}

.ticket-status.approved {
  color: var(--primary-2);
  background: rgba(24, 121, 78, 0.14);
}

.ticket-status.refused {
  color: var(--red);
  background: rgba(182, 66, 66, 0.12);
}

.ticket-status.emitted {
  color: #fff;
  background: var(--primary);
}

.ticket-status.voided {
  color: #111;
  background: repeating-linear-gradient(135deg, rgba(182, 66, 66, 0.18), rgba(182, 66, 66, 0.18) 6px, rgba(182, 66, 66, 0.08) 6px, rgba(182, 66, 66, 0.08) 12px);
  border: 1px solid rgba(182, 66, 66, 0.35);
}

.ticket-info-grid {
  display: grid;
  grid-template-columns: 84px minmax(110px, 1.3fr) 92px 92px;
  gap: 10px;
  min-width: 0;
  align-items: start;
}

.ticket-info-grid.history {
  grid-template-columns: 80px minmax(140px, 1fr);
}

.ticket-info-grid.approval {
  grid-template-columns: minmax(140px, 1.2fr) 90px minmax(120px, 1fr) 130px;
}

.tickets-panel {
  margin-top: 16px;
}

.approval-panel {
  border-color: rgba(209, 123, 15, 0.28);
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
}

.ticket-list-wide {
  gap: 8px;
}

.ticket-list-item-wide {
  grid-template-columns: 86px minmax(0, 1fr) auto;
}

.ticket-info-grid.ticket-single {
  grid-template-columns: 82px 92px minmax(150px, 1.2fr) 110px 92px;
}

.ticket-info-grid strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.ticket-action {
  justify-self: end;
}

.ticket-action-stack {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.ticket-filter-bar label {
  min-width: 190px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--primary-2);
  background: rgba(24, 121, 78, 0.1);
}

.badge.warn {
  color: #7a4300;
  background: rgba(209, 123, 15, 0.14);
}

.badge.red {
  color: var(--red);
  background: rgba(182, 66, 66, 0.1);
}

.contract-limits-panel {
  margin-top: 18px;
}

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

.contract-limit-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.contract-limit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.contract-limit-head span,
.contract-fuel-title span,
.contract-fuel-metrics span,
.contract-fuel-preview span,
.contract-fuel-preview small {
  color: var(--muted);
  font-size: 12px;
}

.contract-limit-head strong,
.contract-fuel-title strong {
  display: block;
  margin-top: 2px;
}

.contract-fuel-list,
.contract-fuel-preview {
  display: grid;
  gap: 10px;
}

.contract-fuel-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: var(--panel-2);
}

.contract-fuel-row.attention {
  border-left-color: var(--accent);
  background: rgba(209, 123, 15, 0.08);
}

.contract-fuel-row.alert {
  border-left-color: #b66a00;
  background: rgba(209, 123, 15, 0.14);
}

.contract-fuel-row.exceeded {
  border-left-color: var(--red);
  background: rgba(182, 66, 66, 0.10);
}

.contract-fuel-row.no-quota {
  border-left-color: var(--muted);
}

.contract-fuel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.contract-fuel-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 8px;
}

.contract-fuel-metrics > div {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.contract-fuel-metrics strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.contract-quota-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 41, 35, 0.12);
}

.contract-quota-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.contract-fuel-row.attention .contract-quota-meter span,
.contract-fuel-row.alert .contract-quota-meter span {
  background: var(--accent);
}

.contract-fuel-row.exceeded .contract-quota-meter span {
  background: var(--red);
}

.contract-fuel-preview {
  padding: 14px;
  border: 1px solid rgba(24, 121, 78, 0.22);
  border-radius: 8px;
  background: rgba(24, 121, 78, 0.07);
}

.contract-fuel-preview h3 {
  margin: 0;
  font-size: 16px;
}

.contract-fuel-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.contract-fuel-preview-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.contract-fuel-preview-item strong {
  display: block;
  margin: 4px 0;
  font-size: 18px;
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(35, 51, 41, 0.045);
}

.audit-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--primary-2);
  background: rgba(24, 121, 78, 0.09);
}

.audit-main {
  min-width: 0;
}

.audit-card-head,
.audit-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.audit-card-head strong {
  font-size: 15px;
}

.audit-card-head span,
.audit-meta span {
  color: var(--muted);
  font-size: 12px;
}

.audit-main p {
  margin: 4px 0 7px;
  color: var(--ink);
  font-size: 13px;
}

.audit-meta span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
}

.audit-detail {
  display: grid;
  gap: 14px;
}

.audit-json-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.audit-json-grid h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.audit-json-grid pre {
  min-height: 180px;
  max-height: 340px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--panel-2);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 16px;
}

.stat-strip div {
  padding: 14px 16px;
  background: var(--panel);
}

.stat-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat-strip strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(21, 38, 28, 0.48);
}

.modal-card {
  width: min(980px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-grid .span-3 {
  grid-column: 1 / -1;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form-note strong {
  color: var(--ink);
}

.reset-delivery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.vehicle-lookup-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: stretch;
}

.vehicle-lookup-field input[data-vehicle-lookup] {
  width: 100%;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.vehicle-lookup-toggle {
  position: relative;
  min-height: 40px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: var(--panel);
  cursor: pointer;
}

.vehicle-lookup-toggle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -35%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--ink);
}

.vehicle-lookup-toggle:hover,
.vehicle-lookup-toggle:focus-visible {
  border-color: rgba(239, 63, 59, 0.38);
  outline: none;
}

.vehicle-lookup-panel {
  position: absolute;
  z-index: 75;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: min(280px, 44vh);
  overflow-y: auto;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(35, 51, 41, 0.18);
}

.vehicle-lookup-panel[hidden] {
  display: none;
}

.vehicle-lookup-option {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.vehicle-lookup-option:hover,
.vehicle-lookup-option:focus-visible {
  border-color: rgba(239, 63, 59, 0.28);
  background: #fff7f5;
  outline: none;
}

.vehicle-lookup-option strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle-lookup-option span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle-lookup-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
}

.location-field {
  align-items: start;
}

.location-field input[data-location-input] {
  width: 100%;
  min-width: 0;
}

.location-combo {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field-action-btn {
  width: 40px;
  min-height: 40px;
}

.location-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(21, 38, 28, 0.56);
}

.location-picker-card {
  width: min(620px, 100%);
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.location-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.location-picker-header h3 {
  margin: 0;
  font-size: 17px;
}

.location-picker-body {
  display: grid;
  gap: 14px;
  padding: 18px;
  overflow: auto;
}

.location-add,
.location-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.location-list {
  display: grid;
  gap: 8px;
}

.location-row {
  grid-template-columns: minmax(0, 1fr) 38px 38px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.location-row-edit {
  grid-template-columns: minmax(0, 1fr) 38px 38px;
}

.location-select {
  min-height: 38px;
  border: 0;
  color: var(--ink);
  background: transparent;
  padding: 0 4px;
  text-align: left;
}

.location-select:hover {
  color: var(--primary-2);
}

.total-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(24, 121, 78, 0.22);
  border-radius: var(--radius);
  background: rgba(24, 121, 78, 0.08);
}

.total-preview strong {
  font-size: 22px;
}

.ticket-preview {
  width: min(80mm, 100%);
  max-width: 320px;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid #111;
  border-radius: 4px;
  color: #111;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.ticket-modal-card {
  width: min(520px, calc(100vw - 28px));
}

.ticket-modal-card .modal-body {
  display: grid;
  place-items: center;
  padding: 20px;
  background: #fbf8f6;
}

.ticket-modal-card .ticket-preview {
  width: min(88mm, 100%);
  max-width: 360px;
}

.ticket-modal-card .modal-footer {
  position: sticky;
  bottom: 0;
  background: var(--panel);
}

.ticket-preview *,
.thermal-ticket-print * {
  font-weight: 700;
}

.ticket-head {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 6px;
  align-items: center;
  border-bottom: 2px solid #111;
  padding-bottom: 5px;
  margin-bottom: 5px;
  text-align: center;
}

.ticket-head img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: grayscale(1) contrast(1.12);
}

.ticket-head strong,
.report-print strong {
  display: block;
}

.ticket-head span {
  display: block;
  margin-top: 1px;
}

.ticket-head strong,
.ticket-head span {
  white-space: nowrap;
}

.ticket-lines {
  display: grid;
  gap: 0;
}

.ticket-lines div {
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr);
  gap: 5px;
  align-items: start;
  border-bottom: 1px dashed #333;
  padding: 3px 0;
}

.ticket-lines span {
  text-transform: uppercase;
}

.ticket-lines strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.ticket-lines .ticket-liters {
  grid-template-columns: 1fr;
  gap: 1px;
  padding: 5px 0;
  border-top: 2px solid #111;
  border-bottom: 2px solid #111;
  text-align: center;
}

.ticket-lines .ticket-liters strong {
  text-align: center;
  font-size: 24px;
  line-height: 1.1;
}

.ticket-lines .ticket-void-row {
  color: #111;
  background: #f1f1f1;
  border: 2px solid #111;
  padding: 4px;
}

.ticket-lines .ticket-void-row strong {
  text-align: right;
}

.ticket-total {
  margin-top: 6px;
  padding: 6px;
  color: #111;
  background: #fff;
  border: 2px solid #111;
  border-radius: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
}

.ticket-void-note {
  margin-top: 6px;
  padding: 6px;
  border: 2px solid #111;
  text-align: center;
  font-size: 12px;
  line-height: 1.25;
  color: #111;
  background: #fff;
}

.ticket-void-note small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
}

.ticket-authenticity {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
}

.ticket-authenticity strong,
.ticket-authenticity span,
.ticket-authenticity small {
  display: block;
}

.ticket-authenticity span {
  margin-top: 2px;
  color: #111;
  font-size: 10px;
}

.ticket-authenticity small {
  margin-top: 3px;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 10px;
}

.ticket-qr {
  display: grid;
  place-items: center;
}

.ticket-qr-code {
  width: 74px;
  height: 74px;
}

.signature {
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
}

.verification-mode .app-shell {
  grid-template-columns: 1fr;
}

.verification-mode .sidebar,
.verification-mode .topbar-actions,
.verification-mode #menuToggle {
  display: none;
}

.verification-mode .main {
  min-height: 100vh;
}

.verification-panel {
  max-width: 860px;
  margin: 0 auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 26px rgba(35, 51, 41, 0.06);
}

.verification-state {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.verification-state .btn-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
}

.verification-state.valid .btn-icon {
  background: var(--primary);
}

.verification-state.invalid .btn-icon {
  background: var(--red);
}

.verification-state.loading .btn-icon {
  background: var(--cyan);
}

.verification-state h2 {
  margin: 0;
}

.verification-state p {
  margin: 4px 0 0;
  color: var(--muted);
}

.verification-state small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.verification-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.verification-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.verification-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.verification-grid strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

.settings-grid .span-2 {
  grid-column: span 2;
}

.setting-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 26px rgba(35, 51, 41, 0.06);
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.brand-preview {
  grid-row: span 2;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.brand-preview img {
  width: 70px;
  height: 58px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
}

.brand-preview strong,
.brand-preview span {
  display: block;
}

.brand-preview span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(72px, 1fr));
  gap: 10px;
}

.color-field {
  min-width: 0;
}

.color-field input {
  min-height: 38px;
  padding: 4px;
}

.setting-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-form .span-3 {
  grid-column: 1 / -1;
}

.danger-zone {
  border-color: rgba(182, 66, 66, 0.28);
  background: rgba(182, 66, 66, 0.05);
}

.technical-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.technical-info div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.technical-info span,
.technical-info strong {
  display: block;
}

.technical-info span {
  color: var(--muted);
  font-size: 12px;
}

.technical-info p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.setting-tile {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.setting-tile h3 {
  margin: 0;
  font-size: 16px;
}

.setting-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.settings-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.settings-overview article {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, var(--panel-2));
  box-shadow: 0 10px 24px rgba(35, 51, 41, 0.05);
}

.settings-overview strong {
  color: var(--ink);
  font-size: 15px;
}

.settings-overview p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.settings-section {
  margin-bottom: 18px;
}

.settings-section-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 5px;
  padding: 4px 8px;
  border: 1px solid rgba(239, 61, 58, 0.16);
  border-radius: 999px;
  color: var(--primary-2);
  background: rgba(239, 61, 58, 0.07);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.settings-section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.settings-section-grid-3 {
  grid-template-columns: repeat(3, minmax(190px, 1fr));
}

.settings-section-grid-4 {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.setting-tile-wide {
  grid-column: 1 / -1;
}

.settings-section-danger {
  border-color: rgba(182, 66, 66, 0.32);
  background: linear-gradient(180deg, #fffafa, #fff5f2);
}

.setting-tile-danger {
  border-color: rgba(182, 66, 66, 0.3);
}

.setting-tile input[type="file"] {
  max-width: 100%;
}

.connection-form {
  display: grid;
  gap: 12px;
}

.secure-connection {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.secure-connection div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.secure-connection span,
.secure-connection small {
  color: var(--muted);
  font-size: 12px;
}

.secure-connection strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.connection-status {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 13px;
}

.connection-status.ok {
  border-color: rgba(24, 121, 78, 0.28);
  color: var(--primary-2);
  background: rgba(24, 121, 78, 0.08);
}

.connection-status.error {
  border-color: rgba(182, 66, 66, 0.3);
  color: var(--red);
  background: rgba(182, 66, 66, 0.07);
}

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--sidebar);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.mobile-only {
  display: none;
}

.print-mount {
  display: none;
}

.official-report {
  --report-primary: var(--primary);
  --report-primary-2: var(--primary-2);
  --report-accent: var(--accent);
  --report-ink: #1f2923;
  --report-panel: #fff;
  background: #fff;
  color: var(--report-ink);
}

.official-report-header {
  display: grid;
  grid-template-columns: 88px 1fr minmax(130px, 180px);
  gap: 14px;
  align-items: center;
  border-top: 8px solid var(--report-primary);
  border-bottom: 3px solid var(--report-accent);
  padding: 14px 0 12px;
}

.official-report-logo-box {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--report-primary) 30%, #fff);
  border-left: 7px solid var(--report-primary);
  background: #fff;
}

.official-report-logo {
  max-width: 70px;
  max-height: 70px;
  object-fit: contain;
}

.official-report-heading {
  min-width: 0;
}

.official-report-heading strong {
  display: block;
  font-size: 10px;
  line-height: 1.35;
  text-transform: uppercase;
}

.official-report-heading h1 {
  margin: 8px 0 4px;
  color: var(--report-primary-2);
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
}

.official-report-heading p,
.official-report-meta span,
.official-report-summary span,
.official-filter-grid span,
.official-report-footer span {
  color: #56645d;
}

.official-report-heading p {
  margin: 0;
  font-size: 11px;
}

.official-report-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  align-content: center;
  border-left: 3px solid color-mix(in srgb, var(--report-accent) 55%, #fff);
  padding-left: 12px;
  text-align: right;
}

.official-report-meta span {
  font-size: 9px;
  text-transform: uppercase;
}

.official-report-meta strong {
  font-size: 11px;
}

.official-report-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.official-report-summary div {
  border: 1px solid color-mix(in srgb, var(--report-primary) 18%, #d9e1dd);
  border-left: 5px solid var(--report-primary);
  padding: 8px 10px;
  background: color-mix(in srgb, var(--report-primary) 5%, #fff);
}

.official-report-summary span,
.official-filter-grid span {
  display: block;
  margin-bottom: 3px;
  font-size: 8.5px;
  text-transform: uppercase;
}

.official-report-summary strong {
  font-size: 13px;
}

.official-report-filters {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #d7dfda;
  background: #fbfdfc;
}

.official-report-filters h2 {
  margin: 0 0 8px;
  color: var(--report-primary-2);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.official-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px 10px;
}

.official-filter-grid strong {
  font-size: 10px;
  line-height: 1.25;
  word-break: break-word;
}

.official-report-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.official-report-table .report-col-ticket { width: 5.5%; }
.official-report-table .report-col-date { width: 7.2%; }
.official-report-table .report-col-vehicle { width: 8.5%; }
.official-report-table .report-col-driver { width: 14.5%; }
.official-report-table .report-col-location { width: 16.2%; }
.official-report-table .report-col-type { width: 6.7%; }
.official-report-table .report-col-fuel { width: 8.6%; }
.official-report-table .report-col-station { width: 8.5%; }
.official-report-table .report-col-contract { width: 6.8%; }
.official-report-table .report-col-liters { width: 4.7%; }
.official-report-table .report-col-price { width: 5.3%; }
.official-report-table .report-col-total { width: 7.5%; }

.official-report-table th,
.official-report-table td {
  border: 1px solid #9aa7a0;
  padding: 4px;
  font-size: 8px;
  line-height: 1.25;
  vertical-align: top;
  word-break: normal;
  overflow-wrap: anywhere;
}

.official-report-table th {
  background: var(--report-primary-2);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
}

.official-report-table .report-cell-driver,
.official-report-table .report-cell-location {
  overflow-wrap: normal;
}

.official-report-table .report-cell-ticket,
.official-report-table .report-cell-date,
.official-report-table .report-cell-vehicle,
.official-report-table .report-cell-type,
.official-report-table .report-cell-number {
  text-align: center;
}

.official-report-table .report-cell-type {
  white-space: nowrap;
}

.official-report-table .report-cell-money {
  text-align: right;
}

.official-report-table .report-nowrap {
  white-space: nowrap;
}

.official-report-table tfoot th {
  background: color-mix(in srgb, var(--report-accent) 18%, #fff);
  color: var(--report-ink);
}

.official-report-empty {
  padding: 18px;
  color: #56645d;
  text-align: center;
}

.official-report-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 2px solid var(--report-primary);
}

.official-report-footer strong {
  display: block;
  margin-top: 4px;
  font-size: 10px;
}

.official-signature {
  text-align: center;
}

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 280px;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

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

  .mobile-only {
    display: inline-grid;
  }

  .topbar {
    padding: 14px 18px;
  }

  .topbar-actions {
    display: none;
  }

  .content {
    width: 100%;
    padding: 18px 18px 34px;
  }

  .page-heading {
    align-items: stretch;
  }

  .page-heading > div:first-child {
    min-width: 0;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar .btn {
    flex: 1 1 220px;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    align-items: end;
  }

  .filter-bar label,
  .ticket-filter-bar label {
    min-width: 0;
    width: 100%;
  }

  .filter-bar .btn {
    width: 100%;
  }

  .ticket-list-item,
  .ticket-list-item-wide {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ticket-info-grid,
  .ticket-info-grid.ticket-single,
  .ticket-info-grid.history,
  .ticket-info-grid.approval {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ticket-action {
    justify-self: stretch;
  }

  .ticket-action-stack {
    min-width: 0;
  }

  .ticket-action .btn,
  .ticket-action .icon-btn {
    width: 100%;
  }

  .dashboard-grid,
  .audit-summary,
  .settings-grid,
  .settings-form,
  .technical-info {
    grid-template-columns: 1fr;
  }

  .settings-grid .span-2 {
    grid-column: auto;
  }

  .contract-fuel-metrics,
  .contract-fuel-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .color-grid {
    grid-template-columns: repeat(3, minmax(72px, 1fr));
  }
}

/* Tema institucional 2026: aprovado no Figma em 23/06/2026. */
:root {
  --bg: #fffaf7;
  --panel: #ffffff;
  --panel-2: #fff7f4;
  --ink: #1f1f24;
  --muted: #6f5c58;
  --line: #eadbd6;
  --primary: #ee4b45;
  --primary-2: #d83a35;
  --primary-hover: #e13e39;
  --primary-hover-2: #c82f2b;
  --accent: #ffc84d;
  --accent-soft: #fff3cc;
  --accent-ink: #5a3500;
  --cyan: #ff6b5f;
  --violet: #8f62db;
  --red: #e5483f;
  --danger-bg: #fee2e2;
  --shadow: 0 12px 30px rgba(120, 28, 24, 0.07);
  --radius: 8px;
  --sidebar: #ffffff;
  --sidebar-2: #fff7f4;
}

body {
  color: var(--ink);
  letter-spacing: 0;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  box-shadow: 8px 0 22px rgba(120, 28, 24, 0.05);
}

.sidebar .brand {
  grid-template-columns: 48px minmax(0, 1fr) 36px;
  padding: 10px 6px 18px;
  border-bottom: 1px solid rgba(234, 219, 214, 0.85);
}

.sidebar .brand img,
.login-brand img {
  width: 48px;
  height: 48px;
  padding: 4px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
  box-shadow: 0 8px 18px rgba(238, 75, 69, 0.10);
}

.sidebar .brand strong {
  color: #191919;
  font-size: 15px;
  font-weight: 800;
}

.sidebar .brand span,
.sidebar-user span,
.developer-credit {
  color: var(--muted);
}

.side-nav {
  gap: 6px;
  padding-top: 12px;
}

.nav-btn {
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 6px;
  color: #493936;
  font-weight: 750;
}

.nav-btn > svg {
  color: var(--primary);
  stroke: currentColor;
}

.nav-btn:hover {
  color: var(--primary-2);
  background: rgba(238, 75, 69, 0.07);
  transform: none;
}

.nav-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 20px rgba(238, 75, 69, 0.18);
}

.nav-btn.active > svg {
  color: #ffffff;
  stroke: #ffffff;
}

.sidebar-user,
.sidebar-collapse-btn,
.sidebar-user-actions .icon-btn {
  border-color: var(--line) !important;
  background: #ffffff !important;
  box-shadow: 0 8px 18px rgba(120, 28, 24, 0.06);
}

.sidebar-collapse-btn,
.sidebar-user-actions .icon-btn {
  color: var(--primary-2) !important;
}

.sidebar-collapse-btn:hover,
.sidebar-user-actions .icon-btn:hover {
  color: #ffffff !important;
  border-color: var(--primary) !important;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
}

.topbar {
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(120, 28, 24, 0.04);
}

.topbar h1 {
  color: #191919;
  font-size: 24px;
  font-weight: 800;
}

.topbar p,
.page-heading p,
.dashboard-command-bar p {
  color: var(--muted);
}

.topbar-avatar,
.notification-btn em {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 20px rgba(238, 75, 69, 0.18);
}

.content {
  width: min(1560px, 100%);
}

.login-screen {
  background:
    linear-gradient(145deg, #ffffff 0%, #fff7f4 48%, #f9d2ca 100%) !important;
}

.login-panel,
.dashboard-command-bar,
.dash-card,
.dash-kpi,
.panel,
.card,
.metric,
.table-wrap,
.dashboard-table-wrap,
.official-report,
.modal-card,
.filter-bar,
.ticket-filter-bar,
.audit-card,
.contract-limit-card,
.dashboard-request-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.dashboard-command-bar,
.page-heading {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.page-heading h2,
.dashboard-command-bar h2,
.panel h3,
.dash-card h3 {
  color: #191919;
  font-weight: 800;
}

.breadcrumb,
.section-label,
.login-credit,
.topbar .main-credit,
.link-button {
  color: var(--primary);
}

.btn,
.icon-btn,
input,
select,
textarea {
  border-radius: 6px;
}

.btn {
  min-height: 36px;
  padding: 8px 14px;
  font-weight: 750;
  box-shadow: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.btn:hover,
.icon-btn:hover {
  transform: none;
  box-shadow: 0 8px 18px rgba(120, 28, 24, 0.08);
}

.btn-primary {
  border-color: var(--primary);
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 20px rgba(238, 75, 69, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-hover-2));
}

.btn-soft {
  color: var(--accent-ink) !important;
  border-color: rgba(246, 178, 26, 0.55) !important;
  background: linear-gradient(135deg, #fff8df, var(--accent-soft)) !important;
}

.btn-ghost,
.icon-btn {
  color: var(--ink);
  border-color: var(--line);
  background: #ffffff;
}

.btn-ghost:hover,
.icon-btn:hover {
  color: var(--primary-2);
  border-color: rgba(238, 75, 69, 0.28);
  background: #fff4f2;
}

.btn-danger,
button[data-action*="delete"],
button[data-action*="clear"] {
  color: var(--primary-2);
  border-color: rgba(238, 75, 69, 0.35);
  background: var(--danger-bg);
}

.btn-danger:hover,
button[data-action*="delete"]:hover,
button[data-action*="clear"]:hover {
  color: #ffffff;
  border-color: var(--red);
  background: var(--red);
}

button[data-action*="approve"],
button[data-action="emit-approved-ticket"] {
  color: #ffffff;
  border-color: #15803d;
  background: #15803d;
}

.filter-bar,
.ticket-filter-bar,
.dash-table-toolbar {
  align-items: end;
  padding: 14px;
  background: #ffffff;
}

.filter-bar label,
.ticket-filter-bar label,
.form-grid label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

input,
select,
textarea {
  min-height: 38px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(238, 75, 69, 0.12);
}

.table-wrap,
.dashboard-table-wrap {
  overflow: auto;
  border-radius: 8px;
}

.data-table,
.dashboard-table,
table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead,
.dashboard-table thead,
table thead {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.data-table thead th,
.dashboard-table thead th,
table thead th,
.dashboard-table th button {
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table tbody tr,
.dashboard-table tbody tr,
table tbody tr {
  background: #ffffff;
}

.data-table tbody tr:hover,
.dashboard-table tbody tr:hover,
table tbody tr:hover {
  background: #fff7f4;
}

.dash-kpi {
  min-height: 138px;
  border-radius: 8px;
}

.dash-kpi::after {
  width: 96px;
  height: 18px;
  opacity: 0.72;
}

.dash-kpi:hover,
.dash-card:hover {
  transform: none;
  box-shadow: 0 14px 34px rgba(120, 28, 24, 0.09);
}

.dash-kpi-icon,
.dash-kpi-blue .dash-kpi-icon,
.dash-kpi-cyan .dash-kpi-icon,
.dash-kpi-violet .dash-kpi-icon,
.kpi-icon,
.dashboard-request-icon,
.audit-icon {
  color: var(--primary);
  border-color: rgba(238, 75, 69, 0.16);
  background: rgba(238, 75, 69, 0.09);
}

.dash-kpi-amber .dash-kpi-icon,
.kpi-icon.amber,
.kpi-icon.cyan {
  color: #9a5b00;
  border-color: rgba(246, 178, 26, 0.30);
  background: rgba(246, 178, 26, 0.18);
}

.location-picker-backdrop {
  background: rgba(33, 25, 26, 0.52);
  backdrop-filter: blur(2px);
}

.location-picker-card {
  width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(33, 25, 26, 0.22);
}

.location-picker-header {
  padding: 16px 18px;
  background: linear-gradient(180deg, #ffffff, var(--panel-2));
}

.location-picker-header h3 {
  color: #191919;
  font-size: 16px;
  font-weight: 800;
}

.location-add,
.location-row {
  gap: 10px;
}

.location-row {
  min-height: 50px;
  border-color: var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.location-row:hover {
  border-color: rgba(238, 75, 69, 0.28);
  background: #fff7f4;
}

.location-select {
  font-weight: 700;
}

.location-select:hover,
.location-select:focus-visible {
  color: var(--primary-2);
}

.ticket-status,
.badge,
.status-pill.success {
  color: var(--primary-2);
  border-color: rgba(238, 75, 69, 0.20);
  background: #ffe3df;
}

.badge.warn {
  color: #92400e;
  background: #fff3cc;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #fff7f4 100%);
  }

  .sidebar .brand,
  body.sidebar-collapsed .sidebar .brand {
    grid-template-columns: 48px minmax(0, 1fr) 36px !important;
  }

  .sidebar .brand img,
  body.sidebar-collapsed .sidebar .brand img {
    width: 48px !important;
    height: 48px !important;
  }

  .page-heading,
  .dashboard-command-bar {
    padding: 14px;
  }
}

@media (max-width: 760px) {
  .topbar-actions {
    display: none;
  }

  .kpi-grid,
  .audit-summary,
  .stat-strip,
  .form-grid,
  .settings-form,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .brand-preview,
  .technical-info,
  .ticket-authenticity,
  .verification-state,
  .contract-fuel-metrics,
  .contract-fuel-preview-grid,
  .color-grid {
    grid-template-columns: 1fr;
  }

  .verification-grid {
    grid-template-columns: 1fr;
  }

  .donut-row {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .form-grid .span-2,
  .form-grid .span-3 {
    grid-column: auto;
  }

  .ticket-list-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dashboard-request-card,
  .ranking-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-request-actions {
    justify-content: stretch;
  }

  .dashboard-request-actions .btn {
    flex: 1;
  }

  .audit-card,
  .audit-json-grid {
    grid-template-columns: 1fr;
  }

  .audit-card > .btn {
    width: 100%;
  }

  .ticket-info-grid,
  .ticket-info-grid.ticket-single,
  .ticket-info-grid.history,
  .ticket-info-grid.approval {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ticket-action {
    justify-self: stretch;
  }

  .ticket-action .btn {
    width: 100%;
  }

  .ticket-action .icon-btn {
    width: 100%;
  }

  .location-add {
    grid-template-columns: 1fr;
  }

  .page-heading {
    align-items: stretch;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar .btn,
  .filter-bar .btn {
    flex: 1;
  }
}

@media print {
  @page official-report {
    size: A4 landscape;
    margin: 6mm;
  }

  @page thermal-ticket {
    size: 80mm 210mm;
    margin: 1.5mm;
  }

  body.printing > *:not(.print-mount) {
    display: none !important;
  }

  body.printing .print-mount {
    display: block;
    color: #111;
    background: #fff;
    padding: 0;
  }

  .print-page {
    width: 100%;
    padding: 18mm;
    font-family: Arial, sans-serif;
  }

  .thermal-ticket-print {
    page: thermal-ticket;
    width: 72mm;
    max-width: 72mm;
    margin: 0 auto;
    padding: 0;
    color: #111;
    background: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9.2pt;
    line-height: 1.1;
    box-sizing: border-box;
    overflow: hidden;
  }

  .thermal-ticket-print .ticket-head,
  .thermal-ticket-print .ticket-lines div,
  .thermal-ticket-print .ticket-total,
  .thermal-ticket-print .ticket-authenticity,
  .thermal-ticket-print .signature {
    break-inside: avoid;
  }

  .thermal-ticket-print .ticket-head {
    grid-template-columns: 10.5mm minmax(0, 1fr);
    gap: 1.5mm;
    padding-bottom: 1.6mm;
    margin-bottom: 1.5mm;
  }

  .thermal-ticket-print .ticket-head img {
    width: 10mm;
    height: 10mm;
  }

  .thermal-ticket-print .ticket-head strong,
  .thermal-ticket-print .ticket-head span {
    white-space: nowrap;
    line-height: 1.08;
    font-size: 8.8pt;
  }

  .thermal-ticket-print .ticket-lines div {
    grid-template-columns: 37% minmax(0, 1fr);
    gap: 1.6mm;
    padding: 0.9mm 0;
  }

  .thermal-ticket-print .ticket-lines .ticket-liters strong {
    font-size: 20pt;
    line-height: 1;
  }

  .thermal-ticket-print .ticket-lines .ticket-liters {
    padding: 1.8mm 0;
  }

  .thermal-ticket-print .ticket-total {
    margin-top: 1.8mm;
    padding: 1.8mm;
    font-size: 13pt;
  }

  .thermal-ticket-print .ticket-authenticity {
    grid-template-columns: 21mm minmax(0, 1fr);
    gap: 1.8mm;
    margin-top: 1.8mm;
    padding: 1.8mm;
  }

  .thermal-ticket-print .ticket-qr-code {
    width: 20mm;
    height: 20mm;
  }

  .thermal-ticket-print .ticket-authenticity span,
  .thermal-ticket-print .ticket-authenticity small {
    font-size: 7pt;
    line-height: 1.1;
  }

  .thermal-ticket-print .ticket-authenticity span {
    margin-top: 0.8mm;
  }

  .thermal-ticket-print .ticket-authenticity small {
    margin-top: 1mm;
  }

  .thermal-ticket-print .signature {
    margin-top: 6mm;
    font-size: 8pt;
    line-height: 1.05;
  }

  .print-page table {
    min-width: 0;
    width: 100%;
    border-collapse: collapse;
  }

  .print-page th,
  .print-page td {
    border: 1px solid #777;
    padding: 6px;
    font-size: 10px;
  }

  .print-page th {
    background: #eee;
    color: #111;
  }

  .official-report {
    page: official-report;
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .official-report-header,
  .official-report-summary,
  .official-report-filters,
  .official-report-footer {
    break-inside: avoid;
  }

  .official-report-header {
    grid-template-columns: 68px 1fr 136px;
    gap: 9px;
    padding: 6px 0 7px;
    border-top-width: 5px;
    border-bottom-width: 2px;
  }

  .official-report-summary {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin: 7px 0;
  }

  .official-filter-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px 7px;
  }

  .official-report-logo-box {
    width: 62px;
    height: 62px;
    border-left-width: 5px;
  }

  .official-report-logo {
    max-width: 53px;
    max-height: 53px;
  }

  .official-report-heading strong {
    font-size: 8.5px;
    line-height: 1.18;
  }

  .official-report-heading h1 {
    margin: 4px 0 2px;
    font-size: 14px;
    line-height: 1.05;
  }

  .official-report-heading p {
    font-size: 9px;
  }

  .official-report-meta {
    gap: 2px;
    padding-left: 8px;
    border-left-width: 2px;
  }

  .official-report-meta span {
    font-size: 7.5px;
  }

  .official-report-meta strong {
    font-size: 9px;
  }

  .official-report-summary div {
    padding: 5px 7px;
    border-left-width: 4px;
  }

  .official-report-summary span,
  .official-filter-grid span {
    margin-bottom: 1px;
    font-size: 7px;
  }

  .official-report-summary strong {
    font-size: 10px;
  }

  .official-report-filters {
    margin-bottom: 7px;
    padding: 6px 7px;
  }

  .official-report-filters h2 {
    margin-bottom: 4px;
    font-size: 8.5px;
  }

  .official-filter-grid strong {
    font-size: 8.3px;
    line-height: 1.12;
  }

  .official-report-table {
    page-break-inside: auto;
  }

  .official-report-table thead {
    display: table-header-group;
  }

  .official-report-table tfoot {
    display: table-footer-group;
  }

  .official-report-table tr {
    break-inside: avoid;
  }

  .official-report .official-report-table th,
  .official-report .official-report-table td {
    padding: 2.5px 3px;
    font-size: 7.2px;
    line-height: 1.16;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .official-report .official-report-table th {
    background: var(--report-primary-2);
    color: #fff;
    font-size: 6.6px;
    line-height: 1;
    white-space: nowrap;
  }

  .official-report .official-report-table tfoot th {
    background: color-mix(in srgb, var(--report-accent) 18%, #fff);
    color: var(--report-ink);
  }

  .official-report .official-report-table .report-cell-driver,
  .official-report .official-report-table .report-cell-location {
    overflow-wrap: normal;
  }

  .official-report-footer {
    gap: 10px;
    margin-top: 8px;
    padding-top: 7px;
    border-top-width: 1px;
  }

  .official-report-footer span {
    font-size: 8px;
  }

  .official-report-footer strong {
    margin-top: 2px;
    font-size: 8.5px;
  }

  .official-signature span {
    line-height: 1;
  }
}

/* Ajustes de estabilidade do menu lateral e uso no APK */
.sidebar-collapse-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  color: #166534;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  box-shadow: none;
}

.sidebar-collapse-btn:hover,
.sidebar-collapse-btn:focus-visible {
  color: #0f172a;
  background: #fbbf24;
  border-color: #fde68a;
}

body.sidebar-collapsed .sidebar-collapse-btn {
  display: inline-grid;
  position: static;
  margin: 8px auto 0;
  z-index: 4;
  width: 28px;
  height: 28px;
  min-height: 28px;
  color: #166534;
  background: rgba(236, 253, 245, 0.92);
  border: 1px solid #86efac;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

body.sidebar-collapsed .brand {
  position: relative;
}

@media (max-width: 1060px) {
  body.menu-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(15, 23, 42, 0.38);
  }

  body.menu-open .sidebar {
    width: min(88vw, 320px);
  }

  body.menu-open.sidebar-collapsed .brand {
    display: flex;
    justify-content: space-between;
  }

  body.menu-open.sidebar-collapsed .brand div,
  body.menu-open.sidebar-collapsed .nav-btn span,
  body.menu-open.sidebar-collapsed .sidebar-user > div:first-child {
    display: block;
  }

  body.menu-open.sidebar-collapsed .sidebar-collapse-btn {
    position: static;
    display: inline-grid;
  }

  body.menu-open.sidebar-collapsed .nav-btn {
    justify-content: flex-start;
    padding: 9px 11px;
  }

  body.menu-open.sidebar-collapsed .sidebar-user {
    justify-content: space-between;
    padding: 12px;
  }

  body.menu-open.sidebar-collapsed .sidebar-user-actions {
    display: flex;
  }
}

/* Aproximação visual com a identidade de Mazagão: vermelho, dourado e base clara. */
:root {
  --bg: #fffaf0;
  --panel: #ffffff;
  --panel-2: #fff7ed;
  --ink: #18181b;
  --muted: #6b5f59;
  --line: #f1d59d;
  --primary: #d90404;
  --primary-2: #8b0000;
  --accent: #ffc400;
  --cyan: #f97316;
  --violet: #7f1d1d;
  --red: #b00000;
  --shadow: 0 18px 46px rgba(127, 29, 29, 0.09);
  --sidebar: #fffefa;
  --sidebar-2: #fff7ed;
}

body {
  background: linear-gradient(180deg, #fffdf8 0%, var(--bg) 46%, #fff7ed 100%);
}

.sidebar {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 196, 0, 0.12), rgba(217, 4, 4, 0.035) 34%, transparent 72%),
    linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  border-right: 1px solid rgba(217, 4, 4, 0.12);
  box-shadow: 12px 0 34px rgba(127, 29, 29, 0.06);
}

.brand {
  border-bottom: 1px solid rgba(217, 4, 4, 0.1);
}

.brand img,
.login-brand img {
  border: 1px solid rgba(255, 196, 0, 0.65);
  border-radius: 16px;
  box-shadow: 0 12px 26px rgba(217, 4, 4, 0.13);
}

.brand strong,
.login-credit,
.topbar .main-credit {
  color: var(--primary-2);
}

.brand span,
.sidebar-user span {
  color: var(--muted);
}

.nav-btn {
  color: #372018;
  border-radius: 14px;
}

.nav-btn svg,
.btn svg,
.icon-btn svg {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-btn > svg {
  width: 20px;
  height: 20px;
  padding: 5px;
  border-radius: 12px;
  color: var(--primary-2);
  background: rgba(255, 196, 0, 0.16);
  box-sizing: content-box;
}

.nav-btn:hover {
  color: var(--primary-2);
  background: rgba(255, 196, 0, 0.14);
}

.nav-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 15px 30px rgba(217, 4, 4, 0.22);
}

.nav-btn.active > svg {
  color: #7f1d1d;
  background: linear-gradient(135deg, #fff3b0, var(--accent));
}

.sidebar-collapse-btn,
.sidebar-user-actions .icon-btn {
  color: var(--primary-2);
  border-color: rgba(255, 196, 0, 0.64);
  background: rgba(255, 196, 0, 0.16);
}

.sidebar-collapse-btn:hover,
.sidebar-collapse-btn:focus-visible,
.sidebar-user-actions .icon-btn:hover {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

body.sidebar-collapsed .sidebar-collapse-btn {
  color: var(--primary-2);
  background: #fff7cc;
  border-color: rgba(255, 196, 0, 0.8);
}

.sidebar-user {
  color: var(--ink);
  border-color: rgba(217, 4, 4, 0.13);
  background: rgba(255, 255, 255, 0.82);
}

.topbar {
  background: rgba(255, 250, 240, 0.9);
  border-bottom: 1px solid rgba(217, 4, 4, 0.11);
}

.dashboard-command-bar,
.dash-card,
.dash-kpi,
.panel,
.card,
.metric,
.table-wrap {
  border-color: rgba(217, 4, 4, 0.1);
}

.btn-primary {
  border-color: var(--primary);
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 26px rgba(217, 4, 4, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f11212, var(--primary-2));
}

.btn-soft {
  border-color: rgba(255, 196, 0, 0.52);
  color: var(--primary-2);
  background: rgba(255, 196, 0, 0.14);
}

.btn-ghost:hover,
.icon-btn:hover {
  border-color: rgba(217, 4, 4, 0.18);
  color: var(--primary-2);
}

.dash-kpi-icon,
.kpi-icon.green,
.dashboard-request-icon {
  color: var(--primary-2);
  background: rgba(255, 196, 0, 0.18);
}

.dash-kpi-blue .dash-kpi-icon,
.kpi-icon.cyan {
  color: #9a3412;
  background: rgba(249, 115, 22, 0.14);
}

.dash-kpi-cyan .dash-kpi-icon,
.kpi-icon.amber {
  color: #a16207;
  background: rgba(255, 196, 0, 0.18);
}

.dash-kpi-violet .dash-kpi-icon,
.kpi-icon.violet {
  color: var(--primary-2);
  background: rgba(217, 4, 4, 0.1);
}

.dash-kpi-amber .dash-kpi-icon,
.kpi-icon.red {
  color: var(--primary);
  background: rgba(217, 4, 4, 0.09);
}

.sparkline polyline,
.sparkline path {
  stroke: var(--primary);
}

.sparkline-blue polyline,
.chart-line-blue {
  stroke: var(--cyan);
}

.sparkline-cyan polyline,
.sparkline-violet polyline {
  stroke: var(--accent);
}

.dash-bar-track span,
.hbar-fill {
  background: linear-gradient(90deg, var(--primary), var(--accent)) !important;
}

/* Tema dominante da logo da Prefeitura: vermelho profundo com dourado de apoio. */
:root {
  --bg: #fff7ed;
  --panel: #ffffff;
  --panel-2: #fff1dd;
  --ink: #171717;
  --muted: #72514c;
  --line: #efc78c;
  --primary: #d90404;
  --primary-2: #7f0000;
  --accent: #ffc400;
  --cyan: #f97316;
  --violet: #6f1212;
  --red: #b00000;
  --shadow: 0 18px 48px rgba(127, 0, 0, 0.14);
  --sidebar: #8b0000;
  --sidebar-2: #3b0a0a;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 196, 0, 0.13), transparent 280px),
    linear-gradient(135deg, rgba(217, 4, 4, 0.08), transparent 360px),
    var(--bg);
}

.sidebar {
  color: #fff8e6;
  background:
    linear-gradient(180deg, rgba(255, 196, 0, 0.18), rgba(217, 4, 4, 0.08) 30%, rgba(0, 0, 0, 0.18) 100%),
    linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  border-right: 1px solid rgba(255, 196, 0, 0.28);
  box-shadow: 16px 0 42px rgba(127, 0, 0, 0.16);
}

.brand {
  border-bottom: 1px solid rgba(255, 196, 0, 0.22);
}

.brand strong {
  color: #ffffff;
}

.brand span,
.sidebar-user span,
.developer-credit {
  color: #fde68a;
}

.brand img,
.login-brand img {
  background: #ffffff;
  border: 2px solid rgba(255, 196, 0, 0.9);
  box-shadow: 0 12px 28px rgba(255, 196, 0, 0.16);
}

.nav-btn {
  color: rgba(255, 248, 230, 0.9);
}

.nav-btn > svg {
  color: #7f0000;
  background: linear-gradient(135deg, #fff4b8, var(--accent));
}

.nav-btn:hover {
  color: #ffffff;
  background: rgba(255, 196, 0, 0.15);
}

.nav-btn.active {
  color: #3b0a0a;
  background: linear-gradient(135deg, #ffd84d, var(--accent));
  box-shadow: 0 16px 32px rgba(255, 196, 0, 0.2), inset 4px 0 0 #ffffff;
}

.nav-btn.active > svg {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.sidebar-collapse-btn,
.sidebar-user-actions .icon-btn,
body.sidebar-collapsed .sidebar-collapse-btn {
  color: #3b0a0a;
  border-color: rgba(255, 196, 0, 0.85);
  background: linear-gradient(135deg, #fff4b8, var(--accent));
}

.sidebar-collapse-btn:hover,
.sidebar-collapse-btn:focus-visible,
.sidebar-user-actions .icon-btn:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: rgba(255, 255, 255, 0.42);
}

.sidebar-user {
  color: #ffffff;
  border-color: rgba(255, 196, 0, 0.24);
  background: rgba(255, 255, 255, 0.09);
}

.topbar {
  background: rgba(255, 247, 237, 0.92);
  border-bottom: 1px solid rgba(217, 4, 4, 0.16);
  box-shadow: 0 10px 26px rgba(127, 0, 0, 0.05);
}

.topbar h1,
.page-heading h2,
.dashboard-command-bar h2,
.panel h3,
.dash-card h3 {
  color: #2b0808;
}

.login-credit,
.topbar .main-credit,
.breadcrumb,
.section-label {
  color: var(--primary-2);
}

.btn-primary {
  border-color: var(--primary);
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 28px rgba(217, 4, 4, 0.24);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f11212, #650000);
}

.btn-soft {
  border-color: rgba(255, 196, 0, 0.65);
  color: #7f0000;
  background: linear-gradient(135deg, rgba(255, 196, 0, 0.2), rgba(255, 244, 184, 0.72));
}

.btn-ghost:hover,
.icon-btn:hover {
  border-color: rgba(217, 4, 4, 0.24);
  color: var(--primary-2);
  background: rgba(255, 196, 0, 0.12);
}

.dashboard-command-bar,
.dash-card,
.dash-kpi,
.panel,
.card,
.metric,
.table-wrap,
.official-report,
.modal-card {
  border-color: rgba(217, 4, 4, 0.14);
  box-shadow: var(--shadow);
}

.dash-kpi-icon,
.kpi-icon.green,
.dashboard-request-icon,
.audit-icon {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.dash-kpi-blue .dash-kpi-icon,
.dash-kpi-cyan .dash-kpi-icon,
.dash-kpi-violet .dash-kpi-icon,
.dash-kpi-amber .dash-kpi-icon,
.kpi-icon.amber,
.kpi-icon.cyan,
.kpi-icon.violet {
  color: #3b0a0a;
  background: linear-gradient(135deg, #fff4b8, var(--accent));
}

.sparkline polyline,
.sparkline path,
.line-path.green,
.chart-point.green {
  stroke: var(--primary);
  fill: var(--primary);
}

.sparkline-blue polyline,
.sparkline-cyan polyline,
.sparkline-violet polyline,
.sparkline-amber polyline {
  stroke: var(--accent);
}

.legend-line.green,
.dash-bar-track span,
.hbar-fill,
.progress-fill,
.status-pill.success {
  background: linear-gradient(90deg, var(--primary), var(--accent)) !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(217, 4, 4, 0.14);
}

/* Correção: ícones limpos e login sem imagem de fundo. */
.login-screen {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 196, 0, 0.22), transparent 24%),
    linear-gradient(145deg, #8b0000 0%, #5d0808 42%, #260505 100%) !important;
}

.nav-btn > svg,
.nav-btn.active > svg {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 0;
  color: currentColor;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
}

.nav-btn {
  border-left: 3px solid transparent;
}

.nav-btn:hover {
  border-left-color: rgba(255, 196, 0, 0.58);
}

.nav-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #d90404, #7f0000);
  border-left-color: var(--accent);
  box-shadow: 0 16px 32px rgba(127, 0, 0, 0.26);
}

.nav-btn.active > svg {
  color: #ffd84d;
}

.dash-kpi-icon,
.dash-kpi-blue .dash-kpi-icon,
.dash-kpi-cyan .dash-kpi-icon,
.dash-kpi-violet .dash-kpi-icon,
.dash-kpi-amber .dash-kpi-icon,
.kpi-icon,
.kpi-icon.green,
.kpi-icon.amber,
.kpi-icon.cyan,
.kpi-icon.violet,
.kpi-icon.red,
.dashboard-request-icon,
.audit-icon {
  color: var(--primary-2);
  background: rgba(217, 4, 4, 0.08);
  border: 1px solid rgba(217, 4, 4, 0.12);
  box-shadow: none;
}

.btn .btn-icon,
.icon-btn span,
.field-action-btn span {
  background: transparent;
}

/* Contraste: botões dourados com ícones internos legíveis. */
.btn-soft,
.sidebar-collapse-btn,
.sidebar-user-actions .icon-btn,
body.sidebar-collapsed .sidebar-collapse-btn {
  color: #2b0808 !important;
  border-color: #b45309 !important;
  background: linear-gradient(135deg, #fff6bf, #ffc400) !important;
  text-shadow: none;
}

.btn-soft .btn-icon,
.btn-soft svg,
.btn-soft .btn-icon svg,
.sidebar-collapse-btn svg,
.sidebar-user-actions .icon-btn svg,
.sidebar-user-actions .icon-btn span {
  color: #2b0808 !important;
  stroke: #2b0808 !important;
  fill: none;
}

.btn-soft:hover,
.sidebar-collapse-btn:hover,
.sidebar-collapse-btn:focus-visible,
.sidebar-user-actions .icon-btn:hover {
  color: #ffffff !important;
  border-color: var(--primary) !important;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
}

.btn-soft:hover .btn-icon,
.btn-soft:hover svg,
.btn-soft:hover .btn-icon svg,
.sidebar-collapse-btn:hover svg,
.sidebar-collapse-btn:focus-visible svg,
.sidebar-user-actions .icon-btn:hover svg,
.sidebar-user-actions .icon-btn:hover span {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

/* Tema visual aproximado ao exemplo: vermelho coral, amarelo institucional e cards limpos. */
:root {
  --bg: #fffdfb;
  --panel: #ffffff;
  --panel-2: #fff8f2;
  --ink: #1f1f24;
  --muted: #6f6461;
  --line: #f0ded8;
  --primary: #e5483f;
  --primary-2: #c9342e;
  --accent: #ffc857;
  --cyan: #f59e0b;
  --red: #dc2626;
  --violet: #8b5cf6;
  --shadow: 0 18px 48px rgba(170, 55, 48, 0.09);
  --radius: 16px;
  --sidebar: #e4554a;
  --sidebar-2: #df6a5d;
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 200, 87, 0.16), transparent 26%),
    radial-gradient(circle at 88% 10%, rgba(229, 72, 63, 0.1), transparent 30%),
    var(--bg);
}

.app-shell {
  grid-template-columns: 244px minmax(0, 1fr);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 78px minmax(0, 1fr);
}

.sidebar {
  color: #ffffff;
  background:
    linear-gradient(160deg, rgba(255, 200, 87, 0.14), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  border-right: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 16px 0 42px rgba(201, 52, 46, 0.16);
}

.sidebar .brand {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 36px;
  justify-items: center;
  gap: 8px;
  padding: 18px 8px 20px;
  border-bottom: 0;
  text-align: center;
}

.sidebar .brand img {
  grid-column: 1 / -1;
  width: 118px;
  height: 118px;
  padding: 8px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(116, 18, 14, 0.16);
  object-fit: contain;
}

.sidebar .brand div {
  grid-column: 1 / -1;
}

.sidebar .brand strong {
  color: #ffffff;
  font-size: 24px;
  line-height: 1.05;
}

.sidebar .brand span,
.sidebar .sidebar-user span,
.sidebar .developer-credit {
  color: rgba(255, 255, 255, 0.88);
}

.sidebar .sidebar-collapse-btn {
  position: absolute;
  top: 18px;
  right: 8px;
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.side-nav {
  gap: 8px;
}

.nav-btn {
  min-height: 48px;
  border-left: 0;
  border-radius: 12px;
  color: #ffffff;
  padding: 12px 14px;
  font-weight: 800;
}

.nav-btn > svg,
.nav-btn.active > svg {
  width: 20px;
  height: 20px;
  color: currentColor;
  stroke: currentColor;
  background: transparent;
}

.nav-btn:hover {
  color: #fff8e5;
  background: rgba(255, 255, 255, 0.14);
  border-left-color: transparent;
}

.nav-btn.active {
  color: #c9342e;
  background: linear-gradient(135deg, #ffe277, var(--accent));
  border-left: 0;
  box-shadow: 0 16px 32px rgba(128, 36, 30, 0.18);
}

.nav-btn.active > svg {
  color: #e5483f;
  stroke: #e5483f;
}

body.sidebar-collapsed .sidebar {
  padding-inline: 10px;
}

body.sidebar-collapsed .sidebar .brand {
  grid-template-columns: 1fr;
  padding: 14px 0 12px;
}

body.sidebar-collapsed .sidebar .brand img {
  width: 54px;
  height: 54px;
  padding: 5px;
  border-width: 2px;
}

body.sidebar-collapsed .sidebar .brand div,
body.sidebar-collapsed .sidebar .sidebar-collapse-btn,
body.sidebar-collapsed .nav-btn span,
body.sidebar-collapsed .sidebar-user > div:first-child {
  display: none;
}

body.sidebar-collapsed .nav-btn {
  justify-content: center;
  padding: 0;
}

.sidebar-user {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.topbar {
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(240, 222, 216, 0.86);
  box-shadow: 0 10px 24px rgba(201, 52, 46, 0.04);
}

.topbar-avatar {
  background: linear-gradient(135deg, #e5483f, #c9342e);
  box-shadow: 0 14px 26px rgba(229, 72, 63, 0.22);
}

.login-screen {
  background:
    radial-gradient(circle at 16% 15%, rgba(255, 200, 87, 0.24), transparent 26%),
    linear-gradient(145deg, #e4554a 0%, #c9342e 46%, #8f201b 100%) !important;
}

.login-card,
.dashboard-command-bar,
.dash-card,
.dash-kpi,
.panel,
.card,
.metric,
.table-wrap,
.official-report,
.modal-card {
  border: 1px solid rgba(240, 222, 216, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.breadcrumb,
.section-label,
.login-credit,
.topbar .main-credit,
.link-button {
  color: var(--primary);
}

.btn-primary {
  border-color: var(--primary);
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 26px rgba(229, 72, 63, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f05a50, #b52b26);
}

.btn-soft,
.sidebar-collapse-btn,
.sidebar-user-actions .icon-btn,
body.sidebar-collapsed .sidebar-collapse-btn {
  color: #7f1d1d !important;
  border-color: rgba(255, 200, 87, 0.9) !important;
  background: linear-gradient(135deg, #fff1a8, var(--accent)) !important;
}

.btn-soft svg,
.btn-soft .btn-icon,
.btn-soft .btn-icon svg,
.sidebar-collapse-btn svg,
.sidebar-user-actions .icon-btn svg,
.sidebar-user-actions .icon-btn span {
  color: #7f1d1d !important;
  stroke: #7f1d1d !important;
}

.dash-kpi::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 118px;
  height: 22px;
  background: linear-gradient(160deg, transparent 18%, var(--primary) 19% 70%, var(--accent) 71%);
  clip-path: polygon(0 85%, 80% 45%, 100% 0, 94% 100%, 0 100%);
  opacity: 0.95;
}

.dash-kpi-icon,
.dash-kpi-blue .dash-kpi-icon,
.dash-kpi-cyan .dash-kpi-icon,
.dash-kpi-violet .dash-kpi-icon,
.dash-kpi-amber .dash-kpi-icon,
.kpi-icon,
.kpi-icon.green,
.kpi-icon.amber,
.kpi-icon.cyan,
.kpi-icon.violet,
.kpi-icon.red,
.dashboard-request-icon,
.audit-icon {
  color: var(--primary);
  border-color: rgba(229, 72, 63, 0.16);
  background: rgba(229, 72, 63, 0.08);
}

.dash-kpi-cyan .dash-kpi-icon,
.dash-kpi-amber .dash-kpi-icon,
.kpi-icon.amber,
.kpi-icon.cyan {
  color: #b45309;
  border-color: rgba(255, 200, 87, 0.28);
  background: rgba(255, 200, 87, 0.18);
}

.dash-kpi-violet .dash-kpi-icon,
.kpi-icon.violet {
  color: var(--violet);
  border-color: rgba(139, 92, 246, 0.18);
  background: rgba(139, 92, 246, 0.1);
}

.sparkline polyline,
.sparkline path,
.line-path.green,
.chart-point.green {
  stroke: var(--primary);
  fill: var(--primary);
}

.sparkline-blue polyline,
.sparkline-cyan polyline,
.sparkline-violet polyline,
.sparkline-amber polyline,
.line-path.blue,
.chart-point.blue {
  stroke: var(--accent);
  fill: var(--accent);
}

.legend-line.green,
.dash-bar-track span,
.hbar-fill,
.progress-fill,
.status-pill.success {
  background: linear-gradient(90deg, var(--primary), var(--accent)) !important;
}

.data-table thead,
table thead {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.data-table thead th,
table thead th {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(229, 72, 63, 0.14);
}

@media (max-width: 1060px) {
  body.menu-open .sidebar {
    width: min(310px, 84vw);
  }

  body.menu-open .sidebar .brand {
    padding-top: 16px;
  }

  body.menu-open .sidebar .brand img {
    width: 96px;
    height: 96px;
  }
}

/* Ajuste de densidade: menu lateral completo visivel em zoom normal. */
.app-shell {
  grid-template-columns: 224px minmax(0, 1fr);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 72px minmax(0, 1fr);
}

.sidebar {
  gap: 9px;
  padding: 12px 10px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar .brand {
  gap: 5px;
  padding: 8px 4px 10px;
}

.sidebar .brand img {
  width: 84px;
  height: 84px;
  padding: 6px;
  border-width: 2px;
  box-shadow: 0 12px 26px rgba(116, 18, 14, 0.14);
}

.sidebar .brand strong {
  font-size: 20px;
}

.sidebar .brand span,
.sidebar .developer-credit {
  font-size: 12px;
}

.sidebar .sidebar-collapse-btn {
  top: 10px;
  right: 4px;
  width: 30px;
  height: 30px;
  min-height: 30px;
}

.side-nav {
  gap: 4px;
}

.nav-btn {
  min-height: 39px;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 14px;
}

.nav-btn > svg,
.nav-btn.active > svg {
  width: 18px;
  height: 18px;
}

.sidebar-user {
  padding: 10px;
  gap: 8px;
  border-radius: 14px;
}

.sidebar-user strong {
  font-size: 13px;
}

.sidebar-user span {
  font-size: 11px;
}

.sidebar-user-actions .icon-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

body.sidebar-collapsed .sidebar {
  padding-inline: 8px;
}

body.sidebar-collapsed .sidebar .brand {
  padding: 8px 0 6px;
}

body.sidebar-collapsed .sidebar .brand img {
  width: 46px;
  height: 46px;
  padding: 4px;
}

body.sidebar-collapsed .nav-btn {
  min-height: 40px;
}

@media (max-height: 760px) {
  .sidebar .brand img {
    width: 72px;
    height: 72px;
  }

  .sidebar .brand strong {
    font-size: 18px;
  }

  .nav-btn {
    min-height: 36px;
    padding-block: 7px;
  }

  .sidebar {
    gap: 7px;
    padding-block: 10px;
  }
}

@media (max-width: 1060px) {
  body.menu-open .sidebar {
    width: min(282px, 84vw);
  }

  body.menu-open .sidebar .brand {
    padding-top: 10px;
  }

  body.menu-open .sidebar .brand img {
    width: 78px;
    height: 78px;
  }
}

/* Correção: botão de expandir continua visível e clicável quando a lateral está recolhida. */
body.sidebar-collapsed .sidebar .brand {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  justify-items: center;
  padding: 8px 0 8px;
}

body.sidebar-collapsed .sidebar .sidebar-collapse-btn {
  display: inline-grid !important;
  position: static !important;
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  margin: 0 0 2px;
  z-index: 6;
}

body.sidebar-collapsed .sidebar .brand img {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 44px;
  height: 44px;
  padding: 4px;
}

body.sidebar-collapsed .sidebar .brand div,
body.sidebar-collapsed .nav-btn span,
body.sidebar-collapsed .sidebar-user > div:first-child {
  display: none;
}

body.sidebar-collapsed .sidebar .sidebar-collapse-btn svg,
body.sidebar-collapsed .sidebar .sidebar-collapse-btn span {
  pointer-events: none;
}

/* Status de cadastros habilitados/desabilitados. */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.danger {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
}

.status-pill.pending {
  color: #7f3838;
  background: #fff3cc;
  border: 1px solid #f5d58a;
}

/* Paleta solicitada: menu neutro vinho, acoes em vermelho queimado e acento verde suave. */
:root {
  --bg: #fffdfb;
  --panel: #ffffff;
  --panel-2: #fbf8f6;
  --ink: #21191a;
  --muted: #6f6360;
  --line: #eadfdb;
  --primary: #a14b4b;
  --primary-2: #7f3838;
  --primary-hover: #934242;
  --primary-hover-2: #703030;
  --accent: #86a36f;
  --accent-soft: #dce9d2;
  --accent-ink: #21331f;
  --cyan: #b87546;
  --violet: #6f5267;
  --red: #b4232a;
  --shadow: 0 18px 48px rgba(58, 39, 41, 0.1);
  --sidebar: #3a2729;
  --sidebar-2: #21191a;
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(134, 163, 111, 0.16), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(161, 75, 75, 0.08), transparent 32%),
    linear-gradient(180deg, #fffdfb 0%, #fbf8f6 100%);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(134, 163, 111, 0.12), rgba(255, 255, 255, 0) 34%),
    linear-gradient(180deg, #3a2729 0%, #2c2021 48%, #21191a 100%);
  border-right-color: rgba(134, 163, 111, 0.2);
  box-shadow: 16px 0 42px rgba(33, 25, 26, 0.22);
}

.sidebar .brand img {
  border-color: rgba(220, 233, 210, 0.92);
  box-shadow: 0 12px 28px rgba(33, 25, 26, 0.22);
}

.nav-btn {
  color: rgba(255, 255, 255, 0.9);
}

.nav-btn:hover {
  color: #ffffff;
  background: rgba(134, 163, 111, 0.16);
}

.nav-btn.active {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  box-shadow: 0 16px 32px rgba(33, 25, 26, 0.24);
}

.nav-btn.active > svg {
  color: var(--accent-ink);
  stroke: var(--accent-ink);
}

.sidebar .brand strong,
.sidebar-user strong {
  color: #ffffff;
}

.sidebar .brand span,
.sidebar .sidebar-user span,
.sidebar .developer-credit {
  color: rgba(220, 233, 210, 0.88);
}

.sidebar-user {
  border-color: rgba(220, 233, 210, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.topbar {
  border-bottom-color: rgba(234, 223, 219, 0.9);
  background: rgba(255, 253, 251, 0.9);
  box-shadow: 0 10px 24px rgba(58, 39, 41, 0.04);
}

.topbar-avatar,
.btn-primary,
.notification-btn em {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.topbar-avatar,
.btn-primary {
  box-shadow: 0 14px 26px rgba(127, 56, 56, 0.22);
}

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

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-hover-2));
}

.btn-soft,
.sidebar-collapse-btn,
.sidebar-user-actions .icon-btn,
body.sidebar-collapsed .sidebar-collapse-btn {
  color: var(--accent-ink) !important;
  border-color: rgba(220, 233, 210, 0.86) !important;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent)) !important;
}

.btn-soft svg,
.btn-soft .btn-icon,
.btn-soft .btn-icon svg,
.sidebar-collapse-btn svg,
.sidebar-user-actions .icon-btn svg,
.sidebar-user-actions .icon-btn span {
  color: var(--accent-ink) !important;
  stroke: var(--accent-ink) !important;
}

.btn-soft:hover,
.sidebar-collapse-btn:hover,
.sidebar-collapse-btn:focus-visible,
.sidebar-user-actions .icon-btn:hover {
  color: #ffffff !important;
  border-color: var(--primary-hover) !important;
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-hover-2)) !important;
}

.btn-soft:hover .btn-icon,
.btn-soft:hover svg,
.btn-soft:hover .btn-icon svg,
.sidebar-collapse-btn:hover svg,
.sidebar-collapse-btn:focus-visible svg,
.sidebar-user-actions .icon-btn:hover svg,
.sidebar-user-actions .icon-btn:hover span {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.login-screen {
  background:
    radial-gradient(circle at 18% 15%, rgba(220, 233, 210, 0.2), transparent 25%),
    linear-gradient(145deg, #3a2729 0%, #2c2021 46%, #21191a 100%) !important;
}

.login-card,
.dashboard-command-bar,
.dash-card,
.dash-kpi,
.panel,
.card,
.metric,
.table-wrap,
.official-report,
.modal-card {
  border-color: rgba(234, 223, 219, 0.95);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
}

.breadcrumb,
.section-label,
.login-credit,
.topbar .main-credit,
.link-button {
  color: var(--primary);
}

.dash-kpi::after {
  background: linear-gradient(160deg, transparent 18%, var(--primary) 19% 70%, var(--accent) 71%);
}

.dash-kpi-icon,
.dash-kpi-blue .dash-kpi-icon,
.dash-kpi-cyan .dash-kpi-icon,
.dash-kpi-violet .dash-kpi-icon,
.dash-kpi-amber .dash-kpi-icon,
.kpi-icon,
.kpi-icon.green,
.kpi-icon.amber,
.kpi-icon.cyan,
.kpi-icon.violet,
.kpi-icon.red,
.dashboard-request-icon,
.audit-icon {
  color: var(--primary);
  border-color: rgba(161, 75, 75, 0.16);
  background: rgba(161, 75, 75, 0.08);
}

.dash-kpi-cyan .dash-kpi-icon,
.dash-kpi-amber .dash-kpi-icon,
.kpi-icon.amber,
.kpi-icon.cyan {
  color: var(--accent-ink);
  border-color: rgba(134, 163, 111, 0.32);
  background: var(--accent-soft);
}

.sparkline polyline,
.sparkline path,
.line-path.green,
.chart-point.green {
  stroke: var(--primary);
  fill: var(--primary);
}

.sparkline-blue polyline,
.sparkline-cyan polyline,
.sparkline-violet polyline,
.sparkline-amber polyline,
.line-path.blue,
.chart-point.blue {
  stroke: var(--accent);
  fill: var(--accent);
}

.legend-line.green,
.dash-bar-track span,
.hbar-fill,
.progress-fill,
.status-pill.success {
  background: linear-gradient(90deg, var(--primary), var(--accent)) !important;
}

.data-table thead,
table thead {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(161, 75, 75, 0.14);
}

.badge,
.notification-btn em,
.status-pill.success {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.notification-btn em {
  border: 1px solid rgba(134, 163, 111, 0.35);
}

.badge.warn {
  color: #703030;
  background: rgba(161, 75, 75, 0.1);
}

.badge.red,
.status-pill.danger {
  color: #7f3838;
  background: rgba(161, 75, 75, 0.12);
  border-color: rgba(161, 75, 75, 0.24);
}

/* Correcoes finais para APK/mobile: gaveta lateral estavel e conteudo sem estouro horizontal. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.main,
.content,
.dashboard-surface,
.panel,
.card,
.dash-card,
.dash-kpi,
.metric {
  min-width: 0;
}

@media (max-width: 1060px) {
  body.sidebar-collapsed .app-shell,
  .app-shell {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .main {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 18;
    min-height: 68px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .content {
    width: 100%;
    max-width: 100%;
    padding: 14px 12px calc(28px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
  }

  .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 40;
    width: min(286px, 86vw) !important;
    height: 100dvh;
    max-height: 100dvh;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 10px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translate3d(-110%, 0, 0) !important;
    transition: transform 240ms ease;
  }

  body.menu-open .sidebar {
    transform: translate3d(0, 0, 0) !important;
  }

  body.menu-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(33, 25, 26, 0.46);
    backdrop-filter: blur(2px);
  }

  body.menu-open .sidebar {
    pointer-events: auto;
  }

  body.sidebar-collapsed .sidebar .brand,
  .sidebar .brand {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 36px !important;
    gap: 9px;
    align-items: center;
    justify-items: stretch;
    padding: 8px 0 10px !important;
    text-align: left;
  }

  body.sidebar-collapsed .sidebar .brand img,
  .sidebar .brand img {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 52px !important;
    height: 52px !important;
    padding: 4px !important;
  }

  body.sidebar-collapsed .sidebar .brand div,
  .sidebar .brand div {
    display: block !important;
    grid-column: 2;
    min-width: 0;
  }

  body.sidebar-collapsed .sidebar .brand strong,
  .sidebar .brand strong {
    font-size: 16px;
    line-height: 1.1;
  }

  .sidebar .brand span {
    display: block;
    margin-top: 2px;
    font-size: 11px;
  }

  body.sidebar-collapsed .sidebar .sidebar-collapse-btn,
  .sidebar .sidebar-collapse-btn {
    display: inline-grid !important;
    position: static !important;
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: end;
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
  }

  body.sidebar-collapsed .nav-btn span,
  body.sidebar-collapsed .sidebar-user > div:first-child {
    display: block;
  }

  .nav-btn {
    justify-content: flex-start !important;
    min-height: 42px;
    padding: 9px 11px !important;
  }

  .nav-btn span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-user {
    align-items: center;
    padding: 10px !important;
  }

  .sidebar-user > div:first-child {
    min-width: 0;
  }

  .sidebar-user strong,
  .sidebar-user span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-heading,
  .dashboard-command-bar,
  .dash-table-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
  }

  .toolbar,
  .dashboard-toolbar,
  .filter-bar,
  .ticket-filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    gap: 10px;
  }

  .toolbar .btn,
  .toolbar .icon-btn,
  .dashboard-toolbar .btn,
  .filter-bar .btn,
  .ticket-filter-bar .btn,
  .period-control,
  .dashboard-search {
    width: 100%;
    min-width: 0;
  }

  .dashboard-kpi-grid,
  .dashboard-main-grid,
  .dashboard-insights-grid,
  .dashboard-toolbar {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .dash-kpi,
  .dash-card,
  .panel,
  .card,
  .metric {
    border-radius: 14px;
  }

  .table-wrap,
  .dashboard-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table,
  .dashboard-table,
  table {
    min-width: 680px;
  }

  .modal-card {
    width: min(96vw, 720px);
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }

  .login-screen {
    min-height: 100dvh;
    padding: calc(18px + env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .login-panel {
    width: min(100%, 420px);
    padding: 22px;
  }
}

@media (max-width: 430px) {
  .topbar h1 {
    font-size: 20px;
  }

  .content {
    padding-inline: 10px;
  }

  .dashboard-command-bar h2 {
    font-size: 22px;
  }

  .dash-kpi {
    min-height: 152px;
  }

  .sidebar {
    width: min(292px, 88vw) !important;
  }
}

/* Tema final v55: dashboard claro com vermelho coral e dourado suave. */
:root {
  --bg: #fffaf7;
  --panel: #ffffff;
  --panel-2: #fff7f4;
  --ink: #1f1f24;
  --muted: #72605d;
  --line: #f0ded8;
  --primary: #ee4b45;
  --primary-2: #d83a35;
  --primary-hover: #e13e39;
  --primary-hover-2: #c82f2b;
  --accent: #ffc84d;
  --accent-soft: #fff3cc;
  --accent-ink: #5a3500;
  --cyan: #ff6b5f;
  --violet: #9f6cff;
  --red: #e5483f;
  --shadow: 0 18px 46px rgba(170, 55, 48, 0.07);
  --radius: 16px;
  --sidebar: #ffffff;
  --sidebar-2: #fff7f4;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 22% 0%, rgba(255, 200, 77, 0.15), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(238, 75, 69, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.app-shell {
  grid-template-columns: 232px minmax(0, 1fr);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 74px minmax(0, 1fr);
}

.sidebar {
  color: var(--ink);
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  border-right: 1px solid rgba(240, 222, 216, 0.96);
  box-shadow: 12px 0 34px rgba(170, 55, 48, 0.06);
}

.sidebar .brand {
  padding: 12px 6px 14px;
}

.sidebar .brand img {
  width: 86px;
  height: 86px;
  padding: 6px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #ffffff;
  object-fit: contain;
  box-shadow: 0 12px 26px rgba(238, 75, 69, 0.12);
}

.sidebar .brand strong,
.sidebar-user strong {
  color: #111827;
}

.sidebar .brand span,
.sidebar .sidebar-user span,
.sidebar .developer-credit {
  color: #7c6460;
}

.nav-btn {
  min-height: 42px;
  color: #4b3937;
  border-radius: 12px;
  font-weight: 800;
}

.nav-btn > svg,
.nav-btn.active > svg {
  color: var(--primary);
  stroke: currentColor;
}

.nav-btn:hover {
  color: var(--primary);
  background: rgba(238, 75, 69, 0.07);
}

.nav-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 26px rgba(238, 75, 69, 0.2);
}

.nav-btn.active > svg {
  color: #ffffff;
  stroke: #ffffff;
}

.sidebar-collapse-btn,
.sidebar-user-actions .icon-btn,
body.sidebar-collapsed .sidebar-collapse-btn {
  color: var(--primary-2) !important;
  border-color: rgba(240, 222, 216, 0.96) !important;
  background: #fff4f2 !important;
  box-shadow: 0 8px 18px rgba(120, 28, 24, 0.08);
}

.sidebar-collapse-btn:hover,
.sidebar-collapse-btn:focus-visible,
.sidebar-user-actions .icon-btn:hover {
  color: #ffffff !important;
  border-color: var(--primary) !important;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
}

.sidebar-user {
  color: var(--ink);
  border-color: rgba(240, 222, 216, 0.98);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(120, 28, 24, 0.08);
}

.topbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(240, 222, 216, 0.88);
  box-shadow: 0 10px 26px rgba(120, 28, 24, 0.04);
}

.topbar h1,
.page-heading h2,
.dashboard-command-bar h2,
.panel h3,
.dash-card h3 {
  color: #191919;
}

.topbar-avatar,
.notification-btn em {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 24px rgba(238, 75, 69, 0.2);
}

.content {
  width: min(1620px, 100%);
}

.login-screen {
  background:
    radial-gradient(circle at 18% 15%, rgba(255, 200, 77, 0.22), transparent 26%),
    linear-gradient(145deg, #ffffff 0%, #fff3ee 46%, #f9d2ca 100%) !important;
}

.login-panel,
.dashboard-command-bar,
.dash-card,
.dash-kpi,
.panel,
.card,
.metric,
.table-wrap,
.official-report,
.modal-card {
  border: 1px solid rgba(240, 222, 216, 0.94);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
}

.login-brand img {
  border: 2px solid var(--accent);
  border-radius: 18px;
  background: #ffffff;
}

.breadcrumb,
.section-label,
.login-credit,
.topbar .main-credit,
.link-button {
  color: var(--primary);
}

.btn-primary {
  border-color: var(--primary);
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 26px rgba(238, 75, 69, 0.21);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-hover-2));
}

.btn-soft {
  color: var(--accent-ink) !important;
  border-color: rgba(246, 178, 26, 0.55) !important;
  background: linear-gradient(135deg, #fff8df, var(--accent-soft)) !important;
}

.btn-ghost,
.icon-btn {
  border-color: rgba(240, 222, 216, 0.94);
  background: #ffffff;
}

.btn-ghost:hover,
.icon-btn:hover {
  color: var(--primary);
  border-color: rgba(238, 75, 69, 0.22);
  background: #fff4f2;
}

.dash-kpi {
  min-height: 156px;
}

.dash-kpi::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 116px;
  height: 22px;
  background: linear-gradient(160deg, transparent 17%, var(--primary) 18% 70%, var(--accent) 71%);
  clip-path: polygon(0 86%, 82% 46%, 100% 0, 94% 100%, 0 100%);
  opacity: 0.96;
}

.dash-kpi-icon,
.dash-kpi-blue .dash-kpi-icon,
.dash-kpi-cyan .dash-kpi-icon,
.dash-kpi-violet .dash-kpi-icon,
.kpi-icon,
.kpi-icon.green,
.kpi-icon.red,
.dashboard-request-icon,
.audit-icon {
  color: var(--primary);
  border-color: rgba(238, 75, 69, 0.16);
  background: rgba(238, 75, 69, 0.09);
}

.dash-kpi-amber .dash-kpi-icon,
.kpi-icon.amber,
.kpi-icon.cyan {
  color: #b45309;
  border-color: rgba(246, 178, 26, 0.3);
  background: rgba(246, 178, 26, 0.18);
}

.sparkline polyline,
.sparkline path,
.line-path.green,
.chart-point.green {
  stroke: var(--primary);
  fill: var(--primary);
}

.sparkline-blue polyline,
.sparkline-cyan polyline,
.sparkline-violet polyline,
.sparkline-amber polyline,
.line-path.blue,
.chart-point.blue {
  stroke: var(--accent);
  fill: var(--accent);
}

.legend-line.green,
.dash-bar-track span,
.hbar-fill,
.progress-fill,
.status-pill.success {
  background: linear-gradient(90deg, var(--primary), var(--accent)) !important;
}

.alert-item > div {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.alert-item.warning > div,
.alert-item.neutral > div {
  color: var(--accent-ink);
  background: linear-gradient(135deg, #ffeeb5, var(--accent));
}

.alert-item {
  border-color: rgba(240, 222, 216, 0.94);
  background: #ffffff;
}

.data-table thead,
table thead {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.data-table thead th,
table thead th,
.dashboard-table th button {
  color: #ffffff;
}

.ticket-status,
.badge,
.status-pill.success {
  color: var(--primary-2);
  background: #ffe3df;
  border-color: rgba(238, 75, 69, 0.2);
}

.badge.warn {
  color: #92400e;
  background: #fff3cc;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(238, 75, 69, 0.13);
}

body.sidebar-collapsed .sidebar .brand img {
  width: 44px;
  height: 44px;
  padding: 4px;
}

@media (max-width: 1060px) {
  body.sidebar-collapsed .sidebar .brand,
  .sidebar .brand {
    grid-template-columns: 58px minmax(0, 1fr) 36px !important;
  }

  body.sidebar-collapsed .sidebar .brand img,
  .sidebar .brand img {
    width: 52px !important;
    height: 52px !important;
  }

  .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #fff7f4 100%);
  }

  .sidebar .brand strong,
  .sidebar .brand span,
  .sidebar .sidebar-user span,
  .sidebar .developer-credit,
  .nav-btn {
    color: var(--ink);
  }

  .nav-btn.active,
  .nav-btn.active span {
    color: #ffffff;
  }
}

/* Override final absoluto - layout institucional aprovado. Deve permanecer no fim do arquivo. */
:root {
  --bg: #fffaf7;
  --panel: #ffffff;
  --panel-2: #fff7f4;
  --ink: #1f1f24;
  --muted: #6f5c58;
  --line: #eadbd6;
  --primary: #ee4b45;
  --primary-2: #d83a35;
  --accent: #ffc84d;
  --accent-soft: #fff3cc;
  --accent-ink: #5a3500;
  --cyan: #ff6b5f;
  --red: #e5483f;
  --danger-bg: #fee2e2;
  --shadow: 0 12px 30px rgba(120, 28, 24, 0.07);
  --radius: 8px;
  --sidebar: #ffffff;
  --sidebar-2: #fff7f4;
}

body {
  color: var(--ink) !important;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%) !important;
}

.app-shell {
  grid-template-columns: 252px minmax(0, 1fr) !important;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 76px minmax(0, 1fr) !important;
}

.sidebar {
  border-right: 1px solid var(--line) !important;
  background: linear-gradient(180deg, #ffffff 0%, #fff7f4 100%) !important;
  box-shadow: 8px 0 22px rgba(120, 28, 24, 0.05) !important;
}

.sidebar .brand {
  grid-template-columns: 48px minmax(0, 1fr) 36px !important;
  padding: 10px 6px 18px !important;
  border-bottom: 1px solid rgba(234, 219, 214, 0.85) !important;
}

.sidebar .brand img,
.login-brand img {
  width: 48px !important;
  height: 48px !important;
  padding: 4px !important;
  border: 1px solid var(--accent) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  object-fit: contain !important;
  box-shadow: 0 8px 18px rgba(238, 75, 69, 0.10) !important;
}

.sidebar .brand strong {
  color: #191919 !important;
  font-size: 15px !important;
  font-weight: 800 !important;
}

.sidebar .brand span,
.sidebar-user span,
.developer-credit {
  color: var(--muted) !important;
}

.side-nav {
  gap: 6px !important;
  padding-top: 12px !important;
}

.nav-btn {
  min-height: 40px !important;
  padding: 9px 10px !important;
  border-radius: 6px !important;
  color: #493936 !important;
  font-weight: 750 !important;
}

.nav-btn > svg {
  color: var(--primary) !important;
  stroke: currentColor !important;
}

.nav-btn:hover {
  color: var(--primary-2) !important;
  background: rgba(238, 75, 69, 0.07) !important;
  transform: none !important;
}

.nav-btn.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
  box-shadow: 0 10px 20px rgba(238, 75, 69, 0.18) !important;
}

.nav-btn.active > svg,
.nav-btn.active span {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.topbar {
  min-height: 78px !important;
  border-bottom: 1px solid var(--line) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 8px 20px rgba(120, 28, 24, 0.04) !important;
}

.topbar h1 {
  color: #191919 !important;
  font-size: 24px !important;
  font-weight: 800 !important;
}

.topbar-avatar,
.notification-btn em {
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
  box-shadow: 0 10px 20px rgba(238, 75, 69, 0.18) !important;
}

.login-panel,
.dashboard-command-bar,
.dash-card,
.dash-kpi,
.panel,
.card,
.metric,
.table-wrap,
.dashboard-table-wrap,
.official-report,
.modal-card,
.filter-bar,
.ticket-filter-bar,
.audit-card,
.contract-limit-card,
.dashboard-request-card,
.page-heading {
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: var(--shadow) !important;
}

.btn,
.icon-btn,
input,
select,
textarea {
  border-radius: 6px !important;
}

.btn {
  min-height: 36px !important;
  padding: 8px 14px !important;
  font-weight: 750 !important;
  transform: none !important;
}

.btn-primary {
  border-color: var(--primary) !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
  box-shadow: 0 10px 20px rgba(238, 75, 69, 0.18) !important;
}

.btn-soft {
  color: var(--accent-ink) !important;
  border-color: rgba(246, 178, 26, 0.55) !important;
  background: linear-gradient(135deg, #fff8df, var(--accent-soft)) !important;
}

.btn-ghost,
.icon-btn {
  color: var(--ink) !important;
  border-color: var(--line) !important;
  background: #ffffff !important;
}

.btn-danger,
button[data-action*="delete"],
button[data-action*="clear"] {
  color: var(--primary-2) !important;
  border-color: rgba(238, 75, 69, 0.35) !important;
  background: var(--danger-bg) !important;
}

.filter-bar,
.ticket-filter-bar,
.dash-table-toolbar {
  align-items: end !important;
  padding: 14px !important;
  background: #ffffff !important;
}

input,
select,
textarea {
  min-height: 38px !important;
  border: 1px solid var(--line) !important;
  color: var(--ink) !important;
  background: #ffffff !important;
}

.data-table thead,
.dashboard-table thead,
table thead {
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
}

.data-table thead th,
.dashboard-table thead th,
table thead th,
.dashboard-table th button {
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
}

.data-table tbody tr:hover,
.dashboard-table tbody tr:hover,
table tbody tr:hover {
  background: #fff7f4 !important;
}

.dash-kpi:hover,
.dash-card:hover {
  transform: none !important;
  box-shadow: 0 14px 34px rgba(120, 28, 24, 0.09) !important;
}

.location-picker-card {
  width: min(720px, 100%) !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  box-shadow: 0 24px 70px rgba(33, 25, 26, 0.22) !important;
}

.location-row {
  min-height: 50px !important;
  border-color: var(--line) !important;
  border-radius: 6px !important;
  background: #ffffff !important;
}

.ticket-status,
.badge,
.status-pill.success {
  color: var(--primary-2) !important;
  border-color: rgba(238, 75, 69, 0.20) !important;
  background: #ffe3df !important;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Ajuste fix3 - fidelidade aos modelos Figma A/B/C. */
.main {
  background: linear-gradient(180deg, #ffffff 0, #fffaf7 220px, #fff7f4 100%) !important;
}

.content {
  width: min(1380px, 100%) !important;
  padding: 28px 36px 40px !important;
}

.topbar {
  padding: 0 36px !important;
}

.topbar-actions {
  gap: 10px !important;
}

.topbar-actions .btn {
  min-width: 126px !important;
}

.sidebar {
  padding: 24px 16px 12px !important;
}

.sidebar .brand {
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
}

.sidebar .brand img {
  width: 40px !important;
  height: 40px !important;
}

.sidebar .brand strong {
  font-size: 15px !important;
  line-height: 1.15 !important;
}

.sidebar .brand span {
  font-size: 11px !important;
}

.nav-btn {
  gap: 12px !important;
  margin: 1px 0 !important;
  font-size: 13px !important;
}

.nav-btn svg {
  width: 18px !important;
  height: 18px !important;
}

.sidebar-user {
  border-radius: 8px !important;
}

.dashboard-surface {
  gap: 18px !important;
}

.dashboard-command-bar {
  min-height: 96px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
}

.dashboard-command-bar h2 {
  margin: 4px 0 5px !important;
  font-size: 26px !important;
}

.dashboard-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}

.period-control {
  min-width: 142px !important;
  min-height: 36px !important;
  border-radius: 18px !important;
  background: #ffffff !important;
}

.dashboard-kpi-grid {
  grid-template-columns: repeat(4, minmax(190px, 1fr)) !important;
  gap: 20px !important;
}

.dash-kpi {
  min-height: 118px !important;
  padding: 18px 20px !important;
  overflow: hidden !important;
}

.dash-kpi::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 auto 0 0 !important;
  width: 5px !important;
  background: linear-gradient(180deg, var(--primary), var(--accent)) !important;
}

.dash-kpi::after {
  display: none !important;
}

.dash-kpi strong {
  margin-top: 8px !important;
  font-size: 28px !important;
}

.dash-kpi p {
  font-size: 12px !important;
}

.dashboard-main-grid {
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.9fr) !important;
  gap: 24px !important;
}

.dashboard-insights-grid {
  grid-template-columns: repeat(3, minmax(260px, 1fr)) !important;
  gap: 20px !important;
}

.dash-card {
  padding: 22px !important;
}

.dash-card-large {
  min-height: 272px !important;
}

.alert-center {
  min-height: 272px !important;
}

.dash-card-head {
  margin-bottom: 18px !important;
}

.dash-card h3 {
  font-size: 16px !important;
}

.dash-chip {
  border-radius: 14px !important;
  color: var(--primary-2) !important;
  border: 1px solid rgba(238, 75, 69, 0.16) !important;
  background: #fff7f4 !important;
}

.page-heading {
  min-height: 104px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 24px !important;
}

.page-heading h2 {
  font-size: 24px !important;
}

.page-heading .toolbar {
  margin-left: auto !important;
}

.page-heading .btn-primary {
  min-width: 160px !important;
  height: 50px !important;
  font-size: 15px !important;
}

.filter-bar {
  display: grid !important;
  grid-template-columns: minmax(280px, 1fr) repeat(auto-fit, minmax(160px, 220px)) !important;
  gap: 14px !important;
  padding: 18px !important;
}

.filter-bar input,
.filter-bar select {
  height: 48px !important;
}

.table-wrap {
  margin-top: 20px !important;
}

.data-table th,
.data-table td,
table th,
table td {
  padding: 16px !important;
}

.data-table tbody tr,
table tbody tr {
  min-height: 64px !important;
}

.row-actions {
  gap: 8px !important;
}

.row-actions .icon-btn,
td .icon-btn {
  width: 46px !important;
  height: 46px !important;
}

@media (max-width: 1060px) {
  .content {
    padding: 16px 12px 28px !important;
  }

  .dashboard-command-bar,
  .page-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
  }

  .dashboard-toolbar,
  .toolbar,
  .filter-bar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .dashboard-kpi-grid,
  .dashboard-main-grid,
  .dashboard-insights-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Ajuste fix4 - grafico fiel ao Figma e contraste de tabelas. */
.institutional-bar-chart {
  min-height: 220px !important;
}

.institutional-bar-chart .chart-legend {
  justify-content: flex-start !important;
  gap: 18px !important;
  margin-bottom: 8px !important;
}

.bar-chart {
  width: 100% !important;
  min-height: 230px !important;
}

.chart-axis-line {
  stroke: #eadbd6 !important;
  stroke-width: 1 !important;
}

.chart-gridline {
  stroke: #f1e4df !important;
  stroke-width: 1 !important;
}

.chart-bar {
  transition: opacity 160ms ease, transform 160ms ease !important;
}

.chart-bar:hover {
  opacity: 0.86 !important;
}

.chart-bar-primary {
  fill: #ee4b45 !important;
}

.chart-bar-accent {
  fill: #ffc84d !important;
}

.legend-line.green {
  background: #ee4b45 !important;
}

.legend-line.blue {
  background: #ffc84d !important;
}

.data-table thead,
.dashboard-table thead,
table thead {
  background: transparent !important;
}

.data-table thead tr,
.dashboard-table thead tr,
table thead tr,
.data-table thead th,
.dashboard-table thead th,
table thead th {
  color: #ffffff !important;
  background: linear-gradient(135deg, #ee4b45, #d83a35) !important;
}

.data-table thead th,
.dashboard-table thead th,
table thead th,
.dashboard-table th button {
  opacity: 1 !important;
  color: #ffffff !important;
  text-shadow: none !important;
}

.data-table thead th:first-child,
.dashboard-table thead th:first-child,
table thead th:first-child {
  border-top-left-radius: 8px !important;
}

.data-table thead th:last-child,
.dashboard-table thead th:last-child,
table thead th:last-child {
  border-top-right-radius: 8px !important;
}

.data-table th,
.dashboard-table th,
table th {
  opacity: 1 !important;
}

/* Ajuste fix9 - KPIs da dashboard: graficos no rodape sem cobrir textos. */
.dashboard-kpi-grid {
  align-items: stretch !important;
}

.dash-kpi {
  isolation: isolate !important;
  min-height: 156px !important;
  padding: 18px 20px 48px !important;
}

.dash-kpi-top,
.dash-kpi strong,
.dash-kpi p {
  position: relative !important;
  z-index: 2 !important;
}

.dash-kpi p {
  width: fit-content !important;
  max-width: calc(100% - 12px) !important;
  min-height: 18px !important;
  margin: 6px 0 0 !important;
  padding: 1px 7px 1px 0 !important;
  line-height: 1.35 !important;
  background: rgba(255, 255, 255, 0.88) !important;
}

.sparkline {
  left: 52px !important;
  right: 18px !important;
  bottom: 12px !important;
  z-index: 1 !important;
  width: calc(100% - 70px) !important;
  height: 28px !important;
  opacity: 0.72 !important;
  pointer-events: none !important;
}

.sparkline polyline,
.sparkline path {
  fill: none !important;
  stroke-width: 3 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* Ajuste fix11 - marca do menu lateral maior e centralizada. */
.sidebar .brand {
  position: relative !important;
  display: flex !important;
  width: 100% !important;
  box-sizing: border-box !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 138px !important;
  padding: 8px 48px 22px !important;
  margin: 0 0 18px !important;
  gap: 8px !important;
  text-align: center !important;
}

.sidebar .brand img {
  width: 72px !important;
  height: 72px !important;
  padding: 4px !important;
  border-radius: 18px !important;
  object-fit: cover !important;
}

.sidebar .brand div {
  display: flex !important;
  min-width: 0 !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 3px !important;
}

.sidebar .brand strong {
  max-width: 100% !important;
  font-size: 22px !important;
  line-height: 1.05 !important;
  text-align: center !important;
  white-space: normal !important;
}

.sidebar .brand span {
  max-width: 100% !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
  text-align: center !important;
  white-space: normal !important;
}

.sidebar .sidebar-collapse-btn {
  position: absolute !important;
  top: 8px !important;
  right: 6px !important;
  width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
}

body.sidebar-collapsed .sidebar .brand {
  display: grid !important;
  grid-template-columns: 1fr !important;
  justify-items: center !important;
  min-height: 92px !important;
  padding: 8px 0 10px !important;
  gap: 6px !important;
}

body.sidebar-collapsed .sidebar .brand img {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  padding: 4px !important;
}

body.sidebar-collapsed .sidebar .sidebar-collapse-btn {
  display: inline-grid !important;
  position: static !important;
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  justify-self: center !important;
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  margin: 0 !important;
}

body.sidebar-collapsed .sidebar .brand div {
  display: none !important;
}

@media (max-height: 760px) {
  .sidebar .brand {
    min-height: 130px !important;
    padding-bottom: 18px !important;
    margin-bottom: 14px !important;
  }

  .sidebar .brand img {
    width: 68px !important;
    height: 68px !important;
  }

  .sidebar .brand strong {
    font-size: 21px !important;
  }
}

@media (max-width: 1060px) {
  body.menu-open .sidebar .brand,
  .sidebar .brand {
    display: flex !important;
    grid-template-columns: none !important;
  }
}

/* Ajuste fix13 - Consumos compacto sem rolagem lateral em desktop. */
.content {
  width: min(1620px, 100%) !important;
}

.consumption-heading {
  min-height: 104px !important;
  padding: 22px 28px !important;
}

.consumption-heading h2 {
  font-size: 28px !important;
  line-height: 1.1 !important;
}

.consumption-heading .toolbar {
  gap: 10px !important;
}

.consumption-heading .btn {
  min-height: 46px !important;
  padding: 0 18px !important;
}

.consumption-filter-bar {
  grid-template-columns: minmax(280px, 1.4fr) minmax(150px, 0.65fr) minmax(140px, 0.65fr) minmax(180px, 0.8fr) !important;
  gap: 12px !important;
  padding: 18px 22px !important;
}

.consumption-filter-bar input,
.consumption-filter-bar select {
  height: 42px !important;
}

.consumption-table-wrap {
  margin-top: 18px !important;
  overflow-x: hidden !important;
}

.consumption-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

.consumption-table .col-id { width: 3.2%; }
.consumption-table .col-date { width: 7%; }
.consumption-table .col-vehicle { width: 8%; }
.consumption-table .col-driver { width: 13.5%; }
.consumption-table .col-location { width: 15.8%; }
.consumption-table .col-type { width: 6.5%; }
.consumption-table .col-fuel { width: 8.5%; }
.consumption-table .col-liters { width: 5%; }
.consumption-table .col-price { width: 6%; }
.consumption-table .col-total { width: 7.2%; }
.consumption-table .col-status { width: 8.8%; }
.consumption-table .col-actions { width: 10.5%; }

.consumption-table th,
.consumption-table td {
  padding: 10px 8px !important;
  font-size: 12.5px !important;
  line-height: 1.3 !important;
}

.consumption-table thead th {
  padding: 14px 8px !important;
  font-size: 10.5px !important;
  letter-spacing: 0 !important;
}

.consumption-table tbody tr {
  min-height: 52px !important;
}

.consumption-table .cell-id,
.consumption-table .cell-liters,
.consumption-table .cell-price,
.consumption-table .cell-total {
  white-space: nowrap !important;
}

.consumption-table .cell-driver span,
.consumption-table .cell-location span {
  display: -webkit-box !important;
  overflow: hidden !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

.consumption-table .cell-date,
.consumption-table .cell-vehicle,
.consumption-table .cell-fuel {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.consumption-table .cell-type .badge,
.consumption-table .cell-status .ticket-status {
  max-width: 100% !important;
  padding: 5px 9px !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

.consumption-table .row-actions {
  justify-content: flex-end !important;
  gap: 4px !important;
  flex-wrap: nowrap !important;
}

.consumption-table .row-actions .icon-btn,
.consumption-table td .icon-btn {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  border-radius: 8px !important;
}

.consumption-table .row-actions .icon-btn svg {
  width: 17px !important;
  height: 17px !important;
}

@media (max-width: 1280px) {
  .consumption-filter-bar {
    grid-template-columns: minmax(0, 1fr) minmax(140px, 0.55fr) minmax(130px, 0.55fr) minmax(160px, 0.7fr) !important;
  }

  .consumption-table th,
  .consumption-table td {
    padding-inline: 6px !important;
    font-size: 12px !important;
  }

  .consumption-table .cell-status .ticket-status {
    font-size: 10.5px !important;
  }
}

.sidebar-user {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px 10px !important;
}

.sidebar-password-btn {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-height: 34px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  border: 1px solid #bbf7d0 !important;
  border-radius: 8px !important;
  color: var(--primary-2) !important;
  background: #ecfdf5 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease !important;
}

.sidebar-password-btn:hover {
  border-color: #86efac !important;
  color: #064e3b !important;
  background: #dcfce7 !important;
}

.sidebar-password-btn svg {
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor !important;
}

body.sidebar-collapsed .sidebar-password-btn {
  display: none !important;
}

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

.wash-order-preview .ticket-authenticity {
  align-items: center;
}

.wash-order-preview .ticket-qr svg,
.ticket-preview .ticket-qr svg {
  display: block;
  width: 104px;
  height: 104px;
  max-width: 100%;
}

.wash-order-preview .ticket-lines strong {
  overflow-wrap: anywhere;
}
