/* ═══════════════════════════════════════════════════
   TradeUP — Design System
   ═══════════════════════════════════════════════════ */

/* ── TOKENS ──────────────────────────────────────── */
:root {
  /* Brand */
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-900: #1e3a8a;

  /* Status */
  --success:      #16a34a;
  --success-light:#dcfce7;
  --warning:      #d97706;
  --warning-light:#fef9c3;
  --danger:       #dc2626;
  --danger-light: #fee2e2;
  --info:         #0891b2;
  --info-light:   #cffafe;

  /* Neutrals */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Surfaces */
  --bg:        var(--gray-50);
  --card-bg:   #ffffff;
  --border:    var(--gray-200);
  --text:      var(--gray-900);
  --text-muted:var(--gray-500);

  /* Sidebar */
  --sidebar-w:     240px;
  --sidebar-bg:    var(--gray-900);
  --sidebar-hover: rgba(255,255,255,.07);
  --sidebar-active:var(--brand-600);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:    0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12);

  /* Radius */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* App mobile */
  --app-header-h:  64px;
  --app-nav-h:     64px;
  --app-bg:        #f0f4ff;
  --app-header-from: #1e40af;
  --app-header-to:   #0f172a;
}

/* ── RESET ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand-600); text-decoration: none; }
img { max-width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ── TYPOGRAPHY ──────────────────────────────────── */
h1 { font-size: 1.5rem;  font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem;    font-weight: 600; }
.text-sm   { font-size: .85rem; }
.text-xs   { font-size: .75rem; }
.text-muted { color: var(--text-muted); }
.fw-600    { font-weight: 600; }
.fw-700    { font-weight: 700; }
.mb-0      { margin-bottom: 0 !important; }
.mt-auto   { margin-top: auto; }

/* ═══════════════════════════════════════════════════
   ADMIN LAYOUT
   ═══════════════════════════════════════════════════ */
.layout-admin {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}
.sidebar-brand-icon {
  width: 34px; height: 34px;
  background: var(--brand-600);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: #fff;
  flex-shrink: 0;
}
.sidebar-brand-name { font-size: .95rem; font-weight: 800; letter-spacing: -.02em; }
.sidebar-brand-sub  { font-size: .65rem; color: var(--gray-400); margin-top: 1px; }

.sidebar-section {
  padding: 18px 12px 4px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-500);
}

.sidebar-nav { padding: 8px; flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--gray-300);
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  text-decoration: none;
  margin-bottom: 2px;
}
.sidebar-nav a:hover             { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav a.active            { background: var(--sidebar-active); color: #fff; }
.sidebar-nav a .nav-icon         { width: 18px; text-align: center; opacity: .75; flex-shrink: 0; }
.sidebar-nav a.active .nav-icon  { opacity: 1; }
.sidebar-nav a .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--gray-300);
  font-size: .8rem;
}
.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-700);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .75rem;
  flex-shrink: 0;
}
.sidebar-user-name  { font-weight: 600; color: #fff; font-size: .825rem; line-height: 1.2; }
.sidebar-user-role  { color: var(--gray-400); font-size: .7rem; }
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--gray-400);
  font-size: .8rem;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  transition: color .15s, background .15s;
}
.sidebar-logout:hover { color: #fff; background: rgba(220,38,38,.2); }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}

/* ── ADMIN CONTENT ───────────────────────────────── */
.admin-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.admin-topbar {
  height: 56px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0;
  z-index: 100;
}
.admin-topbar-left { display: flex; align-items: center; gap: 12px; }
.page-title { font-size: .95rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.page-title i { color: var(--brand-600); }
.btn-menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.admin-body {
  flex: 1;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ═══════════════════════════════════════════════════
   COMPONENTES
   ═══════════════════════════════════════════════════ */

/* ── CARD ────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-body { padding: 18px; }

/* ── KPI GRID ────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.kpi-blue::before   { background: var(--brand-600); }
.kpi-green::before  { background: var(--success); }
.kpi-red::before    { background: var(--danger); }
.kpi-orange::before { background: var(--warning); }
.kpi-cyan::before   { background: var(--info); }

.kpi-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 6px; }
.kpi-value { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.kpi-sub   { font-size: .75rem; color: var(--text-muted); }
.kpi-icon  { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 2rem; opacity: .08; }

/* ── TABLE ───────────────────────────────────────── */
.table-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead tr { background: var(--gray-50); }
th {
  padding: 10px 14px;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td { padding: 11px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  color: var(--text-muted);
  gap: 10px;
}
.empty-state i { font-size: 2.5rem; opacity: .3; }
.empty-state p { font-size: .9rem; }

/* ── SEARCH BOX ──────────────────────────────────── */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box i {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: .85rem;
  pointer-events: none;
}
.search-box input { padding-left: 32px !important; }

/* ── BADGES ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge-blue   { background: var(--brand-100); color: var(--brand-700); }
.badge-green  { background: var(--success-light); color: var(--success); }
.badge-red    { background: var(--danger-light);  color: var(--danger); }
.badge-orange { background: var(--warning-light); color: var(--warning); }
.badge-cyan   { background: var(--info-light);    color: var(--info); }
.badge-gray   { background: var(--gray-100); color: var(--gray-500); }

/* ── BUTTONS ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .875rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, opacity .15s, box-shadow .15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary  { background: var(--brand-600); color: #fff; }
.btn-primary:hover  { background: var(--brand-700); }
.btn-success  { background: var(--success); color: #fff; }
.btn-success:hover  { opacity: .9; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-danger:hover   { opacity: .9; }
.btn-warning  { background: var(--warning); color: #fff; }
.btn-ghost    { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover    { background: var(--gray-100); }
.btn-sm       { padding: 5px 12px; font-size: .8rem; }
.btn-lg       { padding: 12px 24px; font-size: 1rem; }
.btn-block    { width: 100%; }
.btn-icon     { padding: 7px; border-radius: var(--radius-sm); aspect-ratio: 1; }

/* ── FORMS ───────────────────────────────────────── */
.form-group   { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-label   { font-size: .8rem; font-weight: 600; color: var(--gray-700); }
.form-control {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text);
  background: var(--card-bg);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.form-control:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.form-control::placeholder { color: var(--gray-400); }
select.form-control { appearance: none; -webkit-appearance: none; -moz-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 34px; color: #0f172a !important; background-color: #ffffff !important; height: 40px; line-height: 1.5; cursor: pointer; }
select.form-control option { color: #0f172a; background-color: #ffffff; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 3px; }

/* ── ALERTS ──────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
}
.alert-success { background: var(--success-light); color: #15803d; }
.alert-danger  { background: var(--danger-light);  color: #b91c1c; }
.alert-warning { background: var(--warning-light); color: #92400e; }
.alert-info    { background: var(--info-light);    color: #0e7490; }

/* ── FILTER BAR ──────────────────────────────────── */
.filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-bar .form-group { margin-bottom: 0; min-width: 140px; flex: 1; }

/* ── SPLIT GRID ──────────────────────────────────── */
.split-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

/* ── PROGRESS ────────────────────────────────────── */
.progress-wrap { background: var(--gray-100); border-radius: 99px; height: 6px; overflow: hidden; }
.progress-bar  { height: 100%; border-radius: 99px; background: var(--brand-600); transition: width .4s; }
.progress-bar.green  { background: var(--success); }
.progress-bar.red    { background: var(--danger); }
.progress-bar.orange { background: var(--warning); }

/* ── MODAL ───────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-body   { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ═══════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════ */
.login-page {
  min-height: 100svh;
  background: linear-gradient(135deg, var(--gray-900) 0%, #1e3a8a 50%, var(--gray-900) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-logo {
  width: 52px; height: 52px;
  background: var(--brand-600);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff;
  margin: 0 auto 20px;
}
.login-title { color: #fff; font-size: 1.4rem; font-weight: 800; text-align: center; margin-bottom: 4px; }
.login-sub   { color: rgba(255,255,255,.5); font-size: .85rem; text-align: center; margin-bottom: 28px; }
.login-card .form-label   { color: rgba(255,255,255,.75); }
.login-card .form-control { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #fff; }
.login-card .form-control::placeholder { color: rgba(255,255,255,.3); }
.login-card .form-control:focus { border-color: var(--brand-400); background: rgba(255,255,255,.12); box-shadow: 0 0 0 3px rgba(96,165,250,.2); }
.login-card .btn-primary  { background: var(--brand-600); width: 100%; padding: 12px; font-size: 1rem; margin-top: 6px; }
.login-footer { text-align: center; margin-top: 20px; color: rgba(255,255,255,.35); font-size: .75rem; }

/* ═══════════════════════════════════════════════════
   APP MOBILE — LAYOUT DO PROMOTOR
   ═══════════════════════════════════════════════════ */
.layout-app {
  min-height: 100svh;
  background: var(--app-bg);
  display: flex;
  flex-direction: column;
}

.app-header {
  background: linear-gradient(135deg, var(--app-header-from), var(--app-header-to));
  height: var(--app-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}
.app-header-left  { display: flex; flex-direction: column; gap: 2px; }
.app-header-title { font-size: 1rem; font-weight: 700; color: #fff; }
.app-header-sub   { font-size: .72rem; color: rgba(255,255,255,.6); display: flex; align-items: center; gap: 5px; }
.app-header-right { display: flex; align-items: center; gap: 8px; }
.btn-header-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .9rem;
  transition: background .15s;
}
.btn-header-icon:hover { background: rgba(255,255,255,.2); }

/* Dot de status online/offline */
.sync-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  flex-shrink: 0;
}
.sync-dot.offline { background: var(--danger); }
.sync-dot.syncing { background: var(--warning); animation: pulse .8s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.3; } }

.app-body {
  flex: 1;
  padding: 14px 14px calc(var(--app-nav-h) + 14px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

/* ── BOTTOM NAV ──────────────────────────────────── */
.app-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--app-nav-h);
  background: var(--gray-900);
  display: flex;
  z-index: 100;
  border-top: 1px solid rgba(255,255,255,.08);
}
.app-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--gray-400);
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: color .15s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.app-nav a i { font-size: 1.2rem; }
.app-nav a.active { color: var(--brand-400); }
.app-nav a:active  { opacity: .7; }

/* ── KPI ROW (mobile) ────────────────────────────── */
.kpi-row-app {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.kpi-app {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.kpi-app-value { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.kpi-app-label { font-size: .65rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 3px; }

/* ── ROUTE CARD ──────────────────────────────────── */
.route-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--border);
}
.route-card.status-em_andamento { border-left-color: var(--warning); }
.route-card.status-pendente     { border-left-color: var(--brand-600); }
.route-card.status-atrasada     { border-left-color: var(--danger); }
.route-card.status-finalizada   { border-left-color: var(--success); }
.route-card.status-avulsa       { border-left-color: var(--info); }

.route-card-name { font-size: .95rem; font-weight: 700; margin-bottom: 4px; }
.route-card-meta { font-size: .78rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.route-card-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── APP BUTTONS ─────────────────────────────────── */
.btn-app {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.btn-app:active { opacity: .8; transform: scale(.97); }
.btn-app-primary { background: var(--brand-600); color: #fff; }
.btn-app-success { background: var(--success); color: #fff; }
.btn-app-danger  { background: var(--danger);  color: #fff; }
.btn-app-warning { background: var(--warning); color: #fff; }
.btn-app-ghost   { background: var(--gray-100); color: var(--text); border: 1.5px solid var(--border); }
.btn-app-block   { width: 100%; }

/* ── SECTION HEADER ──────────────────────────────── */
.section-hdr {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 0;
}
.section-hdr::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── GPS STATUS ──────────────────────────────────── */
.gps-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .875rem;
}
.gps-card.gps-loading { border-color: var(--brand-300); }
.gps-card.gps-ok      { border-color: #86efac; background: #f0fdf4; }
.gps-card.gps-err     { border-color: #fca5a5; background: #fff5f5; }
.gps-card i { font-size: 1.2rem; flex-shrink: 0; }
.gps-loading i { color: var(--brand-500); }
.gps-ok  i { color: var(--success); }
.gps-err i { color: var(--danger); }

/* ── PRODUCT CARD (abastecimento) ────────────────── */
.produto-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.produto-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.produto-card-name { font-weight: 600; font-size: .9rem; }
.produto-card-ean  { font-size: .72rem; color: var(--text-muted); margin-top: 1px; }
.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty-btn {
  width: 52px; height: 44px;
  background: var(--brand-600);
  border: none;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: background .1s;
  flex-shrink: 0;
}
.qty-btn:active { background: var(--brand-700); }
.qty-control input[type=number] { width: 52px; text-align: center; font-size: 1rem; font-weight: 700; border: none; outline: none; color: #0f172a; }
.qty-input {
  width: 52px;
  text-align: center;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 0;
  height: 36px;
  background: var(--card-bg);
}
.qty-input:focus { outline: none; }

/* ── TOGGLE SWITCH ───────────────────────────────── */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 12px;
}
.toggle-label { font-size: .875rem; font-weight: 500; }
.toggle {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  inset: 0;
  background: var(--gray-300);
  border-radius: 12px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--danger); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── FOTO SECTION ────────────────────────────────── */
.foto-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.foto-section-title { font-weight: 600; font-size: .9rem; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.foto-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.foto-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  border: 1.5px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  font-size: .75rem;
  color: var(--text-muted);
  flex-direction: column;
  gap: 4px;
}
.foto-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto-thumb i { font-size: 1.4rem; }
.foto-thumb input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }

/* ── TOAST ───────────────────────────────────────── */
.toast {
  position: fixed;
  top: 70px; left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--gray-800);
  color: #fff;
  padding: 10px 18px;
  border-radius: 99px;
  font-size: .85rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 999;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── OFFLINE BANNER ──────────────────────────────── */
.offline-banner {
  display: none;
  background: var(--warning);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  text-align: center;
  padding: 7px 14px;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.offline-banner.show { display: flex; }

/* ─── INSTALL PROMPT ─────────────────────────────── */
.install-banner {
  position: fixed;
  bottom: calc(var(--app-nav-h) + 10px);
  left: 10px; right: 10px;
  background: var(--gray-900);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 150;
  box-shadow: var(--shadow-lg);
}
.install-banner.show { display: flex; }
.install-banner-text { flex: 1; color: #fff; font-size: .85rem; }
.install-banner-text strong { display: block; font-size: .9rem; margin-bottom: 2px; }
.install-banner-text span { color: var(--gray-400); font-size: .78rem; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.show { display: block; }
  .admin-content { margin-left: 0; }
  .btn-menu-toggle { display: flex; }
  .split-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .admin-body  { padding: 14px; gap: 14px; }
  .kpi-grid    { grid-template-columns: repeat(2, 1fr); }
  .filter-bar  { flex-direction: column; }
  .filter-bar .form-group { min-width: 0; width: 100%; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .btn-lg   { padding: 11px 18px; }
}
