:root {
  --red: #bc9657;
  --red-dark: #9a773e;
  --red-soft: rgba(188, 150, 87, 0.14);
  --yellow: #ceaf78;
  --yellow-soft: rgba(206, 175, 120, 0.2);
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, 0.1);
  --green: #0d9488;
  --green-soft: rgba(13, 148, 136, 0.12);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.12);
  --ink: #18191a;
  --ink-soft: #242628;
  --off: #e5e5e5;
  --paper: #f6f5f2;
  --white: #ffffff;
  --muted: #686868;
  --line: rgba(24, 25, 26, 0.11);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(7, 7, 7, 0.08);
  --shadow-sm: 0 6px 20px rgba(7, 7, 7, 0.06);
  --shadow-red: 0 10px 28px rgba(188, 150, 87, 0.28);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body {
  font-family: "League Spartan", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.35;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

/* ==========================================
   TOP BAR GOTIVO VISITAS
   ========================================== */
.radio-topbar {
  background: var(--ink);
  color: var(--white);
  font-size: 13px;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--red);
}

.radio-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(255, 196, 0, 0.25);
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.75; }
}

.radio-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.sync-pill.online {
  color: #4ade80;
}

/* ==========================================
   TELA DE LOGIN (AUTENTICAÇÃO)
   ========================================== */
.login-screen {
  min-height: calc(100vh - 35px);
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  background: var(--red);
  position: relative;
  overflow: hidden;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.14), transparent 28%),
    linear-gradient(120deg, transparent 55%, rgba(0, 0, 0, 0.09) 55% 57%, transparent 57%);
  pointer-events: none;
}

.login-hero {
  position: relative;
  z-index: 1;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--white);
}

.login-brand-logo {
  width: 240px;
  margin-bottom: 28px;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.2));
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 8px 14px;
  border-radius: 999px;
  width: fit-content;
  margin-bottom: 20px;
}

.login-hero h1 {
  font-size: clamp(32px, 4.2vw, 52px);
  font-weight: 900;
  line-height: 1.04;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}

.login-hero p {
  font-size: 18px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  max-width: 540px;
  margin-bottom: 28px;
}

.login-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 560px;
}

.login-feature-card {
  background: rgba(7, 7, 7, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  backdrop-filter: blur(8px);
}

.login-feature-card strong {
  display: block;
  font-size: 15px;
  color: var(--yellow);
  margin-bottom: 4px;
}

.login-feature-card span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
}

.login-panel-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.login-card {
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.login-card-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-card-header img {
  height: 52px;
  margin: 0 auto 12px;
  object-fit: contain;
}

.login-card-header h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.login-card-header p {
  font-size: 14px;
  color: var(--muted);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  color: var(--ink);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(225, 6, 44, 0.14);
  outline: none;
}

.form-textarea {
  min-height: 88px;
  resize: vertical;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
  font-weight: 800;
  font-size: 15px;
  padding: 14px 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-red);
  transition: transform 0.15s, background 0.2s;
}

.btn-primary:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--white);
  color: var(--ink);
  border: 1.5px solid var(--line);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
  border-color: var(--ink);
  background: #eceae4;
}

.btn-dark {
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-dark:hover {
  background: #222;
}

.btn-full {
  width: 100%;
}

.quick-login-box {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.quick-login-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
  text-align: center;
}

.quick-login-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.quick-chip {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.quick-chip:hover {
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-1px);
}

.quick-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ==========================================
   ESTRUTURA DO SISTEMA LOGADO
   ========================================== */
.app-shell {
  display: grid;
  grid-template-columns: 265px 1fr;
  min-height: calc(100vh - 35px);
}

.sidebar {
  background: var(--ink);
  color: var(--white);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: calc(100vh - 35px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  padding: 4px 8px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 18px;
}

.sidebar-brand img {
  height: 46px;
  object-fit: contain;
  margin-bottom: 8px;
}

.sidebar-brand-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-user {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 15px;
  flex-shrink: 0;
}

.user-meta {
  min-width: 0;
  flex: 1;
}

.user-meta strong {
  display: block;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--yellow);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-btn {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s;
}

.nav-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.nav-btn.active {
  background: var(--red);
  color: var(--white);
  box-shadow: var(--shadow-red);
}

.nav-counter {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.nav-counter.alert {
  background: var(--yellow);
  color: var(--ink);
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================
   ÁREA PRINCIPAL E CONSULTA RÁPIDA NO TOPO
   ========================================== */
.main-area {
  padding: 24px 28px 110px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.top-action-bar {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.quick-lookup-wrap {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.quick-lookup-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  margin-bottom: 6px;
}

.quick-lookup-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.quick-lookup-input {
  width: 100%;
  background: var(--paper);
  border: 2px solid rgba(225, 6, 44, 0.25);
  border-radius: 999px;
  padding: 13px 44px 13px 18px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
}

.quick-lookup-input:focus {
  background: var(--white);
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(225, 6, 44, 0.12);
  outline: none;
}

.quick-lookup-clear {
  position: absolute;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(7, 7, 7, 0.08);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
}

.top-cta-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* RESULTADO INSTANTÂNEO DE CONSULTA RÁPIDA ("CONSULTA NA PORTA DO CLIENTE") */
.instant-lookup-drawer {
  margin-top: 12px;
  background: #fffdf7;
  border: 2px solid var(--yellow);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.instant-lookup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.instant-match-list {
  display: grid;
  gap: 10px;
}

.instant-match-item.is-free-match {
  background: #f0fdf4;
  border-color: #86efac;
}

.instant-match-item.is-free-match .free-match-title {
  color: #166534;
  font-size: 15px;
}

.instant-match-item.is-free-match .free-match-sub {
  font-size: 13px;
  color: #15803d;
}

.instant-match-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================
   CARDS DE INDICADORES (KPIs)
   ========================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card.highlight-red {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.kpi-card-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.78;
  margin-bottom: 8px;
}

.kpi-card-value {
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 6px;
}

.kpi-card-sub {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
}

/* ==========================================
   FILTROS E BARRA DE FERRAMENTAS DE CLIENTES
   ========================================== */
.filter-bar {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  border: 1px solid var(--line);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid transparent;
  transition: all 0.15s;
}

.filter-pill:hover {
  border-color: var(--ink);
}

.filter-pill.active {
  background: var(--ink);
  color: var(--white);
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.view-mode-switch {
  display: inline-flex;
  background: var(--paper);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.view-mode-btn {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.view-mode-btn.active {
  background: var(--red);
  color: var(--white);
}

/* ==========================================
   CARDS DE CLIENTES E AVISO VISUAL DE CARTEIRA
   ========================================== */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.client-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.client-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.client-card.other-seller-active {
  border-left: 6px solid var(--yellow);
}

.client-card.my-client-active {
  border-left: 6px solid var(--red);
}

.client-card.free-client {
  border-left: 6px solid var(--green);
}

.client-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.client-category-tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 4px;
}

.client-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 4px;
}

.client-subtitle {
  font-size: 13px;
  color: var(--muted);
}

/* BADGES DE STATUS */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-livre {
  background: var(--green-soft);
  color: #0f766e;
}

.status-visitado {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-negociacao {
  background: var(--yellow-soft);
  color: #92400e;
}

.status-proposta {
  background: var(--purple-soft);
  color: var(--purple);
}

.status-fechado {
  background: var(--red-soft);
  color: var(--red);
}

.status-pausado {
  background: #e5e7eb;
  color: #4b5563;
}

/* BANNER DE AVISO DE QUEM ESTÁ ATENDENDO */
.owner-banner {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.owner-banner.is-other {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
}

.owner-banner.is-mine {
  background: rgba(225, 6, 44, 0.06);
  border: 1px solid rgba(225, 6, 44, 0.2);
  color: var(--ink);
}

.owner-banner.is-free {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.owner-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seller-mini-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--white);
  font-weight: 800;
  font-size: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.client-info-list {
  display: grid;
  gap: 6px;
  font-size: 13.5px;
  color: #262626;
}

.client-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-notes-preview {
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: #333;
  border-left: 3px solid var(--ink);
}

.client-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.btn-sm {
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-whatsapp {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.btn-whatsapp:hover {
  background: #d1fae5;
}

.btn-gps-link {
  background: var(--blue-soft);
  color: var(--blue);
}

/* ==========================================
   QUADRO KANBAN (FUNIL DE VENDAS DA RÁDIO)
   ========================================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(250px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.kanban-col {
  background: #ebe9e2;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 440px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(7, 7, 7, 0.1);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kanban-item {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.15s;
}

.kanban-item:hover {
  transform: translateY(-2px);
}

/* ==========================================
   TABELA DE CLIENTES / HISTÓRICO
   ========================================== */
.table-wrap {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  background: var(--ink);
  color: var(--white);
  text-align: left;
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #faf9f6;
}

/* ==========================================
   LINHA DO TEMPO DE VISITAS E GPS
   ========================================== */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.gps-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
}

.gps-pill:hover {
  text-decoration: underline;
}

/* ==========================================
   MODAIS (CADASTRO, CHECK-IN GPS, AVISO VISUAL)
   ========================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 7, 0.68);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--paper);
  width: 100%;
  max-width: 660px;
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  background: var(--ink);
  color: var(--white);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--red);
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 800;
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  background: var(--white);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* CAIXA DE ALERTA DE CONFLITO DE CARTEIRA (AVISO VISUAL) */
.conflict-warning-alert {
  background: #fffbeb;
  border: 2px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
  color: #78350f;
}

.conflict-warning-alert strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #b45309;
  margin-bottom: 6px;
}

.conflict-warning-alert p {
  font-size: 13.5px;
  line-height: 1.4;
}

/* CAIXA DE CHECK-IN GPS NO MODAL */
.gps-checkin-card {
  background: var(--white);
  border: 1.5px dashed var(--blue);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================
   NAVEGAÇÃO MOBILE FIXA (BARRA INFERIOR)
   ========================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ink);
  color: var(--white);
  border-top: 2px solid var(--red);
  z-index: 120;
  padding: 6px 8px env(safe-area-inset-bottom, 8px);
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-item {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 10px;
}

.mobile-nav-item.active {
  color: var(--yellow);
}

.mobile-nav-fab {
  background: var(--red);
  color: var(--white);
  font-weight: 900;
  font-size: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-red);
  transform: translateY(-10px);
  border: 2px solid var(--white);
}

/* TOAST DE NOTIFICAÇÃO */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--ink);
  color: var(--white);
  border-left: 5px solid var(--red);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 700;
  max-width: 360px;
}

.topbar-title-mobile {
  display: none;
}

.topbar-logout-mobile {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
}

/* ==========================================
   RESPONSIVIDADE E OTIMIZAÇÃO LEVE PARA CELULAR
   ========================================== */
@media (max-width: 1024px) {
  .login-screen {
    grid-template-columns: 1fr;
  }
  .login-hero {
    padding: 28px 20px 8px;
    text-align: center;
    align-items: center;
  }
  .login-features {
    display: none;
  }
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100vw;
    overflow-x: hidden;
  }
  .sidebar {
    display: none;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .main-area {
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 14px 14px 96px;
  }
}

@media (max-width: 768px) {
  /* Barra do topo enxuta e limpa no celular */
  .radio-topbar {
    padding: 8px 12px;
    font-size: 11.5px;
  }
  .topbar-title-full {
    display: none;
  }
  .topbar-title-mobile {
    display: inline;
    font-weight: 800;
    letter-spacing: 0.04em;
  }
  .hide-mobile,
  .hide-mobile-btn {
    display: none !important;
  }

  /* Tela de login limpa e espaçosa no celular (sem texto longo empurrando) */
  .login-hero {
    display: none;
  }
  .login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 14px;
  }
  .login-panel-wrap {
    padding: 0;
    width: 100%;
  }
  .login-card {
    padding: 26px 20px;
    border-radius: 22px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  }
  .login-card-header {
    margin-bottom: 18px;
  }
  .login-card-header img {
    height: 44px;
    margin-bottom: 8px;
  }
  .login-card-header h2 {
    font-size: 21px;
  }

  /* Evita auto-zoom do iOS/Android ao tocar em campos */
  .form-input,
  .form-select,
  .form-textarea,
  .quick-lookup-input {
    font-size: 16px !important;
    padding: 11px 13px;
  }

  /* Área principal com mais respiro no celular */
  .main-area {
    padding: 12px 12px 92px;
  }

  /* Barra de busca rápida super enxuta no topo */
  .top-action-bar {
    padding: 12px;
    border-radius: 16px;
    margin-bottom: 12px;
    gap: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
  }
  .quick-lookup-wrap {
    min-width: 100%;
  }
  .quick-lookup-label {
    font-size: 11px;
    margin-bottom: 5px;
  }
  .quick-lookup-input {
    padding: 10px 38px 10px 14px !important;
  }
  .top-cta-group {
    width: 100%;
  }
  #btnTopNewClient {
    width: 100%;
    padding: 10px 14px;
    font-size: 13.5px;
  }

  /* KPIs em faixa horizontal deslizante (ocupa 1/3 do espaço vertical!) */
  .kpi-grid {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .kpi-grid::-webkit-scrollbar {
    display: none;
  }
  .kpi-card {
    flex: 0 0 165px;
    padding: 12px 14px;
    border-radius: 14px;
    scroll-snap-align: start;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
  }
  .kpi-card-label {
    font-size: 10.5px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .kpi-card-value {
    font-size: 22px;
    margin-bottom: 3px;
  }
  .kpi-card-sub {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Barra de filtros em 1 linha deslizante + seletores lado a lado */
  .filter-bar {
    padding: 10px 12px;
    border-radius: 14px;
    margin-bottom: 12px;
    gap: 8px;
  }
  .filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    gap: 6px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .filter-pills::-webkit-scrollbar {
    display: none;
  }
  .filter-pill {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 7px 12px;
    font-size: 12px;
  }
  .filter-controls {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    width: 100%;
    gap: 6px;
  }
  .filter-controls .form-select {
    width: 100% !important;
    min-width: 0;
    padding: 7px 8px !important;
    font-size: 12px !important;
  }
  .view-mode-btn[data-display-mode="table"] {
    display: none;
  }
  .view-mode-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Cards de clientes mais leves, limpos e com respiro entre eles */
  .clients-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .client-card {
    padding: 14px 15px;
    gap: 10px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  }
  .client-title {
    font-size: 17.5px;
  }
  .status-badge {
    padding: 4px 9px;
    font-size: 10.5px;
  }
  .owner-banner {
    padding: 8px 10px;
    font-size: 12px;
  }
  .client-info-list {
    font-size: 12.5px;
    gap: 4px;
  }
  .client-notes-preview {
    padding: 8px 10px;
    font-size: 12.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .client-card-actions {
    gap: 6px;
    padding-top: 8px;
  }
  .client-card-actions .btn-sm {
    padding: 8px 11px;
    font-size: 12px;
    flex: 1 1 auto;
    justify-content: center;
  }

  /* Modais estilo Bottom-Sheet nativo de celular */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .modal-box {
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
  }
  .modal-header {
    padding: 14px 16px;
  }
  .modal-header h3 {
    font-size: 17px;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-footer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 4px));
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .form-group {
    margin-bottom: 12px;
  }

  /* Barra inferior mais leve e ergonômica */
  .mobile-bottom-nav {
    padding: 4px 6px calc(6px + env(safe-area-inset-bottom, 4px));
  }
  .mobile-nav-item {
    font-size: 10.5px;
    padding: 4px 8px;
  }
  .mobile-nav-fab {
    padding: 9px 14px;
    font-size: 11.5px;
    transform: translateY(-8px);
  }
}
