/* ================================================================
   SMS LocalizaMeuCarro — UI moderna, mobile-first, web adaptativo
   ================================================================ */
:root{
  --bg:#0f172a; --bg-soft:#0b1224; --panel:#ffffff; --panel-2:#f8fafc;
  --ink:#0f172a; --ink-2:#334155; --ink-mute:#64748b;
  --line:#e2e8f0; --line-soft:#eef2f7;
  --brand:#0ea5e9; --brand-2:#0284c7; --brand-ink:#fff;
  --ok:#16a34a; --ok-soft:#dcfce7;
  --warn:#d97706; --warn-soft:#fef3c7;
  --err:#dc2626; --err-soft:#fee2e2;
  --info:#0369a1; --info-soft:#e0f2fe;
  --radius:14px; --radius-sm:10px;
  --shadow:0 6px 24px -10px rgba(15,23,42,.18), 0 2px 6px -2px rgba(15,23,42,.08);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font:15px/1.55 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  color:var(--ink); background:linear-gradient(180deg,#f1f5f9 0%, #e2e8f0 100%);
  min-height:100vh;
}
a{color:var(--brand-2); text-decoration:none}
a:hover{text-decoration:underline}
.container{max-width:1180px; margin:0 auto; padding:0 18px}

/* ============ TOPBAR ============ */
.topbar{
  position:sticky; top:0; z-index:50;
  background:linear-gradient(135deg,#0f172a,#1e293b);
  color:#e2e8f0; box-shadow:0 1px 0 rgba(255,255,255,.04);
}
.topbar-inner{display:flex; align-items:center; gap:18px; padding:12px 18px}
.brand{display:flex; align-items:center; gap:10px; color:#fff; text-decoration:none; font-weight:600}
.brand:hover{text-decoration:none}
.brand-mark{
  display:inline-grid; place-items:center; width:34px; height:34px; border-radius:10px;
  background:linear-gradient(135deg,#0ea5e9,#22d3ee); color:#fff; font-weight:800; font-size:13px;
  box-shadow:0 6px 18px -6px rgba(14,165,233,.7);
}
.brand-name{font-size:15px; letter-spacing:.2px}
.nav{display:flex; align-items:center; gap:6px; margin-left:auto; flex-wrap:wrap}
.nav a{
  color:#cbd5e1; padding:8px 12px; border-radius:8px; font-size:14px;
  transition:.15s ease;
}
.nav a:hover{background:rgba(255,255,255,.06); color:#fff; text-decoration:none}
.nav a.on{background:rgba(14,165,233,.18); color:#fff}
.nav-user{display:flex; align-items:center; gap:10px; margin-left:14px; padding-left:14px; border-left:1px solid rgba(255,255,255,.1)}
.nav-username{font-size:13px; color:#cbd5e1}
.role-chip{
  display:inline-block; padding:1px 8px; font-size:11px; font-weight:600;
  border-radius:999px; text-transform:uppercase; letter-spacing:.4px;
}
.role-admin{background:#7c3aed; color:#fff}
.role-usuario{background:#0ea5e9; color:#fff}
.role-final{background:#475569; color:#fff}
.btn-ghost{
  background:rgba(255,255,255,.08); color:#fff; padding:6px 12px; border-radius:8px; font-size:13px;
}
.btn-ghost:hover{background:rgba(255,255,255,.14); text-decoration:none}
.menu-toggle{
  display:none; background:transparent; border:0; cursor:pointer;
  width:38px; height:38px; padding:8px; margin-left:auto;
}
.menu-toggle span{display:block; height:2px; background:#fff; margin:4px 0; border-radius:2px}

/* ============ MAIN ============ */
main.container{padding-top:24px; padding-bottom:50px}

/* ============ CARDS / PANELS ============ */
.card{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:22px; margin-bottom:18px;
}
.card h2, .card h3{margin:0 0 14px 0; font-size:18px}
.card-h{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-bottom:14px; flex-wrap:wrap;
}
.card-h h2{margin:0}
.muted{color:var(--ink-mute)}
.h-row{display:flex; align-items:center; gap:10px; flex-wrap:wrap}

/* ============ FORM ============ */
.form-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px}
.field{display:flex; flex-direction:column; gap:6px; min-width:0}
.field.full{grid-column:1/-1}
.field label{font-size:13px; font-weight:600; color:var(--ink-2)}
.field .hint{font-size:12px; color:var(--ink-mute)}
.input, .select, .textarea{
  width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-sm);
  background:#fff; font:inherit; color:var(--ink); transition:.15s;
}
.input:focus, .select:focus, .textarea:focus{
  outline:none; border-color:var(--brand); box-shadow:0 0 0 3px rgba(14,165,233,.18);
}
.textarea{min-height:88px; resize:vertical; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px}
.input.mono{font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px}

/* ============ BUTTONS ============ */
.btn{
  display:inline-flex; align-items:center; gap:8px; justify-content:center;
  background:var(--brand); color:#fff; border:0; border-radius:10px;
  padding:10px 18px; font:inherit; font-weight:600; cursor:pointer;
  transition:.15s; text-decoration:none;
}
.btn:hover{background:var(--brand-2); text-decoration:none}
.btn[disabled]{opacity:.55; cursor:not-allowed}
.btn-sec{background:#334155}
.btn-sec:hover{background:#1e293b}
.btn-danger{background:var(--err)}
.btn-danger:hover{background:#991b1b}
.btn-ok{background:var(--ok)}
.btn-outline{background:transparent; color:var(--ink-2); border:1px solid var(--line)}
.btn-outline:hover{background:#fff; color:var(--ink)}
.btn-sm{padding:6px 12px; font-size:13px}
.btn-block{width:100%}
.actions{display:flex; gap:10px; flex-wrap:wrap; align-items:center}

/* ============ TABELA ============ */
.table-wrap{overflow-x:auto; border-radius:var(--radius-sm); border:1px solid var(--line)}
table.tb{width:100%; border-collapse:collapse; background:#fff}
table.tb th, table.tb td{padding:12px 14px; text-align:left; border-bottom:1px solid var(--line-soft); font-size:14px}
table.tb th{background:#f8fafc; color:var(--ink-2); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.4px}
table.tb tbody tr:hover{background:#f8fafc}
table.tb tbody tr:last-child td{border-bottom:0}
table.tb td.actions-cell{white-space:nowrap}

/* ============ ALERTS ============ */
.alert{padding:12px 16px; border-radius:var(--radius-sm); margin-bottom:14px; font-size:14px; border:1px solid transparent}
.alert-success{background:var(--ok-soft); color:#14532d; border-color:#86efac}
.alert-danger {background:var(--err-soft); color:#7f1d1d; border-color:#fca5a5}
.alert-warning{background:var(--warn-soft); color:#78350f; border-color:#fcd34d}
.alert-info   {background:var(--info-soft); color:#0c4a6e; border-color:#7dd3fc}

/* ============ BADGES ============ */
.badge{display:inline-block; padding:2px 10px; font-size:11px; font-weight:600; border-radius:999px; letter-spacing:.4px; text-transform:uppercase}
.badge.b-on{background:var(--ok-soft); color:#14532d}
.badge.b-off{background:var(--err-soft); color:#7f1d1d}
.badge.b-mute{background:#e2e8f0; color:#334155}
.badge.b-info{background:var(--info-soft); color:#0c4a6e}
.badge.b-warn{background:var(--warn-soft); color:#78350f}

/* ============ STAT CARDS ============ */
.stats{display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin-bottom:18px}
.stat{
  background:#fff; border:1px solid var(--line); border-radius:var(--radius);
  padding:18px; box-shadow:var(--shadow); position:relative; overflow:hidden;
}
.stat::before{content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--brand)}
.stat .lab{font-size:12px; color:var(--ink-mute); text-transform:uppercase; letter-spacing:.6px; font-weight:600}
.stat .val{font-size:30px; font-weight:700; color:var(--ink); margin-top:4px; line-height:1.1}
.stat .sub{font-size:12px; color:var(--ink-mute); margin-top:6px}

/* ============ PROGRESS BAR ============ */
.progress{
  width:100%; height:18px; background:#e2e8f0; border-radius:999px; overflow:hidden;
  box-shadow:inset 0 1px 3px rgba(0,0,0,.06);
}
.progress > .bar{
  height:100%;
  background:linear-gradient(90deg,#0ea5e9,#22d3ee,#10b981);
  background-size:200% 100%;
  width:0%; transition:width .35s ease;
  animation:shimmer 2s linear infinite;
}
@keyframes shimmer{0%{background-position:0% 0}100%{background-position:200% 0}}
.progress-meta{display:flex; justify-content:space-between; font-size:13px; color:var(--ink-mute); margin-top:8px}
.progress-meta b{color:var(--ink)}

/* ============ ENVIO ITEM ============ */
.send-list{display:flex; flex-direction:column; gap:8px}
.send-item{
  display:flex; align-items:center; gap:12px; padding:10px 14px;
  background:#fff; border:1px solid var(--line); border-radius:10px; font-size:13px;
}
.send-item .ord{
  width:28px; height:28px; flex:0 0 28px; border-radius:8px;
  background:#e2e8f0; color:#334155; display:grid; place-items:center; font-weight:700; font-size:12px;
}
.send-item .msg{flex:1 1 auto; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12.5px; color:var(--ink-2); word-break:break-all}
.send-item .st{min-width:90px; text-align:right}
.send-item.s-ok{background:#f0fdf4; border-color:#86efac}
.send-item.s-ok .ord{background:var(--ok); color:#fff}
.send-item.s-err{background:#fef2f2; border-color:#fca5a5}
.send-item.s-err .ord{background:var(--err); color:#fff}
.send-item.s-snd{background:#eff6ff; border-color:#93c5fd}
.send-item.s-snd .ord{background:var(--brand); color:#fff}
.send-item.s-op{background:#fffbeb; border-color:#fcd34d}
.send-item.s-op .ord{background:var(--warn); color:#fff}
.send-item .sub-info{margin-top:3px}

/* ============ LOGIN PAGE ============ */
.auth-wrap{
  min-height:100vh; display:grid; place-items:center; padding:24px;
  background:radial-gradient(ellipse at top,#1e293b 0%,#0f172a 60%);
}
.auth-card{
  width:100%; max-width:420px; background:#fff; border-radius:18px;
  padding:32px 28px; box-shadow:0 24px 48px -16px rgba(0,0,0,.4);
}
.auth-logo{display:flex; align-items:center; gap:12px; margin-bottom:20px}
.auth-logo .brand-mark{width:42px; height:42px; font-size:15px}
.auth-card h1{margin:0; font-size:22px}
.auth-card .sub{color:var(--ink-mute); font-size:13px; margin-bottom:20px}

/* ============ FOOTER ============ */
.footer{padding:22px 0; color:#64748b; text-align:center; font-size:12px}

/* ============ EMPTY STATE ============ */
.empty{padding:46px 22px; text-align:center; color:var(--ink-mute)}
.empty h3{margin:0 0 6px; color:var(--ink-2)}

/* ============ RESPONSIVE ============ */
@media (max-width: 880px){
  .menu-toggle{display:block; order:3}
  .brand-name{display:none}
  .nav{
    display:none; position:absolute; top:60px; left:0; right:0;
    background:#0f172a; flex-direction:column; align-items:stretch;
    padding:14px; gap:4px; border-top:1px solid rgba(255,255,255,.08);
  }
  .nav.open{display:flex}
  .nav-user{margin-left:0; padding-left:0; border:0; flex-direction:row; padding-top:10px; border-top:1px solid rgba(255,255,255,.08)}
}
@media (max-width: 560px){
  .card{padding:16px}
  .stat .val{font-size:24px}
  table.tb th, table.tb td{padding:10px 8px; font-size:13px}
}
