/* =========================================================================
   GEOVEX — Painel Admin + Rastreio Público
   Usa os mesmos tokens de cor definidos em css/style.css
   ========================================================================= */

.admin-body{ background:var(--bg); min-height:100vh; }
.admin-login-body{ display:flex; align-items:center; justify-content:center; padding:20px; }

.login-box{
  width:100%; max-width:380px; background:#fff; border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:36px 32px; box-shadow:0 20px 50px -24px rgba(10,37,64,.35); text-align:center;
}
.login-logo{ height:44px; margin:0 auto 18px; }
.login-box h1{ font-size:22px; margin-bottom:4px; }
.login-sub{ font-size:12.8px; color:var(--ink-faint); margin-bottom:22px; }
.login-box .field{ text-align:left; }
.login-box input{
  width:100%; border:1px solid var(--line-strong); border-radius:8px; padding:10px 12px; font-size:14px; font-family:inherit;
}
.login-box input:focus{ border-color:var(--blue); outline:none; }

.admin-alert{ padding:10px 14px; border-radius:8px; font-size:13px; margin-bottom:14px; text-align:left; }
.admin-alert.error{ background:rgba(224,85,79,.1); border:1px solid rgba(224,85,79,.4); color:#a13530; }
.admin-alert.ok{ background:rgba(34,178,75,.1); border:1px solid rgba(34,178,75,.4); color:#15803d; }

/* ---------- Admin shell ---------- */
.admin-shell{ max-width:1240px; margin:0 auto; padding:20px 20px 60px; }
.admin-top{
  display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:22px;
  padding-bottom:16px; border-bottom:1px solid var(--line);
}
.admin-top .brand{ display:flex; align-items:center; gap:10px; }
.admin-top .brand img{ height:34px; }
.admin-top .brand b{ font-family:'Barlow Condensed'; font-size:18px; color:var(--navy); text-transform:uppercase; }
.admin-top .brand span{ display:block; font-size:11px; color:var(--ink-faint); }
.admin-top-actions{ display:flex; gap:10px; align-items:center; }

.admin-stats{ display:flex; gap:14px; flex-wrap:wrap; margin-bottom:24px; }
.admin-stat{
  flex:1; min-width:140px; background:#fff; border:1px solid var(--line); border-radius:var(--radius);
  padding:14px 16px;
}
.admin-stat b{ display:block; font-family:'Barlow Condensed'; font-size:24px; color:var(--navy); }
.admin-stat span{ font-size:11.5px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.03em; }

.admin-toolbar{ display:flex; justify-content:space-between; align-items:center; gap:14px; margin-bottom:16px; flex-wrap:wrap; }
.admin-filters{ display:flex; gap:8px; flex-wrap:wrap; }
.admin-filters button{
  padding:8px 14px; border-radius:999px; border:1px solid var(--line-strong); background:#fff; color:var(--ink-soft);
  font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.02em;
}
.admin-filters button.active, .admin-filters button:hover{ background:var(--blue); border-color:var(--blue); color:#fff; }

/* ---------- Orders table / cards ---------- */
.os-list{ display:flex; flex-direction:column; gap:12px; }
.os-card{ background:#fff; border:1px solid var(--line); border-radius:var(--radius-lg); padding:16px 18px; }
.os-card-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:14px; flex-wrap:wrap; margin-bottom:10px; }
.os-card-head .os-id{ font-family:'Barlow Condensed'; font-size:18px; color:var(--navy); }
.os-card-head .os-id span{ font-family:'Inter'; font-size:12px; color:var(--ink-faint); font-weight:600; margin-left:8px; }
.os-card-meta{ font-size:12.8px; color:var(--ink-soft); margin-bottom:10px; }
.os-card-meta b{ color:var(--navy); }

.stage-badge{
  font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; padding:5px 12px; border-radius:999px;
  display:inline-flex; align-items:center; gap:6px; white-space:nowrap;
}
.stage-badge.st-confirmado{ background:var(--accent-bg); color:var(--blue); }
.stage-badge.st-em_producao{ background:var(--accent-bg); color:var(--blue); }
.stage-badge.st-em_transito{ background:rgba(240,169,58,.15); color:#a15a00; }
.stage-badge.st-saiu_para_entrega{ background:rgba(240,169,58,.2); color:#a15a00; }
.stage-badge.st-entregue{ background:rgba(34,178,75,.14); color:#15803d; }
.stage-badge.st-atraso, .stage-badge.st-problema, .stage-badge.st-devolvido{ background:rgba(224,85,79,.12); color:#a13530; }

.os-card-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.os-card-actions .btn{ padding:8px 14px; font-size:11.5px; }
.btn-ghost{ background:#fff; border:1px solid var(--line-strong); color:var(--navy); }
.btn-ghost:hover{ border-color:var(--blue); color:var(--blue); }
.btn-danger-ghost{ background:#fff; border:1px solid rgba(224,85,79,.5); color:#a13530; }
.btn-danger-ghost:hover{ background:rgba(224,85,79,.08); }

.os-map-preview{ margin-top:12px; height:220px; border-radius:var(--radius); overflow:hidden; border:1px solid var(--line); display:none; }

/* ---------- Modal fields shared with cadastro / despacho ---------- */
.modal-lg{ width:640px; }
.form-grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:0 14px; }
.form-grid-3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:0 14px; }

/* ---------- Public tracking page ---------- */
.track-wrap{ max-width:600px; margin:0 auto; padding:30px 18px 60px; }
.track-header{ display:flex; align-items:center; justify-content:center; margin-bottom:20px; }
.track-header img{ height:38px; }
.panel{ background:#fff; border:1px solid var(--line); border-radius:var(--radius-lg); padding:24px; margin-bottom:16px; }
.panel h1{ font-size:19px; margin-bottom:4px; }
.panel .sub{ font-size:12.5px; color:var(--ink-faint); margin-bottom:16px; }
.track-search-form{ display:flex; gap:10px; }
.track-search-form input{
  flex:1; border:1px solid var(--line-strong); border-radius:8px; padding:12px 14px; font-size:15px; font-weight:700;
  letter-spacing:.04em; font-family:inherit; color:var(--navy);
}
.track-search-form input:focus{ border-color:var(--blue); outline:none; }
.track-item-box{ background:var(--panel-2); border:1px solid var(--line); border-radius:10px; padding:14px 16px; margin-bottom:18px; font-size:13px; color:var(--ink); }
.track-item-box div{ margin-bottom:4px; }
.track-item-box b{ color:var(--navy); }
.wpp-cta{
  display:flex; align-items:center; justify-content:center; gap:8px; margin-top:18px; background:var(--whats); color:#fff;
  font-weight:700; font-size:13.5px; padding:13px; border-radius:10px; text-decoration:none;
}
.wpp-cta:hover{ background:var(--whats-2); }

/* ---------- Stepper ---------- */
.tracking-steps{ display:flex; flex-direction:column; gap:0; margin:6px 0 18px; }
.tstep{ display:flex; gap:12px; position:relative; padding-bottom:22px; }
.tstep:last-child{ padding-bottom:0; }
.tstep::before{
  content:''; position:absolute; left:13px; top:28px; bottom:0; width:2px; background:var(--line-strong);
}
.tstep:last-child::before{ display:none; }
.tstep.done::before{ background:var(--blue); }
.tstep-dot{
  width:28px; height:28px; border-radius:50%; background:#fff; border:2px solid var(--line-strong); color:var(--ink-faint);
  display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:800; flex:none; z-index:1;
}
.tstep-dot svg{ width:16px; height:16px; }
.tstep.done .tstep-dot{ background:var(--blue); border-color:var(--blue); color:#fff; }
.tstep.current .tstep-dot{ border-color:var(--blue); color:var(--blue); box-shadow:0 0 0 4px var(--accent-bg); }
.tstep-info{ padding-top:2px; }
.tstep-label{ font-size:13.5px; font-weight:700; color:var(--navy); }
.tstep.done .tstep-label, .tstep.current .tstep-label{ color:var(--navy); }
.tstep:not(.done):not(.current) .tstep-label{ color:var(--ink-faint); font-weight:600; }
.tstep-time{ font-size:11.3px; color:var(--ink-faint); }

.tracking-exception{
  display:flex; align-items:center; gap:8px; background:rgba(224,85,79,.1); border:1px solid rgba(224,85,79,.4);
  color:#a13530; font-size:13px; padding:12px 14px; border-radius:9px; margin-top:8px;
}
.tracking-exception svg{ width:20px; height:20px; flex:none; }

/* ---------- ETA / timer box ---------- */
.eta-box{ display:flex; flex-direction:column; gap:8px; background:var(--accent-bg); border:1px solid rgba(31,111,235,.3); border-radius:10px; padding:12px 14px; margin-bottom:14px; }
.eta-progress{ height:8px; border-radius:999px; background:#fff; overflow:hidden; border:1px solid rgba(31,111,235,.25); }
.eta-progress-fill{ height:100%; background:linear-gradient(90deg,var(--blue),var(--blue-2)); transition:width 1s linear; }
.eta-text{ font-size:12.8px; color:var(--navy); }
.eta-text span{ color:var(--ink-faint); font-weight:500; }

/* ---------- Map ---------- */
.tracking-map{ height:280px; border-radius:var(--radius); overflow:hidden; border:1px solid var(--line); background:var(--panel-2); }
.map-pin{
  width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:800; color:#fff; box-shadow:0 4px 10px rgba(0,0,0,.3); border:2px solid #fff;
}
.map-pin.origin{ background:var(--navy); }
.map-pin.dest{ background:#e0554f; }
.map-pin.truck{ background:var(--blue); width:34px; height:34px; }
.map-pin.truck svg{ width:19px; height:19px; }

/* ---------- Print OS ---------- */
.os-print-wrap{ max-width:760px; margin:0 auto; padding:30px 22px; }
.os-print-head{ display:flex; justify-content:space-between; align-items:flex-start; border-bottom:3px solid var(--navy); padding-bottom:16px; margin-bottom:20px; }
.os-print-head img{ height:46px; }
.os-print-head .os-title{ text-align:right; }
.os-print-head .os-title b{ display:block; font-family:'Barlow Condensed'; font-size:26px; color:var(--navy); }
.os-print-head .os-title span{ font-size:12px; color:var(--ink-faint); }
.os-print-section{ margin-bottom:18px; }
.os-print-section h4{ font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-faint); border-bottom:1px solid var(--line); padding-bottom:6px; margin-bottom:10px; }
.os-print-grid{ display:grid; grid-template-columns:1fr 1fr; gap:6px 24px; font-size:13.5px; }
.os-print-grid div b{ display:block; font-size:10.5px; text-transform:uppercase; color:var(--ink-faint); letter-spacing:.03em; }
.os-print-item{ background:var(--panel-2); border:1px solid var(--line); border-radius:8px; padding:12px 14px; font-size:13.5px; white-space:pre-line; }
.os-sign-row{ display:grid; grid-template-columns:1fr 1fr; gap:40px; margin-top:50px; }
.os-sign-line{ border-top:1px solid var(--ink); padding-top:8px; text-align:center; font-size:12px; color:var(--ink-soft); }
.os-print-toolbar{ text-align:center; margin-bottom:20px; }
@media print{
  .os-print-toolbar, header, .top-strip{ display:none !important; }
  body{ background:#fff !important; }
}
