/* ==========================================================================
   FDA — FRETES DELL'AGNOLO | DESIGN SYSTEM
   Inspirado na sofisticação do Café Dell'Agnolo + Usabilidade do Simples CT-e
   ========================================================================== */

:root {
  /* FDA Transportes Rápidos — Paleta Oficial da Logo */
  --moss-dark: #0c1926;      /* Deep Navy Petróleo FDA (fundo escuro / sidebar) */
  --moss-deep: #102133;      /* Navy Petróleo 900 */
  --moss: #15304b;           /* Navy Petróleo 800 (o azul das letras FDA) */
  --moss-light: #1c3e60;     /* Navy Petróleo 700 */
  --paper: #f4f7fb;          /* Fundo da aplicação limpo e corporativo */
  --cream: #e8f0f8;          /* Superfície sutil azul-gelo */
  --clay: #fb8500;           /* Laranja Solar (o Sol no centro do 'D' da logo) */
  --clay-hover: #e07400;     /* Laranja Solar Escurecido */
  --sun-gold: #ffb703;       /* Amarelo Solar Dourado da logo */
  --ink: #0c1a29;            /* Texto escuro de alto contraste */
  --line: rgba(21, 48, 75, 0.12);
  --line-strong: rgba(21, 48, 75, 0.22);
  --muted: #576d82;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  
  --green: #10b981;
  --green-light: #ecfdf5;
  --red: #ef4444;
  --red-light: #fef2f2;
  --blue: #0284c7;
  --blue-light: #f0f9ff;
  --amber: #fb8500;
  --amber-light: #fff4e5;

  --sans: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'DM Mono', 'Roboto Mono', monospace;
  --serif: 'Playfair Display', Georgia, serif;
}

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

html {
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  touch-action: pan-x pan-y;
  -webkit-touch-callout: none;
}

/* Previne zoom e delay de duplo toque em botões e elementos interativos */
button, input, select, textarea, a, .clickable {
  touch-action: manipulation;
}

/* Textura Grain Elegante (Desativada no mobile para prevenir falha de renderização no Safari/WebKit) */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none !important;
  z-index: -1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
}

@media (hover: none), (pointer: coarse), (max-width: 900px) {
  .grain {
    display: none !important;
    pointer-events: none !important;
  }
}

/* ==========================================================================
   TELA DE LOGIN
   ========================================================================== */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(251, 133, 0, 0.22), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(28, 62, 96, 0.4), transparent 50%),
    var(--moss-dark);
  color: #f7f4ed;
  position: relative !important;
  z-index: 10000 !important;
  pointer-events: auto !important;
}

.login-card {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 44px 38px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 30px 60px rgba(12, 25, 38, 0.45);
  text-align: center;
  position: relative !important;
  z-index: 10001 !important;
  pointer-events: auto !important;
}

#login-screen input,
#login-screen button,
#login-screen select,
#login-screen textarea {
  position: relative !important;
  z-index: 10002 !important;
  pointer-events: auto !important;
  user-select: text !important;
  -webkit-user-select: text !important;
  touch-action: manipulation !important;
}

.login-logo-img {
  width: 130px;
  height: auto;
  margin: 0 auto 18px;
  display: block;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(21, 48, 75, 0.15);
  border: 1px solid rgba(21, 48, 75, 0.08);
}

.login-brand-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: var(--moss-dark);
  color: var(--clay);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  border: 2px solid var(--clay);
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.input-text, .select-input, .textarea-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
}

.input-text:focus, .select-input:focus, .textarea-input:focus {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(194, 139, 78, 0.18);
}

.input-mono {
  font-family: var(--mono);
}

.btn-submit {
  background: var(--moss-dark);
  color: #ffffff;
  border: none;
  padding: 13px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-submit:hover {
  background: var(--moss);
  transform: translateY(-1px);
}

.login-footer-hint {
  margin-top: 24px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  background: var(--cream);
  padding: 10px;
  border-radius: 8px;
}

/* ==========================================================================
   APP CONTAINER (LAYOUT COM SIDEBAR)
   ========================================================================== */
#app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: 270px;
  background: var(--moss-dark);
  color: #f7f4ed;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header {
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  background: #ffffff;
  padding: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-slashes {
  color: var(--clay);
  font-weight: 800;
  letter-spacing: -1px;
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--clay);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.sidebar-brand-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  padding: 12px 10px 4px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: rgba(255,255,255,0.8);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #ffffff;
}

.nav-item.active {
  background: var(--moss);
  color: #ffffff;
  border-color: rgba(251, 133, 0, 0.4);
}

.nav-item.highlight-cte {
  background: rgba(251, 133, 0, 0.16);
  border-color: var(--clay);
  color: #ffd8a8;
}
.nav-item.highlight-cte:hover, .nav-item.highlight-cte.active {
  background: linear-gradient(135deg, #ffb703, #fb8500);
  color: #0c1926;
  font-weight: 800;
}

.nav-item .icon {
  font-size: 17px;
  width: 20px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  background: rgba(255,255,255,0.15);
  padding: 2px 7px;
  border-radius: 12px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  background: rgba(0,0,0,0.15);
}

.offline-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8ce99a;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #51cf66;
  box-shadow: 0 0 6px #51cf66;
}

.btn-logout {
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: rgba(255,255,255,0.8);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-logout:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL
   ========================================================================== */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--paper);
}

.top-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-heading h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-heading p {
  font-size: 12.5px;
  color: var(--muted);
}

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

.btn-lgpd-toggle {
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-lgpd-toggle:hover {
  background: #e2dac9;
}

.company-badge {
  font-size: 12px;
  font-weight: 700;
  background: rgba(46, 125, 50, 0.1);
  color: var(--green);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(46, 125, 50, 0.25);
}

.content-body {
  padding: 24px 28px;
  flex: 1;
}

/* ==========================================================================
   EMISSOR DE CT-E (MODELO SIMPLES CT-E)
   ========================================================================== */
.cte-emitter-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Barra Superior de Ações do Emissor */
.emitter-header-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.03);
  flex-wrap: wrap;
  gap: 14px;
}

.emitter-title-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.emitter-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--moss);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.emitter-title-area h3 {
  font-size: 18px;
  font-weight: 800;
}

.emitter-title-area p {
  font-size: 12px;
  color: var(--muted);
}

.emitter-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-action {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s ease;
}

.btn-xml-import {
  background: #2b4365;
  color: #ffffff;
}
.btn-xml-import:hover {
  background: #1a365d;
}

.btn-sample {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-sample:hover {
  background: #dfd7c5;
}

.btn-draft {
  background: #ffffff;
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-draft:hover {
  background: #f1f3f5;
}

.btn-emit-primary {
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(46, 125, 50, 0.3);
}
.btn-emit-primary:hover {
  background: #256628;
  transform: translateY(-1px);
}

/* Stepper / Abas do Simples CT-e */
.cte-stepper {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.step-tab {
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.step-tab:not(:last-child) {
  border-right: 1px solid var(--line);
}

.step-tab:hover {
  background: var(--bg-card-subtle);
}

.step-tab.active {
  border-bottom-color: var(--clay);
  background: rgba(251, 133, 0, 0.08);
}

.step-num {
  font-size: 11px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cream);
  display: grid;
  place-items: center;
  color: var(--ink);
}

.step-tab.active .step-num {
  background: var(--clay);
  color: #ffffff;
}

.step-label {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* Layout de Duas Colunas do Emissor */
.emitter-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

.emitter-form-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

.tab-section-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tab-section-header h4 {
  font-size: 16px;
  font-weight: 800;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

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

.form-row {
  margin-bottom: 16px;
}

.helper-text {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* Resumo Lateral Flutuante do Simples CT-e */
.emitter-summary-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 90px;
}

.summary-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}

.summary-header {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.freight-total-box {
  background: rgba(46, 125, 50, 0.08);
  border: 1px solid rgba(46, 125, 50, 0.3);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  margin-bottom: 16px;
}

.freight-total-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--green);
}

.freight-total-val {
  font-size: 26px;
  font-weight: 900;
  color: var(--green);
  font-family: var(--mono);
}

.summary-data-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12.5px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dotted var(--line);
  padding-bottom: 6px;
}

.summary-row span:first-child {
  color: var(--muted);
}

.summary-row span:last-child {
  font-weight: 700;
  text-align: right;
}

/* Checklist de Validação do Simples CT-e */
.checklist-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.check-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.check-ok {
  background: var(--green-light);
  color: var(--green);
}

.check-pending {
  background: var(--amber-light);
  color: var(--amber);
}

/* Tabela de NF-e e Componentes */
.item-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}

.item-table th {
  background: var(--bg-card-subtle);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.item-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.btn-table-action {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--red);
  font-weight: 700;
  font-size: 14px;
  padding: 4px;
}

/* Zona de Arrastar e Soltar XML */
.dropzone-box {
  border: 2px dashed var(--clay);
  background: rgba(251, 133, 0, 0.05);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone-box:hover {
  background: rgba(251, 133, 0, 0.12);
}

.dropzone-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

/* ==========================================================================
   CARDS DE MÉTRICAS DO DASHBOARD
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.02);
  display: flex;
  align-items: center;
  gap: 16px;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.icon-green { background: var(--green-light); color: var(--green); }
.icon-amber { background: var(--amber-light); color: var(--amber); }
.icon-blue { background: var(--blue-light); color: var(--blue); }
.icon-clay { background: rgba(251, 133, 0, 0.15); color: var(--clay); }

.metric-info h5 {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.metric-info h3 {
  font-size: 22px;
  font-weight: 900;
  margin-top: 2px;
  font-family: var(--mono);
}

/* ==========================================================================
   TABELAS DE GESTÃO (CT-e, FROTA, MOTORISTAS, ORDENS)
   ========================================================================== */
.data-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.02);
  overflow: hidden;
}

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

.data-card-header h3 {
  font-size: 16px;
  font-weight: 800;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  background: var(--bg-card-subtle);
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tr:hover {
  background: rgba(0,0,0,0.015);
}

.badge {
  padding: 4px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-block;
}

.badge-success { background: var(--green-light); color: var(--green); }
.badge-danger { background: var(--red-light); color: var(--red); }
.badge-warning { background: var(--amber-light); color: var(--amber); }
.badge-info { background: var(--blue-light); color: var(--blue); }
.badge-gray { background: #e9ecef; color: #495057; }

/* Grid de Frota (Cards de Furgões) */
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.vehicle-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vehicle-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.vehicle-plate-badge {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 900;
  background: #f1f3f5;
  border: 2px solid #000;
  padding: 2px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.vehicle-spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-card-subtle);
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
}

/* ==========================================================================
   MODAIS E TOASTS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  place-items: center;
  padding: 20px;
}

.modal-overlay:not(.active) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.modal-overlay.active {
  display: grid !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.modal-window {
  background: #ffffff;
  border-radius: 14px;
  max-width: 640px;
  width: 100%;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

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

.modal-header h4 {
  font-size: 17px;
  font-weight: 800;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-card-subtle);
}

/* Toast Alerts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.25s ease;
  min-width: 280px;
  max-width: 420px;
}

.toast-success { background: #2b8a3e; color: #fff; }
.toast-error { background: #c92a2a; color: #fff; }
.toast-info { background: #1971c2; color: #fff; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsividade */
@media (max-width: 1080px) {
  .emitter-layout {
    grid-template-columns: 1fr;
  }
  .emitter-summary-sidebar {
    position: static;
  }
  .cte-stepper {
    grid-template-columns: repeat(3, 1fr);
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  #app-layout {
    flex-direction: column;
  }
  .app-sidebar {
    width: 100%;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .cte-stepper {
    grid-template-columns: repeat(2, 1fr);
  }
  .pickups-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .panel-header-bar {
    flex-direction: column;
    align-items: stretch !important;
  }
}

/* ==========================================================================
   PAINEL DE COLETAS E ENTREGAS DIÁRIAS (FDA TRANSPORTES)
   ========================================================================== */
.pickups-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px;
}

.panel-header-bar {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(12, 25, 38, 0.04);
}

.date-navigator {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-navigator .input-date {
  width: 155px;
  border: 2px solid var(--clay);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--sans);
  outline: none;
}

#filter-date-hint {
  display: block;
  flex-basis: 100%;
  color: var(--muted);
  font-size: 11.5px;
}

.input-date[aria-invalid="true"],
.input-time-shift[aria-invalid="true"],
.pmc-input[aria-invalid="true"] {
  border-color: #b91c1c;
}

.date-nav-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.date-nav-btn:hover {
  background: var(--cream);
  border-color: var(--moss);
}
.date-nav-btn.active-day {
  background: var(--moss);
  color: #fff;
  border-color: var(--moss);
}
.date-nav-btn.date-nav-today {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
  font-weight: 800;
}
.date-nav-btn.date-nav-today:hover {
  background: #dbeafe;
}

.btn-shift-quick {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-shift-quick:hover {
  background: #fde68a;
}

.btn-shift-clear {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-shift-clear:hover {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary-solar {
  background: var(--brand-sun-gradient, linear-gradient(135deg, #ffb703 0%, #fb8500 100%));
  color: #0a1624;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(251, 133, 0, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary-solar:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(251, 133, 0, 0.45);
}

.btn-pdf-action {
  background: #1e3a5f;
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(30, 58, 95, 0.25);
}
.btn-pdf-action:hover {
  background: #152c48;
  transform: translateY(-1px);
}

.btn-whatsapp-action {
  background: #25D366;
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}
.btn-whatsapp-action:hover {
  background: #1eb956;
  transform: translateY(-1px);
}

.btn-action-presave {
  background: #0284c7 !important;
  color: #ffffff !important;
  border: 1px solid #0369a1 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.28) !important;
}
.btn-action-presave:hover {
  background: #0369a1 !important;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4) !important;
  transform: translateY(-1px);
}

.btn-action-finalize {
  background: #059669 !important;
  color: #ffffff !important;
  border: 1px solid #047857 !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28) !important;
}
.btn-action-finalize:hover {
  background: #047857 !important;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.4) !important;
  transform: translateY(-1px);
}

/* Barra de Jornada de Trabalho do Funcionário */
.work-shift-bar {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--clay);
  border-radius: 12px;
  padding: 12px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: 0 2px 10px rgba(12, 25, 38, 0.03);
}

.work-shift-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
}

.work-shift-title strong {
  font-weight: 800;
  color: var(--ink);
}

.work-shift-title small {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.work-shift-inputs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  width: 100%;
  gap: 14px;
}

.work-shift-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  gap: 8px;
}

.work-shift-field label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.input-time-shift {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 2px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  font-size: 13.5px;
  padding: 6px 10px;
  border-radius: 8px;
  font-family: var(--mono);
  outline: none;
  transition: border-color 0.2s;
}

.input-time-shift:focus {
  border-color: var(--clay);
}

.work-shift-badge {
  min-height: 40px;
  background: #fff8ee;
  border: 1px solid #fb8500;
  color: #b45309;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.work-shift-badge strong {
  font-weight: 900;
  font-size: 13px;
  color: #b45309;
}

/* KPI Cards */
.pickups-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.pickup-kpi-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.pickup-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.pickup-kpi-val {
  font-size: 26px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.1;
  font-family: var(--sans);
}
.pickup-kpi-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* Tabela de Planilha */
.sheet-table-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(12, 25, 38, 0.04);
}
.sheet-table-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-card-subtle);
}
.sheet-table-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.table-pickups {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.table-pickups th {
  background: #0f2238;
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--clay);
  white-space: nowrap;
}
.table-pickups td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink);
  vertical-align: middle;
}
.table-pickups tr:hover td {
  background: rgba(251, 133, 0, 0.03);
}

/* Badges Interativos de Situação */
.status-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  user-select: none;
}
.status-badge-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.badge-pego {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}
.badge-nao-pego {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.badge-entregue {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}
.badge-pendente {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}

.city-badge {
  display: inline-block;
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

/* Formulário e Cidade Pills */
.city-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.city-pill-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.city-pill-btn:hover {
  background: var(--cream);
  border-color: var(--clay);
  color: var(--clay);
}
.city-pill-btn.selected {
  background: var(--clay);
  color: #0a1624;
  border-color: var(--clay);
  font-weight: 800;
}

/* Status Radio Boxes */
.status-radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.status-radio-box {
  border: 2px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.status-radio-box:hover {
  background: var(--bg-card-subtle);
}
.status-radio-box.active-pego {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
}
.status-radio-box.active-nao-pego {
  border-color: #ef4444;
  background: #fef2f2;
  color: #b91c1c;
}
.status-radio-box.active-entregue {
  border-color: #0284c7;
  background: #f0f9ff;
  color: #0369a1;
}
.status-radio-box.active-pendente {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #b45309;
}

/* Barra de Configuração Manual do Relatório no Modal PDF */
.pdf-manual-config-bar {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  padding: 16px 20px;
}

.pmc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 6px;
}

.pmc-header strong {
  font-size: 13px;
  color: #0f2238;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pmc-header span {
  font-size: 11.5px;
  color: #64748b;
}

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

.pmc-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
}

.pmc-group label {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
}

.pmc-input {
  width: 100%;
  min-width: 0;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f2238;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}

.pmc-input:focus {
  border-color: #fb8500;
  box-shadow: 0 0 0 3px rgba(251, 133, 0, 0.15);
}

/* Documento de Impressão / Planilha PDF Oficial */
.pdf-sheet-modal-body {
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  background: #525659;
}

.pdf-sheet-page {
  background: #ffffff;
  color: #000000;
  max-width: 900px;
  margin: 0 auto;
  padding: 36px 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  font-family: Arial, sans-serif;
  line-height: 1.4;
}

.pdf-header-table {
  width: 100%;
  border-bottom: 2px solid #0f2238;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.pdf-print-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  margin-bottom: 20px;
}
.pdf-print-table th {
  background: #0f2238;
  color: #ffffff;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  padding: 8px 10px;
  border: 1px solid #0f2238;
  text-align: left;
}
.pdf-print-table td {
  font-size: 11.5px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  color: #111827;
}
.pdf-print-table tr:nth-child(even) td {
  background: #f9fafb;
}

.pdf-signature-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 36px;
  padding-top: 20px;
}
.pdf-sig-line {
  border-top: 1px solid #000;
  padding-top: 6px;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
}

/* Impressão Direta em PDF nativo no Navegador */
@media print {
  body * {
    visibility: hidden;
  }
  .pdf-sheet-page, .pdf-sheet-page * {
    visibility: visible;
  }
  .pdf-sheet-page {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 20px !important;
    box-shadow: none !important;
  }
  .no-print {
    display: none !important;
  }
}

/* ==========================================================================
   ESTILOS DE AUTENTICAÇÃO, CADASTRO, VERIFICADOR E GESTÃO DE ACESSOS FDA
   ========================================================================== */

.auth-tabs-nav {
  display: flex;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}
.auth-tab-btn {
  flex: 1;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: #475569;
  font-weight: 700;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.auth-tab-btn.active {
  background: #ffffff;
  color: #0f2238;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.quick-accounts-section {
  margin-bottom: 18px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 12px;
}
.quick-accounts-title {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.quick-chips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.quick-chip-btn {
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
}
.quick-chip-btn:hover {
  border-color: #fb8500;
  background: #fff8ee;
  transform: translateY(-1px);
}
.quick-chip-role {
  font-size: 9.5px;
  color: #64748b;
  font-weight: normal;
}

/* Verificador de Consistência */
.verification-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin: 14px 0;
  font-size: 12px;
  transition: all 0.25s ease;
}
.verification-card.consistent {
  background: #f0fdf4;
  border-color: #86efac;
}
.verification-card.divergent {
  background: #fef2f2;
  border-color: #fca5a5;
}
.verif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.verif-title {
  font-weight: 800;
  font-size: 12.5px;
  color: #0f2238;
  display: flex;
  align-items: center;
  gap: 6px;
}
.verif-score-badge {
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 20px;
}
.verif-score-high {
  background: #dcfce7;
  color: #15803d;
}
.verif-score-low {
  background: #fee2e2;
  color: #b91c1c;
}
.verif-item-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  font-size: 11.5px;
  color: #334155;
  line-height: 1.35;
}

/* Badges de Usuários */
.badge-role-owner {
  background: linear-gradient(135deg, #fb8500, #ffb703);
  color: #0c1926;
  font-weight: 900;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-role-subowner {
  background: #0284c7;
  color: #ffffff;
  font-weight: 800;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.badge-role-staff {
  background: #475569;
  color: #ffffff;
  font-weight: 700;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 6px;
}
.badge-status-pending {
  background: #fef3c7;
  color: #b45309;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
}
.badge-status-active {
  background: #dcfce7;
  color: #15803d;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
}
.badge-status-blocked {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Botão de Gestão de Acessos no Header */
.btn-manage-access {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(251, 133, 0, 0.15);
  border: 1px solid #fb8500;
  color: #fb8500;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-manage-access:hover {
  background: #fb8500;
  color: #0c1926;
  transform: translateY(-1px);
}
.badge-pending-count {
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Cards de Solicitações Pendentes (Exclusivo Fabio) */
.pending-card {
  background: #ffffff;
  border: 2px solid #fb8500;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(251, 133, 0, 0.1);
}
.pending-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.btn-approve-success {
  background: #16a34a;
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-approve-success:hover {
  background: #15803d;
  transform: translateY(-1px);
}
.btn-reject-danger {
  background: #dc2626;
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-reject-danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

/* Abas de Navegação Principal do Sistema */
.nav-system-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}
.nav-system-tab-btn {
  background: transparent;
  border: none;
  color: #94a9c0;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}
.nav-system-tab-btn[hidden] {
  display: none !important;
}
.nav-system-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}
.nav-system-tab-btn.active {
  background: #fb8500;
  color: #0c1926;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(251, 133, 0, 0.35);
}

/* Tabela e Ações de Gestão de Usuários */
.sheet-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
}
.sheet-data-table th {
  background: #0f2238;
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 2px solid #fb8500;
  white-space: nowrap;
}
.sheet-data-table td {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12.5px;
  color: #1e293b;
  vertical-align: middle;
}
.sheet-data-table tr:hover td {
  background: #f8fafc;
}

.action-table-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: inherit;
}
.action-table-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.btn-remove-access {
  transition: all 0.2s ease !important;
}
.btn-remove-access:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #b91c1c !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3) !important;
}

/* ==========================================================================
   BARRA DE TOPO DO SISTEMA (APP-HEADER)
   ========================================================================== */
.app-header {
  background: #0c1926;
  color: #ffffff;
  border-bottom: 3px solid var(--clay);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-header-logo {
  height: 44px;
  width: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.app-header-titles {
  display: flex;
  flex-direction: column;
}

.app-header-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin: 0;
  color: #ffffff;
  line-height: 1.2;
}

.app-header-sub {
  font-size: 12px;
  color: #94a9c0;
  margin: 0;
}

/* No Desktop, os controles do menu mobile e backdrop ficam ocultos */
.mobile-header-actions,
.mobile-menu-backdrop,
.mobile-drawer-header {
  display: none !important;
}

.app-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.app-header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header-user-pill {
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-pill-icon {
  font-size: 13px;
}

.user-pill-name {
  color: var(--sun-gold);
}

.btn-logout-top {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 700;
  transition: all 0.2s ease;
}
.btn-logout-top:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  color: #ffffff !important;
}

/* Controles de Data e Filtros da Planilha */
.date-picker-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

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

.sheet-filters-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sheet-filters-wrap .select-input {
  padding: 6px 10px;
  font-size: 12.5px;
  width: auto;
}

.sheet-filters-wrap .input-text {
  padding: 6px 12px;
  font-size: 12.5px;
  width: 180px;
}

/* ==========================================================================
   CARDS DE COLETAS PARA DISPOSITIVOS MÓVEIS (CELULAR E TABLET)
   ========================================================================== */
.mobile-pickups-cards {
  display: none;
}

.mobile-pickup-card {
  background: #ffffff;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(12, 25, 38, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.mobile-pickup-card.is-card-pego {
  border-color: #86efac;
  background: #fafffc;
}

.mobile-pickup-card.is-card-entregue {
  border-color: #7dd3fc;
  background: #f7fbff;
}

.mp-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.mp-meta-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mp-badge-index {
  background: var(--moss);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 6px;
}

.mp-badge-time {
  background: #f1f5f9;
  color: #0f2238;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--mono);
  padding: 2px 8px;
  border-radius: 6px;
}

.mp-badge-date {
  background: #fff8ee;
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

.mp-actions-quick {
  display: flex;
  gap: 6px;
}

.mp-btn-action {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  transition: all 0.15s ease;
}
.mp-btn-action:hover {
  background: #e2e8f0;
}
.mp-btn-action-del {
  color: var(--red);
  border-color: #fca5a5;
  background: #fef2f2;
}
.mp-btn-action-del:hover {
  background: #fee2e2;
}

.mp-card-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mp-detail-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mp-detail-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.mp-detail-main-text {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
}

.mp-detail-subtext {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.mp-city-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 8px;
  background: #e8f0f8;
  color: #0c1a29;
  border: 1px solid #94a9c0;
  width: fit-content;
}

.mp-obs-bubble {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: #334155;
  line-height: 1.35;
}

/* Botões Grandes e Rápidos de 1 Toque para Polegar */
.mp-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.mp-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  min-height: 52px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.mp-toggle-btn:active {
  transform: scale(0.97);
}

.mp-btn-pego-active {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}

.mp-btn-pego-inactive {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.mp-btn-entregue-active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #075985;
}

.mp-btn-entregue-inactive {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.mp-toggle-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.mp-toggle-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.mp-toggle-main {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.mp-toggle-sub {
  font-size: 10px;
  opacity: 0.85;
  font-weight: 600;
}

.mobile-empty-state {
  text-align: center;
  padding: 36px 16px;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: var(--muted);
}

/* ==========================================================================
   BOTÃO FLUTUANTE (FAB) MOBILE PARA ADICIONAR NOVA COLETA
   ========================================================================== */
.mobile-fab-add {
  display: none;
  position: fixed;
  bottom: 22px;
  right: 18px;
  z-index: 1000;
  background: linear-gradient(135deg, #ffb703 0%, #fb8500 100%);
  color: #0c1926;
  font-weight: 900;
  font-size: 14px;
  padding: 13px 22px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(251, 133, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.mobile-fab-add:active {
  transform: scale(0.95);
  box-shadow: 0 4px 14px rgba(251, 133, 0, 0.35);
}
.mobile-fab-add .fab-icon {
  font-size: 16px;
}
.mobile-fab-add .fab-label {
  font-size: 13.5px;
  letter-spacing: 0.3px;
}

/* Suporte para Safe Area no iPhone (Notch e Barra Home) */
@supports (padding: env(safe-area-inset-bottom)) {
  .mobile-fab-add {
    bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

/* Botões de Ação na Tabela (Editar e Excluir) */
.btn-action-edit {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  font-weight: 700;
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  font-family: inherit;
}
.btn-action-edit:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
  transform: translateY(-1px);
}
.btn-action-delete {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-weight: 700;
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  font-family: inherit;
}
.btn-action-delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
  transform: translateY(-1px);
}

/* Cards Mobile de Clientes e Motoristas */
.mobile-customers-cards,
.mobile-drivers-cards,
.mobile-users-cards {
  display: none;
}
.customer-mobile-card,
.driver-mobile-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(15, 34, 56, 0.05);
  margin-bottom: 10px;
}
.cmc-header,
.dmc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.cmc-title,
.dmc-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f2238;
}
.cmc-sub,
.dmc-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}
.cmc-type-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}
.cmc-type-pj {
  background: #e0f2fe;
  color: #0369a1;
}
.cmc-type-pf {
  background: #fef3c7;
  color: #b45309;
}
.cmc-info-row,
.dmc-info-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}
.cmc-label,
.dmc-label {
  color: #64748b;
  font-weight: 600;
  flex-shrink: 0;
}
.cmc-val,
.dmc-val {
  text-align: right;
  color: #0f2238;
}
.cmc-wa-link {
  color: #15803d;
  font-weight: 700;
  text-decoration: none;
}
.cmc-actions,
.dmc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.cmc-actions .btn-action-edit,
.cmc-actions .btn-action-delete,
.dmc-actions .btn-action-edit,
.dmc-actions .btn-action-delete {
  justify-content: center;
  padding: 9px 12px;
  font-size: 12.5px;
}

/* ==========================================================================
   REGRAS RESPONSIVAS COMPLETAS (TABLETS E CELULARES <= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Layout Base */
  #app-layout {
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
  }

  .pickups-container {
    width: 100%;
    min-width: 0;
    padding: 12px 10px 84px 10px; /* Espaço para não cobrir o FAB */
  }

  /* Header Mobile Compacto com apenas Planilha fora e Menu Hambúrguer (Suporte total iPhone 13/Notch e telas diversas) */
  .app-header {
    padding-top: calc(10px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 10px !important;
    padding-left: calc(12px + env(safe-area-inset-left, 0px)) !important;
    padding-right: calc(12px + env(safe-area-inset-right, 0px)) !important;
    min-height: calc(54px + env(safe-area-inset-top, 0px)) !important;
    box-sizing: border-box !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 2000 !important;
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
  }

  .app-header-brand {
    gap: 8px !important;
    min-width: 0 !important;
    flex: 1 !important;
    align-items: center !important;
    position: relative !important;
    z-index: 1002 !important;
    pointer-events: auto !important;
  }

  .app-header-logo {
    height: 34px !important;
    width: 34px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
  }

  .app-header-titles {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .app-header-title {
    font-size: 14px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
    line-height: 1.2 !important;
  }

  .app-header-sub {
    display: none !important;
  }

  /* Ações do topo do Header Mobile */
  .mobile-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 1002 !important;
    pointer-events: auto !important;
  }

  .btn-mobile-header-planilha {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    min-height: 44px !important;
    padding: 0 13px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    border-radius: 22px !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    position: relative !important;
    z-index: 1003 !important;
    pointer-events: auto !important;
    transition: all 0.15s ease !important;
  }

  .btn-mobile-header-planilha:active {
    transform: scale(0.96) !important;
    background: rgba(255, 255, 255, 0.22) !important;
  }

  .btn-mobile-header-planilha.active {
    background: #ea580c !important;
    border-color: #ea580c !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.45) !important;
  }

  .btn-mobile-hamburger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    font-size: 22px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    position: relative !important;
    z-index: 1003 !important;
    pointer-events: auto !important;
    transition: all 0.15s ease !important;
  }

  .btn-mobile-hamburger:active {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: scale(0.95) !important;
  }

  /* Backdrop do Menu Hambúrguer (Oculto totalmente quando inativo para evitar bloqueio no WebKit iOS) */
  .mobile-menu-backdrop {
    display: none !important;
    pointer-events: none !important;
  }

  .mobile-menu-backdrop.active {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.45) !important;
    z-index: 1500 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  /* Gaveta Lateral do Menu Hambúrguer (Drawer com suporte a Safe Areas do iOS) */
  .app-header-controls {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 320px !important;
    max-width: 88vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #0f172a !important;
    border-left: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.65) !important;
    z-index: 2500 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding-top: calc(16px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: 16px !important;
    padding-right: calc(16px + env(safe-area-inset-right, 0px)) !important;
    gap: 12px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    transform: translateX(105%) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }

  .app-header-controls.mobile-menu-open {
    transform: translateX(0) !important;
    pointer-events: auto !important;
    visibility: visible !important;
  }

  .mobile-drawer-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    margin-bottom: 2px !important;
  }

  .btn-close-mobile-menu {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    font-size: 16px !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    transition: all 0.15s ease !important;
  }

  .btn-close-mobile-menu:active {
    background: rgba(255, 255, 255, 0.22) !important;
    transform: scale(0.95) !important;
  }

  .app-header-user {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    background: #1e293b !important;
    border: 1.5px solid #334155 !important;
    border-radius: 12px !important;
    padding: 12px !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .app-header-user-pill {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .user-pill-name {
    font-size: 13.5px !important;
    font-weight: 800 !important;
    color: #f8fafc !important;
    max-width: 160px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .btn-logout-top {
    width: 100% !important;
    background: #dc2626 !important;
    border: 1px solid #ef4444 !important;
    color: #ffffff !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    border-radius: 8px !important;
    text-align: center !important;
    cursor: pointer !important;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .nav-system-tabs {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 7px !important;
    padding: 0 !important;
  }

  .nav-system-tab-btn {
    width: 100% !important;
    min-height: 44px !important;
    padding: 11px 14px !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    justify-content: flex-start !important;
    text-align: left !important;
    border-radius: 10px !important;
    background: #1e293b !important;
    color: #f8fafc !important;
    border: 1.5px solid #334155 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    transition: all 0.15s ease !important;
  }

  .nav-system-tab-btn.active {
    background: #ea580c !important;
    color: #ffffff !important;
    border-color: #ea580c !important;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35) !important;
  }

  #btn-pwa-install-header {
    width: 100% !important;
    justify-content: center !important;
    padding: 11px 14px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
    margin-top: auto !important;
  }

  /* Telas Ultra Pequenas (<= 360px - iPhone SE 1ª geração, pequenos Androids) */
  @media (max-width: 360px) {
    .app-header {
      padding-left: calc(8px + env(safe-area-inset-left, 0px)) !important;
      padding-right: calc(8px + env(safe-area-inset-right, 0px)) !important;
      gap: 6px !important;
    }
    .app-header-brand .app-header-logo {
      height: 30px !important;
      width: 30px !important;
    }
    .app-header-title {
      font-size: 12.5px !important;
    }
    .btn-mobile-header-planilha {
      padding: 0 10px !important;
      font-size: 12px !important;
      min-height: 40px !important;
      gap: 4px !important;
    }
    .btn-mobile-hamburger {
      width: 40px !important;
      min-width: 40px !important;
      height: 40px !important;
      min-height: 40px !important;
      font-size: 19px !important;
    }
  }

  /* Telas Médias e Padrão (361px a 430px - iPhone 12, 13, 14, 15, 16 e Galaxy) */
  @media (min-width: 361px) and (max-width: 430px) {
    .app-header-title {
      font-size: 14px !important;
    }
    .btn-mobile-header-planilha {
      padding: 0 13px !important;
      font-size: 13px !important;
    }
  }

  /* Telas Maiores e Foldables (431px a 768px - iPhone Pro Max, Galaxy Ultra) */
  @media (min-width: 431px) and (max-width: 768px) {
    .app-header-title {
      font-size: 15px !important;
    }
    .app-header-logo {
      height: 36px !important;
      width: 36px !important;
    }
    .btn-mobile-header-planilha {
      padding: 0 15px !important;
      font-size: 13.5px !important;
    }
  }

  /* Barra de Controle de Datas e Ações */
  .panel-header-bar {
    padding: 12px 10px;
    border-radius: 12px;
    margin-bottom: 12px;
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }

  .date-navigator {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    align-items: center;
  }

  .date-picker-wrap {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .input-date-container {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
  }

  .date-navigator .input-date {
    width: 100%;
    flex: 1;
    min-width: 0;
    padding: 8px 36px 8px 10px;
    font-size: 16px;
    text-align: center;
    border-radius: 8px;
    box-sizing: border-box;
  }

  .date-nav-prev,
  .date-nav-today,
  .date-nav-next,
  .date-nav-all {
    width: 100%;
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 800;
    justify-content: center;
    text-align: center;
    min-height: 38px;
    box-sizing: border-box;
  }

  .date-nav-all {
    grid-column: 1 / -1;
  }

  .action-buttons-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #section-view-users .action-buttons-group,
  #section-view-system-health .action-buttons-group {
    grid-template-columns: 1fr;
  }

  #section-view-users .action-buttons-group button,
  #section-view-system-health .action-buttons-group button {
    width: 100%;
    justify-content: center;
  }

  #btn-open-new-pickup {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 14.5px;
  }

  #btn-save-daily-sheet,
  #btn-finalize-daily-sheet {
    width: 100%;
    justify-content: center;
    padding: 10px 6px;
    font-size: 13px;
    min-height: 44px;
    text-align: center;
    white-space: nowrap;
  }

  .btn-pdf-action {
    justify-content: center;
    padding: 10px 8px;
    font-size: 12px;
  }

  .btn-whatsapp-action {
    justify-content: center;
    padding: 10px 8px;
    font-size: 12px;
  }

  .btn-refresh-circle {
    display: none;
  }

  /* Grid de KPIs */
  .pickups-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
    margin-bottom: 14px;
  }

  .pickup-kpi-card {
    padding: 10px 12px;
    border-radius: 10px;
    gap: 10px;
  }

  .pickup-kpi-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 18px;
    border-radius: 8px;
  }

  .pickup-kpi-val {
    font-size: 20px;
  }

  .pickup-kpi-label {
    font-size: 10.5px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .pickup-kpi-card > div:last-child {
    min-width: 0;
  }

  /* Alternância Tabela vs Cards */
  #section-view-pickups .table-responsive,
  #section-view-customers .table-responsive,
  #section-view-drivers .table-responsive,
  #section-view-users .table-responsive,
  #tab-receivables .table-responsive {
    display: none !important;
  }

  .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .mobile-pickups-cards,
  .mobile-customers-cards,
  .mobile-drivers-cards,
  .mobile-users-cards {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    padding: 12px 10px;
  }

  .user-mobile-card {
    min-width: 0;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 34, 56, 0.05);
  }

  .user-mobile-card-name {
    margin-bottom: 10px;
    color: #0f2238;
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

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

  .user-mobile-field {
    min-width: 0;
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
  }

  .user-mobile-label {
    display: block;
    margin-bottom: 3px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .user-mobile-value {
    min-width: 0;
    color: #1e293b;
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .user-mobile-actions {
    margin-top: 10px;
  }

  .user-mobile-actions > div {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 6px !important;
  }

  .user-mobile-actions button {
    min-width: 0;
    min-height: 40px;
    padding: 7px 6px !important;
    font-size: 11px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    justify-content: center;
    text-align: center;
  }

  .user-mobile-actions > span {
    display: block;
    overflow-wrap: anywhere;
  }

  .mobile-fab-add {
    display: flex;
  }

  /* Filtros da Planilha */
  .sheet-table-header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .sheet-table-title {
    font-size: 15px;
  }

  .sheet-filters-wrap {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .sheet-filters-wrap .select-input,
  .sheet-filters-wrap .input-text {
    width: 100%;
    font-size: 14px;
    padding: 10px 12px;
    min-height: 42px;
  }

  /* Modais em Estilo Bottom Sheet no Mobile */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
    justify-content: center;
  }

  .modal-window {
    border-radius: 18px 18px 0 0;
    max-width: 100% !important;
    width: 100% !important;
    max-height: 93vh;
    margin: 0;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
    animation: slideUpModal 0.22s ease-out;
  }

  .modal-header {
    padding: 14px 18px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #ffffff;
  }

  .modal-body {
    padding: 16px !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-footer {
    padding: 12px 16px;
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: #f8fafc;
    border-top: 1px solid var(--line);
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer button {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 14px;
  }

  .form-grid-3,
  .form-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Bloqueia auto-zoom do Safari iOS e Chrome Mobile em campos de texto */
  input,
  select,
  textarea,
  .input-text,
  .select-input,
  .textarea-input,
  .input-date,
  .input-time-shift,
  .pmc-input,
  .modal-window input,
  .modal-window select,
  .modal-window textarea {
    font-size: 16px !important;
  }

  .city-pills-grid {
    gap: 6px;
  }

  .city-pill-btn {
    padding: 8px 12px;
    font-size: 12px;
    min-height: 38px;
  }

  /* Modal de PDF no Mobile */
  #modal-pdf-view .modal-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #modal-pdf-view .modal-header > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 6px;
    width: 100%;
  }

  #modal-pdf-view .pdf-sheet-modal-body {
    padding: 8px;
  }

  #modal-pdf-view .pdf-sheet-page {
    padding: 14px 10px;
    font-size: 11px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  #section-view-users .panel-header-bar > div:first-child {
    width: 100%;
    min-width: 0;
  }

  #section-view-users .panel-header-bar > div:first-child > div {
    flex: 1;
    min-width: 0;
  }

  #section-view-users .panel-header-bar h3,
  #section-view-users .panel-header-bar p {
    overflow-wrap: anywhere;
  }

  .system-health-content-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 12px 12px 0 !important;
  }

  /* Gestão de Acessos no Mobile */
  .pending-card {
    padding: 12px;
  }

  .pending-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .pending-actions-bar button {
    width: 100%;
    justify-content: center;
    padding: 11px;
    font-size: 13px;
  }

  /* Barra de Jornada de Trabalho Mobile */
  .work-shift-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 10px;
    gap: 10px;
    margin-bottom: 12px;
  }
  .work-shift-header-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .work-shift-quick-actions {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: 6px;
  }
  .btn-shift-quick {
    flex: 1;
    text-align: center;
    padding: 6px 8px;
    font-size: 11px;
    justify-content: center;
  }
  .btn-shift-clear {
    padding: 6px 10px;
    font-size: 11px;
  }
  .work-shift-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .work-shift-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    min-width: 0;
  }
  .work-shift-field label {
    font-size: 11px;
    font-weight: 800;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }
  .work-shift-field .input-time-shift {
    width: 100%;
    min-width: 0;
    font-size: 16px;
    text-align: center;
    padding: 6px 4px;
    min-height: 42px;
    box-sizing: border-box;
  }
  .work-shift-badge {
    grid-column: span 2;
    justify-content: center;
    padding: 8px 12px;
    min-height: 38px;
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Barra de Configuração Manual do PDF no Mobile */
  .pdf-manual-config-bar {
    padding: 12px;
  }
  .pmc-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  .pmc-group-wide {
    grid-column: span 2;
  }
}

/* ==========================================================================
   REGRAS PARA TELAS ULTRA-PEQUENAS (CELULARES <= 480px)
   ========================================================================== */
@media (max-width: 480px) {
  #login-screen {
    padding: 14px 12px;
  }

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

  .login-logo-img {
    width: 90px;
    margin-bottom: 12px;
  }

  .login-title {
    font-size: 18px;
  }

  .login-subtitle {
    font-size: 12px;
    margin-bottom: 20px;
  }

  .auth-tabs-nav {
    display: flex;
    gap: 4px;
  }

  .auth-tab-btn {
    font-size: 11.5px;
    padding: 9px 6px;
    flex: 1;
  }

  .auth-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .btn-submit {
    min-height: 48px;
    font-size: 14px;
  }

  .status-radio-group {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .mp-buttons-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mp-toggle-btn {
    padding: 12px;
    min-height: 48px;
  }
}

@keyframes slideUpModal {
  from {
    transform: translateY(100%);
    opacity: 0.8;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
   PWA — Botões e Modal de Instalação na Tela Inicial (SISTEMA FDA)
   ========================================================================== */
.btn-pwa-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  background: linear-gradient(135deg, #0c1926 0%, #15304b 100%);
  color: #ffffff;
  border: 1.5px solid #fb8500;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(12, 25, 38, 0.25);
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.btn-pwa-install:hover, .btn-pwa-install:active {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #102133 0%, #1c3e60 100%);
  box-shadow: 0 6px 18px rgba(251, 133, 0, 0.35);
  border-color: #ffb703;
}

.btn-pwa-logo-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.btn-pwa-install-header {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  background: #0f2238;
  color: #ffb703;
  border: 1.5px solid rgba(255, 183, 3, 0.5);
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.btn-pwa-install-header:hover {
  background: #15304b;
  border-color: #ffb703;
  color: #ffffff;
}

.btn-pwa-install-panel,
#btn-pwa-install-panel {
  display: none !important;
}

@media (max-width: 768px) {
  .btn-pwa-install-header {
    width: 100%;
    justify-content: center;
    padding: 9px 14px;
    font-size: 12.5px;
  }
  .btn-pwa-install-panel,
  #btn-pwa-install-panel {
    display: none !important;
  }
}

/* Banner Flutuante de Instalação Mobile */
.pwa-floating-banner {
  position: fixed;
  bottom: 16px;
  left: 14px;
  right: 14px;
  background: #0c1926;
  color: #ffffff;
  border: 1.5px solid #fb8500;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: slideUpModal 0.3s ease;
}

.pwa-floating-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pwa-floating-banner-left img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.pwa-floating-banner-text {
  font-size: 12px;
  line-height: 1.3;
}

.pwa-floating-banner-text strong {
  display: block;
  font-size: 13px;
  color: #ffb703;
}

.pwa-floating-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-pwa-banner-action {
  background: #fb8500;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.btn-pwa-banner-close {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 16px;
  padding: 4px 8px;
  cursor: pointer;
}

/* Estilos de Linha da Coleta (MANHÃ / TARDE) */
.btn-linha-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
  touch-action: manipulation;
  user-select: none;
}

.linha-manha {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #93c5fd !important;
}

.linha-manha:hover, .linha-manha:active {
  background: #dbeafe !important;
  border-color: #3b82f6 !important;
  transform: scale(1.02);
}

.linha-tarde {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #fde68a !important;
}

.linha-tarde:hover, .linha-tarde:active {
  background: #fde68a !important;
  border-color: #f59e0b !important;
  transform: scale(1.02);
}

/* ==========================================================================
   REDIMENSIONAMENTO E ANTI-ZOOM DO BALÃO DE NOVA COLETA (MODAL DE COLETAS)
   ========================================================================== */
#modal-pickup-form.modal-overlay {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: rgba(12, 25, 38, 0.75) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  padding: 12px 10px !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  z-index: 2500 !important;
  align-items: center !important;
  justify-content: center !important;
  touch-action: pan-y !important;
}

#modal-pickup-form.modal-overlay.active {
  display: flex !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Janela do Balão de Nova Coleta */
#modal-pickup-form .modal-window,
#modal-pickup-form .modal-window-pickup {
  width: 100% !important;
  max-width: 580px !important;
  min-width: 0 !important;
  margin: auto !important;
  background: #ffffff !important;
  border-radius: 16px !important;
  max-height: calc(100dvh - 20px) !important;
  max-height: calc(100vh - 20px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(21, 48, 75, 0.15) !important;
  box-sizing: border-box !important;
  animation: modalBaloonPop 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  transform-origin: center center !important;
}

@keyframes modalBaloonPop {
  0% { opacity: 0; transform: scale(0.96) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Cabeçalho do Balão */
#modal-pickup-form .modal-header {
  padding: 14px 18px !important;
  background: #0f2238 !important;
  color: #ffffff !important;
  border-bottom: 2.5px solid #fb8500 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-shrink: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#modal-pickup-form .modal-header h4 {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  margin: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#modal-pickup-form .btn-close-modal {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border: none !important;
  display: grid !important;
  place-items: center !important;
  font-size: 16px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  touch-action: manipulation !important;
  flex-shrink: 0 !important;
}

#modal-pickup-form .btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  transform: scale(1.05) !important;
}

/* Corpo do Balão com Rolagem Interna Segura */
#modal-pickup-form .modal-body {
  padding: 14px 14px 16px 14px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  flex: 1 1 auto !important;
  -webkit-overflow-scrolling: touch !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* ANTI-ZOOM: Font-size 16px em todos os campos para impedir que o celular dê zoom */
#modal-pickup-form input,
#modal-pickup-form select,
#modal-pickup-form textarea,
#modal-pickup-form .input-pickup-field,
#modal-pickup-form .input-text,
#modal-pickup-form .select-input {
  font-size: 16px !important;
  min-height: 44px !important;
  line-height: 1.3 !important;
  padding: 10px 12px !important;
  border-radius: 8px !important;
  border: 1.5px solid #cbd5e1 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  touch-action: manipulation !important;
  -webkit-text-size-adjust: 100% !important;
}

#modal-pickup-form input:focus,
#modal-pickup-form select:focus,
#modal-pickup-form textarea:focus {
  border-color: #fb8500 !important;
  box-shadow: 0 0 0 3px rgba(251, 133, 0, 0.18) !important;
  outline: none !important;
}

/* Grupos e Campos do Formulário */
#modal-pickup-form .form-group,
#modal-pickup-form .form-row {
  margin-bottom: 12px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

#modal-pickup-form label {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  margin-bottom: 5px !important;
  display: block !important;
  color: var(--ink) !important;
}

/* Caixas de Destaque Internas (Linha e Destino) */
#modal-pickup-form .box-pickup-highlight {
  background: rgba(21, 48, 75, 0.04) !important;
  padding: 11px 12px !important;
  border-radius: 10px !important;
  border: 1.5px solid #cbd5e1 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#modal-pickup-form .box-pickup-destino {
  background: rgba(251, 133, 0, 0.05) !important;
  border: 1.5px solid rgba(251, 133, 0, 0.25) !important;
}

/* Seletores de Linha (MANHÃ / TARDE) e Status (PEGO / ENTREGUE) */
#modal-pickup-form .status-radio-group {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 6px !important;
}

#modal-pickup-form .status-radio-box {
  min-width: 0 !important;
  padding: 10px 6px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  border-radius: 8px !important;
  border: 2px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #64748b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  text-align: center !important;
  box-sizing: border-box !important;
  white-space: normal !important;
  word-break: break-word !important;
  line-height: 1.25 !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.15s ease !important;
}

/* Pílulas de Cidades com 1 Clique */
#modal-pickup-form .city-pills-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  margin-top: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#modal-pickup-form .city-pill-btn {
  padding: 8px 13px !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  border-radius: 18px !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  border: 1.5px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #1e293b !important;
  transition: all 0.15s ease !important;
}

#modal-pickup-form .city-pill-btn:hover {
  background: #ffedd5 !important;
  border-color: #ea580c !important;
  color: #ea580c !important;
}

#modal-pickup-form .city-pill-btn.selected {
  background: #ea580c !important;
  color: #ffffff !important;
  border-color: #c2410c !important;
  font-weight: 900 !important;
  box-shadow: 0 3px 8px rgba(234, 88, 12, 0.35) !important;
}

/* Grid de Motorista / Veículo */
#modal-pickup-form .form-grid-2 {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Rodapé do Balão com Botões de Ação */
#modal-pickup-form .modal-footer {
  padding: 12px 14px !important;
  margin-top: 14px !important;
  border-top: 1px solid var(--line) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  background: #ffffff !important;
  position: sticky !important;
  bottom: 0 !important;
  z-index: 10 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#modal-pickup-form .modal-footer button {
  min-height: 44px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  border-radius: 9px !important;
  padding: 10px 18px !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
}

#modal-pickup-form .btn-modal-cancel {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

#modal-pickup-form .btn-modal-submit {
  flex: 1 !important;
  background: #059669 !important;
  border: 1px solid #047857 !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}

#modal-pickup-form .btn-modal-submit:hover {
  background: #047857 !important;
}

/* Ajustes para Celulares Pequenos (Mobile <= 480px) */
@media (max-width: 480px) {
  #modal-pickup-form.modal-overlay {
    padding: 8px 6px !important;
  }

  #modal-pickup-form .modal-window,
  #modal-pickup-form .modal-window-pickup {
    max-height: calc(100dvh - 16px) !important;
    max-height: calc(100vh - 16px) !important;
    border-radius: 14px !important;
  }

  #modal-pickup-form .modal-body {
    padding: 12px 10px 14px 10px !important;
  }

  #modal-pickup-form .form-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  #modal-pickup-form .modal-footer {
    flex-direction: column-reverse !important;
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  #modal-pickup-form .modal-footer button {
    width: 100% !important;
  }
}

/* ==========================================================================
   CARDS DAS PLANILHAS SALVAS (DONOS E ADMINISTRADORES)
   ========================================================================== */
.saved-sheets-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.saved-sheet-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(15, 34, 56, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.saved-sheet-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(15, 34, 56, 0.12);
  border-color: #0284c7;
}

.saved-sheet-card:active {
  transform: scale(0.98);
}

.saved-sheet-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 8px;
}

.saved-sheet-card-date-badge {
  display: flex;
  flex-direction: column;
}

.saved-sheet-card-date {
  font-size: 16px;
  font-weight: 900;
  color: #0f2238;
  display: flex;
  align-items: center;
  gap: 6px;
}

.saved-sheet-card-weekday {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  margin-top: 1px;
}

.saved-sheet-card-time {
  font-size: 11px;
  font-weight: 800;
  background: #f1f5f9;
  color: #334155;
  padding: 4px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.saved-sheet-card-user {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.saved-sheet-card-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
}

.saved-sheet-card-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.saved-sheet-card-user-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
}

.saved-sheet-card-user-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f2238;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-sheet-card-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.saved-sheet-metric-box {
  background: #f8fafc;
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  border: 1px solid #eef2f6;
}

.saved-sheet-metric-val {
  font-size: 15px;
  font-weight: 900;
  color: #0f2238;
  line-height: 1.2;
}

.saved-sheet-metric-lbl {
  font-size: 9.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 2px;
}

.saved-sheet-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.saved-sheet-card-btn-open {
  background: #0f2238;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
  transition: background 0.15s ease;
}

.saved-sheet-card:hover .saved-sheet-card-btn-open {
  background: #0284c7;
}

/* Campo Adicional de Nota Fiscal Inline */
.input-nf-inline {
  font-size: 13px;
  padding: 6px 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  width: 100%;
  min-width: 110px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background: #ffffff;
}

.input-nf-inline:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
  outline: none;
}

.btn-save-nf-inline {
  background: #059669;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.btn-save-nf-inline:hover {
  background: #047857;
}

.btn-save-nf-inline:active {
  transform: scale(0.96);
}

@media (max-width: 768px) {
  .saved-sheets-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .input-nf-inline {
    font-size: 16px !important; /* Anti-zoom em telas mobile */
  }
}

/* ==========================================================================
   FRETES & BOLETOS A RECEBER — CARDS DE RESUMO (KPIs)
   ========================================================================== */
.receivables-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.receivable-kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 16px;
  padding: 20px 22px;
  min-height: 124px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.receivable-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.receivable-kpi-card:active {
  transform: translateY(-1px);
}

/* Temas dos 4 Cards */
.receivable-kpi-card.card-dinheiro {
  background: #ffffff;
  border: 1.5px solid #bbf7d0;
}
.receivable-kpi-card.card-dinheiro .kpi-card-title {
  color: #166534;
}
.receivable-kpi-card.card-dinheiro .kpi-card-badge {
  background: #dcfce7;
  color: #15803d;
}
.receivable-kpi-card.card-dinheiro .kpi-card-value {
  color: #15803d;
}
.receivable-kpi-card.card-dinheiro.is-active-tab {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25), 0 8px 20px rgba(0, 0, 0, 0.06);
}

.receivable-kpi-card.card-boletos {
  background: #ffffff;
  border: 1.5px solid #e9d5ff;
}
.receivable-kpi-card.card-boletos .kpi-card-title {
  color: #6d28d9;
}
.receivable-kpi-card.card-boletos .kpi-card-badge {
  background: #f3e8ff;
  color: #7c3aed;
}
.receivable-kpi-card.card-boletos .kpi-card-value {
  color: #7c3aed;
}
.receivable-kpi-card.card-boletos.is-active-tab {
  border-color: #9333ea;
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.25), 0 8px 20px rgba(0, 0, 0, 0.06);
}

.receivable-kpi-card.card-ctes {
  background: #ffffff;
  border: 1.5px solid #bfdbfe;
}
.receivable-kpi-card.card-ctes .kpi-card-title {
  color: #1d4ed8;
}
.receivable-kpi-card.card-ctes .kpi-card-badge {
  background: #dbeafe;
  color: #1d4ed8;
}
.receivable-kpi-card.card-ctes .kpi-card-value {
  color: #1d4ed8;
}
.receivable-kpi-card.card-ctes.is-active-tab {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25), 0 8px 20px rgba(0, 0, 0, 0.06);
}

.receivable-kpi-card.card-total {
  background: linear-gradient(135deg, #0f2238 0%, #1e3a5f 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 34, 56, 0.22);
}
.receivable-kpi-card.card-total .kpi-card-title {
  color: #93c5fd;
}
.receivable-kpi-card.card-total .kpi-card-badge {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.receivable-kpi-card.card-total .kpi-card-value {
  color: #facc15;
}
.receivable-kpi-card.card-total .kpi-card-desc {
  color: #cbd5e1;
}
.receivable-kpi-card.card-total.is-active-tab {
  border-color: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.35), 0 8px 24px rgba(15, 34, 56, 0.32);
}

/* Elementos internos dos cards */
.kpi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.kpi-card-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.kpi-card-badge {
  font-size: 11.5px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}
.kpi-card-body {
  display: flex;
  flex-direction: column;
}
.kpi-card-value {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.kpi-card-desc {
  color: #64748b;
  font-size: 11.5px;
  margin-top: 6px;
  display: block;
}

/* Responsividade Adaptativa dos Cards */
@media (max-width: 1024px) {
  .receivables-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 20px;
  }
  .receivable-kpi-card {
    padding: 16px 18px;
    min-height: 116px;
  }
  .kpi-card-value {
    font-size: 23px;
  }
}

@media (max-width: 640px) {
  .receivables-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }
  .receivable-kpi-card {
    padding: 12px 14px;
    border-radius: 12px;
    min-height: 102px;
  }
  .kpi-card-header {
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 4px;
  }
  .kpi-card-title {
    font-size: 11px;
    letter-spacing: 0.2px;
  }
  .kpi-card-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
  }
  .kpi-card-value {
    font-size: 19px;
  }
  .kpi-card-desc {
    font-size: 10.5px;
    margin-top: 3px;
  }
}

@media (max-width: 380px) {
  .receivables-summary-grid {
    gap: 8px;
  }
  .receivable-kpi-card {
    padding: 10px;
  }
  .kpi-card-title {
    font-size: 10px;
  }
  .kpi-card-value {
    font-size: 17px;
  }
}

.receivables-main-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 22px;
  align-items: start;
}

#receivable-col-dinheiro,
#receivable-col-boletos,
#receivable-col-ctes {
  border-radius: 16px;
  border: 1.5px solid var(--line);
  box-shadow: 0 4px 16px rgba(15, 34, 56, 0.04);
  background: #ffffff;
  overflow: hidden;
}

#receivable-col-dinheiro .sheet-table-header,
#receivable-col-boletos .sheet-table-header,
#receivable-col-ctes .sheet-table-header {
  padding: 16px 20px;
}

.receivable-item-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.receivable-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 34, 56, 0.08);
}

/* Card Individual Modernizado de CT-e a Receber */
.cte-item-card {
  position: relative;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1.5px solid #dbeafe;
  border-left: 5px solid #2563eb;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.05);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease;
}

.cte-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.12);
  border-color: #93c5fd;
}

.cte-item-card.is-recebido {
  border-left-color: #10b981;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
  border-color: #bbf7d0;
}

.cte-item-card.is-vencido {
  border-left-color: #ef4444;
  border-color: #fecaca;
  background: linear-gradient(180deg, #ffffff 0%, #fef2f2 100%);
}

.cte-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cte-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cte-badge-number {
  font-size: 12px;
  font-weight: 900;
  color: #1d4ed8;
  background: #dbeafe;
  padding: 4px 10px;
  border-radius: 12px;
  font-family: var(--mono);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cte-badge-idx {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 7px;
  border-radius: 8px;
}

.cte-card-tomador-section {
  margin-bottom: 12px;
}

.cte-card-label {
  font-size: 10.5px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}

.cte-card-tomador-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f2238;
  line-height: 1.3;
  word-break: break-word;
}

.cte-card-grid-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  margin-bottom: 12px;
}

.cte-info-block {
  display: flex;
  flex-direction: column;
}

.cte-info-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.cte-venc-badge {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}

.cte-venc-badge.normal {
  background: #eff6ff;
  color: #1e40af;
}

.cte-venc-badge.hoje {
  background: #fef3c7;
  color: #b45309;
}

.cte-venc-badge.vencido {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 900;
}

.cte-card-obs {
  font-size: 11.5px;
  color: #475569;
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cte-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1.5px dashed #cbd5e1;
  padding-top: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.cte-card-valor-wrap {
  display: flex;
  flex-direction: column;
}

.cte-card-valor-label {
  font-size: 10.5px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cte-card-valor-amount {
  font-size: 20px;
  font-weight: 900;
  font-family: var(--mono);
  line-height: 1.15;
}

.cte-card-valor-amount.recebido {
  color: #15803d;
}

.cte-card-valor-amount.pendente {
  color: #1d4ed8;
}

.cte-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

@media (max-width: 1200px) {
  .receivables-main-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.receivables-subtabs-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}

.receivables-subtab-btn {
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13.5px;
  font-weight: 800;
  border: 1.5px solid var(--line);
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.receivables-subtab-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.receivables-subtab-btn.active {
  background: #0f2238;
  color: #ffffff;
  border-color: #0f2238;
  box-shadow: 0 2px 8px rgba(15, 34, 56, 0.25);
}

.status-badge-recebido {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-badge-pendente {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* ==========================================================================
   PAINEL DE DIAGNÓSTICO DE SERVIÇOS, INFRAESTRUTURA & CONECTIVIDADE
   (Estilo Command Center / Dark Cyber Dashboard com Pings Contínuos)
   ========================================================================== */
.sys-diag-wrapper {
  background: #080f17;
  border: 1.5px solid #152538;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color: #f1f5f9;
}

.sys-diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #162a3f;
}

.sys-diag-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sys-diag-title {
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sys-diag-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sys-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: sysDiagPulse 1.8s infinite ease-in-out;
}

@keyframes sysDiagPulse {
  0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 4px #10b981; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #34d399; }
  100% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 4px #10b981; }
}

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

@media (max-width: 1150px) {
  .sys-diag-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .sys-diag-grid {
    grid-template-columns: 1fr;
  }
  .sys-diag-wrapper {
    padding: 16px;
  }
}

.sys-diag-card {
  background: #0d1723;
  border: 1px solid #1a2c3f;
  border-radius: 12px;
  padding: 16px 18px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.sys-diag-card:hover {
  transform: translateY(-2px);
  border-color: #25405c;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.sys-diag-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #152538;
}

.sys-diag-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: #f8fafc;
}

.sys-diag-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sys-diag-status-pill.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

.sys-diag-card-body {
  display: grid;
  gap: 8px;
}

.sys-diag-card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
  gap: 8px;
}

.sys-diag-card-key {
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
}

.sys-diag-card-val {
  color: #f1f5f9;
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

.sys-diag-card-val.green {
  color: #34d399;
}

.sys-diag-card-val.cyan {
  color: #38bdf8;
}

.sys-diag-card-val.amber {
  color: #fbbf24;
}

/* Console de Diagnóstico Contínuo */
.sys-diag-console-box {
  margin-top: 20px;
  background: #03070c;
  border: 1.5px solid #142838;
  border-radius: 12px;
  padding: 16px 18px;
  font-family: 'Consolas', 'Courier New', monospace;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.7);
}

.sys-diag-console-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #142838;
}

.sys-diag-console-tag {
  font-size: 12.5px;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sys-diag-console-count {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 600;
}

.sys-diag-console-feed {
  max-height: 175px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 5px;
  padding-right: 4px;
}

.sys-diag-log-line {
  font-size: 12px;
  line-height: 1.5;
  color: #22c55e;
  text-shadow: 0 0 4px rgba(34, 197, 94, 0.25);
  word-break: break-all;
}

.sys-diag-log-line .log-time {
  color: #64748b;
  font-weight: 700;
}

.sys-diag-log-line .log-accent {
  color: #38bdf8;
}

.sys-diag-log-line .log-lat {
  color: #fbbf24;
}




