:root {
    color-scheme: light;
}

@media screen {
    .online-presence-bar {
        position: relative;
        z-index: 30;
    }

    .online-dot {
        width: 10px;
        height: 10px;
        border-radius: 999px;
        background: rgb(16 185 129);
        box-shadow: 0 0 0 4px rgb(16 185 129 / 14%);
        flex: 0 0 auto;
    }

    .online-presence-list {
        display: flex;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .online-user-chip {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        max-width: 190px;
        flex: 0 0 auto;
        border: 1px solid rgb(226 232 240);
        border-radius: 999px;
        background: rgb(248 250 252);
        color: rgb(51 65 85);
        font-size: 12px;
        font-weight: 700;
        padding: 4px 9px 4px 4px;
    }

    .online-user-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .theme-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border: 1px solid rgb(203 213 225);
        border-radius: 12px;
        background: rgb(255 255 255);
        color: rgb(71 85 105);
        font-size: 13px;
        font-weight: 700;
        padding: 10px 14px;
        transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
    }

    .theme-toggle::before {
        content: "";
        width: 14px;
        height: 14px;
        border-radius: 999px;
        background: linear-gradient(135deg, rgb(16 185 129), rgb(14 165 233));
        box-shadow: 0 0 0 3px rgb(209 250 229);
    }

    .theme-toggle:hover {
        background: rgb(248 250 252);
        border-color: rgb(148 163 184);
        color: rgb(15 23 42);
    }

    .theme-toggle[aria-pressed="true"] {
        background: linear-gradient(135deg, rgb(15 118 110), rgb(37 99 235));
        border-color: rgb(45 212 191);
        color: white;
        box-shadow: 0 10px 26px rgb(15 23 42 / 18%);
    }

    .theme-toggle[aria-pressed="true"]::before {
        background: white;
        box-shadow: 0 0 0 3px rgb(20 184 166 / 35%);
    }

    .theme-toggle[aria-pressed="true"]::after {
        content: "Ativo";
        border-radius: 999px;
        background: rgb(255 255 255 / 18%);
        color: white;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .04em;
        padding: 2px 6px;
        text-transform: uppercase;
    }

    .theme-toggle-mobile {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    .theme-dark {
        color-scheme: dark;
    }

    .theme-dark body,
    .theme-dark .bg-slate-100 {
        background: rgb(15 23 42) !important;
        color: rgb(226 232 240) !important;
    }

    .theme-dark .bg-white,
    .theme-dark .online-presence-bar,
    .theme-dark [data-sidebar],
    .theme-dark .card,
    .theme-dark .rounded-2xl.bg-white,
    .theme-dark .rounded-xl.bg-white {
        background: rgb(17 24 39) !important;
        color: rgb(226 232 240) !important;
    }

    .theme-dark .bg-slate-50,
    .theme-dark .bg-slate-100\/70 {
        background: rgb(30 41 59) !important;
    }

    .theme-dark .border-slate-100,
    .theme-dark .border-slate-200,
    .theme-dark .border-slate-300,
    .theme-dark [class*="ring-slate-"] {
        border-color: rgb(51 65 85) !important;
        --tw-ring-color: rgb(51 65 85) !important;
    }

    .theme-dark .text-slate-950,
    .theme-dark .text-slate-900,
    .theme-dark .text-slate-800 {
        color: rgb(248 250 252) !important;
    }

    .theme-dark .text-slate-700,
    .theme-dark .text-slate-600 {
        color: rgb(203 213 225) !important;
    }

    .theme-dark .text-slate-500,
    .theme-dark .text-slate-400 {
        color: rgb(148 163 184) !important;
    }

    .theme-dark .hover\:bg-slate-100:hover,
    .theme-dark .hover\:bg-slate-50:hover {
        background: rgb(30 41 59) !important;
    }

    .theme-dark input,
    .theme-dark select,
    .theme-dark textarea,
    .theme-dark .field,
    .theme-dark .tag-input {
        background: rgb(15 23 42) !important;
        border-color: rgb(71 85 105) !important;
        color: rgb(248 250 252) !important;
    }

    .theme-dark input::placeholder,
    .theme-dark textarea::placeholder,
    .theme-dark .tag-entry::placeholder {
        color: rgb(100 116 139) !important;
    }

    .theme-dark .tag-entry {
        background: transparent !important;
        color: rgb(248 250 252) !important;
    }

    .theme-dark .online-user-chip {
        background: rgb(30 41 59);
        border-color: rgb(51 65 85);
        color: rgb(226 232 240);
    }

    .theme-dark .tag-chip,
    .theme-dark .badge {
        background: rgb(6 78 59) !important;
        border-color: rgb(5 150 105) !important;
        color: rgb(209 250 229) !important;
    }

    .theme-dark .bg-emerald-50 {
        background: rgb(6 78 59) !important;
    }

    .theme-dark .route-list-item {
        background: rgb(15 23 42);
        border-color: rgb(51 65 85);
    }

    .theme-dark .route-list-item.active {
        background: linear-gradient(180deg, rgb(6 78 59 / 0.55), rgb(15 23 42));
        border-color: rgb(16 185 129);
    }

    .theme-dark .route-meta-pill {
        background: rgb(30 41 59);
        color: rgb(203 213 225);
    }

    .theme-dark .dashboard-popup-action {
        background: rgb(30 41 59);
        color: rgb(226 232 240);
    }

    .theme-dark .dashboard-popup-action.primary {
        background: rgb(5 150 105);
        color: white;
    }

    .theme-dark .dashboard-map-note {
        background: rgb(23 37 84);
        color: rgb(191 219 254);
    }

    .theme-dark .route-loading {
        background: rgb(15 23 42 / 0.94);
        color: rgb(248 250 252);
    }

    .theme-dark .route-loading span {
        color: rgb(203 213 225);
    }

    .theme-dark .origin-bar-row .bg-slate-100 {
        background: rgb(30 41 59) !important;
    }

    .theme-dark .origin-dashboard-row {
        background: rgb(15 23 42);
        border-color: rgb(51 65 85);
    }

    .theme-dark .top-user-pill {
        background: rgb(15 23 42);
        border-color: rgb(51 65 85);
        color: rgb(226 232 240);
    }

    .theme-dark .top-user-pill:hover {
        background: rgb(30 41 59);
        border-color: rgb(16 185 129);
    }

    .theme-dark .user-avatar,
    .theme-dark .user-avatar-placeholder {
        border-color: rgb(30 41 59);
    }

    .theme-dark .text-emerald-700,
    .theme-dark .text-emerald-800 {
        color: rgb(110 231 183) !important;
    }

    .theme-dark .bg-blue-50 {
        background: rgb(23 37 84) !important;
    }

    .theme-dark .text-blue-700,
    .theme-dark .text-blue-800 {
        color: rgb(147 197 253) !important;
    }

    .theme-dark .bg-amber-50 {
        background: rgb(69 26 3) !important;
    }

    .theme-dark .text-amber-700,
    .theme-dark .text-amber-800 {
        color: rgb(252 211 77) !important;
    }

    .theme-dark .bg-red-50 {
        background: rgb(69 10 10) !important;
    }

    .theme-dark .text-red-700,
    .theme-dark .text-red-800 {
        color: rgb(252 165 165) !important;
    }

    .theme-dark table,
    .theme-dark thead,
    .theme-dark tbody,
    .theme-dark tr {
        border-color: rgb(51 65 85) !important;
    }

    .theme-dark thead,
    .theme-dark .bg-slate-900 {
        background: rgb(2 6 23) !important;
    }

    .theme-dark .leaflet-popup-content-wrapper,
    .theme-dark .leaflet-popup-tip {
        background: rgb(15 23 42) !important;
        color: rgb(226 232 240) !important;
    }

    .theme-dark .leaflet-control,
    .theme-dark .leaflet-control a {
        background: rgb(15 23 42) !important;
        color: rgb(226 232 240) !important;
        border-color: rgb(51 65 85) !important;
    }

    .theme-dark .theme-toggle {
        background: rgb(15 23 42);
        border-color: rgb(51 65 85);
        color: rgb(226 232 240);
    }

    .theme-dark .theme-toggle[aria-pressed="true"] {
        background: linear-gradient(135deg, rgb(13 148 136), rgb(37 99 235));
        border-color: rgb(94 234 212);
        color: white;
        box-shadow: 0 12px 28px rgb(0 0 0 / 32%);
    }

    .theme-dark .theme-toggle::before {
        background: linear-gradient(135deg, rgb(14 165 233), rgb(168 85 247));
        box-shadow: 0 0 0 3px rgb(30 41 59);
    }

    .theme-dark .theme-toggle:hover {
        background: rgb(30 41 59);
        border-color: rgb(71 85 105);
        color: rgb(248 250 252);
    }
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mobile-bottom-nav {
    display: none;
}

.mobile-filter-panel > summary {
    display: none;
}

.sidebar-section-label {
    color: rgb(148 163 184);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    margin: 0 0.75rem 0.45rem;
    text-transform: uppercase;
}

.sidebar-nav-item,
.sidebar-group-summary,
.sidebar-subnav a,
.sidebar-maintenance summary,
.sidebar-logout {
    align-items: center;
    border-radius: 0.75rem;
    color: rgb(71 85 105);
    display: flex;
    font-size: 0.875rem;
    font-weight: 650;
    gap: 0.7rem;
    min-height: 2.75rem;
    padding: 0.65rem 0.9rem;
    transition: background-color 150ms ease, color 150ms ease;
}

.sidebar-nav-item:hover,
.sidebar-group-summary:hover,
.sidebar-subnav a:hover,
.sidebar-maintenance summary:hover,
.sidebar-logout:hover {
    background: rgb(241 245 249);
    color: rgb(15 23 42);
}

.sidebar-nav-item.active,
.sidebar-group-summary.active,
.sidebar-subnav a.active {
    background: rgb(236 253 245);
    color: rgb(6 95 70);
}

.sidebar-nav-item > .bi,
.sidebar-group-summary > .bi:first-child,
.sidebar-subnav a > .bi,
.sidebar-maintenance summary > .bi:first-child,
.sidebar-logout > .bi {
    font-size: 1rem;
    width: 1.15rem;
}

.sidebar-count-badge,
.sidebar-alert-badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 900;
    justify-content: center;
    margin-left: auto;
    min-width: 1.55rem;
    padding: 0.2rem 0.42rem;
}

.sidebar-count-badge {
    background: rgb(209 250 229);
    color: rgb(6 95 70);
}

.sidebar-alert-badge {
    background: rgb(254 226 226);
    color: rgb(185 28 28);
}

.sidebar-alert-dot {
    background: rgb(239 68 68);
    border-radius: 999px;
    height: 0.5rem;
    margin-left: auto;
    width: 0.5rem;
}

.sidebar-group summary {
    cursor: pointer;
    list-style: none;
}

.sidebar-group summary::-webkit-details-marker {
    display: none;
}

.sidebar-group-chevron {
    font-size: 0.7rem;
    margin-left: 0.2rem;
    transition: transform 150ms ease;
}

.sidebar-group[open] > summary .sidebar-group-chevron,
.sidebar-maintenance[open] > summary .sidebar-group-chevron {
    transform: rotate(180deg);
}

.sidebar-subnav {
    border-left: 1px solid rgb(226 232 240);
    margin: 0.3rem 0 0 1.45rem;
    padding-left: 0.45rem;
}

.sidebar-subnav a,
.sidebar-maintenance summary {
    font-size: 0.8rem;
    min-height: 2.45rem;
    padding: 0.5rem 0.7rem;
}

.sidebar-maintenance > div {
    padding-left: 0.8rem;
}

.integration-status {
    align-items: center;
    background: rgb(241 245 249);
    border-radius: 999px;
    color: rgb(71 85 105);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 800;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
}

.integration-status.connected {
    background: rgb(209 250 229);
    color: rgb(6 95 70);
}

.theme-dark .sidebar-nav-item,
.theme-dark .sidebar-group-summary,
.theme-dark .sidebar-subnav a,
.theme-dark .sidebar-maintenance summary,
.theme-dark .sidebar-logout {
    color: rgb(203 213 225);
}

.theme-dark .sidebar-nav-item:hover,
.theme-dark .sidebar-group-summary:hover,
.theme-dark .sidebar-subnav a:hover,
.theme-dark .sidebar-maintenance summary:hover,
.theme-dark .sidebar-logout:hover {
    background: rgb(30 41 59);
    color: rgb(248 250 252);
}

.theme-dark .sidebar-nav-item.active,
.theme-dark .sidebar-group-summary.active,
.theme-dark .sidebar-subnav a.active {
    background: rgb(6 78 59 / 0.6);
    color: rgb(167 243 208);
}

.theme-dark .sidebar-subnav {
    border-left-color: rgb(51 65 85);
}

.theme-dark .sidebar-count-badge,
.theme-dark .integration-status.connected {
    background: rgb(6 78 59);
    color: rgb(167 243 208);
}

.theme-dark .integration-status {
    background: rgb(30 41 59);
    color: rgb(203 213 225);
}

@media (min-width: 768px) {
    .mobile-filter-panel:not([open]) > form {
        display: grid !important;
    }
}

.card {
    border: 1px solid rgb(226 232 240);
    border-radius: 1rem;
    background: white;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.field {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgb(203 213 225);
    background: white;
    padding: 0.7rem 0.9rem;
    outline: none;
}

.field:focus {
    border-color: rgb(16 185 129);
    box-shadow: 0 0 0 4px rgb(209 250 229);
}

.tag-input {
    display: flex;
    min-height: 3rem;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    border-radius: 0.75rem;
    border: 1px solid rgb(203 213 225);
    background: white;
    padding: 0.45rem 0.55rem;
}

.tag-input:focus-within {
    border-color: rgb(16 185 129);
    box-shadow: 0 0 0 4px rgb(209 250 229);
}

.tag-list {
    display: contents;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    background: rgb(236 253 245);
    border: 1px solid rgb(167 243 208);
    color: rgb(6 95 70);
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.tag-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    color: rgb(6 95 70);
    font-size: 0.95rem;
    line-height: 1;
}

.tag-chip button:hover {
    background: rgb(167 243 208);
}

.tag-entry {
    min-width: 12rem;
    flex: 1;
    border: 0;
    outline: none;
    padding: 0.35rem;
    font-size: 0.95rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    padding: 0.68rem 1rem;
    font-size: 0.875rem;
    font-weight: 700;
    transition: 150ms ease;
}

.btn-primary { background: rgb(5 150 105); color: white; }
.btn-primary:hover { background: rgb(4 120 87); }
.btn-soft { background: rgb(241 245 249); color: rgb(15 23 42); }
.btn-soft:hover { background: rgb(226 232 240); }
.btn-danger { background: rgb(220 38 38); color: white; }
.btn-danger:hover { background: rgb(185 28 28); }

.user-avatar {
    border: 2px solid rgb(255 255 255);
    background: rgb(241 245 249);
    box-shadow: 0 6px 18px rgb(15 23 42 / 12%);
}

.user-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgb(255 255 255);
    background: linear-gradient(135deg, rgb(5 150 105), rgb(14 165 233));
    color: white;
    font-weight: 900;
    letter-spacing: .02em;
    box-shadow: 0 6px 18px rgb(15 23 42 / 12%);
}

.top-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgb(226 232 240);
    border-radius: 999px;
    background: rgb(248 250 252);
    color: rgb(15 23 42);
    padding: 0.2rem 0.55rem 0.2rem 0.2rem;
    max-width: 10rem;
}

.top-user-pill:hover {
    border-color: rgb(16 185 129);
    background: rgb(236 253 245);
}

.profile-photo-preview .user-avatar,
.profile-photo-preview .user-avatar-placeholder {
    font-size: 2.2rem;
}

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgb(240 253 244);
    color: rgb(22 101 52);
}

.ranking-scroll {
    max-height: 10rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.ranking-scroll-lg {
    max-height: 24rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.ranking-scroll-lg::-webkit-scrollbar,
.ranking-scroll::-webkit-scrollbar {
    width: 0.45rem;
}

.ranking-scroll-lg::-webkit-scrollbar-thumb,
.ranking-scroll::-webkit-scrollbar-thumb {
    background: rgb(203 213 225);
    border-radius: 999px;
}

.route-saved-list {
    display: grid;
    gap: 12px;
    max-height: 28rem;
    overflow-y: auto;
    padding: 16px;
}

.route-map-shell {
    position: relative;
}

.route-loading {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgb(255 255 255 / 0.94);
    color: rgb(15 23 42);
    text-align: center;
    padding: 24px;
}

.route-loading.hidden {
    display: none;
}

.route-loading span {
    max-width: 420px;
    color: rgb(71 85 105);
    font-size: 14px;
}

.route-loading-spinner {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 4px solid rgb(209 250 229);
    border-top-color: rgb(5 150 105);
    animation: radar-spin .85s linear infinite;
}

@keyframes radar-spin {
    to { transform: rotate(360deg); }
}

.route-list-item {
    border: 1px solid rgb(226 232 240);
    border-radius: 14px;
    background: rgb(255 255 255);
    padding: 16px;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.route-list-item:hover {
    border-color: rgb(16 185 129);
    box-shadow: 0 14px 34px rgb(15 23 42 / 8%);
    transform: translateY(-1px);
}

.route-list-item.active {
    border-color: rgb(5 150 105);
    background: linear-gradient(180deg, rgb(236 253 245), rgb(255 255 255));
    box-shadow: 0 16px 36px rgb(5 150 105 / 14%);
}

.route-meta-pill,
.route-selected-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
}

.route-meta-pill {
    background: rgb(241 245 249);
    color: rgb(71 85 105);
}

.route-selected-pill {
    background: rgb(5 150 105);
    color: white;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.origin-bar-row {
    break-inside: avoid;
    page-break-inside: avoid;
}

.origin-bar-row .bg-emerald-500 {
    background: linear-gradient(90deg, rgb(16 185 129), rgb(14 165 233));
}

.origin-dashboard-row {
    border: 1px solid rgb(226 232 240);
    border-radius: 12px;
    background: rgb(255 255 255);
    padding: 12px;
}

.dashboard-map-shell {
    height: min(560px, 68vh);
    min-height: 360px;
    max-width: 100%;
    position: relative;
    width: 100%;
}

.dashboard-map-canvas {
    height: 100%;
    min-height: 100%;
    width: 100%;
}

.dashboard-map-mobile-sheet {
    display: none;
}

.agenda-grid {
    display: grid;
    grid-template-columns: 5rem repeat(7, minmax(8rem, 1fr));
}

.agenda-corner,
.agenda-day-head,
.agenda-time,
.agenda-slot {
    border-bottom: 1px solid rgb(226 232 240);
    border-right: 1px solid rgb(226 232 240);
}

.agenda-corner,
.agenda-day-head {
    background: rgb(248 250 252);
    min-height: 4rem;
    padding: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 5;
}

.agenda-corner,
.agenda-time {
    left: 0;
    position: sticky;
    z-index: 6;
}

.agenda-time {
    align-items: flex-start;
    background: rgb(248 250 252);
    color: rgb(100 116 139);
    display: flex;
    font-size: 0.78rem;
    font-weight: 800;
    justify-content: center;
    min-height: 4.5rem;
    padding-top: 0.75rem;
}

.agenda-slot {
    background: white;
    min-height: 4.5rem;
    padding: 0.35rem;
    transition: background-color 150ms ease, box-shadow 150ms ease;
}

.agenda-slot.drag-over {
    background: rgb(236 253 245);
    box-shadow: inset 0 0 0 2px rgb(16 185 129);
}

.agenda-lead {
    cursor: grab;
}

.agenda-lead:active {
    cursor: grabbing;
}

.agenda-lead.selected {
    border-color: rgb(5 150 105);
    box-shadow: 0 0 0 3px rgb(209 250 229);
}

.agenda-existing-badge {
    background: rgb(254 243 199);
    border: 1px solid rgb(245 158 11 / 0.35);
    border-radius: 999px;
    color: rgb(146 64 14);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
    padding: 0.3rem 0.45rem;
    text-decoration: none;
    text-transform: uppercase;
}

.agenda-item {
    border: 1px solid rgb(16 185 129 / 0.35);
    border-radius: 0.75rem;
    background: rgb(209 250 229);
    color: rgb(6 78 59);
    display: block;
    font-size: 0.78rem;
    line-height: 1.25;
    margin-bottom: 0.25rem;
    padding: 0.45rem 0.5rem;
    text-align: left;
    width: 100%;
    cursor: grab;
    touch-action: manipulation;
}

.agenda-item:active {
    cursor: grabbing;
}

.agenda-item.is-duplicate {
    border: 2px solid rgb(245 158 11);
    box-shadow: 0 0 0 2px rgb(254 243 199 / 0.8);
}

.agenda-item-badge {
    margin-top: 0.3rem;
}

.agenda-item span {
    color: rgb(71 85 105);
    display: block;
    font-size: 0.7rem;
    margin-top: 0.15rem;
}

.agenda-item .agenda-item-badge {
    background: rgb(254 243 199);
    border: 1px solid rgb(245 158 11 / 0.35);
    border-radius: 999px;
    color: rgb(146 64 14);
    display: inline-flex;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
    margin-top: 0.3rem;
    padding: 0.3rem 0.45rem;
    text-decoration: none;
    text-transform: uppercase;
}

.agenda-item.status-confirmado {
    background: rgb(219 234 254);
    border-color: rgb(59 130 246 / 0.4);
    color: rgb(30 64 175);
}

.agenda-item.status-concluido {
    background: rgb(220 252 231);
    border-color: rgb(34 197 94 / 0.45);
    color: rgb(22 101 52);
}

.agenda-item.status-cancelado {
    background: rgb(241 245 249);
    border-color: rgb(148 163 184 / 0.45);
    color: rgb(71 85 105);
    text-decoration: line-through;
}

.agenda-modal {
    align-items: center;
    background: rgb(15 23 42 / 0.55);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 80;
}

.agenda-modal.hidden {
    display: none;
}

.agenda-dialog {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 24px 70px rgb(15 23 42 / 0.32);
    max-height: 92vh;
    max-width: 42rem;
    overflow-y: auto;
    padding: 1.25rem;
    width: 100%;
}

.agenda-duplicate-warning {
    background: rgb(255 251 235);
    border: 1px solid rgb(245 158 11 / 0.45);
    border-radius: 0.85rem;
    color: rgb(120 53 15);
    padding: 0.85rem;
}

.dashboard-map-card,
.dashboard-map-search,
.dashboard-map-actions {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.dashboard-map-card {
    overflow: hidden;
    width: 100%;
}

.dashboard-map-card h3,
.dashboard-map-card p,
.dashboard-map-search label {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-map-search .field {
    box-sizing: border-box;
    min-width: 0;
}

.map-filter {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgb(203 213 225);
    border-radius: 999px;
    background: white;
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: rgb(51 65 85);
    transition: 150ms ease;
}

.map-filter:hover,
.map-filter.active {
    border-color: rgb(5 150 105);
    background: rgb(236 253 245);
    color: rgb(6 95 70);
}

.map-filter[data-map-filter="1"] {
    border-color: rgb(16 185 129 / 0.45);
}

.map-filter[data-map-filter="1"].active,
.map-filter[data-map-filter="1"]:hover {
    background: rgb(209 250 229);
    color: rgb(4 120 87);
}

.map-filter[data-map-filter="2"] {
    border-color: rgb(250 204 21 / 0.55);
}

.map-filter[data-map-filter="2"].active,
.map-filter[data-map-filter="2"]:hover {
    background: rgb(254 249 195);
    color: rgb(133 77 14);
}

.map-filter[data-map-filter="3"] {
    border-color: rgb(239 68 68 / 0.5);
}

.map-filter[data-map-filter="3"].active,
.map-filter[data-map-filter="3"]:hover {
    background: rgb(254 226 226);
    color: rgb(153 27 27);
}

.map-filter[data-map-filter="approx"] {
    border-color: rgb(168 85 247 / 0.5);
}

.map-filter[data-map-filter="approx"].active,
.map-filter[data-map-filter="approx"]:hover {
    background: rgb(243 232 255);
    color: rgb(109 40 217);
}

.classification-select {
    border-width: 1px;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.classification-select[data-classification=""] {
    border-color: rgb(203 213 225);
    background: rgb(248 250 252);
    color: rgb(71 85 105);
}

.classification-select[data-classification="1"] {
    border-color: rgb(110 231 183);
    background: rgb(209 250 229);
    color: rgb(4 120 87);
}

.classification-select[data-classification="2"] {
    border-color: rgb(253 224 71);
    background: rgb(254 249 195);
    color: rgb(133 77 14);
}

.classification-select[data-classification="3"] {
    border-color: rgb(252 165 165);
    background: rgb(254 226 226);
    color: rgb(153 27 27);
}

.route-number {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: white;
    font-weight: 800;
    text-align: center;
}

.route-popup {
    width: min(72vw, 370px);
    max-height: 68vh;
    overflow-y: auto;
    color: rgb(15 23 42);
    padding-right: 0.15rem;
}

.route-popup strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.25;
}

.route-popup dl {
    display: grid;
    grid-template-columns: 5.75rem 1fr;
    gap: 0.22rem 0.55rem;
    margin: 0;
    font-size: 0.78rem;
}

.route-popup dt {
    color: rgb(100 116 139);
    font-weight: 800;
    text-transform: uppercase;
}

.route-popup dd {
    margin: 0;
    white-space: pre-line;
}

.route-popup-form {
    margin-top: 0.75rem;
    display: grid;
    gap: 0.4rem;
    border-top: 1px solid rgb(226 232 240);
    padding-top: 0.7rem;
}

.route-popup-form label {
    font-size: 0.72rem;
    font-weight: 800;
    color: rgb(100 116 139);
    text-transform: uppercase;
}

.route-popup-form select {
    width: 100%;
    min-height: 2.15rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(203 213 225);
    background: white;
    padding: 0.4rem 0.55rem;
    font-size: 0.82rem;
}

.route-popup-form button {
    min-height: 2.25rem;
    border-radius: 0.5rem;
    background: rgb(5 150 105);
    color: white;
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 800;
    transition: 150ms ease;
}

.route-popup-form button:hover {
    background: rgb(4 120 87);
}

.route-popup-form textarea {
    width: 100%;
    min-height: 3.25rem;
    resize: vertical;
    border-radius: 0.5rem;
    border: 1px solid rgb(203 213 225);
    padding: 0.45rem 0.55rem;
    font-size: 0.82rem;
    line-height: 1.3;
}

.route-popup-date {
    margin: 0.55rem 0 0;
    color: rgb(100 116 139);
    font-size: 0.72rem;
    font-weight: 700;
}

.route-map-warning {
    border-radius: 0.5rem;
    background: rgb(243 232 255);
    color: rgb(109 40 217);
    margin: 0.6rem 0 0;
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 800;
}

.dashboard-map-popup dl {
    grid-template-columns: 6.5rem 1fr;
}

.dashboard-map-extra {
    margin-top: 0.55rem;
}

.dashboard-map-extra summary {
    color: rgb(4 120 87);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 0.45rem;
}

.dashboard-map-edit {
    margin-top: 0.6rem;
}

.dashboard-map-edit > summary {
    align-items: center;
    background: rgb(241 245 249);
    border-radius: 0.55rem;
    color: rgb(15 23 42);
    cursor: pointer;
    display: flex;
    font-size: 0.75rem;
    font-weight: 800;
    justify-content: space-between;
    min-height: 2.2rem;
    padding: 0.45rem 0.65rem;
}

.dashboard-map-edit > summary::after {
    content: "+";
    font-size: 1rem;
}

.dashboard-map-edit[open] > summary::after {
    content: "−";
}

.theme-dark .dashboard-map-edit > summary {
    background: rgb(30 41 59);
    color: rgb(226 232 240);
}

.dashboard-map-popup {
    max-height: min(58vh, 440px);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.dashboard-map-popup .route-popup-form {
    border: 1px solid rgb(226 232 240);
    border-radius: 0.65rem;
    background: white;
    margin-top: 0.65rem;
    padding: 0.55rem;
}

.dashboard-map-popup .route-popup-form textarea {
    min-height: 2.6rem;
    max-height: 5.2rem;
}

.dashboard-map-popup .route-popup-form button {
    position: sticky;
    bottom: 0;
    z-index: 2;
    width: 100%;
    box-shadow: 0 -8px 18px rgb(255 255 255 / 92%);
}

.theme-dark .dashboard-map-popup .route-popup-form {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
}

.theme-dark .dashboard-map-popup .route-popup-form button {
    box-shadow: 0 -8px 18px rgb(15 23 42 / 92%);
}

.dashboard-map-note {
    border-radius: 0.5rem;
    background: rgb(219 234 254);
    color: rgb(30 64 175);
    font-size: 0.72rem;
    font-weight: 800;
    margin: 0.6rem 0 0;
    padding: 0.45rem 0.55rem;
}

.dashboard-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.dashboard-popup-action {
    align-items: center;
    background: rgb(241 245 249);
    border-radius: 0.55rem;
    color: rgb(15 23 42);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    justify-content: center;
    min-height: 2rem;
    padding: 0.45rem 0.7rem;
}

.dashboard-popup-action.primary {
    background: rgb(5 150 105);
    color: white;
}

.dashboard-popup-action:hover {
    filter: brightness(0.96);
}

.dashboard-map-tools > summary {
    display: none;
}

@media (max-width: 480px) {
    .dashboard-map-card {
        max-width: calc(100vw - 2rem);
        padding: 0.75rem;
    }

    .dashboard-map-shell {
        height: 62vh;
        min-height: 320px;
    }

    .dashboard-map-actions .btn,
    .dashboard-map-search .btn {
        width: 100%;
    }

    [data-map-filters] {
        flex-wrap: nowrap;
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        overflow-x: auto;
        padding: 0.15rem 0.25rem 0.35rem;
        scrollbar-width: none;
    }

    [data-map-filters]::-webkit-scrollbar {
        display: none;
    }

    .map-filter {
        flex: 0 0 auto;
        justify-content: center;
        min-height: 2.45rem;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    .route-popup {
        max-height: none;
        width: 100%;
    }

    .dashboard-map-popup {
        max-height: none;
        padding-right: 0;
    }

    .route-popup dl {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }

    .route-popup dt {
        margin-top: 0.3rem;
    }
}

.lead-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
}

.lead-live-search-input {
    font-size: 1rem;
}

.lead-mobile-summary,
.lead-actions-mobile,
.agenda-picker-toggle,
.agenda-mobile-days {
    display: none;
}

.agenda-day-hidden {
    display: none !important;
}

.lead-table tr.hidden {
    display: none !important;
}

.lead-table {
    min-width: 920px;
}

.lead-table th,
.lead-table td {
    vertical-align: top;
    white-space: nowrap;
}

.lead-table td[data-label="Nome"],
.lead-table td[data-label="Endereço"],
.lead-table td[data-label="Referência"],
.lead-table td[data-label="Tags"] {
    max-width: 220px;
    white-space: normal;
}

.lead-actions {
    position: sticky;
    right: 0;
    z-index: 2;
    background: white;
    box-shadow: -8px 0 12px rgb(15 23 42 / 0.06);
}

.lead-table thead th:last-child {
    position: sticky;
    right: 0;
    z-index: 3;
    background: rgb(248 250 252);
    box-shadow: -8px 0 12px rgb(15 23 42 / 0.06);
}

.report-table-wrap {
    overflow-x: auto;
}

.report-column-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.report-column-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgb(203 213 225);
    border-radius: 999px;
    background: white;
    padding: 0.5rem 0.75rem;
    color: rgb(51 65 85);
    cursor: grab;
    user-select: none;
}

.report-column-chip.dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.report-column-chip label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.report-column-handle {
    color: rgb(100 116 139);
    font-weight: 900;
    letter-spacing: -0.12em;
}

.report-table {
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
}

.report-table th,
.report-table td {
    vertical-align: top;
}

.report-row-main td {
    border-top: 4px solid rgb(148 163 184);
}

.report-row-detail td {
    border-bottom: 2px solid rgb(203 213 225);
}

.report-item-even td {
    background: rgb(248 250 252);
}

.report-item-odd td {
    background: rgb(241 245 249);
}

.report-row-detail td {
    font-size: 0.82rem;
}

.report-tags {
    display: inline-block;
    max-width: 10rem;
    color: rgb(71 85 105);
    font-size: 0.72rem;
    line-height: 1.25;
    word-break: break-word;
}

.classification-checks {
    display: grid;
    gap: 0.25rem;
    min-width: 8.5rem;
}

.classification-checks span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgb(51 65 85);
    white-space: nowrap;
}

.classification-checks i {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid rgb(71 85 105);
    background: white;
}

@media (max-width: 767px) {
    .dashboard-map-tools {
        width: 100%;
    }

    .dashboard-map-tools > summary {
        align-items: center;
        border: 1px solid rgb(203 213 225);
        border-radius: 0.7rem;
        color: rgb(51 65 85);
        cursor: pointer;
        display: flex;
        font-size: 0.76rem;
        font-weight: 800;
        gap: 0.4rem;
        justify-content: center;
        min-height: 44px;
        padding: 0.55rem 0.75rem;
    }

    .dashboard-map-tools[open] > summary {
        margin-bottom: 0.5rem;
    }

    .theme-dark .dashboard-map-tools > summary {
        border-color: rgb(71 85 105);
        color: rgb(226 232 240);
    }

    .dashboard-map-mobile-sheet {
        background: white;
        border: 1px solid rgb(226 232 240);
        border-radius: 1rem;
        bottom: 0.5rem;
        box-shadow: 0 -12px 35px rgb(15 23 42 / 0.22);
        box-sizing: border-box;
        display: none;
        flex-direction: column;
        left: 0.5rem;
        max-height: min(72dvh, 34rem);
        overflow: hidden;
        position: absolute;
        right: 0.5rem;
        top: auto;
        z-index: 1000;
    }

    .dashboard-map-mobile-sheet.active {
        display: flex;
    }

    .dashboard-map-mobile-close {
        align-items: center;
        background: white;
        border: 1px solid rgb(203 213 225);
        border-radius: 999px;
        box-shadow: 0 1px 6px rgb(15 23 42 / 0.14);
        color: rgb(15 23 42);
        display: inline-flex;
        font-size: 1.4rem;
        font-weight: 800;
        height: 42px;
        justify-content: center;
        left: auto;
        line-height: 1;
        min-height: 42px;
        padding: 0;
        position: absolute;
        right: 0.65rem;
        top: 0.65rem;
        width: 42px;
        z-index: 4;
    }

    .dashboard-map-mobile-content {
        flex: 1 1 auto;
        min-height: 0;
        overscroll-behavior: contain;
        overflow-y: auto;
        padding: 0.75rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-map-mobile-content::-webkit-scrollbar {
        display: none;
    }

    .dashboard-map-mobile-content .route-popup {
        max-height: none;
        width: 100%;
    }

    .dashboard-map-mobile-content .dashboard-map-popup {
        max-height: none;
        padding-right: 0;
    }

    .dashboard-map-mobile-content .dashboard-map-popup > strong {
        font-size: 1rem;
        line-height: 1.2;
        margin-bottom: 0.45rem;
        min-height: 2.25rem;
        padding-right: 3rem;
    }

    .dashboard-map-mobile-content .dashboard-map-popup dl {
        grid-template-columns: 5.4rem minmax(0, 1fr);
        gap: 0.16rem 0.45rem;
        font-size: 0.76rem;
        line-height: 1.35;
    }

    .dashboard-map-mobile-content .dashboard-map-popup dt {
        font-size: 0.65rem;
        margin-top: 0;
        white-space: nowrap;
    }

    .dashboard-map-mobile-content .dashboard-map-popup dd {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .dashboard-map-mobile-content .dashboard-map-extra {
        margin-top: 0.4rem;
    }

    .dashboard-map-mobile-content .dashboard-map-extra summary {
        font-size: 0.7rem;
        margin-bottom: 0.35rem;
    }

    .dashboard-map-mobile-content .route-popup-form {
        gap: 0.25rem;
        margin-top: 0.45rem;
        padding: 0.45rem;
    }

    .dashboard-map-mobile-content .route-popup-form label {
        font-size: 0.66rem;
    }

    .dashboard-map-mobile-content .route-popup-form select,
    .dashboard-map-mobile-content .route-popup-form button {
        min-height: 2rem;
        padding-bottom: 0.35rem;
        padding-top: 0.35rem;
    }

    .dashboard-map-mobile-content .route-popup-form textarea {
        min-height: 2.25rem;
    }

    .dashboard-map-mobile-content .dashboard-popup-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
        margin-top: 0.6rem;
    }

    .dashboard-map-mobile-content .dashboard-popup-action {
        font-size: 0.7rem;
        min-height: 2.4rem;
        padding: 0.35rem 0.3rem;
    }

    .dashboard-map-mobile-content .dashboard-map-edit > summary {
        min-height: 2.4rem;
    }

    .dashboard-leaflet-popup {
        max-width: calc(100vw - 2rem) !important;
        width: min(300px, calc(100vw - 4.25rem)) !important;
    }

    .dashboard-leaflet-popup .leaflet-popup-content {
        margin: 0;
        max-height: 52vh;
        max-width: 100% !important;
        overflow-y: auto;
        padding: 0.75rem 0.65rem 0.65rem;
        width: 100% !important;
    }

    .dashboard-leaflet-popup .leaflet-popup-content-wrapper {
        box-sizing: border-box;
        max-height: calc(52vh + 1.5rem);
        max-width: 100% !important;
        overflow: hidden;
        padding-right: 1.7rem;
        width: 100%;
    }

    .dashboard-leaflet-popup .leaflet-popup-close-button {
        align-items: center;
        background: rgb(255 255 255 / 94%);
        border-radius: 999px;
        box-shadow: 0 1px 6px rgb(15 23 42 / 0.18);
        display: inline-flex;
        height: 40px !important;
        justify-content: center;
        line-height: 1;
        right: 0.35rem !important;
        top: 0.35rem !important;
        width: 40px !important;
        z-index: 10;
    }

    .dashboard-map-shell {
        height: 62vh;
        min-height: 320px;
    }

    .lead-table-wrap {
        overflow-x: visible;
    }

    .lead-table {
        min-width: 0;
    }

    .lead-table th,
    .lead-table td {
        white-space: normal;
    }

    .lead-actions,
    .lead-table thead th:last-child {
        position: static;
        box-shadow: none;
    }

    .responsive-table thead { display: none; }
    .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
    .responsive-table tr {
        margin-bottom: 1rem;
        border: 1px solid rgb(226 232 240);
        border-radius: 1rem;
        background: white;
        padding: 0.75rem;
    }
    .responsive-table td {
        border: 0;
        padding: 0.45rem 0;
    }
    .responsive-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        font-weight: 800;
        color: rgb(100 116 139);
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

    /* Experiência mobile principal */
    html {
        font-size: 14px;
        scroll-padding-bottom: 5.5rem;
    }

    body {
        font-size: 0.95rem;
        line-height: 1.45;
        padding-bottom: calc(4.75rem + env(safe-area-inset-bottom));
        -webkit-text-size-adjust: 100%;
    }

    main > div {
        padding: 0.9rem 0.75rem 1.25rem;
    }

    [class~="text-3xl"] {
        font-size: 1.5rem !important;
        line-height: 1.18 !important;
    }

    [class~="text-2xl"] {
        font-size: 1.28rem !important;
        line-height: 1.25 !important;
    }

    [class~="text-xl"] {
        font-size: 1.12rem !important;
        line-height: 1.3 !important;
    }

    .mobile-app-header {
        min-height: 3.65rem;
        padding: 0.5rem 0.75rem;
    }

    .mobile-menu-button,
    .mobile-profile-button,
    .theme-toggle-mobile {
        box-sizing: border-box;
        height: 44px;
        min-height: 44px;
        width: 44px;
    }

    .mobile-menu-button {
        align-items: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0.65rem;
    }

    .mobile-brand {
        left: 50%;
        position: absolute;
        transform: translateX(-50%);
    }

    .mobile-brand img {
        border-radius: 0.7rem;
        height: 2.4rem;
        width: 2.4rem;
    }

    .mobile-header-actions {
        gap: 0.4rem;
    }

    .mobile-profile-button {
        border-radius: 0.8rem;
        justify-content: center;
        max-width: none;
        padding: 0.15rem;
    }

    .mobile-profile-button .user-avatar,
    .mobile-profile-button .user-avatar-placeholder {
        height: 2.25rem;
        width: 2.25rem;
    }

    .theme-toggle-mobile {
        border-radius: 0.8rem;
        gap: 0;
        padding: 0;
    }

    .theme-toggle-mobile::before {
        height: 1rem;
        width: 1rem;
    }

    .theme-toggle-mobile [data-theme-label],
    .theme-toggle-mobile[aria-pressed="true"]::after {
        display: none;
    }

    .online-presence-bar {
        padding: 0.35rem 0.85rem;
    }

    .online-presence-bar > div {
        align-items: center;
        flex-direction: row;
        min-height: 1.5rem;
    }

    .online-presence-bar .online-presence-list {
        display: none;
    }

    .online-presence-bar [data-online-count] {
        font-variant-numeric: tabular-nums;
    }

    [data-sidebar] {
        padding-bottom: env(safe-area-inset-bottom);
        width: min(86vw, 20rem);
    }

    [data-sidebar] > div > div:first-child {
        padding: 1rem;
    }

    [data-sidebar] nav {
        overflow-y: auto;
        padding-bottom: 1rem;
        padding-top: 0.75rem;
    }

    [data-sidebar] nav a {
        min-height: 44px;
        padding: 0.65rem 0.9rem;
    }

    [data-sidebar] .theme-toggle,
    [data-sidebar] a[href="logout.php"] {
        min-height: 44px;
    }

    .mobile-bottom-nav {
        align-items: stretch;
        background: rgb(255 255 255 / 96%);
        border-top: 1px solid rgb(226 232 240);
        bottom: 0;
        box-shadow: 0 -8px 24px rgb(15 23 42 / 10%);
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        left: 0;
        padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom));
        position: fixed;
        right: 0;
        z-index: 39;
    }

    .mobile-bottom-link {
        align-items: center;
        background: transparent;
        border: 0;
        border-radius: 0.8rem;
        color: rgb(100 116 139);
        display: flex;
        flex-direction: column;
        font-size: 0.68rem;
        font-weight: 800;
        gap: 0.1rem;
        justify-content: center;
        min-height: 3.35rem;
        padding: 0.2rem;
        text-align: center;
    }

    .mobile-bottom-link.active {
        background: rgb(236 253 245);
        color: rgb(4 120 87);
    }

    .mobile-bottom-link-primary {
        color: rgb(4 120 87);
    }

    .mobile-bottom-link-primary .mobile-bottom-icon {
        background: rgb(5 150 105);
        border-radius: 999px;
        color: white;
        height: 2rem;
        line-height: 1.85rem;
        margin-top: -0.65rem;
        width: 2rem;
    }

    .mobile-bottom-icon {
        display: block;
        font-size: 1.35rem;
        font-weight: 900;
        line-height: 1;
    }

    .theme-dark .mobile-bottom-nav {
        background: rgb(17 24 39 / 97%);
        border-color: rgb(51 65 85);
    }

    .theme-dark .mobile-bottom-link {
        color: rgb(148 163 184);
    }

    .theme-dark .mobile-bottom-link.active {
        background: rgb(6 78 59 / 55%);
        color: rgb(167 243 208);
    }

    .card {
        border-radius: 0.9rem;
    }

    .mobile-filter-panel {
        border: 1px solid rgb(226 232 240);
        border-radius: 0.9rem;
        background: white;
        overflow: hidden;
    }

    .mobile-filter-panel > summary {
        align-items: center;
        color: rgb(15 23 42);
        cursor: pointer;
        display: flex;
        font-size: 0.85rem;
        font-weight: 800;
        justify-content: space-between;
        list-style: none;
        min-height: 48px;
        padding: 0.7rem 0.85rem;
    }

    .mobile-filter-panel > summary::-webkit-details-marker {
        display: none;
    }

    .mobile-filter-panel > summary::after {
        content: "+";
        font-size: 1.25rem;
        line-height: 1;
        margin-left: 0.6rem;
    }

    .mobile-filter-panel[open] > summary::after {
        content: "−";
    }

    .mobile-filter-panel .mobile-filter-hint {
        color: rgb(100 116 139);
        font-size: 0.68rem;
        font-weight: 700;
        margin-left: auto;
    }

    .mobile-filter-panel > form.card {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding-top: 0.25rem;
    }

    .theme-dark .mobile-filter-panel {
        background: rgb(17 24 39);
        border-color: rgb(51 65 85);
    }

    .theme-dark .mobile-filter-panel > summary {
        color: rgb(248 250 252);
    }

    .card.p-5,
    .card.p-6 {
        padding: 1rem;
    }

    section.mt-6,
    div.mt-6 {
        margin-top: 1rem;
    }

    .mb-6 {
        margin-bottom: 1rem;
    }

    .field,
    input,
    select,
    textarea {
        font-size: 16px;
    }

    .field {
        min-height: 44px;
        padding: 0.6rem 0.75rem;
    }

    textarea.field {
        min-height: 5rem;
    }

    .btn {
        border-radius: 0.7rem;
        font-size: 0.8rem;
        min-height: 44px;
        padding: 0.55rem 0.8rem;
    }

    form.card .grid {
        gap: 0.85rem;
    }

    form.card > .mt-5.flex .btn {
        flex: 1 1 8rem;
    }

    .tag-input {
        min-height: 2.9rem;
    }

    .tag-entry {
        min-width: 8rem;
    }

    .ranking-scroll,
    .ranking-scroll-lg {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .responsive-table tr {
        border-radius: 0.85rem;
        margin-bottom: 0.7rem;
        padding: 0.65rem 0.75rem;
    }

    .responsive-table td {
        align-items: start;
        display: grid;
        gap: 0.65rem;
        grid-template-columns: minmax(6.25rem, 34%) minmax(0, 1fr);
        overflow-wrap: anywhere;
        padding: 0.32rem 0;
    }

    .responsive-table td::before {
        font-size: 0.66rem;
        line-height: 1.35;
        margin-top: 0.12rem;
    }

    .responsive-table td[data-label="Ações"] {
        align-items: stretch;
        grid-template-columns: 1fr;
        margin-top: 0.35rem;
    }

    .responsive-table td[data-label="Ações"]::before {
        display: none;
    }

    .lead-table tr[data-lead-row] {
        padding: 0.8rem;
    }

    .lead-table .lead-name-cell {
        display: block;
        padding: 0 0 0.45rem;
    }

    .lead-table .lead-name-cell::before {
        display: none;
    }

    .lead-name-primary {
        display: block;
        font-size: 0.95rem;
        line-height: 1.25;
    }

    .lead-mobile-summary {
        color: rgb(71 85 105);
        display: grid;
        font-size: 0.76rem;
        font-weight: 500;
        gap: 0.3rem;
        line-height: 1.35;
        margin-top: 0.45rem;
    }

    .lead-mobile-summary > a {
        color: rgb(4 120 87);
        font-weight: 800;
    }

    .lead-mobile-details summary,
    .lead-actions-mobile details > summary {
        color: rgb(71 85 105);
        cursor: pointer;
        font-size: 0.72rem;
        font-weight: 800;
        list-style: none;
        padding: 0.25rem 0;
    }

    .lead-mobile-details p {
        margin-top: 0.35rem;
    }

    .lead-table .lead-secondary-cell {
        display: none;
    }

    .lead-table .lead-classification-cell {
        align-items: center;
        border-top: 1px solid rgb(241 245 249);
        grid-template-columns: 5.8rem minmax(0, 1fr);
        margin-top: 0.15rem;
        padding: 0.5rem 0;
    }

    .lead-classification-cell form,
    .lead-classification-cell .classification-select {
        min-width: 0;
        width: 100%;
    }

    .lead-classification-cell form > span {
        display: none;
    }

    .lead-actions-desktop {
        display: none;
    }

    .lead-actions-mobile {
        display: grid;
        gap: 0.45rem;
    }

    .lead-actions-mobile .btn {
        justify-content: center;
        width: 100%;
    }

    .lead-actions-mobile details[open] {
        border-top: 1px solid rgb(241 245 249);
        padding-top: 0.35rem;
    }

    .lead-actions-mobile details form {
        margin-top: 0.35rem;
    }

    .theme-dark .responsive-table tr {
        background: rgb(17 24 39);
        border-color: rgb(51 65 85);
    }

    .theme-dark .lead-mobile-summary,
    .theme-dark .lead-mobile-details summary,
    .theme-dark .lead-actions-mobile details > summary {
        color: rgb(148 163 184);
    }

    .theme-dark .lead-mobile-summary > a {
        color: rgb(110 231 183);
    }

    .theme-dark .lead-table .lead-classification-cell,
    .theme-dark .lead-actions-mobile details[open],
    .theme-dark .agenda-lead-picker.is-open .agenda-picker-toggle {
        border-color: rgb(51 65 85);
    }

    .lead-actions .btn,
    .lead-actions form {
        flex: 1 1 8rem;
    }

    .lead-actions form .btn {
        width: 100%;
    }

    .report-table-wrap,
    .agenda-board,
    .overflow-x-auto {
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .report-table {
        font-size: 0.75rem;
        min-width: 760px;
    }

    .report-table th,
    .report-table td {
        padding: 0.55rem;
    }

    .agenda-board {
        overflow-x: hidden;
        scroll-snap-type: none;
    }

    .agenda-day-head {
        scroll-snap-align: start;
    }

    .agenda-grid {
        grid-template-columns: 3.6rem repeat(7, minmax(7.5rem, 1fr));
    }

    .agenda-grid.mobile-day-view {
        grid-template-columns: 3.6rem minmax(0, 1fr);
        min-width: 0 !important;
        width: 100%;
    }

    .agenda-corner,
    .agenda-day-head {
        min-height: 3.4rem;
        padding: 0.55rem;
    }

    .agenda-time,
    .agenda-slot {
        min-height: 3.65rem;
    }

    .agenda-picker-toggle {
        align-items: center;
        background: transparent;
        border: 0;
        color: rgb(15 23 42);
        display: flex;
        font-size: 0.88rem;
        font-weight: 800;
        justify-content: space-between;
        min-height: 44px;
        padding: 0;
        width: 100%;
    }

    .agenda-picker-content {
        display: none;
        padding-top: 0.65rem;
    }

    .agenda-lead-picker.is-open .agenda-picker-content {
        display: block;
    }

    .agenda-lead-picker.is-open .agenda-picker-toggle {
        border-bottom: 1px solid rgb(226 232 240);
    }

    .agenda-lead-list {
        max-height: 14rem;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .agenda-mobile-days {
        background: rgb(248 250 252);
        border-bottom: 1px solid rgb(226 232 240);
        display: flex;
        gap: 0.35rem;
        overflow-x: auto;
        padding: 0.55rem;
        scrollbar-width: none;
    }

    .agenda-mobile-days::-webkit-scrollbar {
        display: none;
    }

    .agenda-mobile-days button {
        background: white;
        border: 1px solid rgb(226 232 240);
        border-radius: 0.65rem;
        color: rgb(71 85 105);
        flex: 1 0 3.25rem;
        min-height: 2.9rem;
        padding: 0.35rem;
    }

    .agenda-mobile-days button span,
    .agenda-mobile-days button strong {
        display: block;
        font-size: 0.68rem;
        line-height: 1.2;
    }

    .agenda-mobile-days button.active {
        background: rgb(5 150 105);
        border-color: rgb(5 150 105);
        color: white;
    }

    .agenda-grid.mobile-day-view .agenda-item {
        min-height: 3rem;
        width: 100%;
    }

    .theme-dark .agenda-picker-toggle {
        color: rgb(248 250 252);
    }

    .theme-dark .agenda-mobile-days {
        background: rgb(15 23 42);
        border-color: rgb(51 65 85);
    }

    .theme-dark .agenda-mobile-days button {
        background: rgb(17 24 39);
        border-color: rgb(51 65 85);
        color: rgb(203 213 225);
    }

    .theme-dark .agenda-mobile-days button.active {
        background: rgb(5 150 105);
        border-color: rgb(5 150 105);
        color: white;
    }

    .agenda-modal {
        align-items: flex-end;
        padding: 0;
    }

    .agenda-dialog {
        border-radius: 1rem 1rem 0 0;
        max-height: 88dvh;
        padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    }

    .route-saved-list {
        max-height: none;
        padding: 0.75rem;
    }

    .route-list-item {
        padding: 0.85rem;
    }

    .dashboard-map-shell {
        height: 58dvh;
        min-height: 310px;
    }
}

@media (max-width: 480px) {
    .dashboard-map-shell {
        height: 58dvh;
        min-height: 310px;
    }
}

@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

    body {
        background: white;
        font-size: 11px;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    aside,
    .no-print,
    [data-sidebar],
    [data-sidebar-overlay] {
        display: none !important;
    }

    main {
        padding-left: 0 !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid rgb(148 163 184);
        border-radius: 0;
    }

    .print-area {
        color: black;
    }

    .report-lead {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 8px;
        overflow: visible !important;
    }

    .report-lead * {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .report-lead .bg-slate-50,
    .report-lead .rounded-lg {
        background: white !important;
        border-radius: 0 !important;
    }

    .report-lead .p-4 {
        padding: 8px !important;
    }

    .report-lead .p-3 {
        padding: 6px !important;
    }

    .report-lead .space-y-3 > :not([hidden]) ~ :not([hidden]) {
        margin-top: 6px !important;
    }

    .report-checks {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .report-checks label {
        min-height: 28px !important;
        padding: 4px 6px !important;
    }

    .report-text-block {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .report-table-wrap {
        overflow: visible !important;
    }

    .report-table {
        width: 100% !important;
        min-width: 0 !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        font-size: 8.2px !important;
    }

    .report-table th,
    .report-table td {
        border: 1px solid rgb(148 163 184) !important;
        padding: 2px 3px !important;
        line-height: 1.12 !important;
    }

    .report-table thead th {
        background: rgb(226 232 240) !important;
    }

    .report-row-main,
    .report-row-detail {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .report-row-main {
        break-after: avoid;
        page-break-after: avoid;
    }

    .report-row-detail {
        break-before: avoid;
        page-break-before: avoid;
    }

    .report-row-detail td {
        font-size: 7.8px !important;
    }

    .report-row-main td {
        border-top: 2.5px solid rgb(71 85 105) !important;
    }

    .report-row-detail td {
        border-bottom: 1.5px solid rgb(100 116 139) !important;
    }

    .report-item-even td {
        background-color: rgb(248 250 252) !important;
        background-image: linear-gradient(rgb(248 250 252), rgb(248 250 252)) !important;
    }

    .report-item-odd td {
        background-color: rgb(229 231 235) !important;
        background-image: linear-gradient(rgb(229 231 235), rgb(229 231 235)) !important;
    }

    .classification-checks {
        gap: 1px !important;
        min-width: 0 !important;
    }

    .classification-checks span {
        font-size: 7px !important;
        gap: 2px !important;
    }

    .classification-checks i {
        width: 7px !important;
        height: 7px !important;
        border-width: 1px !important;
    }

    .report-tags {
        max-width: 70px !important;
        font-size: 6.8px !important;
        line-height: 1.1 !important;
    }

    .origin-bar-row {
        margin-bottom: 5px !important;
    }

    .origin-bar-row .h-3 {
        height: 7px !important;
    }
}
