:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-2: #eef4f2;
  --ink: #1a2428;
  --muted: #68777d;
  --line: #d9e2df;
  --brand: #E2383D;
  --brand-2: #B82028;
  --accent: #d88b1f;
  --danger: #b43b3b;
  --ok: #16815f;
  --input-bg: #ffffff;
  --focus-bg: #fffafa;
  --subtle-bg: #f9fbfa;
  --login-bg: linear-gradient(135deg, #fff6f6 0%, #f2f6f5 100%);
  --tooltip-bg: #13272b;
  --tooltip-text: #eef7f5;
  --tooltip-muted: #cde0dc;
  --warning-bg: #fff8eb;
  --warning-line: #ead2ad;
  --ok-bg: #dcf3ea;
  --danger-bg: #f9e3df;
  --review-bg: #f7e7ff;
  --pending-bg: #fff1d8;
  --muted-bg: #e9eeee;
  --muted-status: #61716c;
  --shadow: 0 18px 40px rgba(28, 43, 46, 0.08);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101719;
  --surface: #172124;
  --surface-2: #223034;
  --ink: #edf4f2;
  --muted: #aab9b5;
  --line: #314246;
  --brand: #E2383D;
  --brand-2: #ff5a60;
  --accent: #f0b35b;
  --danger: #ff777b;
  --ok: #49d09e;
  --input-bg: #111b1e;
  --focus-bg: #241b1d;
  --subtle-bg: #111b1e;
  --login-bg: linear-gradient(135deg, #1d1516 0%, #101719 100%);
  --tooltip-bg: #eef7f5;
  --tooltip-text: #152326;
  --tooltip-muted: #4d6267;
  --warning-bg: #2b2419;
  --warning-line: #765c31;
  --ok-bg: #15372d;
  --danger-bg: #3b2023;
  --review-bg: #2f2438;
  --pending-bg: #352a17;
  --muted-bg: #263236;
  --muted-status: #b3c1bd;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 180ms ease, color 180ms ease;
}

button,
input,
select,
textarea {
  font: inherit;
  font-size: 14px;
}

button,
select,
input,
textarea {
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

button:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

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

.sidebar {
  background: linear-gradient(180deg, #E2383D 0%, #B82028 100%);
  color: #eef7f5;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.brand:hover .brand-logo {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(226, 56, 61, 0.28);
}

.brand small,
.user-box small,
.user-box span {
  display: block;
  color: rgba(255, 255, 255, 0.76);
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-tab {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: transparent;
  color: #dcecea;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-tab.active,
.nav-tab:hover {
  background: rgba(255, 255, 255, 0.17);
}

.nav-tab:hover {
  transform: translateX(3px);
}

.nav-tab.active::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 999px;
  background: #fff;
}

.user-box {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.main {
  padding: 28px;
  overflow: auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  line-height: 1.3;
}

h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0;
}

h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

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

.theme-toggle {
  min-height: 40px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
}

.theme-toggle:hover {
  border-color: rgba(226, 56, 61, 0.35);
  background: var(--focus-bg);
  transform: translateY(-1px);
}

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

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  margin: 0;
  flex: 0 0 16px;
  accent-color: var(--brand);
}

select {
  cursor: pointer;
}

select:hover {
  border-color: rgba(226, 56, 61, 0.35);
}

select:focus,
input:focus,
textarea:focus {
  outline: 0;
  border-color: rgba(226, 56, 61, 0.55);
  box-shadow: 0 0 0 3px rgba(226, 56, 61, 0.12);
}

select:focus {
  background-color: var(--focus-bg);
}

/* Ícones modernos nos inputs */
input[type="email"] {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%2368777d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>');
  background-repeat: no-repeat;
  background-position: 10px center;
  padding-left: 36px;
}
input[type="password"] {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%2368777d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>');
  background-repeat: no-repeat;
  background-position: 10px center;
  padding-left: 36px;
}
input[type="search"] {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%2368777d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>');
  background-repeat: no-repeat;
  background-position: 10px center;
  padding-left: 36px;
}
select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%2368777d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

textarea {
  resize: vertical;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--login-bg);
}

.dashboard-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 180px)) auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dashboard-filters .primary-btn,
.dashboard-filters .ghost-btn {
  white-space: nowrap;
}

.login-panel {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-brand {
  align-self: start;
}

.login-theme-toggle {
  grid-column: 1;
  justify-self: start;
  align-self: start;
}

.login-form {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  gap: 14px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: viewIn 220ms ease both;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.metric:hover,
.panel:hover {
  border-color: rgba(226, 56, 61, 0.24);
  box-shadow: 0 20px 42px rgba(28, 43, 46, 0.11);
}

.metric {
  padding: 18px;
}

.metric span,
.metric small,
.panel-header span,
.section-head p {
  color: var(--muted);
}

.metric strong {
  display: block;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 10px 0;
}

.metric.warning strong {
  color: var(--danger);
}

.content-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel-header,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

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

.bar-row {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr 48px;
  align-items: center;
  gap: 12px;
}

.baggage-target-row {
  grid-template-columns: 180px 1fr 92px;
}

.otp-row {
  grid-template-columns: 220px 1fr 62px;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--ok);
  transition: width 260ms ease;
}

.bar-fill.alt {
  background: #8796a1;
}

.bar-fill.danger-fill {
  background: var(--danger);
}

.bar-fill.status-fill {
  background: #8796a1;
}

.bar-row strong {
  display: grid;
  gap: 2px;
}

.bar-row strong small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--subtle-bg);
}

.revision-alerts {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.revision-alert {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--warning-line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--warning-bg);
  padding: 12px;
}

.revision-alert span,
.review-note {
  color: var(--muted);
}

.reason-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.reason-list li {
  position: relative;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.reason-item {
  cursor: help;
}

.reason-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: min(360px, 82vw);
  display: none;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  box-shadow: 0 18px 38px rgba(19, 39, 43, 0.22);
  font-size: 13px;
}

.reason-tooltip::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: var(--tooltip-bg);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

.reason-tooltip b,
.reason-tooltip span {
  display: block;
}

.reason-tooltip span {
  color: var(--tooltip-muted);
  line-height: 1.35;
}

.reason-item:hover .reason-tooltip,
.reason-item:focus-within .reason-tooltip,
.reason-item:focus .reason-tooltip {
  display: grid;
}

.primary-btn {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  padding: 10px 14px;
  min-height: 42px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(226, 56, 61, 0.2);
}

.primary-btn:hover:not(:disabled) {
  background: var(--brand-2);
  box-shadow: 0 12px 24px rgba(226, 56, 61, 0.28);
  transform: translateY(-1px);
}

.primary-btn:disabled,
button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.logout-btn {
  margin-top: 12px;
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #eef7f5;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.logout-btn:hover {
  background: rgba(226, 56, 61, 0.2);
  border-color: rgba(226, 56, 61, 0.45);
}

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

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

th,
td {
  text-align: left;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--subtle-bg);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.status.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.status.bad {
  background: var(--danger-bg);
  color: var(--danger);
}

.status.review {
  background: var(--review-bg);
  color: #77419d;
}

.status.pending {
  background: var(--pending-bg);
  color: #96600f;
}

.status.muted {
  background: var(--muted-bg);
  color: var(--muted-status);
}

.danger-text {
  color: var(--danger);
}

.sla-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-panel,
.result-panel {
  box-shadow: none;
}

.wide-panel {
  grid-column: 1 / -1;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.three-cols {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.paired-field {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) 72px;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.paired-field label {
  min-width: 0;
}

.paired-field select,
.paired-field input {
  min-height: 36px;
  padding: 7px 8px;
}

.time-input-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.time-input-wrap input[type="time"] {
  flex: 1 1 auto;
  min-width: 0;
}

.now-btn {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid rgba(226, 56, 61, 0.24);
  border-radius: 8px;
  background: var(--focus-bg);
  color: var(--brand);
  padding: 0 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.now-btn:hover {
  border-color: rgba(226, 56, 61, 0.45);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.collapsible {
  display: none;
  margin-bottom: 16px;
}

.collapsible.open {
  display: block;
  animation: viewIn 220ms ease both;
}

.form-message {
  display: inline-block;
  margin-left: 10px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
}

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

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

.check-grid label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.service-grid {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subtle-bg);
}

.field-title {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.full-label {
  margin: 12px 0;
}

.flight-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.summary-item {
  background: var(--subtle-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.summary-item small {
  color: var(--muted);
  display: block;
  margin-bottom: 3px;
}

.revision-summary {
  grid-column: 1 / -1;
  border-color: var(--warning-line);
  background: var(--warning-bg);
}

.attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.attachment-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.attachment-badge:hover {
  background: var(--focus-bg);
  border-color: rgba(226, 56, 61, 0.35);
  transform: translateY(-1px);
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.list-filter-panel,
.rule-filter-panel {
  margin-bottom: 16px;
  padding: 16px;
}

.list-filter-head,
.rule-filter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.list-filter-head h3,
.rule-filter-head h3 {
  margin-bottom: 4px;
}

.list-filter-head p,
.rule-filter-head p {
  color: var(--muted);
  font-size: 14px;
}

.list-filter-head span,
.rule-filter-head span {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.list-filter-grid .ghost-btn,
.rule-filter-grid .ghost-btn {
  align-self: end;
  min-height: 40px;
}

.rule-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.rule-card strong {
  display: block;
  margin-bottom: 10px;
}

.empty-rule-card {
  grid-column: 1 / -1;
}

.empty-rule-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.rule-meta {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.rule-edit-btn {
  margin-top: 14px;
  width: 100%;
}

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

.validation-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow);
}

.validation-actions {
  display: flex;
  gap: 8px;
}

.rule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.ghost-btn:hover:not(:disabled) {
  border-color: rgba(226, 56, 61, 0.35);
  background: var(--focus-bg);
  box-shadow: 0 8px 18px rgba(28, 43, 46, 0.07);
  transform: translateY(-1px);
}

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

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

.admin-table {
  margin-top: 16px;
}

@media (max-width: 1100px) {
  .three-cols {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

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

  .sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 16px 20px;
    gap: 16px;
  }

  .nav-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .nav-tab.active::before {
    inset: auto 14px 4px 14px;
    width: auto;
    height: 3px;
  }

  .metric-grid,
  .content-grid,
  .sla-layout,
  .login-panel {
    grid-template-columns: 1fr;
  }

  .login-form,
  .login-theme-toggle {
    grid-column: auto;
    grid-row: auto;
  }

  .revision-alert {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head,
  .panel-header,
  .list-filter-head,
  .rule-filter-head,
  .revision-alert {
    align-items: stretch;
    flex-direction: column;
  }

  .user-box {
    margin-top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .user-box .logout-btn {
    margin-top: 0;
    width: auto;
    padding: 0 16px;
  }

  .top-actions,
  .validation-actions,
  .dashboard-filters {
    flex-wrap: wrap;
  }

  .dashboard-filters {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .image-modal-nav.prev { left: 10px; }
  .image-modal-nav.next { right: 10px; }
  .image-modal-close { top: 10px; right: 10px; }
  .image-modal-counter { bottom: 10px; }
}

@media (max-width: 560px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  h1 {
    font-size: 24px;
  }

  .metric strong {
    font-size: 28px;
  }

  .form-grid,
  .check-grid,
  .flight-summary,
  .dashboard-filters,
  .three-cols {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .paired-field {
    grid-template-columns: 1fr;
  }
}

/* Ajuste da cor do ícone no modo escuro */
[data-theme="dark"] input[type="email"] { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23aab9b5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>'); }
[data-theme="dark"] input[type="password"] { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23aab9b5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>'); }
[data-theme="dark"] input[type="search"] { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23aab9b5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>'); }
[data-theme="dark"] select { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23aab9b5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>'); }
