:root {
  --tv-blue: #3f73bd;
  --tv-blue-2: #2f63ac;
  --tv-blue-dark: #173f7d;
  --tv-red: #b31317;
  --tv-purple: #2b0086;
  --tv-purple-2: #4211b7;
  --tv-cream: #fbfaec;
  --tv-cream-2: #fffdf1;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #16233a;
  --muted: #64748b;
  --line: #e3e8f2;
  --line-strong: #cbd5e1;
  --shadow-sm: 0 8px 22px rgba(15, 23, 42, .07);
  --shadow: 0 18px 45px rgba(15, 23, 42, .11);
  --shadow-blue: 0 18px 45px rgba(23, 63, 125, .20);
  --radius: 22px;
}

* {
  box-sizing: border-box
}

html,
body {
  min-height: 100%
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, var(--tv-cream), #eef4ff 55%, #f8fafc);
  color: var(--text)
}

a {
  color: inherit;
  text-decoration: none
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(135deg, var(--tv-blue-dark), var(--tv-blue));
  color: white;
  padding: 12px 20px 0;
  box-shadow: var(--shadow-blue)
}

.brand-card {
  width: min(1220px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 0 12px;
  background: transparent;
  border: 0
}

.brand-logo {
  width: 152px;
  height: 62px;
  border-radius: 6px;
  background: #fff;
  display: grid;
  place-items: center;
  color: #0b3b82;
  font-weight: 950;
  letter-spacing: -.04em;
  line-height: .82;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
  border: 1px solid rgba(255, 255, 255, .7);
  position: relative;
  overflow: hidden;
  text-align: center;
  font-size: 24px;
  font-family: Arial Black, Impact, Inter, sans-serif
}

.brand-logo::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 16px;
  width: 120px;
  height: 34px;
  border-top: 7px solid #e3192b;
  border-left: 7px solid transparent;
  transform: skewX(-22deg);
  opacity: .92
}

.brand-logo::after {
  content: "TRANSPORTE EXECUTIVO";
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  font-size: 8px;
  letter-spacing: .04em;
  color: #263544;
  font-weight: 900
}

.brand-logo.large {
  width: 210px;
  height: 82px;
  font-size: 32px;
  border-radius: 7px
}

.brand-card strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: #dbeafe;
  margin-bottom: 4px
}

.brand-card span {
  font-size: 24px;
  font-weight: 950;
  color: white;
  display: block;
  line-height: 1.05;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .08)
}

.nav {
  width: min(1220px, 100%);
  margin: 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
  overflow: auto;
  background: rgba(255, 253, 241, .92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .72);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 10px;
  box-shadow: 0 -4px 22px rgba(15, 23, 42, .05) inset
}

.nav-link {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  color: #1a3158;
  font-weight: 900;
  border-radius: 15px;
  white-space: nowrap;
  transition: .18s ease;
  border: 1px solid transparent
}

.nav-link:hover {
  background: #fff;
  color: var(--tv-red);
  border-color: #eadfb6;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px)
}

.sidebar-footer {
  display: none
}

.main {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 0 18px 30px;
  min-width: 0;
  background: transparent
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 0 0 20px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .82);
  border-top: 0;
  border-radius: 0 0 24px 24px;
  padding: 22px 26px;
  box-shadow: var(--shadow)
}

.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--tv-blue);
  font-weight: 950;
  margin: 0 0 6px
}

.topbar h1 {
  margin: 0;
  font-size: 34px;
  color: var(--tv-red);
  letter-spacing: -.03em;
  font-weight: 950
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 850;
  color: #1c2b48;
  box-shadow: var(--shadow-sm)
}

.user-pill a {
  color: var(--tv-red);
  font-weight: 950
}

.page-card {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .88);
  box-shadow: var(--shadow);
  border-radius: 26px;
  padding: 24px;
  min-height: calc(100vh - 235px)
}

.section-title {
  margin: 0 0 18px;
  color: var(--tv-red);
  font-size: 30px;
  font-weight: 950;
  letter-spacing: -.02em
}

.muted {
  color: var(--muted)
}

.messages {
  margin-bottom: 14px
}

.msg {
  padding: 12px 14px;
  border-radius: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 800
}

.msg.error {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b
}

.notice {
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #7c2d12;
  margin-bottom: 18px
}

.fiscal-alert {
  background: linear-gradient(135deg, #fff7ed, #eff6ff);
  border-color: #dbeafe;
  color: #1e3a8a
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px
}

.dashboard-head h2 {
  margin: 3px 0 0;
  font-size: 26px;
  color: var(--text);
  font-weight: 950
}

.status-badge {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 950;
  box-shadow: var(--shadow-sm)
}

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

.kpi-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 19px;
  box-shadow: var(--shadow-sm);
  min-height: 145px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: .18s ease
}

.kpi-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 95px;
  height: 95px;
  border-radius: 999px;
  background: rgba(63, 115, 189, .09)
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow)
}

.kpi-card.primary {
  background: linear-gradient(135deg, var(--tv-blue-dark), var(--tv-blue-2));
  color: white;
  box-shadow: var(--shadow-blue)
}

.kpi-card.primary::after {
  background: rgba(255, 255, 255, .14)
}

.kpi-card span {
  font-size: 13px;
  font-weight: 950;
  color: var(--tv-blue);
  position: relative;
  z-index: 1
}

.kpi-card.primary span,
.kpi-card.primary small {
  color: #e6efff
}

.kpi-card strong {
  font-size: 32px;
  line-height: 1;
  letter-spacing: -.03em;
  position: relative;
  z-index: 1
}

.kpi-card small {
  color: var(--muted);
  font-weight: 750;
  position: relative;
  z-index: 1
}

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

.panel,
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-sm)
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px
}

.panel-title h3,
.card h3 {
  margin: 0;
  font-size: 20px;
  color: var(--text);
  font-weight: 950
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  overflow: hidden;
  border-radius: 16px
}

.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--tv-blue);
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc
}

.table td {
  padding: 13px 12px;
  border-bottom: 1px solid #eef2f7
}

.table tr:last-child td {
  border-bottom: 0
}

.empty {
  color: var(--muted);
  text-align: center
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 900;
  font-size: 12px
}

.badge.ok {
  background: #dcfce7;
  color: #166534
}

.badge.danger {
  background: #fee2e2;
  color: #991b1b
}

.btn,
button,
input[type=submit] {
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 950;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: .18s ease
}

.btn.primary,
.btn-primary,
button[type=submit],
input[type=submit] {
  background: linear-gradient(135deg, var(--tv-purple), var(--tv-purple-2));
  color: white;
  box-shadow: 0 10px 24px rgba(43, 0, 134, .20)
}

.btn-secondary {
  background: #eef2ff;
  color: #1e3a8a;
  border: 1px solid #dbeafe
}

.btn:hover,
button:hover,
input[type=submit]:hover {
  filter: brightness(1.05);
  transform: translateY(-1px)
}

form {
  display: grid;
  gap: 14px
}

label {
  font-weight: 950;
  color: #1f3d6e
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 12px 14px;
  background: #f8fafc;
  font: inherit;
  color: #172033;
  transition: .15s ease
}

input:focus,
select:focus,
textarea:focus {
  outline: 4px solid rgba(63, 115, 189, .16);
  border-color: var(--tv-blue);
  background: #fff
}

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

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

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

.field-group,
.field {
  display: grid;
  gap: 7px
}

.help,
.helptext {
  font-size: 12px;
  color: #64748b
}

.error {
  font-size: 12px;
  color: #b91c1c;
  font-weight: 800
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  padding: 18px;
  margin-bottom: 16px
}

.form-section h4 {
  margin: 0 0 14px;
  color: var(--tv-red);
  font-size: 17px;
  font-weight: 950
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px
}

.tab {
  padding: 11px 16px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1e3a8a;
  font-weight: 950
}

.tab-content {
  margin-bottom: 18px
}

.checkbox-list p {
  display: flex;
  gap: 8px;
  align-items: center
}

.schema-list {
  max-height: 260px;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 20px
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 20% 10%, rgba(63, 115, 189, .20), transparent 32%), linear-gradient(135deg, var(--tv-cream), #eaf1ff 75%);
  padding: 24px
}

.login-wrap {
  width: min(1020px, 94vw);
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 26px;
  align-items: stretch
}

.login-brand,
.login-card {
  border-radius: 30px;
  padding: 34px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .75);
  min-height: 430px
}

.login-brand {
  background: linear-gradient(135deg, var(--tv-blue-dark), var(--tv-blue-2));
  color: white;
  position: relative;
  overflow: hidden
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .12), transparent 52%)
}

.login-brand .brand-logo.large {
  position: relative;
  z-index: 1;
  margin-bottom: 28px
}

.login-brand p {
  position: relative;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 950;
  color: #dbeafe;
  margin: 0 0 22px
}

.login-brand h1 {
  position: relative;
  z-index: 1;
  font-size: 38px;
  line-height: 1.08;
  color: #fff;
  margin: 0 0 22px;
  font-weight: 950;
  letter-spacing: -.03em
}

.login-brand span {
  position: relative;
  z-index: 1;
  display: block;
  color: #e6efff;
  font-size: 17px;
  font-weight: 750
}

.login-card {
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center
}

.login-card h2 {
  font-size: 34px;
  color: var(--text);
  margin: 0 0 6px;
  font-weight: 950
}

.login-card>p {
  color: var(--muted);
  margin: 0 0 22px
}

.login-card form {
  margin-top: 10px
}

.login-form input {
  display: block;
  min-height: 50px;
  color: #111827;
  background: #f8fafc;
  border: 1px solid var(--line-strong);
  border-radius: 14px
}

.login-form input::placeholder {
  color: #94a3b8
}

.login-card .btn.primary {
  width: 100%;
  min-height: 52px;
  margin-top: 4px
}

.login-help {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 13px
}

.login-help strong {
  color: #172033;
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 8px
}

.pwa-shell {
  max-width: 760px;
  margin: 0 auto
}

.pwa-shell .card {
  margin-bottom: 16px
}

@media(max-width:1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .content-grid,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr
  }

  .field-grid,
  .form-grid {
    grid-template-columns: 1fr
  }

  .nav {
    border-radius: 0;
    max-width: none
  }

  .topbar {
    border-radius: 0
  }

  .main {
    padding-left: 12px;
    padding-right: 12px
  }

  .login-wrap {
    grid-template-columns: 1fr
  }

  .login-brand,
  .login-card {
    min-height: unset
  }
}

@media(max-width:720px) {
  .sidebar {
    padding: 10px 10px 0
  }

  .brand-card {
    align-items: flex-start
  }

  .brand-logo {
    width: 118px;
    height: 52px;
    font-size: 20px
  }

  .brand-card span {
    font-size: 18px
  }

  .nav {
    gap: 6px;
    padding: 8px
  }

  .nav-link {
    padding: 10px 12px
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 18px
  }

  .topbar h1 {
    font-size: 28px
  }

  .page-card {
    padding: 16px;
    border-radius: 20px
  }

  .kpi-grid {
    grid-template-columns: 1fr
  }

  .login-body {
    padding: 12px
  }

  .login-brand,
  .login-card {
    padding: 24px;
    border-radius: 24px
  }

  .login-brand h1 {
    font-size: 31px
  }

  .login-brand .brand-logo.large {
    width: 170px;
    height: 70px;
    font-size: 27px
  }
}

/* v9 layout: menu lateral moderno com identidade Total Vans */
.app-shell {
  display: grid;
  grid-template-columns: minmax(240px, 280px) 1fr;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--tv-cream), #edf4ff 60%, #fff)
}

.side-menu {
  position: sticky;
  top: 0;
  min-height: 100vh;
  height: auto;
  overflow-y: auto;
  z-index: 30;
  padding: 18px 16px;
  background: linear-gradient(160deg, var(--tv-blue-dark) 0%, var(--tv-blue) 52%, rgba(66, 17, 183, .88) 100%);
  box-shadow: 24px 0 55px rgba(23, 63, 125, .18);
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: #fff
}

.side-brand {
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 13px;
  align-items: center;
  padding: 0 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .16)
}

.side-brand .brand-logo {
  width: 96px;
  height: 54px;
  font-size: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18)
}

.side-brand .brand-logo::before {
  width: 72px;
  height: 26px;
  left: 12px;
  top: 8px;
  border-top-width: 5px
}

.side-brand .brand-logo::after {
  font-size: 6px;
  bottom: 5px
}

.side-brand strong {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #dbeafe;
  margin: 0 0 5px;
  display: block
}

.side-brand span {
  display: block;
  color: #fff;
  font-size: 26px;
  font-weight: 950;
  line-height: .95;
  letter-spacing: -.04em
}

.side-brand small {
  display: block;
  color: #e0ecff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  margin-top: 4px
}

.side-nav {
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 24px;
  padding: 10px;
  backdrop-filter: blur(12px);
  box-shadow: none;
  overflow: visible
}

.side-nav .nav-link {
  width: 100%;
  color: #eff6ff;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 13px 14px;
  font-weight: 950;
  justify-content: flex-start
}

.side-nav .nav-link:hover {
  background: rgba(255, 255, 255, .92);
  color: var(--tv-red);
  border-color: rgba(255, 255, 255, .8);
  box-shadow: 0 14px 32px rgba(15, 23, 42, .14)
}

.side-menu .sidebar-footer {
  display: block;
  margin-top: auto;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  padding: 13px
}

.side-menu .sidebar-footer small {
  display: block;
  color: #dbeafe
}

.side-menu .sidebar-footer strong {
  display: block;
  color: #fff;
  margin-top: 4px
}

.app-main {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 22px 26px 34px
}

.app-topbar {
  border-radius: 28px;
  margin: 0 0 20px;
  border: 1px solid rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow)
}

.page-card {
  min-height: auto;
}

.tab-nav {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px;
  display: inline-flex;
  box-shadow: var(--shadow-sm)
}

.tab-nav .tab {
  display: inline-flex;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  color: #1e3a8a
}

.tab-nav .tab.active {
  background: linear-gradient(135deg, var(--tv-blue-dark), var(--tv-blue));
  color: #fff;
  box-shadow: var(--shadow-blue)
}

.actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap
}

.actions-cell form {
  display: inline;
  margin: 0
}

.btn-danger {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fecaca !important;
  box-shadow: none !important
}

.status-cancelada {
  background: #fee2e2;
  color: #991b1b
}

.status-autorizada {
  background: #dcfce7;
  color: #166534
}

.status-rejeitada {
  background: #ffedd5;
  color: #9a3412
}

.status-emitida {
  background: #dbeafe;
  color: #1e40af
}

.status-rascunho {
  background: #f1f5f9;
  color: #475569
}

.color-picker {
  height: 54px !important;
  padding: 6px !important;
  border-radius: 16px !important;
  cursor: pointer
}

.color-form p:has(input[type="color"]) {
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px
}

.pwa-kpis {
  grid-template-columns: repeat(3, minmax(160px, 1fr))
}

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

  .side-menu {
    position: relative;
    height: auto;
    border-radius: 0
  }

  .side-brand {
    grid-template-columns: 88px 1fr
  }

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

  .app-main {
    padding: 14px
  }

  .page-card {
    min-height: auto
  }

  .pwa-kpis {
    grid-template-columns: 1fr
  }
}

@media(max-width:560px) {
  .side-nav {
    grid-template-columns: 1fr
  }

  .app-topbar {
    border-radius: 20px;
    padding: 18px
  }

  .user-pill {
    width: 100%;
    justify-content: space-between
  }

  .tab-nav {
    display: flex;
    width: 100%;
    border-radius: 22px
  }

  .tab-nav .tab {
    flex: 1;
    justify-content: center
  }

  .actions-cell {
    display: grid
  }

  .actions-cell .btn,
  .actions-cell form,
  .actions-cell button {
    width: 100%
  }
}

/* =========================================================
   v10 - PWA Motorista, lista de embarque e fluxo SEFAZ
   ========================================================= */
.sefaz-return {
  display: block;
  margin-top: 7px;
  max-width: 280px;
  color: #9a3412;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 800;
}

.lista-filter {
  display: grid;
  grid-template-columns: 220px 280px 1fr;
  gap: 16px;
  align-items: end;
}

.driver-app {
  max-width: 920px;
  margin: 0 auto;
  padding-bottom: 74px;
}

.driver-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(145deg, var(--tv-blue-dark), var(--tv-blue), rgba(66, 17, 183, .88));
  box-shadow: var(--shadow-blue);
  margin-bottom: 16px;
}

.driver-hero h2 {
  margin: 4px 0 6px;
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -.03em;
}

.driver-hero p,
.driver-hero .eyebrow {
  color: #e6efff;
}

.driver-next-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.driver-next-card span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--tv-blue);
  font-weight: 950;
}

.driver-next-card h3 {
  margin: 6px 0 3px;
  color: var(--tv-red);
  font-size: 24px;
  font-weight: 950;
}

.driver-next-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.driver-status-pill {
  padding: 9px 14px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-weight: 950;
}

.driver-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.driver-action {
  min-height: 92px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(38, 77, 155, .16);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  color: #18396f;
  font-weight: 950;
}

.driver-action:first-child {
  background: linear-gradient(135deg, var(--tv-purple), var(--tv-purple-2));
  color: #fff;
}

.driver-action span {
  display: block;
  margin-top: 4px;
}

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

.driver-passenger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: 18px;
  padding: 13px 15px;
}

.driver-passenger strong {
  display: block;
  color: #172033;
  font-weight: 950;
}

.driver-passenger small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 750;
}

.driver-bottom-nav {
  position: sticky;
  bottom: 12px;
  z-index: 40;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  margin-top: 18px;
  border-radius: 22px;
  background: rgba(23, 63, 125, .94);
  box-shadow: var(--shadow-blue);
  backdrop-filter: blur(14px);
}

.driver-bottom-nav a {
  text-align: center;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  padding: 10px 6px;
  border-radius: 16px;
}

.driver-bottom-nav a:hover {
  background: rgba(255, 255, 255, .16);
}

@media(max-width:900px) {
  .lista-filter {
    grid-template-columns: 1fr;
  }

  .driver-hero,
  .driver-next-card {
    flex-direction: column;
    align-items: stretch;
  }

  .driver-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .driver-bottom-nav {
    display: grid;
  }
}

@media(max-width:560px) {
  .driver-actions {
    grid-template-columns: 1fr 1fr;
  }

  .driver-action {
    min-height: 78px;
  }

  .driver-passenger {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* =========================================================
   TELA DE USUÁRIOS - LAYOUT CORRIGIDO
   ========================================================= */
.usuarios-form {
  display: flex;
  flex-direction: column;
  gap: 28px
}

.usuarios-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 34px;
  align-items: start
}

.usuarios-grid .field {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.usuarios-grid input[type="text"],
.usuarios-grid input[type="password"],
.usuarios-grid input[type="email"] {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(38, 77, 155, .24);
  background: #f8fbff;
  padding: 0 14px;
  font-weight: 700;
  color: #172033
}

.ativo-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start
}

.ativo-row {
  display: flex;
  align-items: center;
  gap: 10px
}

.ativo-row label {
  margin: 0;
  font-weight: 950;
  color: #18396f
}

.ativo-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  accent-color: #e94b24;
  cursor: pointer
}

.ativo-box small {
  display: block;
  color: #6b7c93;
  font-size: 13px;
  line-height: 1.5;
  max-width: 620px
}

.permissions-section {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.permissions-section h3 {
  margin: 0;
  color: #172033;
  font-size: 20px;
  font-weight: 950
}

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

.permission-card {
  min-height: 54px;
  padding: 12px 16px;
  border: 1px solid rgba(38, 77, 155, .16);
  border-radius: 14px;
  background: rgba(255, 255, 255, .84);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: .18s ease
}

.permission-card:hover {
  border-color: rgba(63, 115, 189, .38);
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
  transform: translateY(-1px)
}

.permission-card span {
  color: #18396f;
  font-weight: 950
}

.permission-card input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  accent-color: #e94b24;
  cursor: pointer
}

.form-actions {
  display: flex;
  justify-content: flex-end
}

@media(max-width:800px) {
  .usuarios-grid {
    grid-template-columns: 1fr
  }

  .permissions-grid {
    grid-template-columns: 1fr
  }

  .form-actions {
    justify-content: stretch
  }

  .form-actions .btn {
    width: 100%
  }
}

/* Abas da tela de configurações */
.config-tabs {
  margin-bottom: 22px;
}

.config-tabs .tab {
  border: 0;
  cursor: pointer;
}

.config-tab-content {
  display: none;
}

.config-tab-content.active {
  display: block;
}

/* Logo enviada pela tela de configurações */
.brand-logo-img {
  width: 112px;
  max-height: 64px;
  object-fit: contain;
  display: block;
  margin: 10px auto 8px;
  padding: 6px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

/* Ajuste lista de embarque */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table small {
  color: var(--muted);
  font-weight: 750;
}

.lista-filter .form-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

@media (max-width: 760px) {

  .lista-filter .form-actions,
  .lista-filter .form-actions .btn {
    width: 100%;
  }
}

/* =========================================================
   CORREÇÃO LOGO REAL DA EMPRESA - SIDEBAR
   ========================================================= */

.side-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-logo-area {
  width: 124px;
  height: 72px;
  margin: 10px auto 8px;
  padding: 7px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.brand-logo-area .brand-logo {
  margin: 0;
  box-shadow: none;
  border: 0;
}

.brand-logo-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.brand-company {
  width: 100%;
  max-width: 220px;
  margin-top: 2px;
  text-align: center;
}

.brand-company strong {
  display: block;
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.18;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  word-break: normal;
  overflow-wrap: anywhere;
}

.brand-company span {
  display: block;
  color: #dbeafe;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}

body.theme-dark {
  --bg: #020617;
  --card: #111827;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --line: #334155;
  --line-strong: #475569;

  background: linear-gradient(135deg, #020617, #0f172a 60%, #111827);
  color: var(--text);
}

body.theme-dark .app-shell {
  background: linear-gradient(135deg, #020617, #0f172a 60%, #111827);
}

body.theme-dark .app-topbar,
body.theme-dark .page-card,
body.theme-dark .card,
body.theme-dark .panel {
  background: rgba(15, 23, 42, .94);
  color: var(--text);
  border-color: rgba(148, 163, 184, .22);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  background: #020617;
  color: #f8fafc;
  border-color: #475569;
}

/* Logo da empresa na sidebar */
.brand-logo-area {
  width: 124px;
  height: 72px;
  margin: 10px auto 8px;
  padding: 7px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.brand-logo-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.brand-logo-placeholder {
  width: 100%;
  height: 100%;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}