:root {
    --geodelix-primary: #007BFF;
    --geodelix-secondary: #00A8FF;
    --geodelix-dark: #0B1F5E;
    --geodelix-bg: #F4F8FC;
    --geodelix-primary-rgb: 0, 123, 255;
    --geodelix-secondary-rgb: 0, 168, 255;
    --geodelix-dark-rgb: 11, 31, 94;
    --font-primary: Montserrat, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg: var(--geodelix-bg);
    --panel: #ffffff;
    --text: var(--geodelix-dark);
    --muted: #667085;
    --line: #dce4ef;
    --brand: var(--geodelix-primary);
    --brand-secondary: var(--geodelix-secondary);
    --brand-dark: var(--geodelix-dark);
    --brand-soft: rgba(var(--geodelix-primary-rgb), 0.12);
    --brand-line: rgba(var(--geodelix-primary-rgb), 0.28);
    --warning: #f5b841;
    --done: #43aa8b;
    --shadow: 0 18px 48px rgba(var(--geodelix-dark-rgb), 0.14);
    --app-height: 100dvh;
    --mobile-bottom-space: calc(env(safe-area-inset-bottom, 0px) + 50px);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    margin: 0;
    min-height: var(--app-height);
    color: var(--text);
    font-family: var(--font-primary);
    background: var(--bg);
}

.shell {
    position: fixed;
    inset: 0;
    width: 100%;
    height: var(--app-height);
    overflow: hidden;
}

.driver-session-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--brand-dark);
    font: inherit;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 28px rgba(var(--geodelix-dark-rgb), 0.08);
    cursor: pointer;
}

.driver-session-button:hover {
    color: #ffffff;
    background: var(--brand);
}

.topbar {
    position: absolute;
    z-index: 530;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    pointer-events: none;
}

.map-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: min(420px, calc(100vw - 32px));
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 32px rgba(var(--geodelix-dark-rgb), 0.12);
    backdrop-filter: blur(14px);
    pointer-events: auto;
}

.map-heading-logo {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    object-fit: contain;
}

h1 {
    margin: 0 0 6px;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1;
    letter-spacing: 0;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.topbar-logo {
    width: 48px;
    max-height: 48px;
    height: auto;
    flex: 0 0 auto;
    align-self: center;
    object-fit: contain;
}

.topbar-brand {
    display: none;
    align-items: center;
    flex: 0 0 48px;
    pointer-events: auto;
}

.topbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.stats {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    pointer-events: auto;
}

.stat {
    appearance: none;
    min-width: 118px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font: inherit;
    text-align: left;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 28px rgba(var(--geodelix-dark-rgb), 0.08);
}

.stat-filter {
    cursor: pointer;
}

.stat-filter:hover {
    border-color: rgba(var(--geodelix-primary-rgb), 0.34);
    background: rgba(255, 255, 255, 0.95);
}

.stat-filter.active {
    border-color: rgba(var(--geodelix-primary-rgb), 0.42);
    color: var(--brand-dark);
    background: rgba(var(--geodelix-primary-rgb), 0.14);
    box-shadow: 0 12px 30px rgba(var(--geodelix-primary-rgb), 0.16);
}

.stat-filter.pending-filter.active {
    border-color: rgba(245, 184, 65, 0.72);
    background: rgba(245, 184, 65, 0.2);
    box-shadow: 0 12px 30px rgba(245, 184, 65, 0.18);
}

.stat-filter.done-filter.active {
    border-color: rgba(67, 170, 139, 0.64);
    background: rgba(67, 170, 139, 0.2);
}

.stat strong {
    display: block;
    font-size: 20px;
    line-height: 1;
}

.stat span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.map-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: var(--app-height);
    border: 0;
    border-radius: 0;
    background: var(--panel);
    box-shadow: none;
}

#map {
    width: 100%;
    height: 100%;
    min-height: var(--app-height);
}

.mapboxgl-map {
    font: inherit;
}

.mapbox-html-marker {
    display: grid;
    place-items: center;
    width: max-content;
    height: max-content;
    cursor: pointer;
}

.mapboxgl-ctrl-bottom-left {
    left: 22px;
    bottom: 22px;
}

.mapboxgl-ctrl-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(var(--geodelix-dark-rgb), 0.14);
}

.mapboxgl-ctrl-group button {
    width: 36px;
    height: 36px;
}

.mapboxgl-popup-content {
    min-width: 190px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    text-align: left;
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(var(--geodelix-dark-rgb), 0.18);
}

.mapboxgl-popup-close-button {
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    padding: 5px 8px;
}

.legend {
    position: absolute;
    z-index: 500;
    right: 16px;
    bottom: 2px;
    display: grid;
    gap: 8px;
    width: min(260px, calc(100% - 32px));
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 32px rgba(var(--geodelix-dark-rgb), 0.12);
    backdrop-filter: blur(14px);
}

.filter-status-button {
    position: absolute;
    z-index: 890;
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 78px);
    min-height: 34px;
    border: 1px solid rgba(var(--geodelix-primary-rgb), 0.22);
    border-radius: 8px;
    padding: 7px 11px;
    color: var(--brand-dark);
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 26px rgba(var(--geodelix-dark-rgb), 0.12);
    backdrop-filter: blur(14px);
    cursor: pointer;
}

.filter-status-button[hidden] {
    display: none;
}

.filter-status-button.pending {
    border-color: rgba(245, 184, 65, 0.62);
    color: #7a4e00;
    background: rgba(255, 250, 235, 0.94);
}

.filter-status-button.done {
    border-color: rgba(67, 170, 139, 0.54);
    color: #1f6b56;
    background: rgba(237, 252, 246, 0.94);
}

.location-panel {
    position: absolute;
    z-index: 510;
    left: 40px;
    bottom: 148px;
    width: 42px;
    height: 42px;
    pointer-events: auto;
}

.location-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--brand-dark);
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 32px rgba(var(--geodelix-dark-rgb), 0.12);
    backdrop-filter: blur(14px);
}

.location-button:hover {
    border-color: #c8d5e4;
}

.location-button.active {
    border-color: rgba(var(--geodelix-primary-rgb), 0.44);
    color: #ffffff;
    background: var(--brand);
}

.location-icon {
    line-height: 1;
}

.location-status {
    display: none;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 32px rgba(var(--geodelix-dark-rgb), 0.1);
    backdrop-filter: blur(14px);
}

.order-card {
    position: absolute;
    z-index: 520;
    top: 108px;
    left: 16px;
    right: 16px;
    width: auto;
    max-height: calc(var(--app-height) - 132px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 42px rgba(var(--geodelix-dark-rgb), 0.16);
    backdrop-filter: blur(14px);
}

.order-card[hidden] {
    display: none;
}

.navigation-progress-card {
    position: absolute;
    z-index: 525;
    top: 108px;
    left: 16px;
    right: 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    border: 1px solid rgba(var(--geodelix-primary-rgb), 0.2);
    border-radius: 8px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 42px rgba(var(--geodelix-dark-rgb), 0.16);
    backdrop-filter: blur(14px);
}

.navigation-progress-card[hidden] {
    display: none;
}

.delivery-reference {
    grid-column: span 2;
    display: grid;
    gap: 4px;
    border: 1px solid rgba(var(--geodelix-primary-rgb), 0.18);
    border-radius: 8px;
    padding: 10px 12px;
    background: rgba(var(--geodelix-primary-rgb), 0.07);
}

.delivery-reference[hidden] {
    display: none;
}

.delivery-reference span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.delivery-reference strong {
    color: var(--text);
    font-size: 14px;
    line-height: 1.35;
}

.navigation-progress-card .navigation-reference {
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
}

.navigation-progress-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.navigation-progress-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.navigation-progress-distance {
    color: var(--text);
    font-size: 26px;
    line-height: 1;
}

.navigation-progress-time {
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 900;
}

.navigation-progress-cancel {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    font-size: 18px;
    background: var(--brand);
    box-shadow: 0 10px 24px rgba(var(--geodelix-primary-rgb), 0.22);
    cursor: pointer;
}

.navigation-progress-cancel:hover {
    background: var(--brand-dark);
}

.order-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.order-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.order-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    object-fit: contain;
}

.order-heading-copy {
    min-width: 0;
}

.order-card-title {
    margin: 0 0 3px;
    font-size: 16px;
    line-height: 1.15;
}

.order-card-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.order-contact {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    min-width: 0;
}

.order-phone {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.contact-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
}

.whatsapp-contact {
    background: #25d366;
}

.phone-contact {
    background: var(--brand);
}

.contact-icon {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.close-card {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    background: #ffffff;
    font-size: 18px;
    line-height: 1;
}

.close-card:hover {
    color: var(--text);
    border-color: #c9d5e4;
}

.order-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.order-row {
    display: grid;
    gap: 3px;
    min-width: 0;
    border: 1px solid rgba(220, 228, 239, 0.9);
    border-radius: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.7);
}

.order-actions-row {
    grid-column: span 2;
    display: none;
}

.order-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.order-value {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.35;
}

.delivery-confirmed-notice {
    grid-column: span 2;
    border: 1px solid rgba(67, 170, 139, 0.28);
    border-radius: 8px;
    padding: 10px 12px;
    color: #1f6b56;
    font-size: 13px;
    font-weight: 900;
    background: rgba(67, 170, 139, 0.12);
}

.delivery-confirmed-notice[hidden] {
    display: none;
}

.route-summary {
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(var(--geodelix-primary-rgb), 0.24);
    border-radius: 8px;
    padding: 10px 12px;
    background: rgba(var(--geodelix-primary-rgb), 0.1);
}

.route-summary.navigating {
    border-color: rgba(var(--geodelix-dark-rgb), 0.22);
    background: rgba(var(--geodelix-dark-rgb), 0.08);
}

.route-summary[hidden] {
    display: none;
}

.route-summary span {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.route-summary strong {
    display: block;
    color: var(--brand-dark);
    font-size: 15px;
    line-height: 1.2;
}

.route-summary.navigating strong {
    color: var(--text);
}

.route-summary strong.loading {
    color: var(--muted);
}

.route-clear-button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 1px solid rgba(var(--geodelix-primary-rgb), 0.24);
    border-radius: 8px;
    color: var(--brand-dark);
    font: inherit;
    font-size: 16px;
    line-height: 1;
    background: #ffffff;
    cursor: pointer;
}

.delivery-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 900;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}

.action-button:disabled {
    cursor: not-allowed;
    opacity: 0.66;
}

.delivered-action {
    color: var(--text);
    background: var(--warning);
    box-shadow: 0 10px 22px rgba(245, 184, 65, 0.28);
}

.delivered-action:hover {
    background: #f0aa22;
}

.route-action {
    color: #ffffff;
    background: var(--brand);
    box-shadow: 0 10px 22px rgba(var(--geodelix-primary-rgb), 0.24);
}

.route-action:hover {
    background: var(--brand-dark);
}

.route-start-action {
    color: #ffffff;
    background: var(--text);
    box-shadow: 0 10px 22px rgba(var(--geodelix-dark-rgb), 0.22);
}

.route-start-action:hover {
    background: var(--brand-dark);
}

.route-backup-action {
    border: 1px solid var(--line);
    color: var(--brand-dark);
    background: #ffffff;
}

.route-backup-action:hover {
    border-color: rgba(var(--geodelix-primary-rgb), 0.4);
    background: rgba(var(--geodelix-primary-rgb), 0.08);
}

.navigation-action-bar {
    position: absolute;
    z-index: 900;
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
    left: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    pointer-events: none;
}

.navigation-action-bar[hidden] {
    display: none;
}

.navigation-action-bar.single-action {
    grid-template-columns: minmax(0, min(360px, 100%));
    justify-content: center;
}

.navigation-action-bar .action-button {
    width: 100%;
    min-height: 48px;
    pointer-events: auto;
}

.navigation-action-bar .action-button[hidden] {
    display: none;
}

.action-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: currentColor;
}

.signature-modal {
    position: fixed;
    z-index: 1200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(var(--geodelix-dark-rgb), 0.38);
    backdrop-filter: blur(10px);
}

.signature-modal[hidden] {
    display: none;
}

.signature-card {
    width: min(520px, 100%);
    max-height: min(760px, calc(var(--app-height) - 36px));
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.signature-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.signature-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.signature-logo {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    object-fit: contain;
}

.signature-kicker {
    margin: 0 0 4px;
    color: #7a4e00;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.signature-order {
    margin: 0;
    color: var(--text);
    font-size: 19px;
    font-weight: 900;
    line-height: 1.15;
}

.signature-copy {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
}

.signature-form {
    display: grid;
    gap: 12px;
}

.field-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.text-field {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font: inherit;
    background: #ffffff;
}

.text-field:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(var(--geodelix-primary-rgb), 0.16);
}

.document-field {
    font-weight: 900;
}

.notes-field {
    min-height: 82px;
    resize: vertical;
}

.signature-pad-wrap {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.signature-pad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    background: #f8fafc;
}

.signature-pad {
    display: block;
    width: 100%;
    height: 190px;
    touch-action: none;
    background:
        linear-gradient(transparent 72%, rgba(102, 112, 133, 0.22) 72%, rgba(102, 112, 133, 0.22) 73%, transparent 73%),
        #ffffff;
}

.signature-help,
.signature-error {
    margin: -4px 0 0;
    font-size: 12px;
    line-height: 1.35;
}

.signature-help {
    color: var(--muted);
}

.signature-error {
    color: #a74300;
    font-weight: 800;
}

.signature-error[hidden] {
    display: none;
}

.text-button {
    border: 0;
    padding: 6px 0;
    color: var(--brand-dark);
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    background: transparent;
}

.signature-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 2px;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    background: #ffffff;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: 5px 10px;
    color: #7a4e00;
    font-size: 12px;
    font-weight: 900;
    background: rgba(245, 184, 65, 0.22);
}

.status-badge.pending,
.status-badge.priority {
    color: #7a4e00;
    background: rgba(245, 184, 65, 0.22);
}

.status-badge.done {
    color: #1f6b56;
    background: rgba(67, 170, 139, 0.18);
}

.legend-title {
    margin: 0 0 2px;
    font-size: 13px;
    text-transform: uppercase;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.legend-filter-button {
    appearance: none;
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 5px 7px;
    font: inherit;
    text-align: left;
    background: transparent;
    cursor: pointer;
}

.legend-filter-button:hover,
.legend-filter-button.active {
    background: rgba(var(--geodelix-primary-rgb), 0.1);
}

.legend-filter-button:not(.active) {
    opacity: 0.72;
}

.legend-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
}

.legend-dot.pending {
    background: var(--warning);
}

.legend-dot.done {
    background: var(--done);
}

.delivery-marker {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 3px solid #ffffff;
    border-radius: 999px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    background: var(--warning);
    box-shadow: 0 10px 22px rgba(245, 184, 65, 0.34);
}

.delivery-marker.priority {
    background: var(--warning);
    color: var(--text);
    box-shadow: 0 10px 22px rgba(245, 184, 65, 0.34);
}

.delivery-marker.done {
    background: var(--done);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(67, 170, 139, 0.34);
}

/* Entrega mas cercana pendiente: rojo con halo pulsante */
.delivery-marker.nearest {
    border-color: #ffffff !important;
    background: #ef233c !important;
    box-shadow: 0 0 0 0 rgba(239, 35, 60, 0.62), 0 12px 26px rgba(239, 35, 60, 0.34) !important;
    color: #ffffff !important;
    animation: pulse-nearest 1.45s ease-out infinite;
    z-index: 2000 !important;
}

@keyframes pulse-nearest {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 35, 60, 0.66), 0 12px 26px rgba(239, 35, 60, 0.34);
    }
    70% {
        box-shadow: 0 0 0 18px rgba(239, 35, 60, 0), 0 12px 26px rgba(239, 35, 60, 0.24);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 35, 60, 0), 0 12px 26px rgba(239, 35, 60, 0.34);
    }
}

/* Texto chico con la distancia en metros dentro del popup */
.delivery-distance {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 400;
    color: var(--text);
    letter-spacing: 0.5px;
}

.driver-marker {
    position: relative;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    transform: rotate(var(--driver-heading, 0deg));
    transform-origin: center;
    transition: transform 160ms linear;
}

.driver-marker::before {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: inherit;
    background: rgba(var(--geodelix-primary-rgb), 0.12);
    box-shadow: 0 0 0 10px rgba(var(--geodelix-primary-rgb), 0.08);
}

.driver-navigation-arrow {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--brand);
    font-size: 32px;
    filter: drop-shadow(0 3px 0 #ffffff) drop-shadow(0 10px 16px rgba(var(--geodelix-dark-rgb), 0.24));
}

.driver-navigation-arrow i {
    transform: translate(1px, -1px) rotate(-45deg);
    transform-origin: center;
}

.popup-title {
    margin: 0 0 6px;
    font-size: 15px;
}

.popup-copy {
    margin: 0 0 8px;
    color: #667085;
    font-size: 13px;
    line-height: 1.35;
}

.popup-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.popup-pill {
    border-radius: 999px;
    padding: 4px 8px;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
    background: rgba(var(--geodelix-primary-rgb), 0.12);
}

@media (max-width: 760px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
        left: 10px;
        right: 10px;
        top: 10px;
    }

    .topbar-brand {
        display: inline-flex;
    }

    .topbar-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }

    .stats {
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: 6px;
        min-width: 0;
    }

    .stat {
        flex: 1 1 0;
        min-width: 0;
        padding: 7px 7px;
    }

    .stat strong {
        font-size: 17px;
    }

    .stat span {
        font-size: 9px;
    }

    .driver-session-button {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        font-size: 15px;
    }

    .map-heading {
        display: none;
    }

    .mapboxgl-popup {
        display: none;
    }

    .order-card {
        top: calc(env(safe-area-inset-top, 0px) + 66px);
        right: 10px;
        left: 10px;
        width: auto;
        min-height: 178px;
        max-height: none;
        overflow: visible;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 8px 8px 20px;
    }

    .navigation-progress-card {
        top: calc(env(safe-area-inset-top, 0px) + 66px);
        right: 10px;
        left: 10px;
        padding: 10px 12px;
    }

    .navigation-progress-distance {
        font-size: 24px;
    }

    .order-card::before {
        content: none;
    }

    .order-card-header {
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
    }

    .order-contact {
        display: none;
    }

    .order-logo {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .order-card-title {
        max-width: calc(100vw - 104px);
        overflow: hidden;
        font-size: 14px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .order-card-subtitle {
        max-width: calc(100vw - 104px);
        overflow: hidden;
        font-size: 11px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .order-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        overflow: visible;
        padding-bottom: 10px;
    }

    .order-row {
        min-width: 0;
        padding: 5px 7px;
    }

    .order-label {
        font-size: 9px;
        line-height: 1;
    }

    .order-value {
        overflow: hidden;
        font-size: 12px;
        line-height: 1.2;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .order-actions-row {
        grid-column: 1 / -1;
        min-height: 50px;
    }

    .route-summary,
    .delivery-reference,
    .delivery-confirmed-notice {
        grid-column: 1 / -1;
        min-height: 42px;
        padding: 8px 9px;
    }

    .delivery-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .delivery-actions .delivered-action,
    .delivery-actions .route-backup-action {
        display: none;
    }

    .delivery-actions.route-navigation-active .route-action {
        display: none;
    }

    .action-button {
        min-height: 40px;
        font-size: 12px;
    }

    .status-badge {
        padding: 4px 8px;
        font-size: 11px;
    }

    .navigation-action-bar {
        right: 12px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
        left: 12px;
    }

    .filter-status-button {
        right: 12px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
        min-height: 32px;
        padding: 6px 10px;
    }

    .location-panel {
        left: 30px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 148px);
        width: 42px;
        height: 42px;
    }

    .signature-modal {
        align-items: end;
        padding: 10px;
    }

    .signature-card {
        max-height: calc(var(--app-height) - 20px);
        padding: 16px;
    }

}
