/* =========================================================
   Hangar Fox (antigo AeroOps) — sistema de gestão de aeronaves
   Tipografia: Inter. As cores abaixo são a base; a marca de cada endereço troca as variáveis
   (brands/hangarfox/hangarfox.css e brands/foxone/foxone.css).
   ========================================================= */
:root {
  --orange: #f04a0f;
  --orange-600: #d63f08;
  --orange-700: #b23306;
  --orange-50: #fff4ee;
  --orange-100: #ffe6d9;
  --orange-200: #fdc8b0;
  --orange-300: #fba47f;
  --ink: #15171a;
  --text: #33363b;
  --muted: #6a6f76;
  --soft: #9a9ea5;
  --line: #e7e8eb;
  --line-soft: #f0f1f3;
  --canvas: #f7f7f8;
  --surface: #ffffff;
  --green: #15803d;
  --green-bg: #e7f6ec;
  --amber: #b45309;
  --amber-bg: #fff3dc;
  --red: #d92d20;
  --red-bg: #fdeceb;
  --purple: #7a3fd6;
  --purple-bg: #f1eaff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 18, 22, .04), 0 6px 20px rgba(16, 18, 22, .04);
  --shadow-lg: 0 24px 60px rgba(16, 18, 22, .18);
  --sidebar: 264px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; letter-spacing: -.02em; }
.icon { flex: none; display: block; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.hidden { display: none !important; }

/* ---------- Estrutura ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  background: #fcfcfc; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 14px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 26px; }
.brand svg { width: 46px; height: 30px; }
.brand-name { font-size: 25px; font-weight: 800; color: var(--ink); letter-spacing: -.035em; }
.nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 10px;
  color: #3e4247; font-size: 15.5px; font-weight: 500; transition: background .15s, color .15s;
}
.nav-item .icon { color: #5d6168; }
.nav-item:hover { background: #f3f3f4; }
.nav-item.active { background: var(--orange-50); color: var(--orange); font-weight: 600; }
.nav-item.active .icon { color: var(--orange); }
.nav-item .badge { margin-left: auto; background: var(--orange-100); color: var(--orange-700); font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 20px; }
.org-card {
  margin-top: 12px; border-top: 1px solid var(--line); padding: 16px 10px 4px;
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; position: relative;
}
.org-logo { width: 42px; height: 42px; border-radius: 50%; background: #1d1f23; display: grid; place-items: center; flex: none; }
.org-logo svg { width: 26px; height: 18px; }
.org-card strong { display: block; font-size: 14.5px; color: var(--ink); }
.org-card small { display: block; font-size: 13px; color: var(--muted); }
.org-card > .icon { margin-left: auto; color: var(--soft); }

.main { margin-left: var(--sidebar); width: calc(100% - var(--sidebar)); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 74px; background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px; padding: 0 32px;
}
.mobile-menu, .mobile-brand { display: none; }
.global-search { position: relative; flex: 0 1 580px; }
.global-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--soft); }
.global-search input {
  width: 100%; height: 44px; border: 1px solid var(--line); background: #f6f6f7; border-radius: 10px;
  padding: 0 14px 0 44px; font-size: 15px; outline: none; transition: border-color .15s, background .15s;
}
.global-search input:focus { border-color: var(--orange-300); background: #fff; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 420px; overflow: auto; z-index: 50;
}
.search-results a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; }
.search-results a:hover, .search-results a.focus { background: var(--orange-50); }
.search-results small { display: block; color: var(--muted); font-size: 13px; }
.search-results .group { font-size: 12px; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; padding: 8px 12px 4px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.bell { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; color: #4a4e55; }
.bell:hover { background: #f3f3f4; }
.bell b { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; }
.user-chip { display: flex; align-items: center; gap: 12px; padding-left: 18px; border-left: 1px solid var(--line); text-align: left; }
.user-chip strong { display: block; font-size: 15px; color: var(--ink); line-height: 1.25; }
.user-chip small { display: block; font-size: 13px; color: var(--muted); }
.user-chip > .icon { color: var(--soft); }

.page { padding: 28px 32px 64px; max-width: 1560px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -.035em; line-height: 1.15; }
.page-head p { margin: 6px 0 0; font-size: 17px; color: var(--muted); }
.page-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; font-weight: 500; margin-bottom: 14px; }
.back-link:hover { color: var(--orange); }
.preview-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--orange-700); background: var(--orange-50); border: 1px solid var(--orange-100); padding: 3px 10px; border-radius: 20px; vertical-align: middle; margin-left: 10px; letter-spacing: 0; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 46px; padding: 0 22px;
  border-radius: 10px; font-size: 15px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 6px 16px rgba(240, 74, 15, .22); }
.btn-primary:hover { background: var(--orange-600); }
.btn-outline { background: #fff; color: var(--orange); border: 1px solid var(--orange-200); }
.btn-outline:hover { background: var(--orange-50); }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: #f6f6f7; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #f6c7c3; }
.btn-danger:hover { background: var(--red-bg); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #126a33; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 9px; gap: 8px; }
.btn-xs { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; gap: 6px; }
.btn-icon { width: 46px; padding: 0; }
.btn-sm.btn-icon { width: 38px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.link { color: var(--orange); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.link:hover { color: var(--orange-700); }

/* ---------- Cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 14px; }
.card-head h2 { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-head h2 .icon { color: var(--text); }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; }
.card-body { padding: 0 24px 22px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mb { margin-bottom: 18px; }
.mt { margin-top: 18px; }

.stat-card { display: flex; gap: 14px; align-items: flex-start; padding: 20px 20px; }
.stat-card > div { min-width: 0; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--orange-50); color: var(--orange); }
.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.red { background: var(--red-bg); color: var(--red); }
.stat-icon.amber { background: var(--amber-bg); color: var(--amber); }
.stat-icon.gray { background: #f1f2f4; color: #50545b; }
.stat-icon.purple { background: var(--purple-bg); color: var(--purple); }
.stat-label { font-size: 15px; color: var(--text); font-weight: 500; }
.stat-value { white-space: nowrap; font-size: clamp(20px, 1.6vw, 28px); font-weight: 750; color: var(--ink); letter-spacing: -.03em; line-height: 1.2; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.stat-value.red { color: var(--red); }
.stat-sub { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat-card.highlight { background: var(--orange-50); border-color: var(--orange-100); }
.stat-link { text-align: left; width: 100%; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s; }
.stat-link:hover { border-color: var(--orange-200); box-shadow: 0 4px 14px rgba(16, 24, 40, .06); }
.stat-link.active { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.trend.up { color: var(--green); background: var(--green-bg); }
.trend.down { color: var(--red); background: var(--red-bg); }
.trend.warn { color: var(--amber); background: var(--amber-bg); }

/* ---------- Pílulas de status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 20px; white-space: nowrap; line-height: 1.4; }
.pill-green { color: var(--green); background: var(--green-bg); }
.pill-amber { color: var(--amber); background: var(--amber-bg); }
.pill-red { color: var(--red); background: var(--red-bg); }
.pill-orange { color: var(--orange-700); background: var(--orange-50); border: 1px solid var(--orange-100); }
.pill-gray { color: #52565d; background: #f0f1f3; }
.pill-purple { color: var(--purple); background: var(--purple-bg); }
.pill-dark { color: #fff; background: rgba(20, 22, 26, .55); backdrop-filter: blur(6px); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- Banner da aeronave ---------- */
.hero {
  position: relative; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; min-height: 190px;
  background: #2a2f36 center / cover no-repeat; color: #fff; display: flex; align-items: flex-end;
}
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 16, 20, .82) 0%, rgba(14, 16, 20, .55) 32%, rgba(14, 16, 20, 0) 62%); }
.hero.no-photo { background: linear-gradient(120deg, #1f2227, #474c55); }
.hero.no-photo .hero-plane { position: absolute; right: 8%; top: 50%; transform: translateY(-50%) rotate(-8deg); color: rgba(255, 255, 255, .16); }
.hero-content { position: relative; padding: 24px 32px; }
.hero-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; opacity: .92; }
.hero-brand { font-size: 15px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .95; }
.hero h2 { color: #fff; font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin: 6px 0 2px; }
.hero-model { font-size: 19px; opacity: .95; }
.hero-badges { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.hero-badges .pill { font-size: 14px; padding: 6px 14px; }
.hero-badges .pill-green { background: #e9f8ee; }
.hero-badges .pill-light { background: rgba(255, 255, 255, .88); color: var(--ink); }
.hero-action { position: absolute; top: 20px; right: 20px; z-index: 2; }
.hero-action .btn { background: #fff; color: var(--ink); border: 0; box-shadow: var(--shadow); }
.hero-stats { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); border-top: 0; }
.hero-stat { display: flex; gap: 12px; padding: 20px 18px; align-items: flex-start; min-width: 0; }
.hero-stat + .hero-stat { border-left: 1px solid var(--line); }
.hero-stat > .icon { color: #50545b; margin-top: 2px; }
.hero-stat > div { min-width: 0; flex: 1; }
.hero-stats.six .hero-stat { padding: 18px 14px; gap: 10px; }
.hero-stats.six .hero-stat strong { font-size: 21px; }
.hero-stats.six .hero-stat span { font-size: 14px; }
.hero-stat span { display: block; font-size: 14.5px; color: var(--muted); }
.hero-stat strong { display: block; white-space: nowrap; font-size: 23px; font-weight: 750; color: var(--ink); letter-spacing: -.02em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.hero-stat small { display: block; font-size: 13.5px; color: var(--muted); }

/* ---------- Abas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 24px 0 20px; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; font-size: 16px; font-weight: 500; color: var(--text); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--orange); }
.tab.active { color: var(--orange); border-color: var(--orange); font-weight: 600; }
.subtabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 0 24px 6px; }
.subtabs button { padding: 10px 12px; font-size: 14.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs button.active { color: var(--orange); border-color: var(--orange); font-weight: 600; }

/* ---------- Listas e tabelas ---------- */
.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; padding: 0 24px 20px; }
.dl > div { border-right: 1px solid var(--line-soft); padding-right: 20px; min-width: 0; }
.dl > div:last-child { border: 0; padding-right: 0; }
.dl-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; padding: 7px 0; font-size: 14.5px; }
.dl-row dt { color: var(--muted); }
.dl-row dd { margin: 0; color: var(--ink); font-weight: 500; }
.dl-row dd small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 12px 16px; background: #fafafb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); color: var(--text); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; transition: background .12s; }
.table tbody tr.clickable:hover { background: #fcf8f6; }
.table td strong { color: var(--ink); font-weight: 600; display: block; }
.table td small { display: block; color: var(--muted); font-size: 13.5px; }
.table .right { text-align: right; }
.table.nowrap td { white-space: nowrap; }
.table.nowrap { font-size: 14.5px; }
.table.nowrap .pill { padding: 3px 10px; font-size: 12.5px; }
.table.nowrap td, .table.nowrap th { padding-left: 12px; padding-right: 12px; }
.table.nowrap td:first-child, .table.nowrap th:first-child { padding-left: 20px; }
.table.nowrap td:last-child, .table.nowrap th:last-child { padding-right: 20px; }
.table tfoot td { font-weight: 700; color: var(--ink); background: #fafafb; border-top: 1px solid var(--line); }

.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row strong { display: block; color: var(--ink); font-weight: 600; font-size: 15px; }
.list-row small { display: block; color: var(--muted); font-size: 14px; }
.list-row > .icon { color: var(--muted); }
.row-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.row-icon.red { color: var(--red); background: var(--red-bg); }
.row-icon.amber { color: var(--amber); background: var(--amber-bg); }
.row-icon.green { color: var(--green); background: var(--green-bg); }
.row-icon.orange { color: var(--orange); background: var(--orange-50); }
.row-icon.gray { color: #50545b; background: #f1f2f4; }

.date-badge { width: 52px; flex: none; border: 1px solid var(--line); border-radius: 10px; text-align: center; padding: 6px 0; background: #fff; }
.date-badge b { display: block; font-size: 19px; font-weight: 750; color: var(--ink); line-height: 1.15; }
.date-badge span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.date-badge.orange { border-color: var(--orange-200); background: var(--orange-50); }
.date-badge.orange b { color: var(--orange-700); }
.route { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); font-size: 16px; flex-wrap: wrap; }
.route .icon { color: var(--muted); }
.route-sub { display: flex; gap: 10px; color: var(--muted); font-size: 14px; align-items: center; flex-wrap: wrap; }
.route-sub i { width: 1px; height: 14px; background: var(--line); }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; flex: none; background: var(--orange-100); color: var(--orange-700); }
.avatar.lg { width: 46px; height: 46px; font-size: 16px; background: var(--orange); color: #fff; }
.avatar.sm { width: 34px; height: 34px; font-size: 12.5px; }
.avatar.c1 { background: #ffe6d9; color: #b23306; }
.avatar.c2 { background: #e7f6ec; color: #15803d; }
.avatar.c3 { background: #f1eaff; color: #6d32c9; }
.avatar.c4 { background: #fff3dc; color: #a24b05; }
.avatar.c5 { background: #f0f1f3; color: #3d4148; }

/* ---------- Formulários ---------- */
.form-card { margin-bottom: 18px; }
.form-card .card-head { border-bottom: 1px solid var(--line-soft); padding-bottom: 16px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px 18px; padding: 0 24px 24px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; } .span-2 { grid-column: span 2; } .span-9 { grid-column: span 9; } .span-5 { grid-column: span 5; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field-label { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.field > label .opt { font-weight: 400; color: var(--soft); }
.field input, .field select, .field textarea, .input {
  height: 46px; width: 100%; border: 1px solid #dcdee2; border-radius: 10px; background: #fff; padding: 0 14px;
  font-size: 15.5px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(240, 74, 15, .12); }
.field input[readonly] { background: #f7f7f8; color: var(--muted); }
.field input.invalid, .field select.invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(217, 45, 32, .1); }
.field .hint { font-size: 13.5px; color: var(--muted); }
.hint .bad, .hint.bad { color: var(--red); }
.dec-split { margin: -6px 0 0; font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dec-split b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dec-split .icon { color: var(--green); }
/* Pagamento parcial */
.pay-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: #fafafb; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pay-summary > div { padding: 12px 14px; min-width: 0; }
.pay-summary > div + div { border-left: 1px solid var(--line); }
.pay-summary span { display: block; font-size: 13px; color: var(--muted); }
.pay-summary strong { display: block; font-size: 18px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.pay-summary strong.accent { color: var(--orange); }
.pay-summary small { display: block; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.partial-note { color: var(--purple) !important; font-weight: 500; }
/* Filtros ativos visíveis (Financeiro) */
.filter-chips { display: flex; flex-direction: column; gap: 8px; }
.filter-note { margin: 0; font-size: 13.5px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.filter-note .icon { flex: none; margin-top: 2px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--orange-100); background: var(--orange-50); color: var(--orange-700); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--orange); }
/* Fatura de vários voos */
.inv-items { display: flex; flex-direction: column; gap: 8px; }
.inv-item { display: grid; grid-template-columns: 22px minmax(0, 1.6fr) minmax(0, 1.1fr) minmax(0, 1.3fr) 150px auto; gap: 8px; align-items: center; }
.inv-item .input.invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(217, 45, 32, .1); }
.inv-n { font-size: 13px; font-weight: 700; color: var(--soft); text-align: center; }
.inv-item > select, .inv-item > input, .inv-item .input-group, .inv-item .input-group input { min-width: 0; width: 100%; }
.inv-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
@media (max-width: 760px) { .inv-item { grid-template-columns: 22px minmax(0, 1fr) auto; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); } .inv-item > :not(.inv-n):not([data-item-del]) { grid-column: 2; } .inv-item [data-item-del] { grid-column: 3; grid-row: 1; } }
[data-excess] .check-row { align-items: flex-start; }
[data-excess] .check-row input { margin-top: 3px; }
@media (max-width: 520px) { .pay-summary { grid-template-columns: 1fr; } .pay-summary > div + div { border-left: 0; border-top: 1px solid var(--line); } }
.field .error { font-size: 13.5px; color: var(--red); font-weight: 500; }
.input-group { display: flex; align-items: stretch; }
.input-group input { border-radius: 10px 0 0 10px; }
.input-group .suffix { display: flex; align-items: center; padding: 0 14px; border: 1px solid #dcdee2; border-left: 0; border-radius: 0 10px 10px 0; background: #f7f7f8; color: var(--muted); font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.segmented { display: inline-flex; background: #f1f2f4; border-radius: 10px; padding: 4px; gap: 2px; }
.segmented button { height: 38px; padding: 0 16px; border-radius: 8px; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.segmented button.active { background: #fff; color: var(--orange); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--ink); user-select: none; }
.switch input { display: none; }
.switch .track { width: 44px; height: 26px; border-radius: 20px; background: #d5d7db; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked + .track { background: var(--orange); }
.switch input:checked + .track::after { transform: translateX(18px); }
.form-footer {
  position: sticky; bottom: 0; z-index: 20; margin: 8px -32px -64px; padding: 16px 32px; background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(8px); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 12px; align-items: center;
}
.form-footer .status { margin-right: auto; color: var(--muted); font-size: 14.5px; }
.photo-drop { display: flex; align-items: center; gap: 18px; }
.photo-preview { width: 200px; height: 96px; border-radius: 10px; background: #f1f2f4 center / cover no-repeat; border: 1px dashed #cfd2d7; display: grid; place-items: center; color: var(--soft); flex: none; }
.owners-table td { padding: 10px 8px; }
.owners-table th { padding: 10px 8px; }
.owners-table select, .owners-table input { height: 42px; border: 1px solid #dcdee2; border-radius: 9px; padding: 0 10px; width: 100%; font-size: 15px; outline: none; background: #fff; }
.owners-table select:focus, .owners-table input:focus { border-color: var(--orange); }
.share-total { display: flex; align-items: center; gap: 10px; font-size: 14.5px; padding: 12px 24px 0; }

/* ---------- Autocomplete de aeródromos ---------- */
.combo { position: relative; }
.combo input { text-transform: uppercase; }
.combo input::placeholder { text-transform: none; }
.combo-list {
  position: absolute; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: 420px; z-index: 60; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 320px; overflow: auto;
}
.combo-item { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.combo-item b { font-size: 15px; color: var(--ink); width: 48px; flex: none; }
.combo-item span { font-size: 14px; color: var(--text); line-height: 1.3; }
.combo-item small { display: block; color: var(--muted); font-size: 12.5px; }
.combo-item.active, .combo-item:hover { background: var(--orange-50); }
.combo-empty { padding: 10px; font-size: 14px; color: var(--muted); }
.combo-meta { font-size: 13px; color: var(--muted); min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Modal, toast, menus ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(18, 20, 24, .5); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
.modal { width: 560px; max-width: 100%; max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal.lg { width: 820px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 26px 6px; }
.modal-head h2 { font-size: 22px; font-weight: 750; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.modal-body { padding: 18px 26px; }
.modal-body .form-grid { padding: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px 22px; border-top: 1px solid var(--line-soft); }
.modal-close { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); flex: none; }
.modal-close:hover { background: #f3f3f4; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; background: #1b1d21; color: #fff; padding: 14px 18px; border-radius: 12px; font-size: 15px; box-shadow: var(--shadow-lg); animation: pop .2s; max-width: 420px; }
.toast .icon { color: #5dd38c; }
.toast.error .icon { color: #ff8a7a; }
.menu { position: absolute; z-index: 70; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 230px; }
.menu button, .menu a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 8px; text-align: left; font-size: 15px; color: var(--text); }
.menu button:hover, .menu a:hover { background: #f5f5f6; }
.menu .danger { color: var(--red); }
.menu .active { color: var(--orange); font-weight: 600; }
.menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 6px 0; }
.menu small { display: block; color: var(--muted); font-size: 13px; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .row-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; }
.empty h3 { font-size: 19px; margin-bottom: 6px; }
.empty p { margin: 0 auto 18px; max-width: 440px; font-size: 15px; }

.alert-box { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--red-bg); border: 1px solid #f6c7c3; }
.alert-box .icon { color: var(--red); margin-top: 2px; }
.alert-box strong { color: var(--red); display: block; font-size: 15.5px; }
.alert-box p { margin: 2px 0 0; font-size: 14px; color: var(--text); }
.alert-box.info { background: var(--orange-50); border-color: var(--orange-100); }
.alert-box.info .icon, .alert-box.info strong { color: var(--orange-700); }
.alert-box.ok { background: var(--green-bg); border-color: #bfe6cb; }
.alert-box.ok .icon, .alert-box.ok strong { color: var(--green); }

/* ---------- Gráficos ---------- */
.bar-chart { display: flex; height: 230px; padding: 10px 24px 22px 12px; gap: 12px; }
.bar-chart .y { display: flex; flex-direction: column; justify-content: space-between; font-size: 13px; color: var(--muted); text-align: right; padding-bottom: 28px; min-width: 34px; }
.bar-chart .plot { flex: 1; position: relative; display: flex; align-items: flex-end; justify-content: space-around; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.bar-chart .plot::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(to top, transparent 0 calc(33.33% - 1px), var(--line-soft) calc(33.33% - 1px) 33.33%); pointer-events: none; }
.bar { position: relative; width: min(64px, 11%); display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar i { display: block; width: 100%; background: var(--orange-300); border-radius: 6px 6px 0 0; transition: height .3s; }
.bar.current i { background: var(--orange); }
.bar i.stack-top { background: var(--orange-200); border-radius: 6px 6px 0 0; }
.bar i.stack-bottom { background: var(--orange); border-radius: 0; }
.bar b { position: absolute; left: 50%; transform: translateX(-50%); font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.bar span { position: absolute; bottom: -26px; left: 50%; transform: translateX(-50%); font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.donut { width: 168px; height: 168px; border-radius: 50%; position: relative; flex: none; }
.donut::after { content: ''; position: absolute; inset: 24px; background: #fff; border-radius: 50%; }
.donut div { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 1; }
.donut strong { display: block; font-size: 19px; font-weight: 750; color: var(--ink); }
.donut small { display: block; font-size: 13px; color: var(--muted); }
.legend-item { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.legend-item i { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; flex: none; }
.legend-item b { display: block; font-weight: 600; color: var(--ink); }
.progress { height: 8px; background: #f0f1f3; border-radius: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--orange); border-radius: 8px; }

/* ---------- Calendário ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; padding: 18px 20px; flex-wrap: wrap; }
.cal-toolbar h2 { font-size: 23px; font-weight: 750; margin-right: 12px; min-width: 190px; }
.cal-toolbar .spacer { flex: 1; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal-head { text-align: center; font-size: 14px; font-weight: 500; color: var(--muted); padding: 10px 4px; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 116px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 6px 5px; font-size: 14px; font-weight: 500; color: var(--ink); min-width: 0; cursor: pointer; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { color: #c3c6cb; background: #fcfcfc; }
.cal-day.today { background: var(--orange-50); }
.cal-day .daynum { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 13px; }
.cal-day.today .daynum { background: var(--orange); color: #fff; font-weight: 700; }
.cal-day:hover { background: #fdfaf8; }
.cal-ev { margin-top: 5px; border-radius: 7px; padding: 4px 5px; font-size: 12px; line-height: 1.3; cursor: pointer; overflow: hidden; }
.cal-ev b { display: flex; align-items: flex-start; gap: 5px; font-size: 12.5px; }
.cal-ev b::before { content: ''; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: currentColor; flex: none; }
.cal-ev b .ttl-full { min-width: 0; overflow: hidden; overflow-wrap: break-word; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; } /* nome do solicitante, até 2 linhas */
.cal-ev b .ttl-first { display: none; }
.cal-ev small { display: block; color: var(--ink); font-size: 11px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.green { background: var(--green-bg); color: var(--green); }
.cal-ev.orange { background: var(--orange-50); color: var(--orange-700); }
.cal-ev.purple { background: var(--purple-bg); color: var(--purple); }
.cal-ev.red { background: var(--red-bg); color: var(--red); }
.cal-ev.gray { background: #f0f1f3; color: #50545b; }
.cal-ev.selected { outline: 2px solid currentColor; }
.cal.week .cal-day { min-height: 380px; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; padding: 6px 12px 14px; }
.week-strip span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.week-strip button { display: grid; place-items: center; width: 42px; height: 42px; margin: 6px auto 0; border-radius: 50%; font-size: 16.5px; font-weight: 600; color: var(--ink); position: relative; }
.week-strip button.active { background: var(--orange); color: #fff; }
.week-strip button.has::after { content: ''; position: absolute; bottom: -6px; width: 5px; height: 5px; border-radius: 50%; background: var(--orange); }

/* ---------- Voos: trechos ---------- */
.leg-card { margin-bottom: 14px; overflow: visible; }
.leg-head { display: flex; align-items: center; gap: 16px; padding: 18px 22px; cursor: pointer; flex-wrap: wrap; }
.leg-num { width: 38px; height: 38px; border-radius: 10px; background: var(--orange-50); color: var(--orange); font-weight: 750; display: grid; place-items: center; flex: none; font-size: 16px; }
.leg-card.closed .leg-num { background: var(--green-bg); color: var(--green); }
.leg-head .grow { flex: 1; min-width: 200px; }
.leg-head .chev { color: var(--muted); transition: transform .15s; }
.leg-card.open .leg-head .chev { transform: rotate(180deg); }
.leg-body { border-top: 1px solid var(--line-soft); padding-top: 20px; }
.leg-section { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); grid-column: span 12; margin-top: 4px; display: flex; align-items: center; gap: 10px; }
.leg-section::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.calc-box { grid-column: span 12; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: #fafafb; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.calc-box > div { padding: 14px 16px; min-width: 0; }
.calc-box > div + div { border-left: 1px solid var(--line); }
.calc-box span { display: block; font-size: 13.5px; color: var(--muted); }
.calc-box strong { display: block; font-size: 21px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.calc-box strong.accent { color: var(--orange); }
.calc-box small { display: block; font-size: 13px; color: var(--muted); }
.calc-box .warn { color: var(--amber); }
.calc-box .bad { color: var(--red); }
.leg-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 0 24px 22px; flex-wrap: wrap; }
.leg-actions .left { margin-right: auto; display: flex; gap: 10px; }
.trip-summary { position: sticky; top: 92px; }
.summary-list { padding: 0 24px 20px; }
.summary-list div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 15px; }
.summary-list div:first-child { border-top: 0; }
.summary-list span { color: var(--muted); }
.summary-list strong { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.summary-big { padding: 4px 24px 18px; }
.summary-big strong { font-size: 36px; font-weight: 800; color: var(--ink); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.summary-big span { font-size: 16px; color: var(--muted); margin-left: 6px; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.info-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 18px; }
.info-strip > div { padding: 16px 20px; min-width: 0; }
.info-strip > div + div { border-left: 1px solid var(--line); }
.info-strip span { display: block; font-size: 13.5px; color: var(--muted); }
.info-strip strong { display: block; font-size: 16px; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.toolbar { display: flex; gap: 12px; padding: 16px 20px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.toolbar .field { flex-direction: row; align-items: center; }
.toolbar .search { position: relative; flex: 1 1 260px; max-width: 380px; }
.toolbar .search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--soft); }
.toolbar .search input { padding-left: 42px; }
.toolbar select, .toolbar input { height: 42px; border: 1px solid #dcdee2; border-radius: 10px; padding: 0 12px; font-size: 15px; background: #fff; outline: none; }
.toolbar select:focus, .toolbar input:focus { border-color: var(--orange); }

.leg-plan-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr) 140px; gap: 14px; }
@media (max-width: 1280px) { .leg-plan-grid { grid-template-columns: 1fr 1fr; } }
[hidden] { display: none !important; }

/* ---------- Aeronaves ---------- */
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.fleet-card { overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; cursor: pointer; }
.fleet-card:hover { box-shadow: 0 12px 30px rgba(16, 18, 22, .1); transform: translateY(-2px); }
.fleet-photo { height: 150px; background: linear-gradient(120deg, #1f2227, #4b505a) center / cover no-repeat; position: relative; display: grid; place-items: center; color: rgba(255, 255, 255, .22); }
.fleet-photo .pill { position: absolute; top: 14px; left: 14px; }
.fleet-photo .sel { position: absolute; top: 14px; right: 14px; }
.fleet-info { padding: 18px 20px 6px; }
.fleet-info h3 { font-size: 24px; font-weight: 800; }
.fleet-info p { margin: 2px 0 0; color: var(--muted); }
.fleet-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 20px 18px; gap: 10px; }
.fleet-stats span { display: block; font-size: 13px; color: var(--muted); }
.fleet-stats b { display: block; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.fleet-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-soft); margin-top: auto; color: var(--muted); font-size: 14px; }
.fleet-foot .link { margin-left: auto; font-size: 14.5px; }
.add-card { border: 2px dashed #d9dbe0; border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 320px; color: var(--muted); background: transparent; transition: border-color .15s, background .15s; }
.add-card:hover { border-color: var(--orange-300); background: #fffaf7; color: var(--orange); }
.add-card strong { font-size: 17px; color: var(--ink); }
.owner-row { display: flex; align-items: center; gap: 14px; padding: 9px 0; }
.owner-row .grow { flex: 1; min-width: 0; font-weight: 500; color: var(--ink); }
.owner-row .grow small { display: block; font-weight: 400; color: var(--muted); font-size: 13.5px; }
.owner-row .share { font-weight: 600; color: var(--ink); min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Ações rápidas ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.quick-btn { height: 56px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 16px; font-weight: 600; color: var(--orange); box-shadow: var(--shadow); transition: background .15s, border-color .15s; }
.quick-btn:hover { border-color: var(--orange-200); background: var(--orange-50); }
.quick-btn.primary { background: var(--orange); color: #fff; border-color: var(--orange); box-shadow: 0 8px 20px rgba(240, 74, 15, .25); }
.quick-btn.primary:hover { background: var(--orange-600); }

/* ---------- Navegação inferior (celular) ---------- */
.bottom-nav { display: none; }
.only-mobile { display: none !important; }

/* ---------- Responsivo ---------- */
@media (max-height: 860px) and (min-width: 761px) {
  .nav { gap: 2px; }
  .nav-item { padding: 9px 14px; }
  .brand { padding-bottom: 16px; }
}
@media (max-width: 1280px) {
  .g-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-stat:nth-child(4) { border-left: 0; }
  .hero-stat:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .layout-side { grid-template-columns: minmax(0, 1fr) 320px; }
  .info-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .info-strip > div:nth-child(4) { border-left: 0; }
  .info-strip > div:nth-child(n + 4) { border-top: 1px solid var(--line); }
}
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-side { grid-template-columns: minmax(0, 1fr); }
  .trip-summary { position: static; }
  .span-3 { grid-column: span 6; }
  .span-2 { grid-column: span 4; }
  .calc-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-box > div:nth-child(3) { border-left: 0; }
  .calc-box > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: 1fr; }
  .dl > div { border: 0; padding: 0; }
  .global-search { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 15.5px; background: #f6f6f7; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); width: 290px; }
  .sidebar.open { transform: none; }
  .sidebar-scrim { position: fixed; inset: 0; background: rgba(18, 20, 24, .45); z-index: 35; }
  .main { margin-left: 0; width: 100%; }
  .topbar { height: 64px; padding: 0 16px; gap: 10px; }
  .mobile-menu { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; margin-left: -6px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -.03em; }
  .mobile-brand svg { width: 36px; height: 24px; }
  .user-chip { border: 0; padding: 0; }
  .user-chip .who, .user-chip > .icon { display: none; }
  .topbar-right { gap: 8px; }
  .page { padding: 18px 16px 110px; }
  .page-head { margin-bottom: 18px; align-items: flex-start; }
  .page-head h1 { font-size: 27px; }
  .page-head p { font-size: 15.5px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .page-actions .btn-icon { flex: none; }
  .grid { gap: 12px; }
  .g-4, .g-3, .g-5 { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 14px; gap: 10px; flex-direction: column; }
  .stat-icon { width: 40px; height: 40px; }
  .stat-value { font-size: 23px; }
  .stat-label { font-size: 14px; }
  .card-head { padding: 16px 16px 10px; }
  .card-head h2 { font-size: 17.5px; }
  .card-body, .summary-list, .dl { padding-left: 16px; padding-right: 16px; }
  .form-grid { padding: 0 16px 18px; gap: 14px; }
  .span-8, .span-6, .span-5, .span-4, .span-9 { grid-column: span 12; }
  .span-3 { grid-column: span 6; }
  .span-2 { grid-column: span 6; }
  .hero { min-height: 170px; }
  .hero-content { padding: 18px; }
  .hero h2 { font-size: 34px; }
  .hero-model { font-size: 16px; }
  .hero-action { top: 12px; right: 12px; }
  .hero-action .btn span { display: none; }
  .hero-stats, .info-strip { grid-template-columns: 1fr 1fr; }
  .hero-stat, .info-strip > div { padding: 14px 16px; border: 0 !important; border-top: 1px solid var(--line) !important; }
  .hero-stat:nth-child(even), .info-strip > div:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .hero-stat strong { font-size: 20px; }
  .hero-stat > .icon { display: none; }
  .tabs { margin: 16px -16px 14px; padding: 0 8px; }
  .tab { padding: 10px 12px; font-size: 15px; }
  .table th, .table td { padding: 12px; }
  .calc-box strong { font-size: 19px; }
  .leg-head { padding: 14px 16px; gap: 12px; }
  .leg-actions { padding: 0 16px 16px; }
  .leg-actions .btn { flex: 1; }
  .leg-actions .left { width: 100%; margin: 0; }
  .form-footer { margin: 8px -16px -110px; padding: 12px 16px calc(78px + env(safe-area-inset-bottom)); }
  .form-footer .status { display: none; }
  .form-footer .btn { flex: 1; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .quick-btn { flex-direction: column; height: auto; padding: 12px 4px; gap: 6px; font-size: 12.5px; color: var(--ink); font-weight: 500; text-align: center; }
  .quick-btn .icon { color: var(--orange); }
  .quick-btn.primary { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
  .quick-btn.primary .icon { color: var(--orange); }
  .cal-day { min-height: 74px; padding: 4px; }
  .cal-ev small { display: none; }
  .cal-ev { padding: 3px; } /* no celular: primeiro nome e matrícula, quebrando a palavra se preciso */
  .cal-ev b { font-size: 11px; }
  .cal-ev b::before { display: none; }
  .cal-ev b .ttl-full { display: none; }
  .cal-ev b .ttl-first { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-width: 0; overflow: hidden; overflow-wrap: anywhere; }
  .cal-ev small.cal-reg { display: block; font-size: 10px; white-space: normal; overflow-wrap: anywhere; }
  .cal-toolbar h2 { font-size: 19px; min-width: 0; }
  .only-mobile { display: initial !important; }
  .only-mobile.block { display: block !important; }
  .only-mobile.flex { display: flex !important; }
  .only-desktop { display: none !important; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 500; color: #6a6f76; padding: 6px 0; }
  .bottom-nav .active { color: var(--orange); font-weight: 600; }
  .bottom-nav .active .icon-wrap { background: var(--orange); color: #fff; }
  .bottom-nav .icon-wrap { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
  .toast-stack { left: 16px; right: 16px; bottom: 90px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .fleet-grid { grid-template-columns: 1fr; }
  .sticky-cta { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 44; height: 54px; font-size: 16.5px; }
}
@media (max-width: 1600px) {
  #finGrid1, #rateioGrid { grid-template-columns: 1fr !important; }
  #finGrid1 .payables-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); column-gap: 28px; }
  #finGrid1 .payables-body .list-row:nth-child(-n + 3) { border-top: 0; }
}
@media (max-width: 1100px) {
  #ovGrid, #agendaGrid, #finGrid1, #finGrid2, #rateioGrid, .stack-mid { grid-template-columns: 1fr !important; }
  .g-3.stack-mobile { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .stack-mobile { grid-template-columns: 1fr !important; }
  .hero-stats.compact-mobile .hero-stat:nth-child(n + 3) { display: none; }
}
@media (max-width: 420px) {
  .g-4, .g-3, .g-5 { grid-template-columns: 1fr 1fr; }
  .calc-box { grid-template-columns: 1fr 1fr; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .page-actions, .form-footer, .leg-actions { display: none !important; }
  .main { margin: 0; width: 100%; }
  body { background: #fff; }
}

/* ---------- Financeiro, contas a pagar e tripulantes ---------- */
.ellipsis { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clickable-row { cursor: pointer; }
.clickable-row:hover strong { color: var(--orange); }
.date-badge.red { border-color: #f6c4bf; background: var(--red-bg); }
.date-badge.red b, .date-badge.red span { color: var(--red); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend-dot.red { background: var(--red); } .legend-dot.amber { background: var(--amber); } .legend-dot.orange { background: var(--orange); }
.legend-dot.gray { background: #b5b9bf; } .legend-dot.green { background: var(--green); } .legend-dot.purple { background: var(--purple); }
.cal-ev.amber { background: var(--amber-bg); color: var(--amber); }
.cal-total { float: right; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.cal-legend { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 20px 16px; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line-soft); }
.pay-toolbar { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pay-toolbar .tabs { border-bottom: 0; }
.pay-toolbar .segmented { margin-bottom: 8px; }
.pay-toolbar .segmented button { display: inline-flex; align-items: center; gap: 6px; }
.month-sep { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 6px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.month-sep:first-child { border-top: 0; padding-top: 0; }
.month-sep strong { color: var(--ink); font-size: 15px; }
.big-num { font-size: 24px; font-weight: 750; color: var(--ink); letter-spacing: -.02em; }
.proj { display: flex; flex-direction: column; gap: 10px; }
.proj-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.proj-m { font-size: 14px; font-weight: 600; color: var(--ink); grid-row: span 2; }
.proj-bar { display: flex; height: 10px; background: #f3f3f5; border-radius: 6px; overflow: hidden; }
.proj-bar i { display: block; height: 100%; }
.proj-bar i.c { background: var(--orange); } .proj-bar i.f { background: var(--orange-200); }
.proj-row b { font-size: 14px; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.proj-row small { grid-column: 2 / 4; font-size: 12.5px; color: var(--muted); }
.proj-row small.neg { color: var(--red); font-weight: 600; }
.cat-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 14px; align-items: center; }
.cat-bar span { display: flex; gap: 8px; align-items: center; color: var(--text); min-width: 0; }
.cat-bar b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.cat-bar .progress { grid-column: span 2; height: 6px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 14px; border-top: 1px solid var(--line-soft); font-size: 14px; color: var(--muted); }
.file-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fafafb; border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 13.5px; max-width: 100%; }
.file-chip button[data-open-file] { color: var(--ink); font-weight: 500; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button[data-open-file]:hover { color: var(--orange); text-decoration: underline; }
.file-chip small { color: var(--muted); font-size: 12px; }
.file-chip button[data-remove-file] { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.file-chip button[data-remove-file]:hover { background: var(--red-bg); color: var(--red); }
.quick-exp { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 24px 16px; }
.cost-wrap { padding: 0 24px 16px; }
.fx-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; color: var(--text); }
.fx-row input { width: 76px; height: 34px; border: 1px solid #dcdee2; border-radius: 8px; padding: 0 8px; font: inherit; font-weight: 600; text-align: right; }
.fx-row input:focus { outline: 2px solid var(--orange-200); border-color: var(--orange); }
.cost-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); margin-top: 6px; padding-top: 14px; font-size: 14px; }
.cost-foot .muted { display: inline-flex; gap: 6px; align-items: center; }
.mini-cal-wrap { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); gap: 22px; align-items: start; }
.mini-cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mini-cal-head strong { color: var(--ink); font-size: 15px; }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.mc-h { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.mc-day { position: relative; min-width: 0; padding: 0; height: 36px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--ink); display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.mc-day:hover { background: var(--orange-50); }
.mc-day.out { color: #c3c6cb; }
.mc-day.today { box-shadow: inset 0 0 0 1.5px var(--orange); color: var(--orange); font-weight: 700; }
.mc-day.sel { background: var(--orange); color: #fff; font-weight: 700; }
.mc-day i { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 50%; }
.mc-day.sel i { box-shadow: 0 0 0 1.5px #fff; }
.mc-day i.red, .mc-legend i.red { background: var(--red); } .mc-day i.amber { background: var(--amber); }
.mc-day i.orange, .mc-legend i.orange { background: var(--orange); } .mc-day i.gray, .mc-legend i.gray { background: #b5b9bf; }
.mc-day i.green, .mc-legend i.green { background: var(--green); } .mc-day i.purple, .mc-legend i.purple { background: var(--purple); }
.mc-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.mc-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.mini-cal-list .list-row:first-of-type { border-top: 0; }
.fin-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fafafb; }
.fin-mini > div { padding: 12px 14px; min-width: 0; }
.fin-mini > div + div { border-left: 1px solid var(--line); }
.fin-mini span { display: block; font-size: 13px; color: var(--muted); }
.fin-mini strong { display: block; font-size: 18px; font-weight: 750; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.02em; }
.fin-mini .bad strong { color: var(--red); }
.crew-ac { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.crew-ac-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.crew-ac-row input[type=checkbox] { accent-color: var(--orange); width: 18px; height: 18px; flex: none; }
.crew-ac-row span { flex: 1; min-width: 0; font-size: 14px; }
.crew-ac-row span small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crew-ac-row select { height: 34px !important; font-size: 13.5px !important; padding: 0 8px !important; width: auto !important; }
.switch-row { display: flex !important; gap: 12px; align-items: center; cursor: pointer; font-weight: 400 !important; }
.switch-row small { display: block; color: var(--muted); font-size: 13.5px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }
@media (max-width: 1600px) { #payGrid, #dashFin { grid-template-columns: 1fr !important; } }
@media (max-width: 1100px) { .fin-filters .span-2 { grid-column: span 4; } }
@media (max-width: 760px) {
  .fin-filters .span-2 { grid-column: span 6; }
  .mini-cal-wrap { grid-template-columns: minmax(0, 1fr); }
  .quick-exp, .cost-wrap { padding-left: 16px; padding-right: 16px; }
  .pay-toolbar { border: 0; }
  .pay-toolbar .tabs { border-bottom: 1px solid var(--line); width: calc(100% + 32px); }
  .fin-mini strong { font-size: 15px; }
  .cal-total { display: none; }
}
@media print { .quick-exp, .cost-foot button, .fx-row input, .back-link, #tripReport, [data-add-exp] { display: none !important; } }
#tripCosts .calc-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#tripCosts .calc-box > div:nth-child(3) { border-left: 0; }
#tripCosts .calc-box > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
.cost-table th, .cost-table td { padding: 10px 12px; font-size: 14.5px; }
.cost-table th:first-child, .cost-table td:first-child { padding-left: 24px; }
@media (max-width: 760px) { .cost-table th:first-child, .cost-table td:first-child { padding-left: 16px; } }
.modal.xl { width: min(1000px, 100%); }
.modal.xl .modal-body { padding: 0; background: #f3f3f4; }
.report-frame { display: block; width: 100%; height: min(72vh, 900px); border: 0; }
@media (max-width: 760px) {
  .leg-head .grow { min-width: 0; }
  .leg-head > .pill { display: none; }
  .leg-head [data-headcalc] .muted { display: none; }
  .leg-head .route-sub { font-size: 13px; gap: 6px; }
}
@media (max-width: 760px) {
  .card-head { flex-wrap: wrap; }
  .card-head > div { min-width: 0; }
  .photo-drop { flex-wrap: wrap; }
  .photo-drop > div { min-width: 0; }
}
@media (max-width: 760px) {
  #tripCosts .calc-box strong { font-size: 17px; white-space: nowrap; }
  #tripCosts .calc-box > div { padding: 12px; }
  .quick-exp { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .quick-exp .btn { flex: none; }
}
/* Rateio */
.month-pill { min-width: 190px; justify-content: center; }
.rat-actions .grow { flex: 1; }
.rat-table td small.warn { color: var(--amber); font-weight: 600; }
.table td.pos { color: var(--green); }
.chk { accent-color: var(--orange); width: 18px; height: 18px; cursor: pointer; }
.rat-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--orange-50); border-radius: 12px; padding: 14px 18px; margin-top: 12px; }
.rat-total > div strong { display: block; font-size: 17px; color: var(--ink); }
.rat-total > div small { color: var(--muted); font-size: 13.5px; }
.rat-total > strong { font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rat-rules p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; }
.rat-rules b { color: var(--ink); font-weight: 600; }
.rat-check { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rat-check li { display: flex; gap: 10px; align-items: flex-start; background: var(--amber-bg); border-radius: 10px; padding: 9px 12px; font-size: 14.5px; }
.rat-check li .icon { color: var(--amber); flex: none; margin-top: 2px; }
.rat-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.rat-preview > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.rat-preview span { display: block; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rat-preview b { display: block; font-size: 19px; color: var(--ink); }
.rat-preview small { color: var(--muted); font-size: 13px; }
.rat-parts { display: flex; flex-direction: column; gap: 8px; }
.rat-part { display: flex; gap: 8px; align-items: center; }
.rat-part select { flex: 1; min-width: 0; height: 44px; border: 1px solid #dcdee2; border-radius: 10px; padding: 0 12px; font: inherit; background: #fff; }
.rat-part .input-group { width: 130px; flex: none; }
.rat-part .input-group input { width: 100%; min-width: 0; height: 44px; border: 1px solid #dcdee2; border-radius: 10px 0 0 10px; padding: 0 10px; font: inherit; }
.rat-cfg td { padding: 10px 12px; }
.rat-cfg .input-group input { height: 40px; border: 1px solid #dcdee2; border-radius: 10px 0 0 10px; padding: 0 10px; font: inherit; }
@media (max-width: 1600px) { #rateioGrid2 { grid-template-columns: 1fr !important; } }
@media (max-width: 760px) {
  .rat-actions .grow { display: none; }
  .rat-actions .btn { flex: 1 1 calc(50% - 6px); }
  .month-pill { min-width: 0; flex: 1; }
  #ratAc { flex: 1 1 100%; }
  .rat-part .input-group { width: 110px; }
}
.rat-table th, .rat-table td { padding: 12px 10px; }
.rat-table th:first-child, .rat-table td:first-child { padding-left: 24px; }
.rat-table th { white-space: normal; vertical-align: bottom; }
.rat-table td.num, .rat-table td .pill { white-space: nowrap; }
.rat-table td:first-child { min-width: 210px; }
.rat-table td { font-size: 14.5px; }
.rat-table td small { white-space: normal; font-size: 12.5px; }
.rat-table td:last-child, .rat-table th:last-child { padding: 12px 10px 12px 4px; width: 44px; }
.rat-sum span { display: inline-flex; gap: 8px; align-items: center; }
.rat-sum span .icon { flex: none; }
/* Grades empilhadas: a coluna única não cresce com textos longos (evita rolagem lateral no celular). */
@media (max-width: 1600px) { #payGrid, #dashFin, #rateioGrid, #rateioGrid2 { grid-template-columns: minmax(0, 1fr) !important; } }
.rat-sum strong { white-space: nowrap; }
/* Combustível */
.fuel-table th, .fuel-table td { padding: 12px 10px; }
.fuel-table th:first-child, .fuel-table td:first-child { padding-left: 24px; }
.fuel-table td.num { white-space: nowrap; }
.fuel-bar { height: 8px; background: #f0f1f3; border-radius: 4px; overflow: hidden; }
.fuel-bar i { display: block; height: 100%; background: var(--orange); border-radius: 0 4px 4px 0; }
.fuel-density { width: 92px !important; height: 40px; text-align: right; flex: none; }
.bar.pair { flex-direction: row; align-items: flex-end; gap: 2px; width: min(72px, 12%); }
.bar.pair i { flex: 1; min-width: 0; background: var(--orange); border-radius: 4px 4px 0 0; }
.bar.pair i.alt { background: #0088a8; }
/* Documentos */
.doc-table th, .doc-table td { padding: 12px 12px; }
.doc-table th:first-child, .doc-table td:first-child { padding-left: 24px; }
.stat-sub.ellipsis { max-width: 100%; }
/* Agendamento */
.rq-legs { display: flex; flex-direction: column; gap: 10px; }
.rq-leg { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr) 104px 104px 36px; gap: 8px; align-items: end; }
.rq-leg .field > label { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.rq-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 760px) {
  .rq-leg { grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
  .rq-leg .field:first-child { grid-column: span 2; }
  .rq-leg [data-leg-del] { justify-self: end; grid-column: span 2; }
  .rq-detail { grid-template-columns: minmax(0, 1fr); }
}
/* Relatórios */
.bar.stacked { gap: 2px; }
.bar.stacked i { border-radius: 0; flex: none; }
.bar.stacked i:first-child { border-radius: 4px 4px 0 0; }
.bar.pair i { border-radius: 4px 4px 0 0; }
.rep-legend { display: flex; gap: 22px; justify-content: center; padding: 0 0 18px; font-size: 14px; color: var(--muted); }
.rep-table th, .rep-table td { padding: 11px 12px; }
.rep-table th:first-child, .rep-table td:first-child { padding-left: 24px; }
.rep-table td.num { white-space: nowrap; }
@media (max-width: 760px) { .rep-table th:first-child, .rep-table td:first-child { padding-left: 16px; } }
.rq-closed { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.rq-closed summary { cursor: pointer; font-size: 14.5px; color: var(--muted); }
.stat-card > div { max-width: 100%; }
@media (max-width: 760px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-sub.ellipsis { white-space: normal; }
}

/* ---------- Usuários, permissões e auditoria ---------- */
.access-note { display: flex; align-items: center; gap: 8px; padding: 9px 28px; background: var(--orange-50); color: #8a3a12; font-size: 14px; font-weight: 500; border-bottom: 1px solid #fde0d0; }
.access-note.hidden { display: none; }
.readonly .page-actions .btn-primary, .readonly .sticky-cta, .readonly .form-footer .btn-primary, .readonly [data-config], .readonly [data-entry], .readonly [data-split], .readonly #confirmChecked, .readonly #reopenMonth, .readonly [data-row-menu], .readonly [data-entry-menu], .readonly a[href*="/editar"], .readonly [data-add-exp], .readonly .quick-exp, .readonly [data-close-leg], .readonly [data-reopen-leg], .readonly #addLegDetail { display: none; }
.alert-box.info { background: #f3f7fa; border-color: #d9e6ee; }
.alert-box.info .icon, .alert-box.info strong { color: #1f5f78; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.perm-row strong { color: var(--ink); font-weight: 600; font-size: 15px; }
.perm-row .segmented button { height: 32px; padding: 0 12px; font-size: 13.5px; }
.perm-row .segmented button:disabled { cursor: not-allowed; opacity: .6; }
.audit-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.audit-filters input, .audit-filters select { min-width: 0; width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; }
.audit-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.audit-row .grow { flex: 1; min-width: 0; }
.audit-row strong { display: block; color: var(--ink); font-weight: 600; font-size: 15px; }
.audit-row small { display: block; color: var(--muted); font-size: 13.5px; }
.audit-row .pill { flex: none; width: 92px; justify-content: center; }
.audit-row > .icon { flex: none; color: var(--muted); }
.audit-count { flex: none; font-size: 13.5px; }
.audit-fields { margin: 0 0 10px; border: 1px solid var(--line-soft); border-radius: 10px; }
.audit-fields td { font-size: 14px; word-break: break-word; }
@media (max-width: 1100px) { .audit-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .audit-filters input[type="search"] { grid-column: 1 / -1; } }
@media (max-width: 760px) {
  .access-note { padding: 8px 16px; font-size: 13.5px; }
  .perm-row .segmented { width: 100%; }
  .perm-row .segmented button { flex: 1; padding: 0 6px; }
  .audit-row { flex-wrap: wrap; }
  .audit-row .pill { width: auto; }
  .audit-row .grow { order: 3; flex-basis: 100%; }
  .audit-count { margin-left: auto; }
}

/* Login e telas fora do sistema */
.auth-page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 24px 16px; background: var(--canvas); }
.auth-card { width: 100%; max-width: 420px; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.auth-brand svg { width: 42px; height: 28px; }
.auth-card h1 { margin: 0 0 6px; font-size: 24px; color: var(--ink); }
.auth-card > p { margin: 0 0 20px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn, .auth-wide { width: 100%; justify-content: center; }
.auth-form .hint { font-size: 13.5px; color: var(--muted); margin-top: -6px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 14.5px; }
.auth-message { padding: 10px 12px; border-radius: 10px; background: var(--red-bg); color: var(--red); font-size: 14.5px; line-height: 1.4; }
.auth-message.ok { background: var(--green-bg); color: var(--green); }
.auth-wait { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; opacity: 0; animation: auth-wait-in .4s ease 3s forwards; }
@keyframes auth-wait-in { to { opacity: 1; } }
.auth-detail { margin-top: 2px; font-size: 12.5px; overflow-wrap: anywhere; }
#loadSecs { font-variant-numeric: tabular-nums; }
.auth-slow { display: grid; gap: 10px; width: min(340px, 100%); margin-top: 18px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); text-align: center; animation: auth-wait-in .3s ease forwards; }
.auth-slow p { margin: 0 0 4px; color: var(--ink); font-size: 14.5px; line-height: 1.45; }
.auth-slow.hidden { display: none; }
#staleNote .link { display: inline; font: inherit; font-weight: 700; color: inherit; text-decoration: underline; white-space: normal; padding: 0; background: none; border: 0; cursor: pointer; }
.auth-message.hidden { display: none; }

/* ---------- Menu por área ---------- */
.nav-group { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); padding: 14px 14px 4px; }
.nav-group.nav-gap { padding: 6px 0 0; }
.nav .nav-item { flex-shrink: 0; }

/* ---------- Manutenção e cadastros ---------- */
.readonly [data-edit-only] { display: none !important; }
.text-red { color: #c81e1e; font-weight: 600; }
.mnt-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mnt-totals span { display: block; font-size: 13.5px; color: var(--muted); }
.mnt-totals strong { font-size: 20px; color: var(--ink); }
.mnt-groups { display: grid; gap: 12px; }
.mnt-group { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.mnt-group-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mnt-group-head .grow { flex: 1; min-width: 180px; }
.mnt-group-head strong { display: block; color: var(--ink); }
.mnt-group-head small { color: var(--muted); font-size: 13.5px; }
.mnt-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0 0; margin-top: 10px; border: 0; border-top: 1px solid var(--line-soft); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.mnt-item .grow { flex: 1; min-width: 0; }
.mnt-item b { display: block; font-weight: 600; color: var(--ink); }
.mnt-item small { color: var(--muted); font-size: 13.5px; }
.mnt-item:hover b { color: var(--orange); }
.mnt-picks { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; }
.mnt-pick { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.mnt-pick .grow { flex: 1; min-width: 0; }
.mnt-pick b { display: block; font-weight: 600; color: var(--ink); font-size: 14.5px; }
.mnt-pick small { color: var(--muted); font-size: 13px; }
.mnt-row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line-soft); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.mnt-row:last-child { border-bottom: 0; }
.mnt-row:hover strong { color: var(--orange); }
.mnt-row .grow small { display: block; }
@media (max-width: 640px) { .mnt-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Campos de lista e seleção de pessoas */
.rep-row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 8px; }
.rep-row .field { flex: 1; min-width: 0; }
.rep-row > .btn { flex: none; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:not(:empty) { margin-bottom: 8px; }
.chips .pill button { display: inline-flex; color: inherit; margin-left: 2px; padding: 0; }
.hours-grid { display: grid; grid-template-columns: minmax(84px, auto) repeat(3, minmax(0, 1fr)); gap: 8px; align-items: center; }
.hours-grid span { font-size: 13.5px; color: var(--muted); }
.hours-grid input { width: 100%; min-width: 0; }
.check-row { display: inline-flex; gap: 8px; align-items: center; font-size: 14.5px; color: var(--text); cursor: pointer; }
.check-row input { accent-color: var(--orange); }
.more-fields { grid-column: span 12; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.more-fields summary { cursor: pointer; font-weight: 600; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.more-fields[open] summary { margin-bottom: 14px; }
.more-fields .form-grid { padding: 0; }

/* Favoritos */
.nav-row { position: relative; }
.nav-row .nav-item { padding-right: 34px; }
.nav-row .badge { margin-right: 2px; }
.nav-star { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: inline-flex; padding: 4px; border-radius: 6px; color: var(--soft); opacity: 0; }
.nav-row:hover .nav-star, .nav-star:focus-visible, .nav-star.on { opacity: 1; }
.nav-star.on, .star-btn.on { color: var(--orange); }
.nav-star.on svg, .star-btn.on svg { fill: currentColor; }
.nav-row .nav-item:has(.badge:not(.hidden)) { padding-right: 34px; }
@media (hover: none) { .nav-star { opacity: 1; } }
.star-btn { display: inline-flex; padding: 6px; border-radius: 8px; color: var(--soft); }
.star-btn:hover { color: var(--orange); background: var(--orange-50); }

/* Central de relatórios */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.report-tile { position: relative; }
.report-tile a { display: block; padding: 16px 44px 16px 18px; height: 100%; }
.report-tile a:hover strong { color: var(--orange); }
.report-tile strong { display: block; color: var(--ink); font-size: 15.5px; }
.report-tile small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.4; margin-top: 4px; }
.report-tile .star-btn { position: absolute; top: 10px; right: 10px; }
.rep-table.dense th, .rep-table.dense td { padding: 8px 6px; font-size: 13px; }
.rep-table tfoot td { font-weight: 700; color: var(--ink); }

/* Gráficos */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card .card-head { gap: 12px; }
.chart-types { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.chart-types button { display: inline-flex; padding: 7px 8px; color: var(--muted); border-left: 1px solid var(--line); }
.chart-types button:first-child { border-left: 0; }
.chart-types button.active { background: var(--orange-50); color: var(--orange); }
.chart-card svg { display: block; width: 100%; height: auto; }
.chart-card .mark { outline: none; }
.chart-card .mark:hover path, .chart-card .mark:focus path, .chart-card path.mark:hover, .chart-card path.mark:focus { opacity: .82; }
.ch-axis { stroke: var(--line); }
.ch-tick { font-size: 11px; fill: var(--muted); }
.ch-value { font-size: 12px; font-weight: 700; fill: var(--ink); }
.ch-big { font-size: 26px; font-weight: 800; fill: var(--ink); }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; color: var(--text); border-radius: 6px; outline: none; }
.hbar:hover div i, .hbar:focus div i { opacity: .82; }
.hbar div { height: 10px; }
.hbar i { display: block; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; }
.hbar b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pie-wrap { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 18px; align-items: center; }
.pie-legend { display: flex; flex-direction: column; gap: 6px; font-size: 14px; min-width: 0; }
.pie-legend div { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.pie-legend i { width: 12px; height: 12px; border-radius: 3px; }
.pie-legend b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.gauge { max-width: 340px; margin: 0 auto; text-align: center; }
.gauge p { margin: 4px 0 0; font-size: 14px; color: var(--text); }
.chart-table { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.chart-table summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.chart-table table { margin-top: 6px; }
.chart-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: #fff; border-radius: 8px; padding: 7px 10px; font-size: 13px; line-height: 1.35; max-width: 260px; box-shadow: var(--shadow-lg); }
.chart-tip strong { display: block; font-size: 14px; }
.chart-tip span { color: #d3d5da; }

/* Mapas */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 16px; align-items: start; }
.map-card { overflow: hidden; }
.route-map { display: block; width: 100%; height: auto; background: #f4f7fa; }
.map-land { fill: #fff; stroke: #cdd3da; stroke-width: 1; }
.map-route { stroke: var(--orange); stroke-linecap: round; opacity: .75; outline: none; }
.map-route:hover, .map-route:focus { opacity: 1; }
.map-stop { fill: var(--ink); stroke: #fff; stroke-width: 2; }
.map-label { font-size: 12.5px; font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 3px; }

/* Relatórios personalizados */
.col-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.col-picks .pill { cursor: pointer; padding: 6px 12px; }
.col-picks input { accent-color: var(--orange); }
.cond-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.cond-row .input { width: 100%; }

@media (max-width: 900px) {
  .chart-grid, .map-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .pie-wrap { grid-template-columns: minmax(0, 1fr); }
  .pie-wrap svg { max-width: 220px; margin: 0 auto; }
  .cond-row { grid-template-columns: 1fr 1fr; }
  .chart-card .card-head { flex-wrap: wrap; }
  .hours-grid { font-size: 13px; }
}
.pill input[type=checkbox], .check-row input[type=checkbox] { width: 16px; height: 16px; min-height: 0; padding: 0; flex: none; box-shadow: none; }

/* ---------- Contas ---------- */
.acc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -6px 0 22px; }
.acc-toolbar > .btn { padding: 0 16px; }
.acc-select { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px 0 16px; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); cursor: pointer; }
.acc-select select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font: inherit; font-size: 15.5px; font-weight: 500; color: var(--ink); padding: 0 26px 0 0; height: 44px; cursor: pointer; }
.acc-select select:focus { outline: none; }
.acc-select:focus-within { border-color: var(--orange-300); box-shadow: 0 0 0 3px var(--orange-50); }
.acc-select .icon { position: absolute; right: 12px; pointer-events: none; color: var(--muted); }
.acc-period { display: inline-flex; gap: 8px; }
.acc-period-btn { min-width: 178px; padding: 0 14px; font-weight: 500; font-size: 15.5px; color: var(--ink); }
.acc-ico { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--orange-50); color: var(--orange); flex: none; }
.acc-ico.lg { width: 76px; height: 76px; border-radius: 16px; }
.acc-total { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 28px; padding: 22px 28px; margin-bottom: 22px; }
.acc-total-main { padding-left: 28px; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.acc-total-main span { font-size: 19px; font-weight: 600; color: var(--ink); }
.acc-total-main strong { font-size: 36px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.2; }
.acc-total-main small { font-size: 16px; color: #50545b; }
.acc-total-note { margin: 0; padding-left: 28px; border-left: 1px solid var(--line); align-self: stretch; display: flex; align-items: center; color: #50545b; font-size: 16px; }
.acc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.acc-card { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 20px; padding: 22px 24px; color: inherit; transition: border-color .15s, box-shadow .15s; }
.acc-card:hover { border-color: var(--orange-200); box-shadow: 0 8px 22px rgba(21, 23, 26, .07); }
.acc-card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.acc-name { font-size: 21px; font-weight: 700; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-card .pill { margin-bottom: 14px; }
.acc-label { font-size: 16px; color: #50545b; }
.acc-value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.25; }
.acc-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--orange); font-weight: 600; font-size: 16px; }
.acc-hint { margin: 12px 2px 22px; color: #50545b; font-size: 15.5px; }
.neg, .acc-value.neg, .stat-value.neg { color: var(--red) !important; }
.acc-table td { font-size: 15.5px; }
.acc-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-table .acc-in { color: var(--green); font-weight: 700; }
.acc-table .acc-out { color: var(--ink); font-weight: 700; }
.acc-table .acc-cell-link { color: var(--ink); font-weight: 400; }
.acc-table .acc-cell-link:hover { color: var(--orange); }
.acc-type { font-size: 14px; padding: 4px 11px; gap: 6px; }
.acc-doc { color: var(--muted); border-color: transparent !important; background: transparent !important; }
.acc-doc:hover { color: var(--orange); }
.acc-empty { margin: 0; padding: 4px 24px 16px; }
.acc-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 4px 18px 18px; padding: 16px 18px; background: #f3f4f6; border-radius: 12px; }
.acc-foot strong { font-size: 18px; font-weight: 700; color: var(--ink); }
.acc-foot strong:last-child { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.acc-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.acc-approval { display: flex; flex-wrap: wrap; gap: 8px; align-self: center; }
.crumbs { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--orange); }
.crumbs b { color: var(--ink); font-weight: 600; }
.acc-title-pill { font-size: 15px; letter-spacing: 0; vertical-align: middle; margin-left: 10px; position: relative; top: -3px; }
.acc-assign { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 26px; align-items: stretch; }
.acc-assign-main .card-head { padding-bottom: 10px; }
.acc-assign-main .card-head h2, .acc-summary-head h2, .acc-resp h3 { font-size: 22px; }
.acc-resp { margin: 4px 22px 22px; padding: 18px 20px 20px; border: 1px solid var(--orange-200); background: var(--orange-50); border-radius: 14px; display: flex; flex-direction: column; gap: 8px; }
.acc-resp h3 { margin: 0 0 6px; font-size: 21px; font-weight: 700; color: var(--ink); }
.acc-resp .hint { color: var(--muted); font-size: 14.5px; }
.acc-split-link { align-self: flex-start; font-size: 14px; margin-top: 4px; }
.rsel { position: relative; }
.rsel-btn { width: 100%; height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #fff; border: 1px solid #dcdee2; border-radius: 10px; font-size: 16px; color: var(--ink); text-align: left; }
.rsel-btn:disabled { background: #f6f6f7; color: var(--muted); cursor: not-allowed; }
.rsel-btn .icon { color: var(--muted); flex: none; }
.rsel.accent .rsel-btn { border-color: var(--orange); }
.rsel-btn[aria-expanded="true"] { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-100); }
.rsel-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rsel-badge { flex: none; background: #f1f2f4; color: #50545b; font-size: 13.5px; font-weight: 500; padding: 3px 10px; border-radius: 8px; }
.rsel-menu { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(21, 23, 26, .14); padding: 6px; max-height: 300px; overflow-y: auto; }
.rsel-opt { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 8px; font-size: 16px; font-weight: 500; color: var(--ink); text-align: left; }
.rsel-opt span:first-child { flex: 1; min-width: 0; }
.rsel-opt:hover, .rsel-opt:focus { background: #f6f6f7; outline: none; }
.rsel-opt.on { background: var(--orange-50); color: var(--orange); font-weight: 600; }
.rsel-opt.on .icon { color: var(--orange); flex: none; }
.acc-assign-side { display: flex; flex-direction: column; gap: 18px; }
.acc-summary { overflow: hidden; }
.acc-summary-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; background: var(--orange-50); color: var(--orange); }
.acc-summary-head h2 { font-size: 21px; font-weight: 700; color: var(--ink); }
.acc-summary-row { padding: 15px 22px; border-top: 1px solid var(--line); }
.acc-summary-row span { display: block; font-size: 15.5px; color: #50545b; }
.acc-summary-row strong { display: block; font-size: 21px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.acc-summary-row strong.big { font-size: 26px; font-weight: 800; }
.acc-summary-row small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.acc-summary-note { margin: 0; padding: 16px 22px 20px; border-top: 1px solid var(--line); color: #50545b; font-size: 16px; line-height: 1.5; }
.acc-assign-actions { margin-top: auto; display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.acc-assign-actions .btn { min-width: 140px; }
@media (max-width: 1280px) { .acc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .acc-assign, .acc-bottom { grid-template-columns: 1fr; }
  .acc-total { grid-template-columns: auto minmax(0, 1fr); }
  .acc-total-note { grid-column: 1 / -1; border-left: 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .acc-grid { grid-template-columns: 1fr; }
  .acc-toolbar > * { flex: 1 1 auto; }
  .acc-select, .acc-period { width: 100%; }
  .acc-select select { width: 100%; }
  .acc-period-btn { flex: 1; min-width: 0; }
  .acc-total { padding: 18px; gap: 16px; }
  .acc-total-main { padding-left: 16px; }
  .acc-total-main strong { font-size: 28px; }
  .acc-ico.lg { width: 60px; height: 60px; }
  .acc-resp { margin: 4px 14px 16px; }
  .acc-foot { margin: 4px 12px 12px; }
  .acc-title-pill { top: 0; }
}

/* Pilotos além do comandante (abertura do voo) */
.pilot-rows { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pilot-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 170px) auto; gap: 8px; align-items: center; width: 100%; }
@media (max-width: 640px) { .pilot-row { grid-template-columns: auto minmax(0, 1fr) auto; } .pilot-row select[data-pk="role"] { grid-column: 2; } }

/* Visão geral: cotação do dólar e do euro, card de revisão clicável */
.fx-quotes { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-top: 4px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fx-quotes:empty { display: none; }
.fx-quotes b { color: var(--ink); font-weight: 650; margin-right: 2px; }
.fx-quotes small { font-size: 12px; color: var(--soft); }
a.hero-stat { color: inherit; text-decoration: none; }
a.hero-stat:hover strong { text-decoration: underline; }
.hero-stat strong.bad { color: var(--red); }

/* Fechamento do trecho: abastecimentos vinculados */
.uplift-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg-soft, #fafafa); }
.uplift-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.uplift-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.uplift-row:first-of-type { border-top: 0; }
.uplift-row .grow { flex: 1; min-width: 220px; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Contas a pagar: parcela da conta e itens da fatura */
.bill-wrap .share-note { margin: -4px 0 8px 64px; font-size: 13px; color: var(--muted); }
.bill-wrap .share-note b { color: var(--green, #1a7f37); }
.bill-items { margin: -4px 0 10px 64px; font-size: 13px; }
.bill-items summary { cursor: pointer; color: var(--muted); }
.bill-items small { display: block; padding: 3px 0; color: var(--text); }
.exp-history { display: flex; flex-direction: column; gap: 3px; background: var(--bg-soft, #fafafa); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

/* ===== Rodada de 17/11 (Rhema) ===== */
/* Solicitação: lista e quantidade de passageiros juntas */
.rq-pax { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px 18px; align-items: start; }
.rq-pax .rq-pax-hint { grid-column: 1 / -1; margin: -4px 0 0; }
@media (max-width: 640px) { .rq-pax { grid-template-columns: 1fr; } }

/* Passageiros por trecho (abertura e detalhe do voo) */
.leg-pax { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px 16px; align-items: start; margin-top: 12px; }
.leg-pax .leg-pax-foot { grid-column: 1 / -1; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: -2px; }
.leg-pax .warn { color: var(--amber); font-weight: 600; }
.leg-pax .bad { color: var(--red); font-weight: 600; }
.leg-pax-detail { border-top: 1px solid var(--line-soft); padding: 14px 24px 4px; margin-top: 4px; }
.leg-pax-detail .leg-pax-title { grid-column: 1 / -1; margin: 0 !important; }
@media (max-width: 640px) { .leg-pax { grid-template-columns: 1fr; } .leg-pax-detail { padding: 12px 16px 4px; } }
.leg-head .leg-sheet { flex: none; }
@media (max-width: 760px) { .leg-head .leg-sheet span { display: none; } }

/* Lista de voos: recorte de datas e destaque dos trechos no período */
.date-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.date-filter input { height: 40px; border: 1px solid #dcdee2; border-radius: 10px; padding: 0 10px; font: inherit; color: var(--ink); }
.range-note { color: var(--orange-700) !important; }
.leg-card.in-range { box-shadow: 0 0 0 2px var(--orange-300), var(--shadow); }
.range-pill { font-size: 11.5px !important; padding: 1px 8px !important; margin-left: 6px; vertical-align: middle; }

/* Histórico do voo */
.trip-history summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 22px; cursor: pointer; list-style: none; }
.trip-history summary::-webkit-details-marker { display: none; }
.trip-history summary strong { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); }
.trip-history .card-body { padding-top: 0; }

/* Despesa: divisão entre contas escolhidas */
.split-parts { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg-soft, #fafafa); }
.split-part { display: grid; grid-template-columns: minmax(0, 1fr) 130px 110px auto; gap: 8px; align-items: center; }
.split-part small { text-align: right; font-variant-numeric: tabular-nums; }
.split-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.split-foot .bad { color: var(--red); font-weight: 600; }
@media (max-width: 640px) { .split-part { grid-template-columns: minmax(0, 1fr) 110px auto; } .split-part small { display: none; } }

/* Contas a pagar: filtros, abas sem rolagem lateral e seleção para baixa em lote */
.pay-filters .form-grid { padding: 14px 18px; gap: 12px; }
.pay-filters label { color: var(--muted); font-weight: 500; }
.pay-range-in { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pay-range-in input { min-width: 0; }
.pay-tabs { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 0; }
.pay-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; font-size: 15.5px; font-weight: 500; color: var(--text); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.pay-tab b { font-size: 12.5px; font-weight: 650; background: var(--line-soft); color: var(--muted); border-radius: 99px; padding: 1px 8px; }
.pay-tab.active { color: var(--orange); border-color: var(--orange); font-weight: 600; }
.pay-tab.danger b { background: var(--red-bg); color: var(--red); }
.pay-list-head { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.pay-list-head h2 { margin-bottom: 2px; }
.pay-select-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.bill-wrap.selecting { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: start; }
.bill-wrap .bill-main { min-width: 0; }
.bill-pick { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 22px; width: 34px; cursor: pointer; }
.bill-pick input { width: 20px; height: 20px; accent-color: var(--orange); cursor: pointer; }
.bill-pick.off { cursor: not-allowed; }
.bill-pick.off small { display: none; }
.bill-wrap.picked .list-row { background: var(--orange-50); border-radius: 10px; }
.batch-bar { position: sticky; bottom: 12px; z-index: 30; margin-top: 16px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-lg); }
.batch-bar > div:first-child { display: flex; flex-direction: column; }
.batch-bar span { font-size: 13.5px; opacity: .8; }
.batch-bar-actions { display: flex; gap: 8px; }
.batch-bar .btn-ghost { color: #fff; }
.batch-table input.batch-amt { width: 120px; text-align: right; }
.batch-table td.warn { color: var(--amber); font-weight: 600; }
.batch-table td.bad { color: var(--red); font-weight: 600; }
.batch-result { display: flex; flex-direction: column; gap: 14px; }
.cal-scroll { overflow-x: auto; }
@media (max-width: 760px) {
  .pay-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .pay-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; border-bottom: 0; }
  .pay-tab { border: 1px solid var(--line); border-radius: 10px; margin: 0; padding: 9px 6px; font-size: 14px; white-space: normal; text-align: center; line-height: 1.2; min-height: 44px; }
  .pay-tab.active { background: var(--orange-50); border-color: var(--orange-300); }
  .pay-view { align-self: flex-start; }
  .pay-filters .form-grid > .field { grid-column: 1 / -1; }
  .bill-wrap .share-note, .bill-items { margin-left: 0; }
  .batch-bar { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .batch-table input.batch-amt { width: 96px; }
  .cal-scroll .cal { min-width: 640px; }
}
@media (min-width: 761px) and (max-width: 1100px) { .pay-filters .form-grid > .field { grid-column: span 6; } }

/* Ficha de embarque e assinatura */
.sheet-tabs { margin-bottom: 10px; }
.sheet-tabs .segmented button { height: auto; min-height: 36px; padding: 6px 12px; text-align: left; }
.sheet-status .alert-box { margin-bottom: 10px; padding: 10px 14px; }
.sheet-foot-left { margin-right: auto; display: inline-flex; gap: 8px; }
.sig-wrap { display: flex; flex-direction: column; gap: 12px; }
.sig-pad { width: 100%; height: auto; aspect-ratio: 3 / 1; border: 1.5px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }
.sig-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.sig-current img { display: block; max-height: 90px; max-width: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
@media (max-width: 640px) { .sheet-foot-left { width: 100%; margin-bottom: 6px; } }

/* Fatura do motor e câmbio da baixa */
.engine-card .engine-parts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 13px; }
.engine-card .engine-parts span { white-space: nowrap; }
@media (max-width: 640px) { .engine-card { flex-wrap: wrap; } .engine-card .engine-parts span { white-space: normal; } }
.owner-row td { background: var(--orange-50); }
.fx-pay { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg-soft, #fafafa); }
.pay-card[hidden], .fx-pay [hidden] { display: none !important; }

/* Relatório de custos: anexos, vários voos e envio por e-mail */
.cr-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cr-head > div { display: flex; flex-direction: column; min-width: 0; }
.cr-head small { color: var(--muted); }
.cr-panel { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; max-height: 300px; overflow: auto; background: var(--bg-soft, #fafafa); }
.cr-panel[hidden] { display: none; }
.cr-group + .cr-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.cr-group-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.cr-att { display: flex; gap: 10px; align-items: center; padding: 6px 0; cursor: pointer; }
.cr-att .grow { min-width: 0; display: flex; flex-direction: column; }
.cr-att b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.cr-att small { color: var(--muted); overflow-wrap: anywhere; }
.cr-att input, .tp-row input { width: 18px; height: 18px; accent-color: var(--orange); flex: none; }
.cr-warn { color: var(--amber); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.tp-list { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.tp-row { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line-soft); cursor: pointer; }
.tp-row:first-child { border-top: 0; }
.tp-row .grow { min-width: 0; display: flex; flex-direction: column; }
.tp-row small { color: var(--muted); }
.send-sugg { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.send-sugg button { cursor: pointer; }
.send-files { list-style: none; margin: 6px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; }
.send-files li { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line-soft); }
.send-files li:first-child { border-top: 0; }
.send-files .grow { min-width: 0; display: flex; flex-direction: column; }
.send-files b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.send-files small { color: var(--muted); overflow-wrap: anywhere; }
.send-dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; margin: 12px 0; }
.send-dl dt { color: var(--muted); }
.send-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .send-dl { grid-template-columns: 1fr; } .send-dl dt { margin-top: 6px; } }
.modal-foot { flex-wrap: wrap; }
@media (max-width: 640px) { .modal-foot > .btn { flex: 1 1 auto; } }
/* Janelas largas: a prévia (iframe) ocupa a largura toda; o restante tem margem */
.modal.xl .sheet-tabs { padding: 14px 26px 0; margin: 0; }
.modal.xl .sheet-status { padding: 10px 26px 0; }
.modal.xl .sheet-status .alert-box { margin-bottom: 12px; }
.modal.xl [data-cr-head] { padding: 14px 26px 4px; }
.modal.xl [data-batch-body] { background: var(--surface); padding: 18px 26px; }
@media (max-width: 760px) { .modal.xl .sheet-tabs, .modal.xl .sheet-status, .modal.xl [data-cr-head], .modal.xl [data-batch-body] { padding-left: 18px; padding-right: 18px; } }
.batch-bar .btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.batch-bar .btn-ghost:disabled { opacity: .5; }

/* Plataforma: cadastro de empresas clientes (tela fora do sistema, mais larga que o login) */
.platform-page { justify-content: flex-start; }
.auth-card.platform-card { max-width: 1040px; }
.platform-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.platform-brand { margin: 0; }
.platform-brand img { max-height: 64px; width: auto; height: auto; }
.platform-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.platform-form { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--canvas); }
.platform-form h2, .platform-section h2 { margin: 0; font-size: 17px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.platform-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.platform-section { margin-top: 24px; }
.platform-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.platform-table td { vertical-align: top; }
.platform-table .num { text-align: right; white-space: nowrap; }
.platform-links { display: flex; flex-direction: column; gap: 8px; }
.platform-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.platform-link small { display: block; color: var(--muted); margin-top: 2px; }
@media (max-width: 760px) {
  .platform-grid { grid-template-columns: 1fr; }
  .auth-card.platform-card { padding: 20px 16px; }
  .platform-link { flex-wrap: wrap; }
}
