/* Infosoft RastreadorPro — padrão visual dos SaaS da casa (CSS local, sem CDN, CSP estrita). */
:root {
  --brand-50: #f4fbf5; --brand-100: #e5f6e8; --brand-500: #15803d; --brand-600: #166534; --brand-900: #14532d;
  --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1; --slate-400: #94a3b8;
  --slate-500: #64748b; --slate-600: #475569; --slate-700: #334155; --slate-800: #1e293b; --slate-900: #0f172a;
  --emerald-50: #ecfdf5; --emerald-200: #a7f3d0; --emerald-700: #047857; --emerald-800: #065f46;
  --red-50: #fef2f2; --red-200: #fecaca; --red-500: #ef4444; --red-600: #dc2626; --red-800: #991b1b;
  --amber-50: #fffbeb; --amber-200: #fde68a; --amber-800: #92400e;
  --blue-50: #eff6ff; --blue-200: #bfdbfe; --blue-800: #1e40af;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --ring: 0 0 0 1px var(--slate-200);
  --font: ui-sans-serif, system-ui, -apple-system, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 1rem; line-height: 1.5; color: var(--slate-800);
  background: var(--slate-50); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.75rem; line-height: 2.15rem; font-weight: 700; letter-spacing: -0.025em; color: var(--slate-900); margin: 0 0 .5rem; }
h2 { font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; color: var(--slate-900); margin: 0 0 .75rem; }
h3 { font-size: 1rem; line-height: 1.5rem; font-weight: 600; color: var(--slate-900); margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
code { word-break: break-all; font-size: .875em; background: var(--slate-100); padding: .1rem .35rem; border-radius: .25rem; }
:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }

/* Barra superior fixa */
.topbar { position: sticky; top: 0; z-index: 50; background: #fff; box-shadow: var(--shadow-sm); border-bottom: 1px solid var(--slate-200); }
.topbar-in { max-width: 80rem; margin: 0 auto; padding: 0 1rem; height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .4rem; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.03em; color: var(--brand-600); text-decoration: none; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav { display: none; align-items: center; gap: 1.25rem; white-space: nowrap; }
.nav > a, .navbtn {
  display: inline-flex; align-items: center; gap: .25rem; min-height: 2.75rem; padding: .375rem .25rem; border: 0; border-bottom: 2px solid transparent;
  background: none; font: inherit; font-size: .875rem; font-weight: 500; color: var(--slate-600); cursor: pointer; text-decoration: none;
}
.nav > a:hover, .navbtn:hover { color: var(--slate-900); border-bottom-color: var(--slate-300); text-decoration: none; }
.dd { position: relative; }
.dd-panel {
  position: absolute; right: 0; top: 100%; margin-top: .5rem; z-index: 60; min-width: 14rem; padding: .375rem;
  background: #fff; border-radius: .75rem; box-shadow: var(--shadow-lg), 0 0 0 1px rgb(15 23 42 / 0.08);
}
.dd-panel a, .dd-panel button {
  display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 2.75rem; padding: .5rem .75rem; border: 0; border-radius: .5rem;
  background: none; font: inherit; font-size: .875rem; font-weight: 500; color: var(--slate-700); text-align: left; cursor: pointer; text-decoration: none;
}
.dd-panel a:hover, .dd-panel button:hover { background: var(--slate-50); color: var(--brand-600); text-decoration: none; }
.dd-panel .danger { color: var(--red-600); }
.dd-who { padding: .5rem .75rem .25rem; font-size: .75rem; color: var(--slate-500); word-break: break-all; }
.acctbtn {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem; padding: .375rem .75rem; border-radius: .5rem; border: 1px solid var(--slate-200);
  background: #fff; font: inherit; font-size: .8125rem; font-weight: 600; color: var(--slate-700); cursor: pointer; max-width: 14rem;
}
.acctbtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.burger { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: .5rem; border: 0; border-radius: .5rem; background: none; color: var(--slate-700); cursor: pointer; font-size: 1.25rem; }
.drawer {
  position: absolute; top: 4rem; left: 0; width: 100%; background: #fff; padding: .5rem 1rem 1rem;
  box-shadow: var(--shadow-lg); border-top: 1px solid var(--slate-200); z-index: 60;
}
.drawer a, .drawer button { display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 2.75rem; padding: .625rem .5rem; border: 0; border-radius: .5rem; background: none; font: inherit; font-size: 1rem; font-weight: 500; color: var(--slate-700); text-align: left; text-decoration: none; cursor: pointer; }
.drawer hr { border: 0; border-top: 1px solid var(--slate-200); margin: .5rem 0; }
.drawer .danger { color: var(--red-600); }

/* Conteúdo */
.container { flex: 1; width: 100%; max-width: 80rem; margin: 0 auto; padding: 1.5rem 1rem 5.5rem; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 2.5rem 1rem 4rem; }
.auth-brand { display: flex; justify-content: center; font-size: 1.875rem; font-weight: 700; letter-spacing: -0.03em; color: var(--brand-600); margin-bottom: .5rem; }
.auth-title { text-align: center; font-size: 1.375rem; margin: 0 0 1.5rem; }
.narrow { width: 100%; max-width: 28rem; margin-left: auto; margin-right: auto; }
.card { background: #fff; box-shadow: var(--ring), var(--shadow-sm); border-radius: .5rem; padding: 1.25rem; margin-bottom: 1.25rem; }
.auth-card { padding: 2rem 1.5rem; box-shadow: var(--ring), var(--shadow); }
.auth-card .btn { width: 100%; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.muted { color: var(--slate-500); }
.small { font-size: .875rem; }

/* Formulários (alvos mobile >= 44px e fonte >= 16px) */
label { display: block; margin-bottom: 1rem; font-size: .875rem; font-weight: 500; color: var(--slate-900); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], textarea, select {
  display: block; width: 100%; margin-top: .375rem; padding: .5rem .75rem; border: 0; border-radius: .375rem; background: #fff; color: var(--slate-900);
  font: inherit; font-size: 1rem; line-height: 1.5rem; min-height: 2.75rem; box-shadow: inset 0 0 0 1px var(--slate-300), var(--shadow-sm);
}
textarea { min-height: 5.5rem; }
input:focus, textarea:focus, select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand-600); }
input[type=checkbox] { width: 1.125rem; height: 1.125rem; margin-right: .5rem; accent-color: var(--brand-600); vertical-align: middle; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.75rem; padding: .5rem 1rem; border: 0; border-radius: .375rem;
  background: var(--brand-600); color: #fff; font: inherit; font-size: .9375rem; font-weight: 600; box-shadow: var(--shadow-sm); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-500); color: #fff; text-decoration: none; }
.btn-light { background: #fff; color: var(--slate-700); box-shadow: inset 0 0 0 1px var(--slate-300); }
.btn-light:hover { background: var(--slate-50); color: var(--slate-900); }
.btn-danger { background: var(--red-600); }
.btn-danger:hover { background: var(--red-500); }
.btn-sm { min-height: 2.75rem; padding: .375rem .75rem; font-size: .875rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.inline-form { display: inline; margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.quick-add { display: grid; grid-template-columns: 1fr; gap: .75rem; align-items: end; }
.quick-add label { margin-bottom: 0; }

/* Alertas */
.alert { padding: .875rem 1rem; border-radius: .375rem; margin-bottom: 1.25rem; font-size: .9375rem; font-weight: 500; }
.alert-ok { background: var(--emerald-50); color: var(--emerald-800); box-shadow: inset 0 0 0 1px var(--emerald-200); }
.alert-err { background: var(--red-50); color: var(--red-800); box-shadow: inset 0 0 0 1px var(--red-200); }

/* Abas e Badges */
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.tab {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem; padding: .375rem .75rem; border-radius: .375rem;
  background: #fff; color: var(--slate-700); font-size: .875rem; font-weight: 500; box-shadow: inset 0 0 0 1px var(--slate-200); text-decoration: none;
}
.tab:hover { background: var(--slate-100); text-decoration: none; }
.tab.active { background: var(--brand-600); color: #fff; box-shadow: none; }
.badge {
  display: inline-flex; align-items: center; padding: .15rem .55rem; border-radius: 9999px; font-size: .75rem; font-weight: 600;
  background: var(--slate-100); color: var(--slate-700);
}
.badge-ok { background: var(--emerald-50); color: var(--emerald-800); box-shadow: inset 0 0 0 1px var(--emerald-200); }
.badge-go { background: var(--brand-100); color: var(--brand-900); box-shadow: inset 0 0 0 1px var(--emerald-200); }
.badge-warn { background: var(--amber-50); color: var(--amber-800); box-shadow: inset 0 0 0 1px var(--amber-200); }
.badge-err { background: var(--red-50); color: var(--red-800); box-shadow: inset 0 0 0 1px var(--red-200); }
.badge-info { background: var(--blue-50); color: var(--blue-800); box-shadow: inset 0 0 0 1px var(--blue-200); }
.badge-muted { background: var(--slate-100); color: var(--slate-600); }

/* Lista de encomendas e timeline */
.ship-item { display: flex; flex-direction: column; gap: .75rem; padding: 1rem; background: #fff; border-radius: .5rem; box-shadow: var(--ring), var(--shadow-sm); margin-bottom: .75rem; }
.ship-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.ship-code { font-family: ui-monospace, monospace; font-weight: 700; font-size: 1rem; color: var(--slate-900); }
.progress-track { width: 100%; height: .45rem; background: var(--slate-100); border-radius: 9999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand-600); border-radius: 9999px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.25rem; border-left: 2px solid var(--slate-200); }
.timeline li { position: relative; padding: 0 0 1.25rem 1rem; }
.timeline li::before { content: ""; position: absolute; left: -1.625rem; top: .25rem; width: .625rem; height: .625rem; border-radius: 9999px; background: var(--brand-600); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--slate-300); }
.timeline li:last-child { padding-bottom: 0; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { text-align: left; padding: .625rem .5rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; color: var(--slate-500); border-bottom: 1px solid var(--slate-200); }
td { text-align: left; padding: .625rem .5rem; border-bottom: 1px solid var(--slate-200); vertical-align: middle; }

/* Barra inferior mobile */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: flex; justify-content: space-around; align-items: center;
  background: #fff; border-top: 1px solid var(--slate-200); height: 3.75rem;
}
.bottom-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 4rem; min-height: 2.75rem; font-size: .75rem; font-weight: 600; color: var(--slate-600); text-decoration: none; }
.bottom-bar a:hover { color: var(--brand-600); }

/* Utilitários sem estilo inline (CSP style-src 'self') */
.m-0 { margin: 0; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .75rem; }
.mt-3 { margin-top: 1rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .75rem; }
.mb-3 { margin-bottom: 1rem; }
.my-3 { margin: 1rem 0; }
.ml-2 { margin-left: .5rem; }
.p-compact { padding: .875rem 1rem; }
.flex-1 { flex: 1; }
.min-w-240 { min-width: 240px; }
.between { justify-content: space-between; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.err-text { color: var(--red-600); }
.narrow-lg { max-width: 52rem; }
.row-check { display: flex; align-items: center; gap: .5rem; }
.sep { border: 0; border-top: 1px solid var(--slate-200); margin: 1.25rem 0; }
.summary-link { cursor: pointer; font-weight: 600; color: var(--brand-600); }
.select-inline { width: auto; min-height: 2.75rem; margin: 0; }
.bkp-list { padding-left: 1.25rem; margin: 0; }
.bkp-list li { margin-bottom: .5rem; }
.ev-desc { margin: .25rem 0; }
.pct-10 { width: 10%; }
.pct-25 { width: 25%; }
.pct-50 { width: 50%; }
.pct-62 { width: 62%; }
.pct-75 { width: 75%; }
.pct-85 { width: 85%; }
.pct-100 { width: 100%; }

@media (min-width: 768px) {
  .nav { display: flex; }
  .mobile-only, .bottom-bar { display: none; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .quick-add { grid-template-columns: 2fr 2fr 1.5fr auto; }
  .container { padding-bottom: 2.5rem; }
}
