/* TVDE Platform — tvde-checklist identity (navy header, light background, white cards) */
:root {
  --navy:      #1A2E4A;
  --navy-light:#253459;
  --navy-dark: #111E36;
  --blue:      #3B82F6;
  --blue-light:#60A5FA;
  --bg:        #F1F5F9;
  --surface:   #FFFFFF;
  --border:    #E2E8F0;
  --text:      #1E293B;
  --muted:     #64748B;
  --success:   #10B981;
  --warning:   #F59E0B;
  --error:     #EF4444;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Layout (tvde-checklist identity: navy header, light background, no sidebar) ── */
.app-hdr {
  background: var(--navy);
  color: #fff;
  padding: 12px 24px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 60;
}
.app-hdr-left, .app-hdr-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-hdr-right { flex-wrap: wrap; justify-content: flex-end; }
.app-brand { color: #fff; text-decoration: none; font-size: 18px; font-weight: 800; white-space: nowrap; }
.hdr-sep { opacity: .4; }
.hdr-module { font-size: 15px; font-weight: 700; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-back {
  color: rgba(255,255,255,.8); text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; white-space: nowrap;
}
.hdr-back:hover { background: rgba(255,255,255,.1); color: #fff; }
.hdr-chip {
  font-size: 12px; color: rgba(255,255,255,.85); text-decoration: none; background: rgba(255,255,255,.1);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
a.hdr-chip:hover { background: rgba(255,255,255,.18); }
.hdr-mode { font-weight: 700; letter-spacing: .3px; }
.hdr-user { font-size: 13px; color: rgba(255,255,255,.8); }
.hdr-btn {
  background: rgba(255,255,255,.15); border: none; color: #fff; padding: 8px 16px; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 600;
}
.hdr-btn:hover { background: rgba(255,255,255,.25); }
.inline-form { display: inline; }

/* Module submenu (tvde-checklist tabs bar) */
.tabs-bar {
  background: var(--surface); border-bottom: 2px solid var(--border); padding: 0 24px;
  display: flex; gap: 4px; overflow-x: auto; position: sticky; top: 58px; z-index: 50;
}
.tab-btn {
  padding: 13px 16px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none;
  border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }

.page-content { padding: 22px 28px; max-width: 1320px; margin: 0 auto; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.breadcrumb:empty { display: none; }
.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--muted); }

/* ── Home: module cards (tvde-checklist) ── */
.home-wrap { max-width: 960px; margin: 0 auto; }
.home-hello { text-align: center; margin: 10px 0 4px; font-size: 15px; color: var(--muted); }
.home-hello strong { color: var(--text); }
.home-cards { padding: 22px 0 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.home-card {
  padding: 32px 20px; border-radius: 20px; border: 2px solid var(--border); background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  transition: transform .2s, box-shadow .2s, border-color .2s; box-shadow: 0 1px 3px rgba(0,0,0,.06);
  text-align: center; position: relative; min-height: 180px; text-decoration: none; color: var(--text);
}
.home-card:hover, .home-card:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.13); outline: none; }
.home-card:active { transform: translateY(-1px); }
.home-card .hci { font-size: 44px; line-height: 1; }
.home-card h3 { font-size: 17px; font-weight: 800; }
.home-card p { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.home-card .hc-mode {
  position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 800; padding: 3px 8px;
  border-radius: 12px; text-transform: uppercase; letter-spacing: .5px; background: #F1F5F9; color: var(--muted);
}
.home-card.green h3 { color: #16a34a; }   .home-card.green:hover { border-color: #16a34a; }
.home-card.purple h3 { color: #1e40af; }  .home-card.purple:hover { border-color: #1e40af; }
.home-card.indigo h3 { color: #7c3aed; }  .home-card.indigo:hover { border-color: #7c3aed; }
.home-card.cyan h3 { color: #c2410c; }    .home-card.cyan:hover { border-color: #c2410c; }
.home-card.orange h3 { color: #a16207; }  .home-card.orange:hover { border-color: #a16207; }
.home-card.violet h3 { color: #6d28d9; }  .home-card.violet:hover { border-color: #6d28d9; }
.home-card.navy h3 { color: #374151; }    .home-card.navy:hover { border-color: #374151; }
.home-empty { text-align: center; padding: 48px 20px; color: var(--muted); }

.home-card.teal h3 { color: #0f766e; }    .home-card.teal:hover { border-color: #0f766e; }
.home-card.amber h3 { color: #b45309; }   .home-card.amber:hover { border-color: #b45309; }

/* Blocked account page */
.blocked-wrap { display: flex; justify-content: center; padding: 48px 16px; }
.blocked-card { max-width: 560px; width: 100%; text-align: center; padding: 36px 28px; }
.blocked-icon { font-size: 44px; display: block; margin-bottom: 10px; }
.blocked-card h2 { color: var(--navy); margin-bottom: 10px; }
.blocked-card p { margin-top: 8px; line-height: 1.5; }
.blocked-actions { margin-top: 22px; }

/* LEV / TRO / DEV type cards (Movimentações landing) */
.tipo-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tipo-card {
  padding: 20px; border-radius: 16px; border: 2px solid var(--border); background: #fff; display: flex;
  align-items: center; gap: 16px; transition: transform .2s, box-shadow .2s, border-color .2s; text-decoration: none;
  color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.tipo-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.tipo-card .ci { font-size: 36px; }
.tipo-card h3 { font-size: 17px; font-weight: 800; }
.tipo-card p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.tipo-card.lev h3 { color: var(--lev); } .tipo-card.lev:hover { border-color: var(--lev); }
.tipo-card.tro h3 { color: var(--tro); } .tipo-card.tro:hover { border-color: var(--tro); }
.tipo-card.dev h3 { color: var(--dev); } .tipo-card.dev:hover { border-color: var(--dev); }

/* Section cards (Backoffice landing) */
.section-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.section-card {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: #fff; border: 1.5px solid var(--border);
  border-radius: 14px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s;
}
.section-card:hover { border-color: var(--navy); transform: translateY(-1px); }
.section-card .sc-icon { font-size: 24px; }
.section-card strong { display: block; font-size: 14px; color: var(--navy); }
.section-card small { color: var(--muted); font-size: 12px; }

/* Filters bar (tvde-checklist .filtros) + company selector */
.filters-bar {
  background: #fff; border-radius: 12px; padding: 12px 16px; border: 1.5px solid var(--border); margin-bottom: 16px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
}
.filters-bar label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; display: block; margin-bottom: 4px; }
.filters-bar .form-select, .filters-bar .form-input { width: auto; min-width: 150px; padding: 7px 10px; }
.filters-bar .grow { flex: 1; }
.company-pill {
  display: inline-flex; align-items: center; gap: 6px; background: #EEF2FF; color: var(--navy); font-weight: 700;
  border-radius: 999px; padding: 6px 12px; font-size: 13px;
}

/* Money */
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.money, th.money { text-align: right; }
.pos { color: #16A34A; }
.neg { color: #DC2626; }

/* Calendar */
.cal { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.cal th { background: transparent; border: none; text-align: center; }
.cal td { background: #fff; border: 1px solid var(--border); border-radius: 8px; vertical-align: top; height: 96px; padding: 6px; font-size: 12px; }
.cal td.out { background: #F8FAFC; color: #94A3B8; }
.cal td.today { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.cal .cal-day { font-weight: 700; font-size: 12px; margin-bottom: 4px; }
.cal .cal-ev { display: block; background: #FFF7ED; color: #9A3412; border-radius: 6px; padding: 2px 6px; margin-bottom: 3px;
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .cal-ev.done { background: #DCFCE7; color: #166534; }
.day-group { margin-bottom: 14px; }
.day-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--navy); margin: 0 0 6px; }

/* Empty state */
.empty-state { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty-state .es-icon { font-size: 34px; display: block; margin-bottom: 8px; }

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.stat-card .stat-sub {
  font-size: 11px;
  color: var(--success);
  margin-top: 6px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: opacity .15s, background .15s;
}
.btn:hover { opacity: .88; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-navy    { background: var(--navy); color: #fff; }
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--bg); }
.btn-danger  { background: var(--error); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Table ── */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.table-toolbar {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #F8FAFF; }
tbody td {
  padding: 11px 16px;
  font-size: 13.5px;
}
.table-empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}
.badge-green  { background: #DCFCE7; color: #166534; }
.badge-red    { background: #FEE2E2; color: #991B1B; }
.badge-yellow { background: #FEF9C3; color: #854D0E; }
.badge-gray   { background: #F1F5F9; color: #475569; }
.badge-blue   { background: #DBEAFE; color: #1E40AF; }

/* ── Forms ── */
.form-card {
  max-width: 680px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 32px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.form-error { font-size: 12px; color: var(--error); margin-top: 2px; }
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── Detail card ── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.detail-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}
.detail-field p {
  font-size: 14px;
  color: var(--text);
}
.detail-field p:empty::after { content: "—"; color: var(--muted); }

/* ── Messages ── */
.messages-list { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.message {
  padding: 10px 16px;
  border-radius: 7px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.message-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.message-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.message-warning { background: #FEF9C3; color: #854D0E; border: 1px solid #FDE047; }
.message-info    { background: #DBEAFE; color: #1E40AF; border: 1px solid #93C5FD; }

/* ── Login ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
}
.login-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 40px 44px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin-bottom: 4px;
}
.login-card .login-sub {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 28px;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .btn { margin-top: 6px; justify-content: center; width: 100%; padding: 10px; }

/* ── Role badge ── */
.role-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  background: rgba(59,130,246,.1);
  color: var(--blue);
}

/* ── Divider ── */
.section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin-bottom: 12px;
  margin-top: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}


/* ══════════════════════════════════════════════════════════════════════════
   Operational layer (night session) — desktop-first, dense, tvde-checklist look
   LEV green · TRO amber · DEV red (legacy colour codes)
   ══════════════════════════════════════════════════════════════════════════ */
:root {
  --lev: #16A34A; --lev-bg: #DCFCE7;
  --tro: #D97706; --tro-bg: #FEF3C7;
  --dev: #DC2626; --dev-bg: #FEE2E2;
}

.page-header { margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.page-header h2 { display: flex; align-items: center; gap: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 12.5px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: 4px 0 12px; }
.info-line { font-size: 12.5px; color: var(--navy); background: #EEF4FF; border-radius: 6px; padding: 6px 10px; margin-top: 10px; }
.info-line:empty { display: none; }
.strong-link { color: var(--blue); text-decoration: none; font-weight: 600; }
.strong-link:hover { text-decoration: underline; }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--bg); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Plates look like plates */
.plate {
  display: inline-block; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-weight: 700; font-size: 12.5px; letter-spacing: .5px; color: var(--navy);
  background: #fff; border: 1px solid #CBD5E1; border-left: 4px solid #1D4ED8;
  border-radius: 4px; padding: 1px 6px; text-decoration: none; white-space: nowrap;
}
a.plate:hover { border-color: var(--blue); }

/* Movement type badges */
.badge.mv-lev, .mv-count.mv-lev { background: var(--lev-bg); color: var(--lev); }
.badge.mv-tro, .mv-count.mv-tro { background: var(--tro-bg); color: var(--tro); }
.badge.mv-dev, .mv-count.mv-dev { background: var(--dev-bg); color: var(--dev); }
.badge-lg { font-size: 13px; padding: 3px 10px; border-radius: 6px; }
.mv-count { display: inline-block; min-width: 34px; text-align: center; border-radius: 6px; padding: 2px 6px; font-size: 20px; }

/* KPI strip (detail headers) */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--navy); border-radius: 8px; padding: 10px 14px; position: relative; display: flex; flex-direction: column; gap: 2px; }
.kpi label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; }
.kpi strong { font-size: 15px; color: var(--text); }
.kpi strong a { color: inherit; text-decoration: none; }
.kpi small { font-size: 11.5px; color: var(--muted); }
.kpi-link { position: absolute; top: 8px; right: 10px; font-size: 11.5px; color: var(--blue); text-decoration: none; }

/* Stat cards are links */
a.stat-card { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; border-top: 3px solid var(--navy); }
a.stat-card:hover { border-color: var(--blue); transform: translateY(-1px); }
.stat-card.stat-green { border-top-color: var(--lev); }
.stat-card.stat-blue { border-top-color: var(--blue); }
.stat-card .stat-sub { color: var(--muted); }
.stats-grid { gap: 12px; margin-bottom: 18px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-dash { grid-template-columns: 2fr 1fr; }
.table-card, .card { margin-bottom: 16px; }
.grid-2 > .table-card, .grid-2 > .card { margin-bottom: 0; }
.quick-actions { display: flex; flex-direction: column; gap: 6px; }

/* Dense tables */
thead th { padding: 8px 12px; }
tbody td { padding: 8px 12px; font-size: 13px; vertical-align: middle; }
.table-toolbar { padding: 10px 14px; }
.table-toolbar strong { font-size: 13px; color: var(--navy); }
.filters { justify-content: flex-start; flex-wrap: wrap; }
.filters .form-input, .filters .form-select { width: auto; min-width: 180px; padding: 6px 10px; font-size: 13px; }

/* Forms: sections + pills */
.form-card { max-width: 1040px; padding: 22px 26px; }
.form-section { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.form-section:last-of-type { border-bottom: none; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .9px; color: var(--navy); font-weight: 700; margin-bottom: 10px; }
.section-subtitle { font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 0 8px; display: flex; gap: 8px; align-items: center; }
.form-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; }
.pills > div, .pills ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.pills label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500 !important; font-size: 12.5px !important;
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; cursor: pointer; background: #fff; user-select: none; }
.pills input[type=radio] { accent-color: var(--navy); margin: 0; }
.pills label:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
.pills-sm label { padding: 3px 9px; font-size: 11.5px !important; }
.sticky-actions { position: sticky; bottom: 0; background: var(--surface); padding-bottom: 6px; z-index: 5; }

/* Checklist */
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 4px 18px; margin-top: 10px; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #F1F5F9; font-size: 13px; }
.badge.chk-ok { background: var(--lev-bg); color: var(--lev); }
.badge.chk-missing { background: var(--dev-bg); color: var(--dev); }
.badge.chk-na { background: #F1F5F9; color: #475569; }

/* Responsive (desktop-first) */
@media (max-width: 900px) {
  .page-content { padding: 16px; }
  .grid-2, .grid-dash { grid-template-columns: 1fr; }
  .table-card { overflow-x: auto; }
  .checklist { grid-template-columns: 1fr; }
  .home-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tipo-cards { grid-template-columns: 1fr; }
  .app-hdr { padding: 10px 16px; flex-wrap: wrap; position: static; }
  .tabs-bar { padding: 0 12px; position: static; }
  .hdr-module { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page-content { padding: 12px 16px; }
  .home-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 14px; }
  .home-card { min-height: auto; padding: 16px; flex-direction: row; text-align: left; gap: 14px; justify-content: flex-start; min-width: 0; }
  .home-card .hci { font-size: 30px; width: 40px; text-align: center; flex-shrink: 0; }
  .home-card .hct { min-width: 0; flex: 1; }
  .home-card .hc-mode { top: 8px; right: 8px; font-size: 9px; padding: 2px 6px; }
  .app-hdr { gap: 8px; }
  .app-brand { font-size: 16px; }
  .app-hdr-right { gap: 6px; }
  .hdr-user, .hdr-sep, .hdr-chip:not(.hdr-mode) { display: none; }
  .hdr-btn { padding: 6px 12px; }
  .hdr-back { padding: 5px 9px; }
  .cal td { height: 64px; }
}

.stat-card.stat-red { border-top-color: var(--dev); }
.stat-card.stat-amber { border-top-color: var(--tro); }
.stat-card.selected { box-shadow: 0 0 0 2px var(--blue) inset; }
table.suggestions { margin: 8px 0 14px; border: 1px solid var(--border); border-radius: 6px; }
table.suggestions code { font-size: 12.5px; background: #F1F5F9; padding: 1px 5px; border-radius: 4px; }

/* Form helpers (formerly inline in base.html) */
.choice-list ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
.choice-list label { font-weight: 400; display: flex; gap: 6px; align-items: center; }
.form-group.full { grid-column: 1 / -1; }
.banner { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.banner-info { background: #EEF4FF; color: #1D3A7A; }
.banner-warn { background: #FFF6E5; color: #7A4B00; }
.dev-link { word-break: break-all; font-family: monospace; font-size: 12px; background: #F4F4F5; padding: 8px; border-radius: 6px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.steps span { font-size: 12px; padding: 4px 10px; border-radius: 20px; background: #EEF0F4; color: #667; }
.steps span.done { background: #E3F6EA; color: #1B6B3A; }
.steps span.current { background: var(--navy); color: #fff; }
.stat-card.stat-income { border-top-color: var(--lev); }
.stat-card.stat-expense { border-top-color: var(--dev); }
.stat-card .stat-value.money { font-size: 24px; }
.readonly-note { font-size: 12px; color: var(--muted); background: #F1F5F9; border-radius: 999px; padding: 4px 10px; }
.stat-card .stat-value.pos { color: #16A34A; }
.stat-card .stat-value.neg { color: #DC2626; }

/* ---- Commercial: plan offer cards, price summary (functional; visual refinement later) ---- */
.login-card:has(.offer-grid) { max-width: 900px; }
.offer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 12px 0; }
@media (max-width: 720px) { .offer-grid { grid-template-columns: 1fr; } }
.offer-card { position: relative; border: 1px solid #E2E8F0; border-radius: 12px; padding: 20px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.offer-card.featured { border: 2px solid var(--navy); box-shadow: 0 6px 20px rgba(27, 42, 74, .12); }
.offer-badge { position: absolute; top: -11px; right: 16px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 10px; border-radius: 20px; }
.offer-card h3 { margin: 0; font-size: 18px; }
.offer-price { font-size: 26px; font-weight: 800; }
.offer-price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.offer-card ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.offer-card li { padding: 2px 0; }
.offer-card li::before { content: "✓ "; color: #16A34A; font-weight: 700; }
.offer-note { font-size: 12px; color: var(--muted); }
.offer-card .btn { margin-top: auto; justify-content: center; }
.price-summary { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.price-summary td { padding: 6px 4px; border-bottom: 1px solid #EEF0F4; }
.price-summary td:last-child { text-align: right; font-weight: 600; }
.price-summary tr.total td { font-size: 16px; border-bottom: 0; }
.terms-box { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 8px; padding: 12px; font-size: 13px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; font-weight: 400; margin: 12px 0; }
.consent input { margin-top: 3px; }
.module-pick { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid #EEF0F4; }
.banner-warning { background: #FEF9C3; color: #854D0E; }

/* "Criar cliente" — central client registration with OCR */
.intake .section-title { margin-top: 22px; }
.intake .section-subtitle { font-size: 12px; font-weight: 700; color: var(--muted); margin: 16px 0 8px; }
.kind-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.kind-card {
  display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 2px solid var(--border); border-radius: 14px;
  background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; position: relative;
}
.kind-card input { position: absolute; opacity: 0; pointer-events: none; }
.kind-card .kc-icon { font-size: 26px; }
.kind-card strong { color: var(--navy); font-size: 14px; }
.kind-card small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.kind-card:hover { border-color: var(--blue-light); }
.kind-card.active { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,46,74,.12); }
.kind-card:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.slot-card { border: 1.5px solid var(--border); border-radius: 14px; padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.slot-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.slot-head strong { color: var(--navy); font-size: 14px; }
.slot-hint { font-size: 12px; color: var(--muted); margin: 0; }
.slot-files { display: flex; flex-direction: column; gap: 6px; }
.file-pick { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
.file-pick input { font-size: 12px; max-width: 100%; }
.slot-read { align-self: flex-start; }
.slot-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot-fields .form-group:first-child:last-child { grid-column: 1 / -1; }
.slot-status { font-size: 12px; color: var(--muted); text-align: right; }
.slot-status.busy { color: var(--blue); }
.slot-status.ok { color: #047857; }
.slot-status.err { color: var(--error); }
.ocr-filled { background: #FEF9C3 !important; border-color: #EAB308 !important; }
@media (max-width: 640px) { .slot-fields { grid-template-columns: 1fr; } }

/* =====================================================================
   Controle de Vencimentos — painel da frota (layout do dono, 2026-10-18)
   ===================================================================== */
.page-content.page-full { max-width: none; padding: 0; }
.tab-count {
  display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 4px; border-radius: 10px;
  background: #E2E8F0; color: var(--muted); font-size: 10.5px; font-weight: 700; text-align: center;
}
.tab-btn.active .tab-count { background: var(--navy); color: #fff; }
.hdr-alert {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 14px; border-radius: 20px; margin-right: 12px;
  background: #FEF2F2; border: 1.5px solid #FCA5A5; color: #DC2626; font-size: 12px; font-weight: 700; text-decoration: none;
}
.hdr-alert:hover { background: #FEE2E2; }

.vp { background: #fff; }
.vp-filters {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 10px 8px; border-bottom: 1px solid var(--border); background: #fff;
}
.vp-filters select, .vp-filters input {
  height: 28px; padding: 0 26px 0 8px; border: 1px solid #CBD5E1; border-radius: 4px; background-color: #fff;
  font-size: 11.5px; color: var(--text); min-width: 96px;
}
.vp-filters input { padding-right: 8px; min-width: 150px; }
.vp-filters .vp-wide { min-width: 220px; flex: 1 1 220px; max-width: 360px; }
.vp-clear {
  height: 28px; padding: 0 12px; border: 1px solid #CBD5E1; border-radius: 4px; background: #F8FAFC;
  color: var(--muted); font-size: 11.5px; cursor: pointer;
}
.vp-clear:hover { background: #F1F5F9; color: var(--text); }
.vp-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 8px 12px; font-size: 12px; color: var(--muted);
}
.vp-summary b { font-size: 14px; margin-right: 2px; }
.n-red { color: #DC2626; } .n-amber { color: #D97706; } .n-green { color: #16A34A; } .n-lav { color: #8B8FD8; }
.vp-count { color: var(--muted); }
.vp-legend { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
.vp-legend i { margin-left: 6px; }

.vp-scroll { overflow: auto; max-height: calc(100vh - 205px); border-top: 1px solid var(--border); }
.vp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; white-space: nowrap; }
.vp-table thead th {
  position: sticky; top: 0; z-index: 2; background: var(--navy); color: #fff; font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .4px; padding: 9px 10px; text-align: left; cursor: pointer; user-select: none;
}
.vp-table thead th:hover { background: var(--navy-light); }
.vp-table thead th.sorted-asc::after { content: " ▲"; font-size: 9px; }
.vp-table thead th.sorted-desc::after { content: " ▼"; font-size: 9px; }
.vp-table thead th.c-alert::after { content: ""; }
.vp-table tbody td { padding: 0 10px; height: 29px; border-bottom: 1px solid #EEF2F6; color: #334155; }
.vp-table tbody tr:nth-child(even) td { background: #F8FAFC; }
.vp-table tbody tr:hover td { background: #EFF6FF; }
.vp-table tbody tr.row-stopped td { opacity: .55; }
.vp-table tbody tr.row-stopped:hover td { opacity: .85; }
.vp-table .c-alert { width: 26px; text-align: center; padding: 0 6px; }
.vp-table .c-plate { font-weight: 800; color: #475569; letter-spacing: .2px; }
.vp-table .c-plate a { color: inherit; text-decoration: none; }
.vp-table .c-plate a:hover { color: var(--blue); }
.vp-table .c-num { font-variant-numeric: tabular-nums; }
.vp-table .muted { color: #94A3B8; }
.vp-empty td { text-align: center; color: var(--muted); padding: 30px !important; }

.adot, .dot { display: inline-block; border-radius: 50%; vertical-align: middle; }
.adot { width: 10px; height: 10px; }
.adot-vencido { background: #EF4444; } .adot-breve { background: #F59E0B; }
.adot-ok { background: #22C55E; } .adot-sem { background: #D8D4F2; }
.dot { width: 9px; height: 9px; margin-left: 4px; }
.dot-file { background: #4ADE80; box-shadow: inset 0 0 0 1px #22C55E; }
.dot-nofile { background: #FBBF24; box-shadow: inset 0 0 0 1px #F59E0B; }

.cell-select {
  height: 22px; min-width: 82px; padding: 0 18px 0 6px; border: 1px solid #CBD5E1; border-radius: 3px; background: #fff;
  font-size: 11px; color: var(--text); cursor: pointer;
}
.cell-select.st-OK, .st-text.st-OK { font-weight: 700; color: #0F172A; }
.cell-select.st-STOPPED, .st-text.st-STOPPED { color: #64748B; }
.loc-select { min-width: 92px; }

.co-pill { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10.5px; font-weight: 700; }
.co-0 { background: #DBEAFE; color: #2563EB; } .co-1 { background: #EDE9FE; color: #7C3AED; }
.co-2 { background: #FFEDD5; color: #C2410C; } .co-3 { background: #E2E8F0; color: #334155; }
.co-4 { background: #DCFCE7; color: #15803D; } .co-5 { background: #CFFAFE; color: #0E7490; }
.co-6 { background: #FCE7F3; color: #BE185D; } .co-7 { background: #FEF9C3; color: #A16207; }

.dc { font-size: 11px; }
.dc .dc-date { font-weight: 700; text-decoration: none; color: inherit; }
.dc .dc-date small { font-size: 10px; font-weight: 600; }
.dc-vencido .dc-date { color: #DC2626; } .dc-breve .dc-date { color: #D97706; } .dc-ok .dc-date { color: #16A34A; }
.dc-def { color: #A5A9DD; font-weight: 600; }
.dc-edit {
  border: 0; background: none; padding: 0 2px; cursor: pointer; font-size: 10px; opacity: .55; filter: hue-rotate(-20deg);
}
.dc-edit:hover, .dc-edit:focus-visible { opacity: 1; }
.c-ins { color: #64748B; }
.c-problem { max-width: 150px; }
.problem-edit {
  border: 0; background: none; padding: 0; cursor: pointer; color: #EA9A3F; font-size: 10.5px; max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; text-align: left;
}
.problem-edit .pe-add { color: #CBD5E1; font-weight: 700; }
.problem-edit:hover .pe-add { color: var(--blue); }
.loc-text { display: inline-block; min-width: 80px; padding: 1px 6px; border: 1px solid #E2E8F0; border-radius: 3px; font-size: 11px; }
.vp-note { font-size: 11px; color: var(--muted); padding: 8px 12px 14px; }
.vp-note .dot { margin: 0 2px; }

.vp-dialog { border: 0; border-radius: 14px; padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.vp-dialog::backdrop { background: rgba(15,23,42,.45); }
.vp-dialog form { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.vp-dialog h3 { color: var(--navy); font-size: 16px; }
.vp-dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.vp-dialog .form-actions { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }

.vp-table.simple td { color: #334155; }
@media (max-width: 900px) { .vp-scroll { max-height: none; } .vp-legend { margin-left: 0; } }

/* compact chrome on the panel pages (owner's layout) */
.vp-page .app-hdr { min-height: 43px; padding: 6px 12px; }
.vp-page .hdr-back { padding: 3px 9px; font-size: 11px; }
.vp-page .hdr-module { font-size: 13px; font-weight: 800; opacity: 1; }
.vp-page .hdr-chip, .vp-page .hdr-user { font-size: 11px; }
.vp-page .hdr-btn { padding: 4px 10px; font-size: 11px; }
.vp-page .tabs-bar { padding: 0 10px; }
.vp-page .tab-btn { padding: 8px 12px; font-size: 11.5px; }
.vp-page { background: #fff; }
.vp-filters select { width: auto; max-width: 132px; height: 25px; font-size: 11px; padding: 0 22px 0 7px; }
.vp-filters .vp-wide { max-width: 300px; min-width: 200px; }
.vp-filters input { height: 25px; font-size: 11px; }
.vp-clear { height: 25px; font-size: 11px; }
.loc-select { appearance: none; -webkit-appearance: none; padding: 0 6px; min-width: 70px; background: #fff; }
.vp-table tbody tr .pe-add { visibility: hidden; }
.vp-table tbody tr:hover .pe-add { visibility: visible; }
.vp-filters { padding-top: 10px; }
.vp-filters select { field-sizing: content; max-width: none; min-width: 84px; }
.vp-filters .vp-wide { field-sizing: fixed; width: 260px; }
.vp-page .tabs-bar { top: 43px; }
.vp-filters { gap: 5px; }
.vp-filters select { font-size: 10.5px; padding: 0 18px 0 6px; min-width: 70px; }
.vp-filters .vp-wide { width: 230px; min-width: 0; }
.vp-filters input { min-width: 0; width: 120px; }
.vp-filters .vp-wide { flex: 0 0 auto; width: 210px; }
.vp-filters { flex-wrap: wrap; align-items: center; }
.vp-filters select { padding: 0 4px 0 5px; height: 24px; min-width: 0; }
.vp-filters input, .vp-clear { height: 24px; }
.vp-filters input { width: 110px; }
.hdr-alert { cursor: pointer; font-family: inherit; }

/* Movimentações — continuar um processo, fotografias da vistoria (2026-10-19) */
.tipo-card.cont h3 { color: #0f766e; } .tipo-card.cont:hover { border-color: #0f766e; }
.continue-card { max-width: 460px; }
.continue-form { display: flex; gap: 10px; margin-top: 10px; }
.code-input { font-size: 24px; letter-spacing: .25em; text-transform: uppercase; text-align: center; font-weight: 800; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.photo-drop { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 2px dashed var(--border, #cbd5e1);
  border-radius: 12px; cursor: pointer; background: var(--surface-2, #f8fafc); }
.photo-drop:hover { border-color: var(--primary, #2563eb); }
.photo-drop input[type=file] { margin-top: 6px; max-width: 100%; }
.pd-title { font-weight: 800; } .pd-hint { font-size: 12.5px; color: var(--muted); } .pd-count { font-size: 12.5px; font-weight: 700; color: #0f766e; }
.photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photo-thumb { display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11.5px; }
.photo-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--border, #e2e8f0); }
.handover-dialog .handover-qr { display: flex; justify-content: center; }
.handover-dialog .handover-qr svg { width: 220px; height: 220px; }
.handover-dialog .handover-code { font-size: 34px; font-weight: 900; letter-spacing: .3em; text-align: center; color: #0f766e; }

/* Controle de Vencimentos — the dot warns the driver on WhatsApp (2026-10-19) */
.dot-wa { width: 13px; height: 13px; padding: 0; border: 0; cursor: pointer; outline: 2px solid #25D366; outline-offset: 1px;
  transition: transform .12s; }
.dot-wa:hover, .dot-wa:focus-visible { transform: scale(1.35); }
.dot-ask { background: #FDE047; box-shadow: inset 0 0 0 1px #EAB308; }
.wa-text { width: 100%; font-size: 13px; resize: vertical; }
.wa-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #14532d; color: #fff;
  padding: 10px 16px; border-radius: 10px; font-weight: 700; z-index: 1000; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

/* table-tools.js — filters + sorting on the Motoristas / Cartões / Via Verde tabs (2026-10-19) */
.tt-bar { padding: 10px 12px; }
.table-card .tt-bar { border-bottom: 1px solid var(--border, #e2e8f0); }
th.tt-sortable { cursor: pointer; user-select: none; }
th.tt-sortable:hover { text-decoration: underline; }
th.tt-sortable.sorted-asc::after { content: " ▲"; font-size: 9px; }
th.tt-sortable.sorted-desc::after { content: " ▼"; font-size: 9px; }
.tt-bar .vp-count { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Criar cliente — nothing below the kind until it is chosen (2026-10-19) */
.kind-pick-hint { margin: 14px 0 4px; padding: 14px 16px; border: 1px dashed var(--border, #cbd5e1); border-radius: 12px;
  color: var(--muted); background: var(--surface-2, #f8fafc); font-weight: 600; }

/* T-INF-011 — acceptance environment banner (never shown in production) */
.env-banner { background: #b45309; color: #fff; text-align: center; font-weight: 700; padding: .35rem .75rem; font-size: .85rem; letter-spacing: .02em; }

/* Aviso de aceitacao no rodape das paginas de acesso */
.login-page > .env-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: transparent; color: rgba(255,255,255,.8); font-size: 12px; font-weight: 500; text-align: center; padding: 12px 18px; line-height: 1.5; box-sizing: border-box; }
.login-page { padding: 16px 12px 58px; box-sizing: border-box; }

/* TVDE: layout responsivo de login e MFA */
.login-page { box-sizing:border-box; padding:24px 16px 64px; }
.login-page .login-card { box-sizing:border-box; min-width:0; max-width:520px; overflow:hidden; }
.login-page .login-card p, .login-page .login-card span, .login-page .login-card li { overflow-wrap:anywhere; }
.login-page .dev-link { display:block; max-width:100%; box-sizing:border-box; white-space:normal; overflow-wrap:anywhere; word-break:break-all; line-height:1.6; }
.login-page .env-banner { position:fixed; bottom:0; left:0; right:0; z-index:10; box-sizing:border-box; background:transparent; color:rgba(255,255,255,.85); text-align:center; font-size:12px; font-weight:500; padding:12px 16px; line-height:1.5; }
@media(max-width:600px) { .login-page .login-card { padding:28px 22px; } .login-page .env-banner { font-size:11px; } }
