/* =========================================================================
   Atende Log — tema visual
   ========================================================================= */
:root {
  --al-primary: #0e7490;
  --al-primary-2: #155e75;
  --al-accent: #14b8a6;
  --al-grad: linear-gradient(135deg, #0e7490 0%, #155e75 100%);
  --al-bg: #f4f6fb;
  --al-surface: #ffffff;
  --al-surface-2: #f8f9fd;
  --al-border: #e6e8f0;
  --al-text: #0f172a;
  --al-muted: #64748b;
  --al-sidebar: #0b1220;
  --al-sidebar-2: #0f172a;
  --al-radius: 16px;
  --al-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --al-shadow-lg: 0 20px 50px -20px rgba(14, 116, 144, .35);
  /* botões: cores sólidas e sóbrias */
  --al-btn: #1f2937;
  --al-btn-hover: #111827;
  --al-btn-text: #ffffff;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-primary: #0e7490;
  --bs-primary-rgb: 14, 116, 144;
  --bs-link-color: #0e7490;
  --bs-link-hover-color: #155e75;
  --bs-border-radius: 10px;
}
[data-bs-theme="dark"] {
  --al-bg: #0a0e1a;
  --al-surface: #111729;
  --al-surface-2: #0e1424;
  --al-border: #1f2942;
  --al-text: #e2e8f0;
  --al-muted: #8b98b4;
  --al-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --bs-body-bg: #0a0e1a;
  --bs-body-color: #e2e8f0;
  --bs-border-color: #1f2942;
  --bs-link-color: #67c6d9;
  --al-btn: #e5e7eb;
  --al-btn-hover: #ffffff;
  --al-btn-text: #0f172a;
}

html, body { background: var(--al-bg); color: var(--al-text); }
body { font-feature-settings: "cv02", "cv03", "cv04", "cv11"; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
.text-muted, .muted { color: var(--al-muted) !important; }
.mono { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace; font-size: .85em; }
.fw-800 { font-weight: 800; }
.small-caps { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--al-muted); }

/* ---------------------------------------------------------------- shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 264px; flex-shrink: 0; position: fixed; inset: 0 auto 0 0; z-index: 1040;
  background: radial-gradient(120% 60% at 0% 0%, #12303a 0%, transparent 60%), linear-gradient(180deg, var(--al-sidebar), var(--al-sidebar-2));
  color: #cbd5e1; display: flex; flex-direction: column; padding: 20px 14px;
  border-right: 1px solid rgba(255, 255, 255, .04); transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 1.3rem;
  background: var(--al-grad); box-shadow: 0 8px 20px -6px rgba(14, 116, 144, .5);
}
.brand-name { font-weight: 800; font-size: 1.15rem; color: #fff; letter-spacing: -.02em; }
.brand-name span { color: #67c6d9; }
.brand-sub { font-size: .72rem; color: #64748b; }
.nav-section { flex: 1; overflow-y: auto; }
.nav-label { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: #475569; font-weight: 700; padding: 16px 12px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: 10px;
  color: #94a3b8; font-weight: 500; font-size: .92rem; transition: all .15s ease; position: relative;
}
.nav-item i { font-size: 1.1rem; width: 20px; text-align: center; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(14, 116, 144, .35), rgba(14, 116, 144, .10)); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--al-grad); }
.nav-item .ro-tag { margin-left: auto; font-size: .6rem; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.08); color: #94a3b8; }
.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, .06); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
  background: var(--al-grad); color: #fff; flex-shrink: 0;
}
.sidebar-footer .who { line-height: 1.2; overflow: hidden; }
.sidebar-footer .who b { color: #e2e8f0; font-size: .86rem; display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.sidebar-footer .who small { color: #64748b; font-size: .72rem; }

.main { flex: 1; margin-left: 264px; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 16px; padding: 14px 28px;
  background: color-mix(in srgb, var(--al-bg) 82%, transparent); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--al-border);
}
.page-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.page-sub { color: var(--al-muted); font-size: .85rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.content { padding: 26px 28px 60px; max-width: 1600px; width: 100%; }

.tenant-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: .86rem;
  background: var(--al-surface); border: 1px solid var(--al-border); color: var(--al-text); box-shadow: var(--al-shadow);
}
.tenant-pill .swatch { width: 10px; height: 10px; border-radius: 50%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--al-border);
  background: var(--al-surface); color: var(--al-text); box-shadow: var(--al-shadow); transition: transform .15s;
}
.icon-btn:hover { transform: translateY(-1px); color: var(--al-primary); }
.sidebar-toggle { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .5); z-index: 1035; }
  .main { margin-left: 0; }
  .sidebar-toggle { display: grid; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .tenant-pill .tname { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------------------------------------------------------------- cards */
.card, .al-card {
  background: var(--al-surface); border: 1px solid var(--al-border); border-radius: var(--al-radius); box-shadow: var(--al-shadow);
  --bs-card-bg: var(--al-surface); --bs-card-border-color: var(--al-border);
}
.card-header { background: transparent; border-bottom: 1px solid var(--al-border); padding: 16px 20px; font-weight: 700; }
.card-body { padding: 20px; }
.card-title-sm { font-weight: 700; font-size: 1rem; margin: 0; display: flex; align-items: center; gap: 8px; }

.kpi { position: relative; overflow: hidden; padding: 18px 20px; height: 100%; }
.kpi .kpi-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; margin-bottom: 14px;
}
.kpi .kpi-label { color: var(--al-muted); font-size: .8rem; font-weight: 600; }
.kpi .kpi-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.kpi .kpi-foot { font-size: .78rem; color: var(--al-muted); margin-top: 4px; }
.kpi::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; opacity: .07; background: currentColor; }
.kpi-link { color: inherit; display: block; height: 100%; transition: transform .15s; }
.kpi-link:hover { transform: translateY(-2px); }

.tone-primary { --tone: #0e7490; --tone-bg: rgba(14, 116, 144, .12); }
.tone-violet { --tone: #2563eb; --tone-bg: rgba(37, 99, 235, .12); }
.tone-info { --tone: #0ea5e9; --tone-bg: rgba(14, 165, 233, .13); }
.tone-success { --tone: #10b981; --tone-bg: rgba(16, 185, 129, .13); }
.tone-warning { --tone: #f59e0b; --tone-bg: rgba(245, 158, 11, .15); }
.tone-danger { --tone: #ef4444; --tone-bg: rgba(239, 68, 68, .13); }
.tone-secondary { --tone: #64748b; --tone-bg: rgba(100, 116, 139, .14); }
.tone-dark { --tone: #334155; --tone-bg: rgba(51, 65, 85, .14); }
[data-bs-theme="dark"] .tone-dark { --tone: #94a3b8; }
.kpi .kpi-icon { color: var(--tone); background: var(--tone-bg); }
.kpi { color: var(--al-text); }
.kpi::after { background: var(--tone); }

.badge-soft {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600;
  color: var(--tone); background: var(--tone-bg); white-space: nowrap;
}
.badge-soft .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------------------------------------------------------------- buttons */
.btn { font-weight: 600; font-size: .875rem; line-height: 1.3; border-radius: 9px; padding: .5rem .95rem; display: inline-flex; align-items: center; gap: .4rem; justify-content: center; }
.btn > .bi { font-size: 1em; }
.btn-sm { padding: .32rem .65rem; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: .62rem 1.15rem; font-size: .95rem; border-radius: 10px; }
.btn-primary { background: var(--al-btn); border: 1px solid var(--al-btn); color: var(--al-btn-text); box-shadow: none; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--al-btn-hover) !important; border-color: var(--al-btn-hover) !important; color: var(--al-btn-text) !important; }
.btn-primary:disabled { background: var(--al-btn); border-color: var(--al-btn); color: var(--al-btn-text); opacity: .45; }
.btn-soft { background: var(--al-surface-2); border: 1px solid var(--al-border); color: var(--al-text); }
.btn-soft:hover { border-color: var(--al-muted); color: var(--al-text); background: var(--al-surface); }
.btn-success { background: #15803d; border: 1px solid #15803d; color: #fff; }
.btn-success:hover, .btn-success:focus { background: #166534; border-color: #166534; color: #fff; }
.btn-danger { background: #b91c1c; border: 1px solid #b91c1c; color: #fff; }
.btn-danger:hover, .btn-danger:focus { background: #991b1b; border-color: #991b1b; color: #fff; }
.btn-warning { background: #d97706; border: 1px solid #d97706; color: #fff; }
.btn-warning:hover, .btn-warning:focus { background: #b45309; border-color: #b45309; color: #fff; }
.btn-ghost { background: transparent; border: 0; color: var(--al-muted); }
.btn-ghost:hover { color: var(--al-text); background: rgba(127, 127, 127, .12); }

/* ---------------------------------------------------------------- forms */
.form-control, .form-select {
  border-radius: 10px; border-color: var(--al-border); background-color: var(--al-surface); padding: .5rem .85rem; font-size: .9rem; min-height: 40px;
}
.form-control:focus, .form-select:focus { border-color: var(--al-primary); box-shadow: 0 0 0 4px rgba(14, 116, 144, .15); }
.form-label { font-weight: 600; font-size: .82rem; color: var(--al-muted); margin-bottom: .35rem; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--al-muted); pointer-events: none; }
.input-icon > .form-control { padding-left: 2.3rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filter-bar > * { flex: 1 1 160px; }
.filter-bar > .fb-actions { flex: 0 0 auto; display: flex; gap: 8px; }

/* ---------------------------------------------------------------- tables */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: rgba(14, 116, 144, .04); margin: 0; font-size: .9rem; }
.table > thead th {
  font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--al-muted); font-weight: 700;
  background: var(--al-surface-2); border-bottom: 1px solid var(--al-border); padding: 12px 14px; white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.table > tbody td { padding: 12px 14px; vertical-align: middle; border-color: var(--al-border); }
.table-wrap { overflow: auto; border-radius: 0 0 var(--al-radius) var(--al-radius); }
.table-wrap.tall { max-height: 640px; }
.row-link { cursor: pointer; }
.cell-title { font-weight: 600; }
.cell-sub { font-size: .78rem; color: var(--al-muted); }

/* ---------------------------------------------------------------- tabs / chips */
.chip-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-tabs a {
  padding: 7px 14px; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--al-muted);
  background: var(--al-surface); border: 1px solid var(--al-border); display: inline-flex; gap: 8px; align-items: center;
}
.chip-tabs a.active { color: var(--al-btn-text); background: var(--al-btn); border-color: var(--al-btn); }
.chip-tabs a:not(.active):hover { color: var(--al-text); border-color: var(--al-muted); }
.chip-tabs a .count { font-size: .72rem; background: rgba(0, 0, 0, .08); padding: 0 7px; border-radius: 999px; }
.chip-tabs a.active .count { background: rgba(127, 127, 127, .25); }

/* ---------------------------------------------------------------- empty state */
.empty { text-align: center; padding: 50px 20px; color: var(--al-muted); }
.empty .empty-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 16px; font-size: 2rem; color: var(--al-primary); background: rgba(14, 116, 144, .1); }
.empty h5 { color: var(--al-text); font-weight: 700; }

/* ---------------------------------------------------------------- alerts / toast */
.alert { border-radius: 12px; border: 0; display: flex; gap: 10px; align-items: flex-start; box-shadow: var(--al-shadow); }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.al-toast {
  min-width: 280px; max-width: 420px; padding: 14px 16px; border-radius: 14px; color: #fff; font-weight: 500; font-size: .9rem;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .35); animation: toastIn .3s ease; display: flex; gap: 10px; align-items: center;
}
.al-toast.success { background: linear-gradient(135deg, #10b981, #059669); }
.al-toast.danger { background: linear-gradient(135deg, #f43f5e, #be123c); }
.al-toast.info { background: var(--al-grad); }
.al-toast.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- login */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(80% 60% at 20% 10%, rgba(14, 116, 144, .40), transparent 60%),
              radial-gradient(70% 60% at 90% 90%, rgba(20, 184, 166, .35), transparent 60%),
              linear-gradient(140deg, #0b1020, #0f2a33 60%, #134e4a);
}
.auth-hero h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; max-width: 520px; }
.auth-hero p { color: #cbd5e1; max-width: 460px; font-size: 1.05rem; }
.auth-hero .grid-lines { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.auth-feature { display: flex; gap: 12px; align-items: center; color: #e2e8f0; font-weight: 500; margin-bottom: 12px; }
.auth-feature i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--al-bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .form-control { padding: .8rem 1rem .8rem 2.6rem; border-radius: 12px; }
.auth-card .input-icon > i { left: 14px; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { display: none; } }

.tenant-card { display: flex; align-items: center; gap: 14px; padding: 18px; width: 100%; text-align: left; border: 1px solid var(--al-border); border-radius: 14px; background: var(--al-surface); transition: all .15s; color: var(--al-text); }
.tenant-card:hover { border-color: var(--al-primary); transform: translateY(-2px); box-shadow: var(--al-shadow-lg); }
.tenant-card .tc-logo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; }

/* ---------------------------------------------------------------- import */
.dropzone {
  border: 2px dashed color-mix(in srgb, var(--al-primary) 45%, var(--al-border)); border-radius: 20px; padding: 48px 24px; text-align: center;
  background: radial-gradient(60% 80% at 50% 0%, rgba(14, 116, 144, .08), transparent 70%), var(--al-surface); transition: all .2s;
}
.dropzone.drag { border-color: var(--al-primary); background-color: rgba(14, 116, 144, .06); transform: scale(1.005); }
.dropzone .dz-icon { width: 84px; height: 84px; border-radius: 24px; margin: 0 auto 18px; display: grid; place-items: center; font-size: 2.3rem; color: #fff; background: var(--al-grad); box-shadow: var(--al-shadow-lg); }
.progress-xl { height: 18px; border-radius: 999px; background: var(--al-surface-2); border: 1px solid var(--al-border); overflow: hidden; }
.progress-xl .bar { height: 100%; width: 0; background: var(--al-grad); border-radius: 999px; transition: width .3s ease; position: relative; overflow: hidden; }
.progress-xl .bar.running::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.counter { text-align: center; padding: 14px; border-radius: 14px; background: var(--tone-bg); color: var(--tone); }
.counter b { display: block; font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.counter span { font-size: .78rem; font-weight: 600; }
.log-list { max-height: 380px; overflow: auto; font-size: .84rem; }
.log-list .log-row { display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--al-border); }
.log-list .log-row i { font-size: 1rem; }

/* ---------------------------------------------------------------- route builder */
.builder { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1199.98px) { .builder { grid-template-columns: 1fr; } }
.builder-panel { position: sticky; top: 86px; }
.city-group { border: 1px solid var(--al-border); border-radius: 14px; margin-bottom: 12px; background: var(--al-surface); overflow: hidden; }
.city-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--al-surface-2); cursor: pointer; user-select: none; }
.city-head .city-name { font-weight: 700; }
.city-head .city-meta { margin-left: auto; font-size: .78rem; color: var(--al-muted); display: flex; gap: 12px; }
.city-group.collapsed .city-body { display: none; }
.nf-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--al-border); cursor: pointer; transition: background .12s; }
.nf-item:hover { background: rgba(14, 116, 144, .04); }
.nf-item.sel { background: rgba(14, 116, 144, .09); box-shadow: inset 3px 0 0 var(--al-primary); }
.nf-item .nf-dest { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-item .nf-sub { font-size: .76rem; color: var(--al-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-item .nf-nums { text-align: right; font-size: .78rem; color: var(--al-muted); line-height: 1.35; }
.nf-item .nf-nums b { color: var(--al-text); font-size: .86rem; }
.form-check-input { width: 1.15em; height: 1.15em; cursor: pointer; }
.form-check-input:checked { background-color: var(--al-primary); border-color: var(--al-primary); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { padding: 10px; border-radius: 12px; background: var(--al-surface-2); border: 1px solid var(--al-border); text-align: center; }
.stat b { display: block; font-size: 1.05rem; font-weight: 800; }
.stat span { font-size: .7rem; color: var(--al-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cap-bar { height: 10px; border-radius: 999px; background: var(--al-surface-2); overflow: hidden; border: 1px solid var(--al-border); }
.cap-bar > div { height: 100%; background: linear-gradient(90deg, #10b981, #14b8a6); transition: width .25s, background .25s; }
.cap-bar.warn > div { background: linear-gradient(90deg, #f59e0b, #f97316); }
.cap-bar.over > div { background: linear-gradient(90deg, #ef4444, #dc2626); }
.stops { max-height: 330px; overflow: auto; }
.stop { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--al-border); margin-bottom: 6px; background: var(--al-surface); font-size: .85rem; }
.stop .handle { cursor: grab; color: var(--al-muted); }
.stop .n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .72rem; color: #fff; background: var(--al-grad); flex-shrink: 0; }
.stop .info { min-width: 0; flex: 1; }
.stop .info div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop.sortable-ghost { opacity: .4; }

/* ---------------------------------------------------------------- route detail */
.timeline-steps { display: flex; gap: 0; }
.timeline-steps .step { flex: 1; text-align: center; position: relative; font-size: .78rem; font-weight: 600; color: var(--al-muted); }
.timeline-steps .step .dot { width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center; background: var(--al-surface-2); border: 2px solid var(--al-border); position: relative; z-index: 1; }
.timeline-steps .step::before { content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 2px; background: var(--al-border); }
.timeline-steps .step:first-child::before { display: none; }
.timeline-steps .step.done { color: var(--al-text); }
.timeline-steps .step.done .dot { background: var(--al-grad); border-color: transparent; color: #fff; }
.timeline-steps .step.done::before { background: var(--al-primary); }
.progress-thin { height: 8px; border-radius: 999px; background: var(--al-surface-2); overflow: hidden; }
.progress-thin > div { height: 100%; background: var(--al-grad); border-radius: 999px; }
.ordem { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: .8rem; background: rgba(14, 116, 144, .1); color: var(--al-primary); }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.dl-grid dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--al-muted); font-weight: 700; }
.dl-grid dd { margin: 2px 0 0; font-weight: 600; }

/* ---------------------------------------------------------------- report hub */
.report-tile { display: block; padding: 22px; border-radius: var(--al-radius); background: var(--al-surface); border: 1px solid var(--al-border); box-shadow: var(--al-shadow); color: var(--al-text); transition: all .18s; height: 100%; }
.report-tile:hover { transform: translateY(-3px); border-color: var(--al-primary); box-shadow: var(--al-shadow-lg); color: var(--al-text); }
.report-tile .rt-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; color: #fff; background: var(--al-grad); margin-bottom: 14px; }
.insight { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(135deg, rgba(14, 116, 144, .08), rgba(14,116,144,.03)); margin-bottom: 8px; font-size: .9rem; }
.insight i { color: var(--al-primary-2); font-size: 1.1rem; }
.chart-box { position: relative; height: 290px; }

/* ---------------------------------------------------------------- perms matrix */
.perm-matrix td, .perm-matrix th { text-align: center; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; }
.btn-check + .btn-perm { border: 1px solid var(--al-border); background: var(--al-surface); color: var(--al-muted); font-size: .78rem; padding: .25rem .7rem; }
.btn-check:checked + .btn-perm { background: var(--al-btn); color: var(--al-btn-text); border-color: var(--al-btn); }
.btn-check:checked + .btn-perm.none { background: var(--al-surface-2); color: var(--al-text); border-color: var(--al-muted); }

/* ---------------------------------------------------------------- misc */
.dropdown-menu { border-radius: 14px; border-color: var(--al-border); box-shadow: 0 20px 50px -20px rgba(15, 23, 42, .35); padding: 6px; background: var(--al-surface); }
.dropdown-item { border-radius: 8px; padding: 8px 12px; font-size: .9rem; display: flex; gap: 10px; align-items: center; }
.modal-content { border-radius: 20px; border-color: var(--al-border); background: var(--al-surface); }
.modal-header, .modal-footer { border-color: var(--al-border); }
.pagination { --bs-pagination-border-radius: 10px; --bs-pagination-active-bg: var(--al-primary); --bs-pagination-active-border-color: var(--al-primary); margin: 0; }
.page-link { color: var(--al-text); background: var(--al-surface); border-color: var(--al-border); }
.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- print (romaneio/recibo) */
.print-sheet { background: #fff; color: #111; max-width: 960px; margin: 24px auto; padding: 40px; border-radius: 16px; box-shadow: var(--al-shadow); }
.print-sheet table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.print-sheet th, .print-sheet td { border-bottom: 1px solid #ddd; padding: 8px 6px; text-align: left; }
.print-sheet .sign { margin-top: 60px; display: flex; gap: 60px; }
.print-sheet .sign div { flex: 1; border-top: 1px solid #333; text-align: center; padding-top: 6px; font-size: .85rem; }
@media print {
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .print-sheet { box-shadow: none; margin: 0; padding: 0; max-width: none; }
}

/* ---------------------------------------------------------------- abas (detalhe da NF) */
.nf-tabs { border-bottom: 1px solid var(--al-border); flex-wrap: nowrap; overflow-x: auto; gap: 0; }
.nf-tabs .nav-link { color: var(--al-muted); font-weight: 600; font-size: .9rem; white-space: nowrap; padding: .65rem .1rem; margin-right: 1.4rem; }
.nf-tabs .nav-link:hover { color: var(--al-text); }
.nf-tabs .nav-link.active { color: var(--al-text); border-bottom-color: var(--al-text); }

/* ---------------------------------------------------------------- montador: foco no endereço */
.bairro-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--al-border); background: color-mix(in srgb, var(--al-surface-2) 60%, var(--al-surface)); font-size: .82rem; cursor: pointer; user-select: none; }
.bairro-head .text-muted { margin-left: auto; }
.nf-item .nf-addr { font-weight: 700; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-item .nf-compl { font-weight: 500; color: var(--al-muted); }
.nf-item .nf-loc { font-size: .82rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-item .nf-loc .cep { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-weight: 700; font-size: .78rem; padding: 1px 7px; margin-right: 8px; border-radius: 6px; background: var(--al-surface-2); border: 1px solid var(--al-border); }
.nf-item .nf-cli { font-size: .76rem; color: var(--al-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-item { padding-left: 28px; }

/* ---------------------------------------------------------------- breadcrumb */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .78rem; color: var(--al-muted); margin-bottom: 2px; }
.crumbs a { color: var(--al-muted); font-weight: 500; }
.crumbs a:hover { color: var(--al-text); text-decoration: underline; }
.crumbs i { font-size: .65rem; opacity: .7; }
.crumbs span { color: var(--al-text); font-weight: 600; }
.back-btn { flex-shrink: 0; }
.lock-note { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--al-muted); margin-top: 6px; }
select:disabled.locked { background-color: var(--al-surface-2); color: var(--al-text); opacity: 1; cursor: not-allowed; }
.veic-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--al-surface-2); border: 1px solid var(--al-border); font-size: .84rem; min-width: 0; }
.veic-link i { color: var(--al-primary); }
.veic-link.sem { color: var(--al-muted); border-style: dashed; }
.veic-link.sem i { color: var(--al-muted); }
.grab { cursor: grab; }
.pager { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--al-border); }
.pager .pagination { margin-left: auto; }
.pager .form-select { width: auto; }
.page-item.active .page-link { background: var(--al-btn); border-color: var(--al-btn); color: var(--al-btn-text); }

/* ---------------------------------------------------------------- montador: rolagem própria */
/* A lista de NFs e o painel da rota têm rolagem independente; a página não cresce com milhares de NFs. */
.nf-scroll { max-height: calc(100vh - 290px); min-height: 320px; overflow-y: auto; overscroll-behavior: contain;
  padding-right: 6px; border-radius: 14px; scrollbar-gutter: stable; }
.builder-panel { max-height: calc(100vh - 104px); overflow-y: auto; overscroll-behavior: contain; border-radius: var(--al-radius); }
.builder-panel .stops { max-height: none; }
.nf-scroll::-webkit-scrollbar, .builder-panel::-webkit-scrollbar { width: 8px; }
.nf-scroll::-webkit-scrollbar-thumb, .builder-panel::-webkit-scrollbar-thumb { background: var(--al-border); border-radius: 8px; }
.nf-scroll::-webkit-scrollbar-thumb:hover, .builder-panel::-webkit-scrollbar-thumb:hover { background: var(--al-muted); }
@media (max-width: 1199.98px) {
  .nf-scroll { max-height: 60vh; }
  .builder-panel { position: static; max-height: none; overflow: visible; }
}
.nf-pager { margin-top: 10px; background: var(--al-surface); border: 1px solid var(--al-border); border-radius: 14px; }
.nf-scroll { max-height: calc(100vh - 340px); }

/* seletor "por página": largura suficiente para 3 dígitos + seta */
.pp-select { width: auto !important; min-width: 84px; padding: .3rem 2rem .3rem .7rem !important; }
/* montador: lista de NFs um pouco maior */
.builder { grid-template-columns: minmax(0, 1.6fr) minmax(340px, 1fr); }
.nf-scroll { max-height: calc(100vh - 280px); min-height: 420px; }
#btnCriar { padding: .6rem 1rem; }

/* =========================================================================
   Nova rota — assistente em 3 passos
   ========================================================================= */
.wiz { padding-bottom: 96px; }
.wiz-steps { list-style: none; padding: 0; margin: 0 0 22px; display: flex; gap: 10px; counter-reset: s; }
.wiz-step { flex: 1; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; cursor: pointer;
  background: var(--al-surface); border: 1px solid var(--al-border); color: var(--al-muted); transition: all .15s; min-width: 0; }
.wiz-step:hover { border-color: var(--al-muted); }
.wiz-step .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem;
  background: var(--al-surface-2); border: 1px solid var(--al-border); flex-shrink: 0; }
.wiz-step .lbl { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.wiz-step .lbl b { color: var(--al-text); font-size: .9rem; }
.wiz-step .lbl small { font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wiz-step.active { border-color: var(--al-primary); box-shadow: 0 0 0 3px rgba(14, 116, 144, .12); }
.wiz-step.active .num { background: var(--al-primary); border-color: var(--al-primary); color: #fff; }
.wiz-step.done .num { background: var(--al-btn); border-color: var(--al-btn); color: var(--al-btn-text); font-size: 0; }
.wiz-step.done .num::before { content: "\F26E"; font-family: "bootstrap-icons"; font-size: 1rem; }
.wiz-step.done .lbl small { color: var(--al-text); }

.wiz-pane { display: none; animation: fadeIn .25s ease; }
.wiz-pane.active { display: block; }
.wiz-head { margin-bottom: 16px; }
.wiz-head h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; margin: 0 0 2px; }
.wiz-head p { color: var(--al-muted); margin: 0; }
.wiz-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }

/* passo 1 — cartões de veículo */
.veic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.veic-card { position: relative; text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px;
  background: var(--al-surface); border: 1px solid var(--al-border); color: var(--al-text); box-shadow: var(--al-shadow); transition: all .15s; }
.veic-card:hover { border-color: var(--al-muted); transform: translateY(-2px); }
.veic-card.sel { border-color: var(--al-primary); box-shadow: 0 0 0 3px rgba(14, 116, 144, .15); }
.veic-card .vc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.veic-card .vc-placa { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-weight: 800; font-size: 1.05rem; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 6px; border: 2px solid var(--al-text); background: var(--al-surface); }
.veic-card .vc-modelo { font-weight: 600; margin-top: 4px; }
.veic-card .vc-mot, .veic-card .vc-cap { font-size: .84rem; color: var(--al-muted); display: flex; gap: 6px; align-items: center; }
.veic-card .vc-check { position: absolute; right: 12px; bottom: 12px; font-size: 1.3rem; color: var(--al-primary); opacity: 0; transition: opacity .15s; }
.veic-card.sel .vc-check { opacity: 1; }

/* passo 2 — região */
.chips-label { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--al-muted); margin: 6px 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; max-height: 92px; overflow-y: auto; }
.chip { border: 1px solid var(--al-border); background: var(--al-surface); color: var(--al-text); border-radius: 999px; padding: 5px 12px;
  font-size: .82rem; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; transition: all .12s; }
.chip:hover { border-color: var(--al-muted); }
.chip .n { font-size: .72rem; color: var(--al-muted); font-weight: 600; }
.chip.active { background: var(--al-btn); border-color: var(--al-btn); color: var(--al-btn-text); }
.chip.active .n { color: inherit; opacity: .75; }
.btn.magic { border-color: var(--al-primary); color: var(--al-primary); background: rgba(14, 116, 144, .06); }
.btn.magic:hover { background: var(--al-primary); color: #fff; }

.lista-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--al-border); }
.wiz .nf-scroll { max-height: calc(100vh - 420px); min-height: 360px; border-radius: 0; padding-right: 0; }
.wiz .nf-item { grid-template-columns: 26px minmax(0, 1fr) auto; padding: 10px 16px; }
.wiz .nf-item .nf-tick { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--al-border); display: grid; place-items: center;
  color: transparent; font-size: .8rem; transition: all .12s; }
.wiz .nf-item.sel .nf-tick { background: var(--al-primary); border-color: var(--al-primary); color: #fff; }
.wiz .bairro-head { cursor: default; position: sticky; top: 0; z-index: 1; gap: 8px; }
.wiz .pager { border-top: 1px solid var(--al-border); }

/* barra da carga (rodapé fixo no passo 2) */
.carga-bar { position: fixed; left: 264px; right: 0; bottom: 0; z-index: 1030; display: flex; align-items: center; gap: 18px;
  padding: 12px 28px; background: color-mix(in srgb, var(--al-surface) 92%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--al-border); box-shadow: 0 -10px 30px -18px rgba(15, 23, 42, .35); }
.carga-veic { display: flex; gap: 10px; align-items: center; font-size: .85rem; line-height: 1.2; min-width: 0; }
.carga-veic i { font-size: 1.3rem; color: var(--al-primary); }
.carga-veic small { color: var(--al-muted); }
.carga-nums { font-size: .95rem; white-space: nowrap; }
.carga-cap { flex: 1; min-width: 140px; max-width: 420px; }
.carga-cap small { color: var(--al-muted); }
@media (max-width: 991.98px) { .carga-bar { left: 0; padding: 10px 16px; gap: 10px; flex-wrap: wrap; } .carga-veic { display: none; } }

/* passo 3 */
.resumo-veic { display: flex; gap: 10px; align-items: center; font-size: .9rem; line-height: 1.25; }
.resumo-veic i { font-size: 1.4rem; color: var(--al-primary); }
.resumo-veic small { color: var(--al-muted); }
.wiz .stops { max-height: calc(100vh - 330px); }
@media (max-width: 767.98px) { .wiz-step .lbl small { display: none; } }

/* ---------- histórico de paradas na rota (NFs reprogramadas / rota cancelada) ---------- */
.hist-body .hist-sep td { background: var(--al-surface-2); color: var(--al-muted); font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: .5rem .75rem; border-top: 2px solid var(--al-border); }
.hist-body .hist-row td { background: var(--al-surface-2); }
.hist-body .hist-row .cell-title, .hist-body .hist-row td:nth-child(4) { color: var(--al-muted); }
.hist-body .hist-row .ordem { background: transparent; border: 1px dashed var(--al-border); color: var(--al-muted); }
.hist-list { list-style: none; margin: 0; padding: 0; }
.hist-list li { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px dashed var(--al-border); }
.hist-list li:last-child { border-bottom: 0; }

/* ---------- notificações ---------- */
.notif-list { display: flex; flex-direction: column; gap: .5rem; transition: opacity .15s; }
.notif-list.is-muted { opacity: .45; }
.notif-item { display: flex; align-items: center; gap: .85rem; padding: .7rem .85rem; border: 1px solid var(--al-border);
  border-radius: 12px; background: var(--al-surface); cursor: pointer; margin: 0; }
.notif-item:hover { border-color: rgba(14, 116, 144, .35); }
.notif-item .form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }
.notif-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: rgba(14, 116, 144, .1); color: var(--al-primary); font-size: 1.05rem; }
.notif-mute { background: var(--al-surface-2); border-style: dashed; }
.notif-mute .notif-ico { background: rgba(100, 116, 139, .12); color: var(--al-muted); }
.notif-st { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-size: .9rem; }
.notif-st.on { background: rgba(16, 185, 129, .12); color: #059669; }
.notif-st.off { background: rgba(100, 116, 139, .1); color: var(--al-muted); }
.notif-st.warn { background: rgba(245, 158, 11, .14); color: #b45309; }
.hora-input { width: 124px; flex-shrink: 0; }
.dl-grid .dl-wide { grid-column: 1 / -1; }
.tenant-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; background: var(--al-primary); }
.smtp-link { display: block; color: inherit; text-decoration: none; }
.smtp-link:hover .cell-sub { color: var(--al-primary); }
.modo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; }
.modo-opt { display: flex; gap: .65rem; align-items: flex-start; padding: .75rem .85rem; border: 1px solid var(--al-border);
  border-radius: 12px; cursor: pointer; margin: 0; background: var(--al-surface); }
.modo-opt:has(input:checked) { border-color: var(--al-primary); box-shadow: 0 0 0 3px rgba(14, 116, 144, .12); }
.modo-opt .form-check-input { margin-top: .2rem; flex-shrink: 0; }
#smtpCampos { transition: opacity .15s; }
#smtpCampos.is-muted { opacity: .5; }

/* ---------- coluna de ações padronizada (tabelas de paradas) ---------- */
.col-acoes { width: 120px; min-width: 120px; text-align: right; white-space: nowrap; }
.acoes { display: flex; justify-content: flex-end; align-items: center; gap: .35rem; min-height: 34px; }
.acoes form { display: contents; }
.btn-acao { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: 9px; font-size: 1rem; }
.valor-rota { width: 120px; margin-left: auto; }
.col-acoes-sm { width: 88px; min-width: 88px; text-align: right; white-space: nowrap; }
.valor-rota { width: 104px; }

/* ---------- anexos (canhoto / comprovantes) ---------- */
.anexo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .6rem; }
.anexo { border: 1px solid var(--al-border); border-radius: 10px; overflow: hidden; background: var(--al-surface); }
.anexo-thumb { display: block; aspect-ratio: 4 / 3; background: var(--al-surface-2); }
.anexo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.anexo-pdf { display: grid; place-items: center; height: 100%; color: #b91c1c; font-weight: 700; font-size: .8rem; }
.anexo-pdf i { font-size: 1.8rem; }
.anexo-meta { display: flex; align-items: center; justify-content: space-between; gap: .25rem; padding: .25rem .4rem;
  font-size: .72rem; color: var(--al-muted); }
.anexo-meta form { display: inline; }
.col-acoes { width: 156px; min-width: 156px; }
.chips-dica { text-transform: none; letter-spacing: 0; font-size: .75rem; }
@media (pointer: coarse) { .chips-dica { display: none; } }
.uf-select { width: auto; min-width: 170px; flex: 0 0 auto; padding-right: 2.25rem; }

/* ---------- visualizador de comprovantes ---------- */
.btn-preview { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid var(--al-border); background: var(--al-surface);
  color: var(--al-primary); border-radius: 999px; padding: .1rem .55rem; font-size: .75rem; font-weight: 600; line-height: 1.5; cursor: pointer; }
.btn-preview:hover { border-color: var(--al-primary); background: rgba(14, 116, 144, .06); }
.btn-preview.compacto { padding: .25rem .5rem; font-size: .8rem; vertical-align: middle; }
.preview-box { background: #0b1220; color: #e2e8f0; border: 0; }
.preview-box .modal-header { border-color: rgba(255, 255, 255, .08); }
.preview-box .btn-ghost, .preview-box .text-muted { color: #94a3b8 !important; }
.preview-box .btn-close { filter: invert(1); }
.preview-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.pv-conteudo { width: 100%; display: flex; align-items: center; justify-content: center; padding: .75rem 3.5rem; }
.pv-conteudo img { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 6px; background: #fff; }
.pv-conteudo iframe { width: 100%; height: 78vh; border: 0; border-radius: 6px; background: #fff; }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.2rem; display: grid; place-items: center; z-index: 2; }
.pv-nav:hover { background: rgba(255, 255, 255, .24); }
.pv-nav.prev { left: .75rem; } .pv-nav.next { right: .75rem; }

/* anexos maiores no detalhe da NF */
.anexo-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.anexo { margin: 0; }
.anexo-thumb { position: relative; width: 100%; border: 0; padding: 0; cursor: zoom-in; }
.anexo-zoom { position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(15, 23, 42, .55); color: #fff; font-size: .75rem; opacity: 0; transition: opacity .15s; }
.anexo-thumb:hover .anexo-zoom { opacity: 1; }
.anexo-meta { padding: .4rem .5rem; font-size: .78rem; color: var(--al-text); align-items: flex-start; }
.anexo-info { min-width: 0; flex: 1 1 auto; }
.pv-thumb { position: relative; width: 52px; height: 40px; padding: 0; border: 1px solid var(--al-border); border-radius: 8px;
  overflow: visible; background: var(--al-surface-2); cursor: zoom-in; vertical-align: middle; }
.pv-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; display: block; }
.pv-thumb:hover { border-color: var(--al-primary); box-shadow: 0 0 0 3px rgba(14, 116, 144, .15); }
.pv-thumb-pdf { display: grid; place-items: center; height: 100%; color: #b91c1c; font-size: 1.2rem; }
.pv-thumb-n { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--al-primary); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.baixa-massa { border: 1px dashed var(--al-border); border-radius: 12px; padding: .75rem .9rem; background: var(--al-surface-2); }

/* ---------- selects: espaço para a seta (o padding global cortava o texto) ---------- */
.form-select { padding-right: 2.4rem; background-position: right .8rem center; text-overflow: ellipsis; }
.form-select-sm { padding-right: 2.1rem; background-position: right .6rem center; }
.form-select.w-auto, .form-select[style*="width:auto"] { min-width: max-content; }
.btn { white-space: nowrap; }
.anexo-grid-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.anexo-meta b, .anexo-meta .anexo-info { white-space: nowrap; }

/* ---------- transferência / coleta ---------- */
.minuta-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .75rem 1rem; border-radius: 12px;
  background: var(--al-surface-2); border: 1px solid var(--al-border); }
.minuta-num { display: flex; flex-direction: column; line-height: 1.1; }
.minuta-num small { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--al-muted); font-weight: 700; }
.minuta-num b { font-size: 1.25rem; }
.minuta-trajeto { display: flex; align-items: center; gap: .5rem; font-weight: 600; margin-left: auto; }
.minuta-trajeto i { color: var(--al-primary); }
.nova-rota-menu { min-width: 260px; padding: .4rem; }
.nova-rota-menu .dropdown-item { display: flex; gap: .75rem; align-items: center; border-radius: 10px; padding: .6rem .75rem; white-space: normal; }
.nova-rota-menu .dropdown-item i { font-size: 1.2rem; color: var(--al-primary); }
.nova-rota-menu .dropdown-item small { display: block; color: var(--al-muted); font-size: .78rem; }
.valor-rota.a-definir { border-color: #f59e0b; background: rgba(245, 158, 11, .06); }

/* Pagamentos: entrega x transferência */
.composicao { display: flex; flex-wrap: wrap; gap: 4px; }
.tipo-rota { font-size: .7rem; }
.grupo-tipo { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--al-border);
  background: var(--tone-bg); color: var(--tone); font-weight: 700; font-size: .85rem; }
.grupo-tipo:first-child { border-top: 0; }
.grupo-tipo .sub { margin-left: auto; color: var(--al-text); }
.grupo-tipo small { font-weight: 500; color: var(--al-muted); }
.resumo-tipos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.resumo-tipo { border-radius: 12px; padding: 12px 14px; background: var(--tone-bg); color: var(--tone); }
.resumo-tipo .rt-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.resumo-tipo .rt-valor { font-size: 1.25rem; font-weight: 800; color: var(--al-text); }
.resumo-tipo .rt-sub { font-size: .78rem; color: var(--al-muted); }

/* Celular: título em cima, ações quebram para a linha de baixo (sem rolagem lateral) */
@media (max-width: 767.98px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topbar > .min-w-0 { flex: 1 1 0; }
  .topbar-actions { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .topbar-actions > form { display: inline-flex; }
  .page-title { font-size: 1.15rem; }
}

/* Novo pagamento (wizard) */
.mot-card .mc-nome { font-weight: 700; font-size: 1rem; padding-right: 24px; }
.mot-card .mc-total { font-size: 1.25rem; font-weight: 800; margin-top: 2px; }
.mot-card .mc-total small { font-size: .72rem; font-weight: 600; color: var(--al-muted); }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.opt-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 14px; cursor: pointer; margin: 0;
  background: var(--al-surface); border: 1px solid var(--al-border); box-shadow: var(--al-shadow); transition: all .15s; }
.opt-card:hover { border-color: var(--al-muted); }
.opt-card:has(input:checked) { border-color: var(--al-primary); box-shadow: 0 0 0 3px rgba(14, 116, 144, .15); }
.opt-card > input { margin-top: 12px; accent-color: var(--al-primary); width: 18px; height: 18px; flex: none; }
.oc-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 1.25rem;
  color: var(--al-primary); background: rgba(14, 116, 144, .1); }
.oc-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.oc-txt b { font-size: 1rem; }
.oc-txt small { color: var(--al-muted); }
.tbl-pag .col-chk { width: 44px; padding-right: 0; }
.tbl-pag tr.desmarcada td:not(.col-chk) { opacity: .45; }
.tbl-pag .valor-rota { width: 130px; }
.pay-bar .btn { white-space: nowrap; }
.wiz-pane[data-step="3"] { padding-bottom: 80px; }
.dados-pag { display: grid; gap: 6px; font-size: .9rem; }
.dados-pag > div { display: flex; gap: 10px; align-items: center; }
.dados-pag span { color: var(--al-muted); min-width: 56px; }
.liquido-box { border-radius: 12px; padding: 12px 14px; background: var(--al-surface-2); margin-bottom: 12px; }
@media (max-width: 575.98px) {
  .wiz-steps { gap: 6px; }
  .wiz-step { min-width: 0; padding: 8px; gap: 6px; }
  .wiz-step .lbl b { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 575.98px) {
  .tbl-pag th:nth-child(3), .tbl-pag td:nth-child(3), .tbl-pag th:nth-child(4), .tbl-pag td:nth-child(4) { display: none; }
  .tbl-pag .valor-rota { width: 112px; }
  .tbl-pag .col-chk { width: 34px; }
}

/* Topo: botões de ação na mesma altura do seletor de tenant e dos ícones */
.topbar-actions .btn { height: 38px; padding-top: 0; padding-bottom: 0; }
.topbar-actions .icon-btn { width: 38px; height: 38px; border-radius: 10px; }
.topbar-actions .tenant-pill { height: 38px; padding-top: 0; padding-bottom: 0; }
.form-control-sm, .form-select-sm { min-height: 32px; }
textarea.form-control { min-height: 0; }
/* botões ao lado de campos (filtros, envio de arquivo) com a mesma altura do campo */
.fb-actions .btn { height: 40px; padding-top: 0; padding-bottom: 0; }
.fb-actions .btn:not(:has(span)):only-child, .fb-actions .btn-soft { min-width: 40px; }
/* telas médias: se o título for longo, as ações do topo descem para a linha de baixo em vez de vazar */
@media (max-width: 1199.98px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topbar > .min-w-0 { flex: 1 1 320px; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
}

/* Importar (wizard) */
.conf-filtro { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.conf-filtro:hover { transform: translateY(-1px); }
.conf-filtro.active { box-shadow: 0 0 0 2px var(--tone); }
.conf-scroll { max-height: calc(100vh - 430px); min-height: 240px; overflow: auto; }
.conf-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--al-surface); }
.fim-icone { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; font-size: 2.3rem; color: #fff; background: var(--al-grad); }
.fim-icone.aviso { background: #d97706; }

/* Transferência (wizard) */
.tr-veic { cursor: pointer; margin: 0; }
.tr-veic:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(14, 116, 144, .35); }
.rev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 18px; font-size: .9rem; }
.rev-grid > div { display: flex; flex-direction: column; border-bottom: 1px solid var(--al-border); padding-bottom: 6px; min-width: 0; }
.rev-grid span { color: var(--al-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.rev-grid b { overflow: hidden; text-overflow: ellipsis; }
