/* ==========================================================================
   CajáDelivery v2 - Design System & Modern Stylesheet
   Modern dispatch & logistics dashboard (Central + Rider App + TV Monitor)
   ========================================================================== */

:root {
  color-scheme: light;

  /* Brand Colors */
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-gradient: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  --primary-glow: rgba(234, 88, 12, 0.22);
  --primary-subtle: #ffedd5;
  --primary-text: #9a3412;

  /* Light Theme Neutrals (Central Operacional) */
  --bg-app: #f8fafc;
  --panel: #ffffff;
  --panel-hover: #f1f5f9;
  --panel-muted: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  /* Typography Colors */
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --text-subtle: #94a3b8;

  /* Sidebar Theme (Slate 900) */
  --sidebar-bg: #0f172a;
  --sidebar-border: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-item-hover: rgba(255, 255, 255, 0.07);
  --sidebar-item-active: #1e293b;
  --sidebar-width: 260px;

  /* Status Tokens */
  --green: #16a34a;
  --green-bg: #dcfce7;
  --green-border: #bbf7d0;
  --green-text: #166534;

  --yellow: #ca8a04;
  --yellow-bg: #fef9c3;
  --yellow-border: #fef08a;
  --yellow-text: #854d0e;

  --orange: #ea580c;
  --orange-bg: #ffedd5;
  --orange-border: #fed7aa;
  --orange-text: #9a3412;

  --red: #dc2626;
  --red-bg: #fee2e2;
  --red-border: #fecaca;
  --red-text: #991b1b;

  --blue: #2563eb;
  --blue-bg: #dbeafe;
  --blue-border: #bfdbfe;
  --blue-text: #1e40af;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.09), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */

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

html, body {
  min-height: 100vh;
  background: var(--bg-app);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: transparent;
  cursor: pointer;
  user-select: none;
}

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

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 0.16s ease;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--panel-hover);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.32);
}

.btn-green {
  background: #16a34a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.22);
}

.btn-green:hover:not(:disabled) {
  background: #15803d;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.3);
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
}

.btn-ghost {
  min-height: 36px;
  padding: 0 12px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  box-shadow: none;
  font-size: 13px;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--panel-hover);
  border-color: var(--line);
  color: var(--text);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: inline-grid;
  place-items: center;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--line);
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--panel-hover);
  color: var(--text);
  border-color: var(--line-strong);
}

.action-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Form Fields & Controls
   ========================================================================== */

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.label {
  display: block;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.field input,
.field textarea,
.field select,
.toolbar input {
  width: 100%;
  min-height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.toolbar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.field input::placeholder,
.field textarea::placeholder,
.toolbar input::placeholder {
  color: var(--text-subtle);
}

.field textarea {
  padding: 10px 14px;
  min-height: 72px;
  resize: vertical;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field i,
.search-field svg {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.search-field input {
  padding-left: 40px !important;
}

.form-error {
  margin-bottom: 16px;
  border: 1px solid var(--red-border);
  border-radius: var(--radius-sm);
  background: var(--red-bg);
  color: var(--red-text);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
}

/* ==========================================================================
   Status Pills & Badges
   ========================================================================== */

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill.green,
.status-pill.accepted,
.status-pill.finished,
.status-pill.available,
.status-pill.confirmed {
  background: var(--green-bg);
  color: var(--green-text);
  border-color: var(--green-border);
}

.status-pill.yellow,
.status-pill.route,
.status-pill.called,
.status-pill.pending {
  background: var(--yellow-bg);
  color: var(--yellow-text);
  border-color: var(--yellow-border);
}

.status-pill.orange,
.status-pill.pending_payment,
.status-pill.expired {
  background: var(--orange-bg);
  color: var(--orange-text);
  border-color: var(--orange-border);
}

.status-pill.red,
.status-pill.refused,
.status-pill.unavailable {
  background: var(--red-bg);
  color: var(--red-text);
  border-color: var(--red-border);
}

/* ==========================================================================
   Login & Server Setup Screens
   ========================================================================== */

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(440px, 1.15fr);
  background: #ffffff;
}

.login-brand {
  min-height: 100vh;
  padding: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(249, 115, 22, 0.15), transparent 65%),
    linear-gradient(145deg, #090d16 0%, #0f172a 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  border-right: 1px solid #1e293b;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 90%, rgba(234, 88, 12, 0.08), transparent 45%);
  pointer-events: none;
}

.login-brand img {
  width: min(340px, 78%);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.6);
  padding: 12px;
}

.login-brand h1 {
  margin-top: 28px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.login-brand p {
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 500;
  color: #cbd5e1;
}

.login-panel {
  align-self: center;
  justify-self: center;
  width: min(440px, calc(100% - 48px));
  padding: 44px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.login-panel .brand-mark {
  margin-bottom: 20px;
}

.login-panel h1 {
  margin: 6px 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.login-muted {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13.5px;
}

.login-panel .btn {
  width: 100%;
  margin-top: 8px;
  min-height: 46px;
  font-size: 14.5px;
}

.server-setup-screen {
  grid-template-columns: 1fr;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(249, 115, 22, 0.12), transparent 45%),
    #0f172a;
}

.server-setup-panel {
  background: #1e293b;
  border-color: #334155;
  color: #ffffff;
}

.server-setup-panel h1 {
  color: #ffffff;
}

.server-setup-panel .login-muted {
  color: #94a3b8;
}

.server-setup-panel .field input {
  background: #0f172a;
  border-color: #334155;
  color: #ffffff;
}

/* ==========================================================================
   App Shell & Desktop Layout
   ========================================================================== */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 20;
}

.brand {
  height: 72px;
  padding: 0 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--primary-gradient);
  color: #ffffff;
  flex: 0 0 auto;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-mark svg,
.brand-mark i {
  width: 20px;
  height: 20px;
}

.brand-copy strong {
  display: block;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.brand-copy strong span {
  color: var(--primary);
}

.brand-copy small {
  display: block;
  margin-top: 2px;
  color: var(--sidebar-text);
  font-size: 11px;
  font-weight: 500;
}

/* Sidebar Navigation */
.nav {
  padding: 16px 12px;
  display: grid;
  gap: 4px;
  flex-grow: 1;
}

.nav button {
  min-height: 42px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sidebar-text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: all 0.15s ease;
}

.nav button svg,
.nav button i {
  width: 18px;
  height: 18px;
  color: var(--sidebar-text);
  transition: color 0.15s ease;
}

.nav button:hover {
  background: var(--sidebar-item-hover);
  color: var(--sidebar-text-active);
}

.nav button:hover svg,
.nav button:hover i {
  color: var(--sidebar-text-active);
}

.nav button.is-active {
  background: var(--sidebar-item-active);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav button.is-active svg,
.nav button.is-active i {
  color: var(--primary);
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--sidebar-border);
  padding: 16px 16px 20px;
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.session-name {
  display: block;
  color: #f1f5f9;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-role {
  margin-top: 2px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-role::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.logout {
  width: 100%;
  height: 36px;
  margin-top: 12px;
  border-radius: var(--radius-sm);
  background: var(--sidebar-item-hover);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--sidebar-border);
  transition: all 0.15s ease;
}

.logout svg,
.logout i {
  width: 16px;
  height: 16px;
}

.logout:hover {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(220, 38, 38, 0.35);
  color: #fca5a5;
}

/* Main Content Area */
.main {
  padding: 32px 36px 64px;
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

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

/* Operational KPI Summary Box */
.summary-box {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  height: 42px;
}

.summary-box div {
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--line);
}

.summary-box div:last-child {
  border-right: 0;
}

.summary-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.summary-box strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.summary-box .orange {
  color: var(--primary);
}

.summary-box .yellow {
  color: var(--yellow);
}

/* ==========================================================================
   Cards & Layout Grid
   ========================================================================== */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-pad {
  padding: 24px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.card h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.card-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.grid-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 24px;
}

/* Step Grid (Nova Chamada mini preview cards) */
.step-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.mini-box {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-muted);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 104px;
}

.mini-box .label {
  margin-bottom: 6px;
}

.mini-box strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.mini-box p {
  margin: 4px 0 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.mini-box .status-pill {
  align-self: flex-start;
}

/* Choice List (Estabelecimentos na Central) */
.choice-list {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.choice-row {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-align: left;
  transition: all 0.15s ease;
}

.choice-row:hover {
  background: var(--panel-hover);
  border-color: var(--line-strong);
}

.choice-row.is-selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
  box-shadow: 0 0 0 1px var(--primary);
}

.choice-row strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.choice-row span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.choice-row.is-selected strong {
  color: var(--primary-text);
}

.choice-row.is-selected span {
  color: #b45309;
}

.choice-row i,
.choice-row svg {
  color: var(--muted);
  width: 18px;
  height: 18px;
}

.choice-row.is-selected i,
.choice-row.is-selected svg {
  color: var(--primary);
}

/* Queue List */
.queue-list {
  display: grid;
  gap: 8px;
}

.queue-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #ffffff;
  transition: all 0.15s ease;
}

.queue-item:hover {
  border-color: var(--line-strong);
  background: var(--panel-hover);
}

.queue-pos {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  background: var(--primary-subtle);
  color: var(--primary-text);
  font-weight: 700;
  font-size: 12px;
}

.queue-item strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.queue-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}

/* Route & Active Call Items */
.route-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  transition: all 0.15s ease;
}

.route-item:hover {
  border-color: var(--line-strong);
}

.route-item strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.route-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.empty {
  padding: 36px 20px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-muted);
}

/* ==========================================================================
   Data Tables (Motoboys, Estabelecimentos, Usuários, Histórico)
   ========================================================================== */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.toolbar .page-head {
  margin-bottom: 0;
}

.toolbar .search-field {
  width: min(340px, 100%);
}

.table-card {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

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

th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

td {
  color: var(--text-secondary);
  font-size: 13px;
}

tbody tr {
  transition: background-color 0.12s ease;
}

tbody tr:hover {
  background-color: #f8fafc;
}

tr:last-child td {
  border-bottom: 0;
}

.identity-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 600;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  background: #f1f5f9;
  color: var(--primary);
  border: 1px solid var(--line);
  overflow: hidden;
  flex: 0 0 auto;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar svg,
.avatar i {
  width: 16px;
  height: 16px;
}

/* Metric KPI Cards (Pagamentos / Usuários) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--primary-subtle);
  color: var(--primary);
  flex-shrink: 0;
}

.metric-icon svg,
.metric-icon i {
  width: 22px;
  height: 22px;
}

.metric-card span {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-top: 2px;
}

.metric-card strong.orange { color: var(--primary); }
.metric-card strong.yellow { color: var(--yellow); }

/* Split Grid for Payments */
.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.payment-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  margin-bottom: 8px;
}

.payment-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  background: var(--primary-subtle);
  color: var(--primary-text);
  font-weight: 700;
  font-size: 14px;
}

.payment-row strong {
  font-size: 13.5px;
  color: var(--text);
}

.payment-row span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

/* Establishments Grid */
.establishment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.establishment-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.15s ease;
}

.establishment-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.establishment-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.establishment-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--primary-subtle);
  color: var(--primary);
  flex-shrink: 0;
}

.establishment-main strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex-grow: 1;
}

.establishment-card > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
}

/* Settings View */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.sound-grid {
  display: grid;
  gap: 8px;
}

.sound-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  text-align: left;
  transition: all 0.15s ease;
}

.sound-card:hover {
  background: var(--panel-hover);
}

.sound-card.is-selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.sound-card strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.sound-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.sound-card.is-selected strong {
  color: var(--primary-text);
}

/* ==========================================================================
   Rider Mobile App (Modern Ergonomic Experience - v17)
   ========================================================================== */

.rider-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(249, 115, 22, 0.09) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
    #090d16;
  color: #f8fafc;
  padding: 0 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

/* Modern Sticky Glass Navigation Header */
.rider-nav-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0 -16px 4px;
  padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rider-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rider-nav-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(249, 115, 22, 0.35);
}

.rider-nav-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rider-nav-text strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.rider-nav-text strong span {
  color: var(--primary);
}

.rider-badge-v17 {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rider-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rider-gps-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.rider-gps-pill.is-live {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.rider-gps-pill.is-idle {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.rider-nav-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #cbd5e1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rider-nav-icon-btn:active {
  transform: scale(0.92);
}

.rider-nav-icon-btn.is-logout:hover,
.rider-nav-icon-btn.is-logout:active {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Pulsing Status Dots */
.rider-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.rider-pulse-dot.is-green {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.rider-pulse-dot.is-green::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 1.5px solid #10b981;
  animation: pulse-ring 1.8s infinite;
}

.rider-pulse-dot.is-amber {
  background: #f59e0b;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ==========================================================================
   Hero Driver Card
   ========================================================================== */

.rider-hero-card {
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(23, 32, 51, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  overflow: hidden;
}

.rider-hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.6), transparent);
}

.rider-hero-card.is-online::before {
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.7), transparent);
}

/* Driver Profile Row */
.rider-hero-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rider-avatar-wrap {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #1e293b;
  color: var(--primary);
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
  border: 2px solid #334155;
}

.rider-avatar-wrap.has-glow {
  border-color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

.rider-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  object-fit: cover;
}

.rider-avatar-status {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid #0f172a;
}

.rider-avatar-status.is-green {
  background: #10b981;
}

.rider-avatar-status.is-gray {
  background: #64748b;
}

.rider-hero-info {
  flex: 1;
  min-width: 0;
}

.rider-hero-name-row h1 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rider-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.rider-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
}

.rider-tag svg {
  color: #38bdf8;
}

/* Center Stage Queue Display */
.rider-queue-display {
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(11, 17, 32, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rider-queue-display.is-first {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(16, 185, 129, 0.14) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.12);
}

.rider-queue-display.is-active {
  border-color: rgba(16, 185, 129, 0.25);
}

.rider-queue-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rider-queue-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #f59e0b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rider-queue-display.is-active .rider-queue-badge {
  color: #34d399;
}

.rider-queue-time {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.rider-queue-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.rider-queue-number {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #ffffff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.rider-queue-display.is-first .rider-queue-number {
  color: #fbbf24;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.rider-queue-number.is-text {
  font-size: 22px;
  color: #94a3b8;
  font-weight: 800;
}

.rider-queue-status-text {
  flex: 1;
  min-width: 0;
}

.rider-queue-status-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.rider-queue-status-text p {
  margin: 3px 0 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.35;
}

/* Master Power / Availability Toggle Button */
.rider-power-btn {
  width: 100%;
  min-height: 58px;
  border-radius: 14px;
  border: 0;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.rider-power-btn:active {
  transform: scale(0.98);
}

.rider-power-btn.is-on {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.rider-power-btn.is-off {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.rider-power-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.rider-power-btn.is-on .rider-power-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.rider-power-btn.is-off .rider-power-icon {
  background: rgba(255, 255, 255, 0.06);
  color: #f59e0b;
}

.rider-power-copy {
  text-align: left;
  flex: 1;
}

.rider-power-copy strong {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.rider-power-copy small {
  display: block;
  font-size: 11.5px;
  opacity: 0.85;
  margin-top: 2px;
}

/* Real-Time GPS Strip */
.rider-gps-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.rider-gps-status-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.rider-gps-status-copy span:last-child {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rider-gps-refresh-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #93c5fd;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rider-gps-refresh-action:active {
  background: rgba(59, 130, 246, 0.2);
  transform: scale(0.95);
}

/* ==========================================================================
   Incoming Call Card (Big High-Tactile Alert)
   ========================================================================== */

.rider-call-banner {
  padding: 20px;
  border-radius: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.rider-call-banner.is-pending {
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(249, 115, 22, 0.32) 0%, transparent 70%),
    #18100a;
  border: 2px solid #f97316;
  box-shadow: 0 0 35px rgba(249, 115, 22, 0.4);
  animation: call-pulse-orange 1.8s infinite alternate;
}

@keyframes call-pulse-orange {
  0% { box-shadow: 0 0 20px rgba(249, 115, 22, 0.3); }
  100% { box-shadow: 0 0 40px rgba(249, 115, 22, 0.55); border-color: #fb923c; }
}

.rider-call-banner.is-route {
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(16, 185, 129, 0.25) 0%, transparent 70%),
    #0a1811;
  border: 2px solid #10b981;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
}

.rider-call-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rider-call-beacon-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rider-call-beacon-wrap strong {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffedd5;
}

.rider-call-beacon-wrap.is-green strong {
  color: #d1fae5;
}

.rider-call-beacon {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ea580c;
  box-shadow: 0 0 10px #ea580c;
  animation: pulse-beacon 1.2s infinite;
}

.rider-call-beacon.is-green {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

@keyframes pulse-beacon {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
  100% { transform: scale(0.9); opacity: 1; }
}

.rider-call-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fca5a5;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.rider-route-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  font-size: 12px;
  font-weight: 700;
}

.rider-call-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rider-call-store {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rider-call-store-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(249, 115, 22, 0.2);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: #fb923c;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.rider-call-store-icon.is-green {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.rider-call-store-info h3 {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.25;
}

.rider-call-store-info p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #fed7aa;
}

.rider-call-loc-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.rider-loc-icon {
  color: #f97316;
  flex-shrink: 0;
  margin-top: 2px;
}

.rider-loc-icon.is-green {
  color: #34d399;
}

.rider-loc-details small {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rider-loc-details strong {
  display: block;
  font-size: 14px;
  color: #ffffff;
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.35;
}

/* Call Actions Buttons (Big & Touch-Friendly) */
.rider-call-actions-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-call-accept {
  width: 100%;
  min-height: 56px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
  transition: all 0.2s ease;
}

.btn-call-accept:active {
  transform: scale(0.98);
}

.btn-call-finish {
  width: 100%;
  min-height: 54px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.btn-call-navigate {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #38bdf8;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.rider-call-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-call-maps {
  min-height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.btn-call-reject {
  min-height: 44px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

/* ==========================================================================
   Clean Rider Cards (Check-in & PIX)
   ========================================================================== */

.rider-card {
  padding: 18px 20px;
  border-radius: 18px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rider-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rider-card-heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rider-section-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.rider-card-heading h2 {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}

.rider-period-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.rider-info-banner {
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rider-info-banner.is-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.rider-info-banner.is-success .rider-info-icon {
  color: #34d399;
}

.rider-info-banner.is-pending {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.rider-info-banner.is-pending .rider-info-icon {
  color: #fbbf24;
}

.rider-info-banner.is-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  margin-top: 4px;
}

.rider-info-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.rider-info-text small {
  display: block;
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.rider-btn-full {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
}

.rider-card-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.rider-foot-btn {
  background: none;
  border: 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px 6px;
}

.rider-foot-btn:hover {
  color: #ffffff;
}

/* PIX Card Styling */
.rider-pix-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rider-pix-amount {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.rider-pix-details {
  text-align: right;
  min-width: 0;
}

.rider-pix-label {
  display: block;
  font-size: 10.5px;
  color: #94a3b8;
  text-transform: uppercase;
}

.rider-pix-key-val {
  display: block;
  font-size: 12.5px;
  color: #38bdf8;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
  margin-top: 2px;
}

.rider-pix-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rider-btn-action {
  min-height: 44px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  width: 100%;
}

.rider-empty {
  text-align: center;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.rider-empty h1 {
  font-size: 20px;
  color: #ffffff;
  margin: 0;
}

.rider-empty p {
  color: #94a3b8;
  font-size: 14px;
  margin: 0;
}

/* ==========================================================================
   Monitor TV (view=monitor)
   ========================================================================== */

.monitor-page {
  min-height: 100vh;
  background: #090d16;
  color: #ffffff;
  padding: 32px 48px;
}

.monitor-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.monitor-hero {
  padding: 32px;
  border-radius: var(--radius-lg);
  background: #111827;
  border: 1px solid #1f293d;
  margin-bottom: 32px;
}

.monitor-hero h1 {
  font-size: 48px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  margin-top: 8px;
}

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

.monitor-page .card {
  background: #111827;
  border-color: #1f293d;
  color: #ffffff;
}

.monitor-page .card h2 {
  color: #ffffff;
  font-size: 20px;
}

.monitor-rider {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: #090d16;
  border: 1px solid #1f293d;
  margin-bottom: 12px;
}

.monitor-rider strong {
  font-size: 18px;
  color: #ffffff;
}

.monitor-rider span {
  color: #94a3b8;
  font-size: 14px;
}

/* ==========================================================================
   Modals & Toasts
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal {
  width: min(520px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal h3 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #334155;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  z-index: 150;
  animation: toast-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast svg,
.toast i {
  color: #4ade80;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast.is-error {
  background: #450a0a;
  border-color: #7f1d1d;
  color: #fecaca;
}

.toast.is-error svg,
.toast.is-error i {
  color: #f87171;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1080px) {
  :root {
    --sidebar-width: 220px;
  }

  .main {
    padding: 24px 20px 48px;
  }

  .grid-dashboard {
    grid-template-columns: 1fr;
  }

  .cards-grid,
  .split-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-border);
  }

  .brand {
    height: 60px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
    gap: 4px;
  }

  .nav button {
    min-height: 38px;
    font-size: 12.5px;
    padding: 0 10px;
    gap: 8px;
  }

  .sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
  }

  .logout {
    width: auto;
    margin-top: 0;
    padding: 0 14px;
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: auto;
    padding: 36px 20px 24px;
  }

  .login-brand img {
    width: 180px;
  }

  .login-brand h1 {
    font-size: 24px;
  }

  .login-panel {
    width: calc(100% - 32px);
    padding: 24px;
    margin: 20px auto 40px;
  }

  .step-grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .summary-box {
    width: 100%;
    justify-content: space-between;
  }

  .summary-box div {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    justify-content: center;
  }

  .monitor-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Solicitações das Lojas (Central de Despacho)
   ========================================================================== */

.store-requests-banner {
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.08);
}

.store-requests-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.store-requests-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: #9a3412;
  display: flex;
  align-items: center;
  gap: 8px;
}

.store-requests-head small {
  color: var(--muted);
  font-size: 12.5px;
  margin-left: auto;
}

.store-requests-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.store-request-item {
  background: #fffaf5;
  border: 1px solid #ffedd5;
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.store-request-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.store-request-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.store-request-top strong {
  font-size: 14.5px;
  color: var(--text);
  font-weight: 700;
}

.store-request-time {
  font-size: 11px;
  color: var(--muted);
  background: #ffffff;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid #fed7aa;
  white-space: nowrap;
}

.store-request-address {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.store-request-address strong {
  color: var(--text);
}

.store-request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}

.store-request-tag {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.store-request-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed #fed7aa;
}

.store-request-actions .btn {
  flex: 1;
}

/* ==========================================================================
   Banner de Pagamentos e Check-in Pendentes no Painel
   ========================================================================== */

.pending-payments-banner {
  background: #ffffff;
  border: 1.5px solid #a7f3d0;
  border-left: 4px solid #10b981;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
}

.pending-payments-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.pending-payments-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pending-payments-head small {
  color: var(--muted);
  font-size: 12.5px;
  margin-left: auto;
}

.pending-payments-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
}

.pending-payment-item {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pending-payment-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.pending-payment-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid #86efac;
}

.pending-payment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pending-payment-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pending-payment-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pending-payment-top strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pending-payment-time {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.pending-payment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.pending-payment-phone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pending-payment-val-pill {
  background: #dcfce7;
  color: #166534;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid #bbf7d0;
}

.pending-payment-action-box {
  flex-shrink: 0;
}

.pending-payment-action-box .btn {
  white-space: nowrap;
  padding: 8px 14px;
  font-weight: 600;
}

/* Nav Badge */
.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  line-height: 1.2;
}

.nav-badge.yellow {
  background: #f59e0b;
  color: #1c1917;
}

.nav-badge.pulse {
  animation: badge-pulse 1.5s infinite;
}

@keyframes badge-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* ==========================================================================
   Portal do Estabelecimento (Área da Loja)
   ========================================================================== */

.establishment-app {
  min-height: 100vh;
  background: #f8fafc;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.establishment-navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.establishment-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.establishment-brand .brand-mark {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #ffffff;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
}

.establishment-brand-copy strong {
  font-size: 15px;
  font-weight: 700;
  display: block;
  color: var(--text);
}

.establishment-brand-copy span {
  font-size: 11.5px;
  color: var(--muted);
}

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

.establishment-content {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.establishment-status-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.establishment-status-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.establishment-status-info strong {
  font-size: 14.5px;
  display: block;
  color: var(--text);
}

.establishment-status-info span {
  font-size: 12.5px;
  color: var(--muted);
}

.pulse-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.pulse-indicator.green {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
  animation: pulse-ring-green 2s infinite;
}

.pulse-indicator.yellow {
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
  animation: pulse-ring-yellow 2s infinite;
}

@keyframes pulse-ring-green {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-ring-yellow {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.establishment-live-card {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1.5px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.establishment-live-card.pending-central {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
}

.establishment-live-card.active-call {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

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

.live-status-header strong {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rider-info-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.rider-info-box .rider-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0284c7;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.rider-info-box .rider-details {
  flex: 1;
}

.rider-info-box .rider-details strong {
  font-size: 14.5px;
  display: block;
  color: var(--text);
}

.rider-info-box .rider-details span {
  font-size: 12px;
  color: var(--muted);
}

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

@media (max-width: 640px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.btn-call-store {
  margin-top: 8px;
  height: 48px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Área Maps - Monitoramento em Tempo Real de Cajazeiras
   ========================================================================== */

.live-map-wrapper {
  display: flex;
  height: calc(100vh - 170px);
  min-height: 550px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.live-map-sidebar {
  width: 360px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  z-index: 10;
  flex-shrink: 0;
}

.live-map-sidebar-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fafafa;
}

.map-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: 38px;
}

.map-search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 13.5px;
  color: var(--text);
}

.map-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.map-pill {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.map-pill.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.live-map-riders-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-riders-empty {
  padding: 30px 20px;
  text-align: center;
}

.map-rider-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #f1f5f9;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-rider-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.map-rider-card.has-gps {
  border-left: 3px solid #10b981;
}

.map-rider-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  overflow: visible;
}

.map-rider-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.map-rider-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.map-rider-status-dot.green { background: #10b981; }
.map-rider-status-dot.orange { background: #f97316; }
.map-rider-status-dot.yellow { background: #eab308; }
.map-rider-status-dot.gray { background: #94a3b8; }

.map-rider-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.map-rider-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.map-rider-name-row strong {
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill-xs {
  font-size: 10.5px;
  padding: 1px 6px;
}

.map-rider-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.rider-gps-time.green {
  color: #059669;
  font-weight: 600;
}

.map-rider-delivery-tag {
  font-size: 11px;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #ffedd5;
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-rider-action {
  flex-shrink: 0;
}

.live-map-sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fafafa;
}

.map-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}

.live-map-canvas-wrap {
  flex: 1;
  position: relative;
  height: 100%;
}

.live-map-canvas {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.live-map-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-floating-btn {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-floating-btn:hover {
  background: #f8fafc;
  color: var(--primary);
  transform: translateY(-1px);
}

.map-floating-btn.sim-btn {
  background: #fff7ed;
  border-color: #f97316;
  color: #c2410c;
}

.map-floating-btn.sim-btn:hover {
  background: #ffedd5;
  color: #9a3412;
}

.map-floating-btn.sim-btn.is-running {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
  animation: pulse-sim-red 1.8s infinite;
}

@keyframes pulse-sim-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Custom Marker Pins on Map */
.custom-map-rider-icon {
  background: transparent;
  border: none;
}

.rider-marker-pin {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.marker-inner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #10b981;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 2;
  transition: transform 0.2s ease;
}

.rider-marker-pin:hover .marker-inner {
  transform: scale(1.12);
}

.marker-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.marker-inner .marker-bike-icon {
  font-size: 18px;
  line-height: 1;
}

.rider-marker-pin.is-green .marker-inner { border-color: #10b981; }
.rider-marker-pin.is-orange .marker-inner { border-color: #f97316; }
.rider-marker-pin.is-yellow .marker-inner { border-color: #eab308; }
.rider-marker-pin.is-gray .marker-inner { border-color: #94a3b8; }

.marker-name-tag {
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 2px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 3;
}

.marker-pulse-ring {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.rider-marker-pin.is-green .marker-pulse-ring {
  background: rgba(16, 185, 129, 0.35);
  animation: marker-pulse-green 2s infinite;
}

.rider-marker-pin.is-orange .marker-pulse-ring {
  background: rgba(249, 115, 22, 0.35);
  animation: marker-pulse-orange 1.8s infinite;
}

.rider-marker-pin.is-yellow .marker-pulse-ring {
  background: rgba(234, 179, 8, 0.35);
  animation: marker-pulse-yellow 1.8s infinite;
}

@keyframes marker-pulse-green {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes marker-pulse-orange {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes marker-pulse-yellow {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Custom Store Pins */
.custom-map-store-icon {
  background: transparent;
  border: none;
}

.store-marker-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 20px;
}

.store-name-tag {
  background: #ffffff;
  color: #1e293b;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-top: 1px;
}

/* Map Popup Custom Card */
.map-popup-card {
  min-width: 220px;
  font-family: inherit;
}

.map-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 8px;
}

.map-popup-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
}

.map-popup-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-popup-header strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
}

.map-popup-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #475569;
}

.map-popup-details div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.map-popup-details div strong {
  color: #0f172a;
}

.map-popup-route-box {
  margin-top: 6px;
  padding: 6px 8px;
  background: #fff7ed;
  border: 1px solid #ffedd5;
  border-radius: 4px;
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.map-popup-whatsapp {
  margin-top: 10px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

/* GPS indicator on motoboy screen */
.rider-gps-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
  color: #065f46;
  font-size: 11.5px;
  font-weight: 600;
}

.rider-gps-btn {
  background: #047857;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  transition: background 0.15s ease;
}

.rider-gps-btn:hover {
  background: #059669;
}

.rider-small-btn.is-gps {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.rider-small-btn.is-gps.is-active {
  background: rgba(16, 185, 129, 0.28);
  color: #10b981;
  border-color: #10b981;
  font-weight: 700;
}

.rider-small-btn.is-gps:hover {
  background: #10b981;
  color: #ffffff;
}

@media (max-width: 860px) {
  .live-map-wrapper {
    flex-direction: column;
    height: 75vh;
  }
  .live-map-sidebar {
    width: 100%;
    height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}


/* Rastreamento Suave em Tempo Real e Câmera Seguidora */
.leaflet-marker-icon.custom-map-rider-icon {
  transition: transform 0.75s cubic-bezier(0.25, 0.1, 0.25, 1), -webkit-transform 0.75s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.map-floating-btn.auto-follow-btn.is-following {
  background: #ff7a00;
  color: #ffffff;
  border-color: #e06c00;
  box-shadow: 0 4px 14px rgba(255, 122, 0, 0.45);
  animation: pulseFollow 2s infinite;
}

@keyframes pulseFollow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 122, 0, 0.6);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 122, 0, 0);
  }
}

.marker-heading-arrow {
  position: absolute;
  top: -16px;
  left: 50%;
  transform-origin: center bottom;
  color: #ff7a00;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

/* ==========================================================================
   Controle de Taxas dos Motoboys (Aba Pagamentos estilo Planilha)
   ========================================================================== */

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

.payments-kpis-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-pay-total .metric-icon {
  background: #dcfce7;
  color: #15803d;
}

.metric-pay-pix .metric-icon {
  background: #e0f2fe;
  color: #0284c7;
}

.metric-pay-cash .metric-icon {
  background: #ffedd5;
  color: #ea580c;
}

.metric-pay-unpaid .metric-icon {
  background: #fee2e2;
  color: #dc2626;
}

.metric-pay-pending .metric-icon {
  background: #fef9c3;
  color: #ca8a04;
}

.payments-table-card {
  margin-top: 8px;
}

.payments-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

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

.filter-pill-box {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  padding: 4px 6px;
  border-radius: 8px;
  gap: 4px;
  border: 1px solid #e2e8f0;
}

.filter-group-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  padding: 0 4px;
}

.filter-pill {
  border: none;
  background: transparent;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.filter-pill.is-active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}

.filter-pill-green.is-active {
  background: #16a34a;
  color: #ffffff;
}

.filter-pill-red.is-active {
  background: #dc2626;
  color: #ffffff;
}

.filter-pill-yellow.is-active {
  background: #ca8a04;
  color: #ffffff;
}

.date-picker-input {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: inherit;
  color: #334155;
  cursor: pointer;
  outline: none;
}

.date-picker-input.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  font-weight: 600;
}

.payments-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 14px;
  min-width: 270px;
  color: #64748b;
  transition: border-color 0.15s;
}

.payments-search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.payments-search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  color: #0f172a;
}

.payments-table-responsive {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.payments-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.payments-table th {
  background: #f8fafc;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  border-bottom: 2px solid var(--line);
}

.payments-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13.5px;
}

.payment-tr {
  transition: background-color 0.12s ease;
}

.tr-paid {
  background: #ffffff;
}

.tr-paid:hover {
  background: #f8fafc;
}

.tr-unpaid {
  background: #fffafa;
}

.tr-unpaid:hover {
  background: #fef2f2;
}

.tr-pending {
  background: #fffdf5;
}

.tr-pending:hover {
  background: #fefce8;
}

.pay-rider-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pay-rider-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #1e293b;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pay-meta-by {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.td-value {
  font-size: 14.5px;
  color: #0f172a;
}

.badge-pay {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.badge-pay-yes {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.badge-pay-no {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

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

.badge-method {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
}

.badge-method-pix {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.badge-method-cash {
  background: #ffedd5;
  color: #ea580c;
  border: 1px solid #fed7aa;
}

.badge-method-empty {
  color: #94a3b8;
  font-weight: 600;
  padding-left: 8px;
}

.shift-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.shift-diurno {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

.shift-noturno {
  background: #ede9fe;
  color: #6b21a8;
  border: 1px solid #ddd6fe;
}

.pay-notes-tag {
  background: #f1f5f9;
  color: #334155;
  border: 1px dashed #cbd5e1;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  max-width: 250px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pay-notes-empty {
  color: #94a3b8;
  padding-left: 4px;
}

.pay-action-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

/* Modais de Pagamento */
.payment-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.payment-modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}

.payment-modal-header p {
  font-size: 13px;
  color: #64748b;
  margin: 2px 0 0 0;
}

.payment-modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.payment-modal-icon.green {
  background: #dcfce7;
  color: #16a34a;
}

.payment-modal-icon.red {
  background: #fee2e2;
  color: #dc2626;
}

.payment-modal-icon.orange {
  background: #ffedd5;
  color: #ea580c;
}

.payment-modal-icon.blue {
  background: #e0f2fe;
  color: #0284c7;
}

.payment-method-selector {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.pay-method-radio {
  flex: 1;
  cursor: pointer;
  display: block;
}

.pay-method-radio input {
  display: none;
}

.pay-method-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  font-weight: 700;
  font-size: 13.5px;
  transition: all 0.15s ease;
  background: #ffffff;
  color: #475569;
}

.pay-method-radio.is-selected .pill-pix {
  border-color: #0284c7;
  background: #f0f9ff;
  color: #0284c7;
  box-shadow: 0 0 0 1px #0284c7;
}

.pay-method-radio.is-selected .pill-cash {
  border-color: #ea580c;
  background: #fff7ed;
  color: #ea580c;
  box-shadow: 0 0 0 1px #ea580c;
}

.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-hint {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  margin-top: 4px;
}

/* Compact public HTTPS control used by the installed motoboy app. */
.public-https-area {
  position: fixed;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: min(310px, calc(100vw - 24px));
  padding: 9px 9px 9px 10px;
  border: 1px solid rgba(245, 184, 27, 0.38);
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.public-https-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(245, 184, 27, 0.15);
  color: #f5b81b;
}

.public-https-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.public-https-copy span {
  color: #94a3b8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.public-https-copy strong {
  display: block;
  overflow: hidden;
  color: #f8fafc;
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-https-area > button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: #f5b81b;
  color: #172033;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.public-https-modal {
  max-width: 520px;
}

.public-https-modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.public-https-modal-head > span {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(245, 184, 27, 0.15);
  color: #d89b00;
}

.public-https-modal-head h3 {
  margin: 0;
}

.public-https-modal-head p,
.public-https-help {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 480px) {
  .public-https-area {
    width: min(265px, calc(100vw - 24px));
  }
}
