html { scroll-behavior: smooth; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; }
.app-window { backdrop-filter: blur(18px); }
.card { border-radius: 24px; background: #fff; box-shadow: 0 10px 28px rgba(15, 23, 42, .06); border: 1px solid rgba(226, 232, 240, .85); }
.field { width: 100%; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; padding: .7rem .95rem; outline: none; font-size: .92rem; }
.field:focus { border-color: #0f172a; box-shadow: 0 0 0 4px rgba(15, 23, 42, .08); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 999px; padding: .7rem .95rem; font-size: .9rem; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.btn-primary { background: #0f172a; color: #fff; }
.btn-soft { background: #fff; color: #0f172a; box-shadow: 0 1px 0 rgba(15, 23, 42, .04); border: 1px solid #e2e8f0; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.status { display: inline-flex; align-items: center; white-space: nowrap; border-radius: 999px; padding: .25rem .65rem; font-size: .72rem; font-weight: 800; line-height: 1.15; }
.status-ativo, .status-aprovado, .status-concluida, .status-entregue { background: #dcfce7; color: #166534; }
.status-pendente, .status-rascunho, .status-aguardando { background: #fef3c7; color: #92400e; }
.status-roteirizada, .status-roteirizada_app, .status-em_andamento, .status-em_rota { background: #dbeafe; color: #1e40af; }
.status-roteirizada_manual { background: #ede9fe; color: #5b21b6; }
.status-inativo, .status-cancelada, .status-cancelado, .status-nao_entregue { background: #fee2e2; color: #991b1b; }
@media print {
    aside, header, .no-print { display: none !important; }
    body { background: #fff !important; }
    main { padding: 0 !important; }
}

.sidebar-rail { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 999px; color: #64748b; transition: .18s ease; }
.sidebar-rail svg { width: 1.08rem; height: 1.08rem; }
.sidebar-rail:hover, .sidebar-rail-active { background: #e11d48; color: #fff; box-shadow: 0 12px 24px rgba(225, 29, 72, .22); }
.dashboard-hero { border-radius: 28px; background: linear-gradient(135deg, #fff 0%, #fff 58%, #fdf2f5 100%); padding: 1.25rem; box-shadow: 0 12px 32px rgba(15, 23, 42, .07); border: 1px solid rgba(226, 232, 240, .8); }
.metric-mini { border-radius: 20px; background: #fff; padding: 1rem; box-shadow: 0 8px 22px rgba(15, 23, 42, .06); border: 1px solid rgba(226, 232, 240, .8); }
.metric-mini span { display: block; font-size: .72rem; font-weight: 800; color: #64748b; }
.metric-mini strong { display: block; margin-top: .45rem; font-size: 1.45rem; line-height: 1; font-weight: 950; color: #0f172a; }
.metric-mini-dark { background: #0f172a; border-color: #0f172a; }
.metric-mini-dark span, .metric-mini-dark strong { color: #fff; }
.route-row { display: flex; align-items: center; gap: .8rem; border-radius: 18px; padding: .75rem; transition: .18s ease; }
.route-row:hover { background: #f8fafc; }
.coordinate-map { min-height: 320px; }
.coordinate-map .leaflet-control-attribution { font-size: 10px; }
@media (min-width: 640px) {
    .sidebar-rail { width: 2.75rem; height: 2.75rem; }
}
@media (min-width: 1280px) {
    body { font-size: 14px; }
}

#route-map { min-height: 420px; }
.leaflet-container { font-family: inherit; }
.route-marker { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: #0f172a; color: #fff; border: 2px solid #fff; box-shadow: 0 8px 20px rgba(15, 23, 42, .25); font-size: 12px; font-weight: 800; }
.route-marker-origin { background: #059669; }

.waze-qr { display: inline-grid; place-items: center; width: 96px; height: 96px; padding: 6px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
.waze-qr svg { width: 84px; height: 84px; display: block; }
@media print {
    .print-route { padding: 0 !important; }
    .print-route-table th, .print-route-table td { break-inside: avoid; page-break-inside: avoid; }
    .waze-qr { width: 86px; height: 86px; padding: 4px; }
    .waze-qr svg { width: 78px; height: 78px; }
}
