:root {
    --okd-purple-deep: #7f00b2;
    --okd-purple: #8e22bb;
    --okd-violet: #ab49cc;
    --okd-blue: #1e91ed;
    --okd-sky: #4ca1f5;
    --okd-ink: #17152a;
    --okd-muted: #706c82;
    --okd-line: rgba(127, 0, 178, 0.13);
    --okd-surface: #ffffff;
    --okd-canvas: #f7f6fc;
    --okd-soft-purple: rgba(171, 73, 204, 0.10);
    --okd-soft-blue: rgba(76, 161, 245, 0.12);
    --okd-green: #198754;
    --okd-orange: #e58a00;
    --okd-red: #d43b55;
    --okd-gradient: linear-gradient(135deg, #7f00b2 0%, #8e22bb 30%, #ab49cc 53%, #1e91ed 79%, #4ca1f5 100%);
    --okd-gradient-horizontal: linear-gradient(90deg, #7f00b2 0%, #ab49cc 49%, #1e91ed 100%);
    --okd-shadow-sm: 0 8px 24px rgba(70, 38, 112, 0.09);
    --okd-shadow-md: 0 18px 46px rgba(70, 38, 112, 0.15);
    --okd-shadow-lg: 0 28px 72px rgba(55, 26, 96, 0.24);
    --okd-radius: 22px;
    --okd-topbar-height: 72px;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--okd-violet) rgba(127, 0, 178, 0.07);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(127, 0, 178, 0.06);
}

*::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--okd-gradient);
    background-clip: padding-box;
}

html {
    min-height: 100%;
    background: var(--okd-canvas);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    padding-top: calc(var(--okd-topbar-height) + env(safe-area-inset-top, 0px));
    color: var(--okd-ink);
    background:
        radial-gradient(circle at 6% 5%, rgba(171, 73, 204, 0.14), transparent 30rem),
        radial-gradient(circle at 96% 12%, rgba(30, 145, 237, 0.13), transparent 26rem),
        linear-gradient(180deg, #fbfaff 0%, #f4f7ff 54%, #f8f6fc 100%);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3,
h4,
.brand strong,
.detail-brand strong,
.quote-panel strong,
.order-number,
.detail-hero h1,
.detail-summary strong {
    font-family: "Montserrat", "Inter", sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.topbar {
    position: fixed;
    z-index: 1100;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    height: calc(var(--okd-topbar-height) + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) max(18px, env(safe-area-inset-right, 0px)) 0 max(18px, env(safe-area-inset-left, 0px));
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #fff;
    background: var(--okd-gradient);
    box-shadow: 0 14px 34px rgba(82, 25, 139, 0.24);
}

.topbar::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.34);
}

.brand,
.detail-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 14px;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.30), 0 9px 22px rgba(45, 16, 86, 0.20);
    font-size: 18px;
}

.brand > div,
.detail-brand > span:last-child {
    min-width: 0;
}

.brand strong,
.detail-brand strong {
    display: block;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.045em;
    line-height: 1;
}

.brand strong span,
.detail-brand strong span {
    color: #fff;
}

.brand small,
.detail-brand small {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.76);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-indicator {
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 11px;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    font-size: 9px;
    font-weight: 850;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.live-indicator i {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #35dc83;
    box-shadow: 0 0 0 3px rgba(53, 220, 131, 0.18), 0 0 12px rgba(53, 220, 131, 0.70);
}

.customer-shell {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 24px 18px 44px;
}

.lookup-card,
.store-card,
#orderCard,
.orders-card,
.map-section,
.detail-panel,
.detail-summary article,
.empty-state,
.orders-grid > article,
.orders-grid > a,
.customer-order-card,
.order-summary-card {
    border: 1px solid var(--okd-line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--okd-shadow-sm);
}

.lookup-card,
.store-card,
#orderCard,
.orders-card {
    border-radius: var(--okd-radius);
}

.lookup-card {
    display: grid;
    padding: 24px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    align-items: center;
    gap: 24px;
    overflow: hidden;
}

.lookup-card::before {
    content: "";
    position: absolute;
}

.eyebrow {
    display: block;
    margin: 0 0 7px;
    color: var(--okd-purple);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.lookup-card h1,
.section-heading h2,
.store-card h2,
.map-heading h3,
.orders-card h2 {
    margin: 0;
    color: var(--okd-ink);
    letter-spacing: -0.045em;
}

.lookup-card h1 {
    font-size: clamp(27px, 4vw, 39px);
    line-height: 1.04;
}

.lookup-card > div:first-child > p,
.store-card p {
    margin: 9px 0 0;
    color: var(--okd-muted);
    font-size: 12px;
    line-height: 1.55;
}

.lookup-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.lookup-row input,
.customer-form input,
.map-search input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border: 1px solid rgba(127, 0, 178, 0.17);
    border-radius: 15px;
    color: var(--okd-ink);
    background: #fff;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(38, 25, 58, 0.03);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.lookup-row input:focus,
.customer-form input:focus,
.map-search input:focus {
    border-color: var(--okd-violet);
    box-shadow: 0 0 0 4px rgba(171, 73, 204, 0.12);
}

.lookup-row input::placeholder,
.customer-form input::placeholder,
.map-search input::placeholder {
    color: #aaa5b6;
}

.lookup-row button,
.register-button,
.customer-modal-primary {
    display: inline-flex;
    min-height: 54px;
    padding: 0 20px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 15px;
    color: #fff;
    background: var(--okd-gradient-horizontal);
    box-shadow: 0 12px 25px rgba(99, 30, 160, 0.23);
    font-weight: 850;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.lookup-row button:hover,
.register-button:not(:disabled):hover,
.customer-modal-primary:hover {
    transform: translateY(-1px);
    filter: saturate(1.08);
    box-shadow: 0 16px 30px rgba(83, 34, 147, 0.28);
}

.lookup-row button:disabled,
.register-button:disabled,
.customer-modal-primary:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
}

.form-message {
    grid-column: 1 / -1;
    min-height: 18px;
    margin: 8px 0 0;
    color: var(--okd-muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.45;
}

.form-message.error,
.field-feedback.error {
    color: var(--okd-red);
}

.form-message.success,
.field-feedback.success {
    color: var(--okd-green);
}

.store-card {
    display: flex;
    margin-top: 16px;
    padding: 18px 20px;
    align-items: center;
    gap: 14px;
}

.store-logo {
    display: grid;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 17px;
    color: #fff;
    background: var(--okd-gradient);
    box-shadow: 0 12px 26px rgba(107, 31, 166, 0.23);
    font-size: 21px;
}

.store-card h2 {
    font-size: 18px;
}

#orderCard,
.orders-card {
    margin-top: 18px;
    padding: 22px;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading h2 {
    font-size: 22px;
}

.customer-form {
    display: grid;
    gap: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.customer-form label {
    display: grid;
    gap: 7px;
    color: var(--okd-ink);
    font-size: 11px;
    font-weight: 850;
}

.field-feedback {
    min-height: 15px;
    color: var(--okd-muted);
    font-size: 9px;
    line-height: 1.4;
}

.location-status {
    display: flex;
    margin: 16px 0;
    padding: 14px 15px;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(30, 145, 237, 0.17);
    border-radius: 16px;
    color: #126ea9;
    background: rgba(76, 161, 245, 0.09);
}

.location-status > i {
    display: grid;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--okd-blue), var(--okd-sky));
}

.location-status strong,
.location-status span {
    display: block;
}

.location-status strong {
    font-size: 11px;
}

.location-status span {
    margin-top: 4px;
    color: var(--okd-muted);
    font-size: 9px;
    line-height: 1.4;
}

.location-status.success {
    border-color: rgba(25, 135, 84, 0.20);
    color: var(--okd-green);
    background: rgba(25, 135, 84, 0.08);
}

.location-status.success > i {
    background: linear-gradient(135deg, #17884f, #26aa68);
}

.location-status.error {
    border-color: rgba(212, 59, 85, 0.20);
    color: var(--okd-red);
    background: rgba(212, 59, 85, 0.08);
}

.location-status.error > i {
    background: linear-gradient(135deg, #c92e49, #e1546d);
}

.quote-panel {
    display: grid;
    margin-bottom: 17px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.quote-panel > div {
    padding: 17px;
    border: 1px solid var(--okd-line);
    border-radius: 17px;
    background: linear-gradient(135deg, rgba(171, 73, 204, 0.06), rgba(76, 161, 245, 0.08));
    text-align: center;
}

.quote-panel > div:last-child {
    border: 0;
    color: #fff;
    background: var(--okd-gradient);
    box-shadow: 0 14px 30px rgba(99, 32, 157, 0.23);
}

.quote-panel span {
    display: block;
    color: var(--okd-muted);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quote-panel > div:last-child span {
    color: rgba(255, 255, 255, 0.78);
}

.quote-panel strong {
    display: inline-flex;
    margin-top: 7px;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    font-size: 30px;
    letter-spacing: -0.045em;
}

.quote-panel small {
    font-size: 12px;
    font-weight: 800;
}

.map-section {
    position: relative;
    margin-top: 2px;
    padding: 17px;
    border-radius: 19px;
    overflow: visible;
}

.map-search {
    position: relative;
    margin-bottom: 14px;
    padding: 13px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--okd-soft-purple), var(--okd-soft-blue));
}

.map-search label {
    display: flex;
    margin-bottom: 8px;
    align-items: center;
    gap: 7px;
    color: var(--okd-purple-deep);
    font-size: 10px;
    font-weight: 850;
}

.map-search p {
    margin: 7px 0 0;
    color: var(--okd-muted);
    font-size: 8px;
    line-height: 1.4;
}

.address-results {
    position: absolute;
    z-index: 1050;
    top: calc(100% - 4px);
    right: 13px;
    left: 13px;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--okd-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--okd-shadow-md);
}

.address-results button,
.address-results > div,
.address-result {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid rgba(127, 0, 178, 0.08);
    color: var(--okd-ink);
    background: #fff;
    font-size: 10px;
    line-height: 1.45;
    text-align: left;
}

.address-results button:hover,
.address-result:hover {
    background: linear-gradient(135deg, var(--okd-soft-purple), var(--okd-soft-blue));
}

.map-heading {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.map-heading h3 {
    font-size: 18px;
}

.map-heading > small {
    max-width: 320px;
    color: var(--okd-muted);
    font-size: 9px;
    line-height: 1.45;
    text-align: right;
}

.map-heading > small i {
    margin-right: 5px;
    color: var(--okd-purple);
}

/* El mapa queda rectangular y con menor altura; se elimina cualquier relación cuadrada. */
.customer-map {
    width: 100% !important;
    height: 290px !important;
    min-height: 0 !important;
    max-height: 290px !important;
    aspect-ratio: auto !important;
    border: 1px solid rgba(127, 0, 178, 0.14);
    border-radius: 17px;
    overflow: hidden;
    background: #eceaf3;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.50);
}

.customer-map .leaflet-control-zoom a,
.tracking-map .leaflet-control-zoom a {
    border-color: var(--okd-line) !important;
    color: var(--okd-purple-deep) !important;
    background: #fff !important;
}

.customer-map .leaflet-control-attribution,
.tracking-map .leaflet-control-attribution {
    color: var(--okd-muted);
    background: rgba(255, 255, 255, 0.88) !important;
    font-size: 8px;
}

.selected-location {
    display: flex;
    margin-top: 11px;
    padding: 11px 12px;
    align-items: flex-start;
    gap: 9px;
    border-radius: 13px;
    color: var(--okd-muted);
    background: linear-gradient(135deg, rgba(171, 73, 204, 0.07), rgba(76, 161, 245, 0.09));
    font-size: 9px;
    line-height: 1.45;
}

.selected-location i {
    margin-top: 2px;
    color: var(--okd-purple);
}

.register-button {
    width: 100%;
    min-height: 59px;
    margin-top: 17px;
    font-size: 13px;
    letter-spacing: 0.035em;
}

.orders-card {
    margin-bottom: 18px;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 13px;
}

.empty-state {
    display: flex;
    min-height: 150px;
    padding: 26px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    border-style: dashed;
    border-radius: 18px;
    color: var(--okd-muted);
    text-align: center;
}

.empty-state i {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 17px;
    color: var(--okd-purple);
    background: linear-gradient(135deg, var(--okd-soft-purple), var(--okd-soft-blue));
    font-size: 21px;
}

.empty-state p {
    max-width: 390px;
    margin: 0;
    font-size: 10px;
    line-height: 1.55;
}

/* Compatibilidad con las tarjetas generadas dinámicamente por customer-assets/app.js. */
.orders-grid > article,
.orders-grid > a,
.customer-order-card,
.order-summary-card,
.order-list-card,
.order-item {
    position: relative;
    display: block;
    min-width: 0;
    padding: 17px;
    overflow: hidden;
    border-radius: 18px;
    color: var(--okd-ink);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.orders-grid > article::before,
.orders-grid > a::before,
.customer-order-card::before,
.order-summary-card::before,
.order-list-card::before,
.order-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--okd-gradient);
}

.orders-grid > article:hover,
.orders-grid > a:hover,
.customer-order-card:hover,
.order-summary-card:hover,
.order-list-card:hover,
.order-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--okd-shadow-md);
}

.orders-grid :is(.order-top, .order-header, .order-card-top, .order-summary-top) {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.orders-grid :is(.order-number, h3, h4) {
    margin: 0;
    font-size: 15px;
    letter-spacing: -0.03em;
}

.orders-grid :is(.order-store, .order-route, .order-customer, .order-driver, .order-meta, .order-details) {
    margin-top: 11px;
    color: var(--okd-muted);
    font-size: 9px;
    line-height: 1.5;
}

.orders-grid :is(.order-store, .order-route, .order-customer, .order-driver) i {
    margin-right: 6px;
    color: var(--okd-purple);
}

.status-pill,
.order-status,
.order-status-pill,
.detail-status {
    display: inline-flex;
    min-height: 27px;
    padding: 0 9px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(127, 0, 178, 0.12);
    border-radius: 999px;
    color: var(--okd-purple-deep);
    background: var(--okd-soft-purple);
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

:is(.status-pill, .order-status, .order-status-pill, .detail-status).pending,
.pending :is(.status-pill, .order-status, .order-status-pill) {
    color: #9a6200;
    background: rgba(229, 138, 0, 0.12);
}

:is(.status-pill, .order-status, .order-status-pill, .detail-status).assigned,
.assigned :is(.status-pill, .order-status, .order-status-pill) {
    color: var(--okd-purple-deep);
    background: var(--okd-soft-purple);
}

:is(.status-pill, .order-status, .order-status-pill, .detail-status).delivering,
.delivering :is(.status-pill, .order-status, .order-status-pill) {
    color: #0876c4;
    background: rgba(30, 145, 237, 0.13);
}

:is(.status-pill, .order-status, .order-status-pill, .detail-status).delivered,
.delivered :is(.status-pill, .order-status, .order-status-pill) {
    color: var(--okd-green);
    background: rgba(25, 135, 84, 0.11);
}

:is(.status-pill, .order-status, .order-status-pill, .detail-status).cancelled,
.cancelled :is(.status-pill, .order-status, .order-status-pill) {
    color: #787280;
    background: rgba(112, 108, 130, 0.11);
}

.toast {
    position: fixed;
    z-index: 1600;
    top: calc(var(--okd-topbar-height) + env(safe-area-inset-top, 0px) + 12px);
    right: 16px;
    left: 16px;
    max-width: 450px;
    margin: auto;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.23);
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(135deg, rgba(127, 0, 178, 0.97), rgba(30, 145, 237, 0.97));
    box-shadow: var(--okd-shadow-lg);
    font-size: 10px;
    font-weight: 750;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-14px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
    opacity: 1;
    transform: none;
}

.customer-modal {
    position: fixed;
    z-index: 1700;
    inset: 0;
    display: grid;
    padding: 18px;
    place-items: center;
}

.customer-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 12, 36, 0.62);
}

.customer-modal-card {
    position: relative;
    width: min(100%, 440px);
    max-height: calc(100vh - 36px);
    padding: 27px 23px 22px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 25px;
    background: #fff;
    box-shadow: var(--okd-shadow-lg);
    text-align: center;
}

.customer-modal-icon {
    display: grid;
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    place-items: center;
    border-radius: 20px;
    color: #fff;
    background: var(--okd-gradient);
    box-shadow: 0 14px 30px rgba(95, 28, 153, 0.25);
    font-size: 23px;
}

.customer-modal-icon.success {
    background: linear-gradient(135deg, #198754, #29ae6d);
}

.customer-modal-card h3 {
    margin: 0 0 9px;
    font-size: 22px;
    letter-spacing: -0.04em;
}

.customer-modal-card p {
    margin: 0 0 18px;
    color: var(--okd-muted);
    font-size: 10px;
    line-height: 1.6;
}

.customer-modal-primary,
.customer-modal-secondary {
    width: 100%;
    min-height: 52px;
}

.customer-modal-secondary {
    margin-top: 8px;
    border: 1px solid var(--okd-line);
    border-radius: 15px;
    color: var(--okd-purple-deep);
    background: linear-gradient(135deg, var(--okd-soft-purple), var(--okd-soft-blue));
    font-weight: 850;
}

.leaflet-container {
    font-family: "Inter", sans-serif;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    color: var(--okd-ink);
    background: #fff;
}

.leaflet-popup-content-wrapper {
    border-radius: 13px;
    box-shadow: var(--okd-shadow-md);
}

.driver-map-icon,
.customer-driver-marker {
    display: grid !important;
    width: 36px !important;
    height: 36px !important;
    margin: -18px 0 0 -18px !important;
    place-items: center !important;
    border: 3px solid #fff !important;
    border-radius: 50% !important;
    color: #fff !important;
    background: var(--okd-gradient-horizontal) !important;
    box-shadow: 0 6px 18px rgba(57, 23, 96, 0.30) !important;
}

@media (max-width: 760px) {
    :root {
        --okd-topbar-height: 66px;
        --okd-radius: 19px;
    }

    body {
        padding-top: calc(var(--okd-topbar-height) + env(safe-area-inset-top, 0px));
    }

    .topbar {
        padding-right: max(12px, env(safe-area-inset-right, 0px));
        padding-left: max(12px, env(safe-area-inset-left, 0px));
    }

    .brand-mark {
        width: 37px;
        height: 37px;
        border-radius: 12px;
        font-size: 16px;
    }

    .brand strong,
    .detail-brand strong {
        font-size: 17px;
    }

    .brand small,
    .detail-brand small {
        font-size: 8px;
    }

    .live-indicator {
        min-height: 29px;
        padding: 0 9px;
        font-size: 8px;
    }

    .customer-shell {
        padding: 16px 12px 34px;
    }

    .lookup-card {
        padding: 19px;
        grid-template-columns: 1fr;
        gap: 17px;
    }

    .lookup-card h1 {
        font-size: 28px;
    }

    #orderCard,
    .orders-card {
        padding: 17px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .map-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .map-heading > small {
        max-width: none;
        text-align: left;
    }

    .customer-map {
        height: 230px !important;
        max-height: 230px !important;
    }

    .orders-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 470px) {
    .brand small,
    .detail-brand small {
        max-width: 150px;
    }

    .live-indicator > span,
    #socketState {
        max-width: 78px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .lookup-row {
        grid-template-columns: 1fr;
    }

    .lookup-row button {
        width: 100%;
    }

    .quote-panel {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .quote-panel > div {
        padding: 13px 9px;
    }

    .quote-panel strong {
        font-size: 25px;
    }

    .map-section {
        padding: 13px;
    }

    .customer-map {
        height: 215px !important;
        max-height: 215px !important;
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ========================================================================
 * INDEX.PHP — GRID COMPACTO DE ÓRDENES
 * Corrige tarjetas grandes, separación, iconografía y desbordamientos.
 * ======================================================================== */
.orders-card {
    padding: 18px;
    overflow: hidden;
}

.orders-card > .section-heading {
    margin-bottom: 13px;
}

.orders-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    align-items: start;
    gap: 10px;
}

.orders-grid > :not(.empty-state) {
    position: relative;
    display: flex !important;
    width: 100%;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 12px 12px 11px 15px !important;
    overflow: hidden !important;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--okd-line) !important;
    border-radius: 15px !important;
    color: var(--okd-ink);
    background: #fff !important;
    box-shadow: 0 5px 16px rgba(70, 38, 112, 0.075) !important;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.orders-grid > :not(.empty-state)::before {
    width: 3px !important;
}

.orders-grid > :not(.empty-state):hover {
    border-color: rgba(127, 0, 178, .23) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 9px 22px rgba(70, 38, 112, .11) !important;
}

.orders-grid > :not(.empty-state),
.orders-grid > :not(.empty-state) * {
    min-width: 0;
    max-width: 100%;
}

.orders-grid > :not(.empty-state) :is(strong, b, span, small, p, h3, h4, div) {
    overflow-wrap: anywhere;
    word-break: normal;
}

.orders-grid :is(.order-top, .order-header, .order-card-top, .order-summary-top, .okd-order-card-head) {
    display: grid !important;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px !important;
}

.orders-grid :is(.order-number, .okd-order-number, h3, h4) {
    display: flex;
    min-width: 0;
    margin: 0 !important;
    align-items: center;
    gap: 7px;
    color: var(--okd-ink);
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1.18;
    letter-spacing: -.025em;
}

.okd-order-number-icon {
    display: inline-grid;
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: var(--okd-gradient-horizontal);
    box-shadow: 0 6px 13px rgba(127, 0, 178, .18);
    font-size: 10px;
}

.orders-grid :is(.status-pill, .order-status, .order-status-pill) {
    min-height: 23px !important;
    padding: 0 7px !important;
    font-size: 7px !important;
    line-height: 1;
}

.orders-grid :is(.order-store, .order-route, .order-customer, .order-driver, .order-meta, .order-details) {
    width: 100%;
    margin-top: 0 !important;
    color: var(--okd-muted);
    font-size: 8px !important;
    line-height: 1.35 !important;
}

.orders-grid .okd-order-field {
    display: grid !important;
    width: 100%;
    margin: 0 !important;
    padding: 7px 8px !important;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 7px !important;
    border: 1px solid rgba(127, 0, 178, .07);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(171, 73, 204, .045), rgba(76, 161, 245, .055));
}

.okd-order-field-icon {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 8px;
    color: var(--okd-purple);
    background: #fff;
    box-shadow: 0 3px 8px rgba(70, 38, 112, .08);
    font-size: 9px;
}

.okd-order-field-content {
    display: block;
    min-width: 0;
}

.orders-grid .okd-order-field :is(span, small) {
    display: block;
    color: var(--okd-muted);
    font-size: 7px !important;
    font-weight: 750;
    line-height: 1.25;
}

.orders-grid .okd-order-field :is(strong, b) {
    display: block;
    margin-top: 2px;
    color: var(--okd-ink);
    font-size: 9px !important;
    font-weight: 800;
    line-height: 1.28;
}

.okd-order-open-hint {
    display: flex;
    width: 100%;
    margin-top: 1px;
    padding-top: 8px;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    border-top: 1px solid rgba(127, 0, 178, .08);
    color: var(--okd-purple);
    font-size: 7px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .045em;
}

.okd-order-open-hint i {
    color: var(--okd-blue);
    font-size: 8px;
}

.orders-grid .empty-state {
    grid-column: 1 / -1;
}

@media (max-width: 760px) {
    .orders-card {
        padding: 14px;
    }

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

@media (max-width: 560px) {
    .orders-grid {
        grid-template-columns: 1fr;
    }

    .orders-grid > :not(.empty-state) {
        padding: 12px 12px 10px 15px !important;
    }
}

/* ========================================================================
 * AJUSTE DEFINITIVO DE LAS CARDS DE ÓRDENES EN INDEX.PHP
 * - Más espacio entre icono y texto de sede/motorizado.
 * - Sin placa del motorizado.
 * - Tipografía reducida, excepto el número de orden.
 * - Contenido siempre contenido dentro de la tarjeta.
 * ======================================================================== */
.orders-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 225px), 1fr));
    gap: 11px;
}

.orders-grid > :not(.empty-state) {
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 11px 13px 10px 15px !important;
    gap: 7px !important;
    overflow: hidden !important;
}

.orders-grid > :not(.empty-state),
.orders-grid > :not(.empty-state) *,
.orders-grid .okd-order-field,
.orders-grid .okd-order-field-content,
.orders-grid .okd-order-field-content * {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

.orders-grid > :not(.empty-state) :is(strong, b, span, small, p, h3, h4, div),
.orders-grid .okd-order-field-content,
.orders-grid .okd-order-field-content * {
    overflow: hidden !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
    text-overflow: clip !important;
}

/* El número de orden conserva una fuente destacada. */
.orders-grid :is(.order-number, .okd-order-number, h3, h4) {
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
}

.okd-order-number-icon {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
    font-size: 9px;
}

.orders-grid :is(.status-pill, .order-status, .order-status-pill) {
    min-height: 21px !important;
    padding: 0 6px !important;
    font-size: 6.5px !important;
}

.orders-grid .okd-order-field {
    min-height: 36px;
    padding: 6px 8px !important;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px !important;
    border-radius: 9px;
}

.okd-order-field-icon {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    font-size: 8px;
}

/* Separación solicitada entre el icono y el nombre. */
.orders-grid .okd-order-field-store,
.orders-grid .okd-order-field-driver {
    grid-template-columns: 24px minmax(0, 1fr) !important;
    column-gap: 16px !important;
    padding-left: 8px !important;
    padding-right: 9px !important;
}

.orders-grid .okd-order-field-store .okd-order-field-icon,
.orders-grid .okd-order-field-driver .okd-order-field-icon {
    width: 24px;
    height: 24px;
}

.orders-grid .okd-order-field-store .okd-order-field-content,
.orders-grid .okd-order-field-driver .okd-order-field-content {
    width: 100%;
    padding-left: 0 !important;
}

/* Tipografía compacta para todos los datos internos. */
.orders-grid .okd-order-field :is(span, small),
.orders-grid .okd-order-field-label {
    font-size: 6.5px !important;
    font-weight: 750 !important;
    line-height: 1.2 !important;
}

.orders-grid .okd-order-field :is(strong, b),
.orders-grid .okd-order-field-value {
    margin-top: 1px !important;
    font-size: 8px !important;
    font-weight: 800 !important;
    line-height: 1.24 !important;
}

/* Ocultamiento defensivo de cualquier campo de placa. */
.orders-grid :is(.order-plate, .vehicle-plate, [data-order-plate]) {
    display: none !important;
}

/* Tarifa centrada, en negrita, pero sin competir con el número de orden. */
.orders-grid .okd-order-field-fee {
    display: grid !important;
    min-height: 50px;
    padding: 7px 10px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    place-items: center;
    gap: 2px !important;
    text-align: center;
    border-color: rgba(127, 0, 178, .12);
    background: linear-gradient(135deg, rgba(127, 0, 178, .08), rgba(30, 145, 237, .09));
}

.orders-grid .okd-order-field-fee .okd-order-field-icon,
.orders-grid .okd-order-field-fee > i {
    display: none !important;
}

.orders-grid .okd-order-field-fee .okd-order-field-content {
    display: grid;
    width: 100%;
    justify-items: center;
    gap: 2px;
    text-align: center;
}

.orders-grid .okd-order-field-fee .okd-order-fee-label {
    font-size: 6.5px !important;
    font-weight: 850 !important;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.orders-grid .okd-order-field-fee .okd-order-fee-value,
.orders-grid .okd-order-field-fee :is(strong, b) {
    width: 100%;
    margin: 0 !important;
    color: var(--okd-purple-deep) !important;
    font-family: "Montserrat", "Inter", sans-serif;
    font-size: 14px !important;
    font-weight: 900 !important;
    line-height: 1.08 !important;
    text-align: center;
}

.okd-order-open-hint {
    padding-top: 7px;
    gap: 5px;
    font-size: 6.5px;
}

.okd-order-open-hint i {
    font-size: 7px;
}

@media (max-width: 760px) {
    .orders-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }
}

@media (max-width: 560px) {
    .orders-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================================================
 * CARDS DE ÓRDENES AGRUPADAS — AJUSTE V14
 * - Tipografía general más pequeña; número de orden permanece destacado.
 * - Estado en la primera línea y número de orden en la línea siguiente.
 * - Órdenes separadas por activas, completadas, canceladas y no entregadas.
 * ======================================================================== */
.orders-card {
    overflow: hidden;
}

.orders-grid {
    display: block !important;
    width: 100%;
    min-width: 0;
}

.okd-order-group {
    width: 100%;
    min-width: 0;
    margin: 0 0 18px;
    padding: 12px;
    border: 1px solid rgba(127, 0, 178, .10);
    border-radius: 16px;
    background: rgba(255, 255, 255, .64);
}

.okd-order-group:last-child {
    margin-bottom: 0;
}

.okd-order-group-heading {
    display: flex;
    width: 100%;
    min-width: 0;
    margin-bottom: 10px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.okd-order-group-heading > div {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.okd-order-group-heading h3 {
    min-width: 0;
    margin: 0;
    color: var(--okd-ink);
    font-family: "Montserrat", "Inter", sans-serif;
    font-size: 10px !important;
    font-weight: 850;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.okd-order-group-icon {
    display: grid;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 8px;
    color: var(--okd-purple);
    background: linear-gradient(135deg, rgba(171, 73, 204, .12), rgba(76, 161, 245, .13));
    font-size: 9px;
}

.okd-order-group-count {
    display: grid;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--okd-gradient-horizontal);
    font-size: 8px;
    font-weight: 900;
}

.okd-order-group-completed .okd-order-group-icon {
    color: #176fb4;
    background: rgba(76, 161, 245, .13);
}

.okd-order-group-cancelled .okd-order-group-icon {
    color: #7f00b2;
    background: rgba(127, 0, 178, .10);
}

.okd-order-group-undelivered .okd-order-group-icon {
    color: #706978;
    background: rgba(112, 105, 120, .10);
}

.okd-order-group-grid {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
    gap: 12px;
}

.okd-order-card-compact {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 9px 11px 9px 13px !important;
    gap: 5px !important;
    font-size: 7px !important;
}

.okd-order-card-compact,
.okd-order-card-compact * {
    max-width: 100% !important;
}

.okd-order-card-compact :is(span, small, p, div, strong, b) {
    font-size: 7px !important;
    line-height: 1.22 !important;
}

.okd-order-head {
    display: grid;
    width: 100%;
    min-width: 0;
    padding: 0 0 7px;
    gap: 5px;
    border-bottom: 1px solid rgba(127, 0, 178, .08);
}

.okd-order-status-row {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
}

.okd-order-number-row {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
}

.okd-order-number-row .okd-order-number,
.okd-order-card-compact .okd-order-number,
.okd-order-card-compact .order-number {
    display: flex !important;
    width: 100%;
    min-width: 0;
    align-items: center;
    gap: 7px;
    color: var(--okd-ink) !important;
    font-family: "Montserrat", "Inter", sans-serif !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.08 !important;
    overflow-wrap: anywhere !important;
}

.okd-order-card-compact :is(.status-pill, .order-status, .order-status-pill) {
    min-height: 18px !important;
    padding: 0 6px !important;
    border-radius: 999px !important;
    font-size: 5.8px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

.okd-order-card-compact .okd-order-number-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    font-size: 7px !important;
}

.okd-order-card-compact .okd-order-field {
    min-height: 31px;
    padding: 5px 7px !important;
    grid-template-columns: 19px minmax(0, 1fr);
    gap: 7px !important;
    border-radius: 8px;
}

.okd-order-card-compact .okd-order-field-icon {
    width: 19px;
    height: 19px;
    border-radius: 6px;
    font-size: 7px !important;
}

.okd-order-card-compact .okd-order-field-store,
.okd-order-card-compact .okd-order-field-driver {
    grid-template-columns: 20px minmax(0, 1fr) !important;
    column-gap: 16px !important;
}

.okd-order-card-compact .okd-order-field-store .okd-order-field-icon,
.okd-order-card-compact .okd-order-field-driver .okd-order-field-icon {
    width: 20px;
    height: 20px;
}

.okd-order-card-compact .okd-order-field :is(span, small),
.okd-order-card-compact .okd-order-field-label {
    font-size: 5.8px !important;
    font-weight: 750 !important;
    line-height: 1.15 !important;
}

.okd-order-card-compact .okd-order-field :is(strong, b),
.okd-order-card-compact .okd-order-field-value {
    margin-top: 1px !important;
    font-size: 7px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
}

.okd-order-card-compact .okd-order-field-fee {
    min-height: 42px;
    padding: 6px 8px !important;
}

.okd-order-card-compact .okd-order-field-fee .okd-order-fee-label {
    font-size: 5.8px !important;
}

.okd-order-card-compact .okd-order-field-fee .okd-order-fee-value,
.okd-order-card-compact .okd-order-field-fee :is(strong, b) {
    font-size: 11px !important;
    font-weight: 900 !important;
}

.okd-order-card-compact .okd-order-open-hint {
    padding-top: 6px;
    gap: 4px;
    font-size: 5.8px !important;
}

.okd-order-card-compact .okd-order-open-hint i {
    font-size: 6px !important;
}

@media (max-width: 760px) {
    .okd-order-group {
        padding: 10px;
    }

    .okd-order-group-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }
}

@media (max-width: 560px) {
    .okd-order-group-grid {
        grid-template-columns: 1fr;
    }

    .okd-order-group-heading h3 {
        font-size: 9px !important;
    }
}


/* =====================================================================
 * AJUSTE FINAL — GRUPOS CON SUBTÍTULOS, SIN CONTENEDORES ADICIONALES
 * ===================================================================== */
.orders-card {
    overflow: visible !important;
    border: 1px solid rgba(127, 0, 178, 0.16) !important;
    background: linear-gradient(145deg, rgba(248, 245, 255, 0.98), rgba(242, 248, 255, 0.98)) !important;
    box-shadow: 0 16px 38px rgba(65, 29, 105, 0.10) !important;
}

.orders-card > .section-heading {
    margin-bottom: 16px !important;
}

.orders-grid.okd-orders-flat-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 13px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Es únicamente un subtítulo de separación: no es una tarjeta ni un contenedor. */
.orders-grid > .okd-order-group-heading,
.orders-grid > .okd-order-group-subtitle {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: auto minmax(24px, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 0 !important;
    margin: 17px 0 0 !important;
    padding: 0 2px 7px !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(127, 0, 178, 0.18) !important;
    border-radius: 0 !important;
    color: var(--okd-ink, #17152a) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.orders-grid > .okd-order-group-heading:first-child,
.orders-grid > .okd-order-group-subtitle:first-child {
    margin-top: 0 !important;
}

.orders-grid > .okd-order-group-heading h3,
.orders-grid > .okd-order-group-subtitle h3 {
    margin: 0 !important;
    padding: 0 !important;
    color: #5d2481 !important;
    font-family: "Montserrat", "Inter", sans-serif !important;
    font-size: 10px !important;
    font-weight: 850 !important;
    line-height: 1.25 !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
}

.orders-grid > .okd-order-group-heading .okd-order-group-line,
.orders-grid > .okd-order-group-subtitle .okd-order-group-line {
    display: block !important;
    min-width: 24px !important;
    height: 1px !important;
    background: linear-gradient(90deg, rgba(142, 34, 187, 0.28), rgba(30, 145, 237, 0.06)) !important;
}

.orders-grid > .okd-order-group-heading .okd-order-group-count,
.orders-grid > .okd-order-group-subtitle .okd-order-group-count {
    display: inline-grid !important;
    min-width: 23px !important;
    height: 23px !important;
    padding: 0 6px !important;
    place-items: center !important;
    border: 1px solid rgba(127, 0, 178, 0.14) !important;
    border-radius: 999px !important;
    color: #7f00b2 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    font-family: "Inter", sans-serif !important;
    font-size: 7px !important;
    font-weight: 900 !important;
}

/* Cada orden vuelve a ser una tarjeta claramente independiente. */
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact {
    position: relative !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 11px !important;
    overflow: hidden !important;
    border: 1.5px solid rgba(127, 0, 178, 0.23) !important;
    border-radius: 15px !important;
    color: var(--okd-ink, #17152a) !important;
    background: #ffffff !important;
    box-shadow: 0 8px 20px rgba(70, 32, 111, 0.13) !important;
    outline: 1px solid rgba(255, 255, 255, 0.86) !important;
    outline-offset: -3px !important;
}

.orders-grid.okd-orders-flat-grid > .okd-order-card-compact::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 4px !important;
    height: auto !important;
    border-radius: 15px 0 0 15px !important;
    background: linear-gradient(180deg, #7f00b2, #ab49cc, #1e91ed) !important;
    pointer-events: none !important;
}

.orders-grid.okd-orders-flat-grid > .okd-order-card-compact:hover {
    transform: translateY(-2px) !important;
    border-color: rgba(127, 0, 178, 0.35) !important;
    box-shadow: 0 12px 28px rgba(70, 32, 111, 0.18) !important;
}

/* Anula cualquier contenedor heredado de una versión almacenada en caché. */
.orders-grid > .okd-order-group {
    display: contents !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.orders-grid > .okd-order-group > .okd-order-group-grid {
    display: contents !important;
}

@media (max-width: 920px) {
    .orders-grid.okd-orders-flat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 560px) {
    .orders-card {
        padding: 15px !important;
    }

    .orders-grid.okd-orders-flat-grid {
        grid-template-columns: 1fr !important;
        gap: 11px !important;
    }

    .orders-grid > .okd-order-group-heading,
    .orders-grid > .okd-order-group-subtitle {
        margin-top: 14px !important;
        padding-bottom: 6px !important;
    }

    .orders-grid > .okd-order-group-heading h3,
    .orders-grid > .okd-order-group-subtitle h3 {
        font-size: 9px !important;
    }
}

/* =====================================================================
 * AJUSTE DE LEGIBILIDAD — COMERCIO/SEDE, MOTORIZADO Y TARIFA
 * ===================================================================== */
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact {
    font-size: 7.6px !important;
}

.orders-grid.okd-orders-flat-grid > .okd-order-card-compact :is(span, small, p, div, strong, b) {
    font-size: 7.6px !important;
    line-height: 1.28 !important;
}

/* Mantiene las etiquetas compactas, pero más legibles. */
.orders-grid.okd-orders-flat-grid .okd-order-field :is(span, small),
.orders-grid.okd-orders-flat-grid .okd-order-field-label {
    font-size: 6.3px !important;
    line-height: 1.2 !important;
}

/* Separa claramente el icono del nombre del comercio/sede y del motorizado. */
.orders-grid.okd-orders-flat-grid .okd-order-field-store,
.orders-grid.okd-orders-flat-grid .okd-order-field-driver {
    grid-template-columns: 22px minmax(0, 1fr) !important;
    column-gap: 21px !important;
    min-height: 38px !important;
    padding: 7px 9px !important;
    align-items: center !important;
}

.orders-grid.okd-orders-flat-grid .okd-order-field-store .okd-order-field-icon,
.orders-grid.okd-orders-flat-grid .okd-order-field-driver .okd-order-field-icon {
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px !important;
    font-size: 8px !important;
}

.orders-grid.okd-orders-flat-grid .okd-order-field-store .okd-order-field-content,
.orders-grid.okd-orders-flat-grid .okd-order-field-driver .okd-order-field-content {
    min-width: 0 !important;
    width: 100% !important;
    padding-left: 0 !important;
}

/* Nombres de comercio/sede y motorizado ligeramente más grandes. */
.orders-grid.okd-orders-flat-grid .okd-order-field-store :is(strong, b, .okd-order-field-value),
.orders-grid.okd-orders-flat-grid .okd-order-field-driver :is(strong, b, .okd-order-field-value) {
    display: block !important;
    width: 100% !important;
    margin-top: 2px !important;
    color: var(--okd-ink, #17152a) !important;
    font-size: 9px !important;
    font-weight: 850 !important;
    line-height: 1.32 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
}

/* Tarifa más visible, centrada y en negrita. */
.orders-grid.okd-orders-flat-grid .okd-order-field-fee {
    min-height: 48px !important;
    padding: 8px 10px !important;
}

.orders-grid.okd-orders-flat-grid .okd-order-field-fee .okd-order-fee-label {
    font-size: 6.4px !important;
}

.orders-grid.okd-orders-flat-grid .okd-order-field-fee .okd-order-fee-value,
.orders-grid.okd-orders-flat-grid .okd-order-field-fee :is(strong, b) {
    font-family: "Montserrat", "Inter", sans-serif !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    line-height: 1.08 !important;
    text-align: center !important;
}

@media (max-width: 560px) {
    .orders-grid.okd-orders-flat-grid .okd-order-field-store,
    .orders-grid.okd-orders-flat-grid .okd-order-field-driver {
        column-gap: 19px !important;
    }

    .orders-grid.okd-orders-flat-grid .okd-order-field-store :is(strong, b, .okd-order-field-value),
    .orders-grid.okd-orders-flat-grid .okd-order-field-driver :is(strong, b, .okd-order-field-value) {
        font-size: 9.2px !important;
    }
}

/* =====================================================================
 * AJUSTE V17 — FUENTE REALMENTE MÁS GRANDE EN LAS CARDS DE ÓRDENES
 * ===================================================================== */
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact {
    font-size: 11px !important;
}

.orders-grid.okd-orders-flat-grid > .okd-order-card-compact :is(span, small, p, div, strong, b) {
    font-size: 11px !important;
    line-height: 1.34 !important;
}

/* Estado en la primera línea. */
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact :is(.status-pill, .order-status, .order-status-pill) {
    min-height: 22px !important;
    padding: 0 9px !important;
    font-size: 8.5px !important;
    font-weight: 900 !important;
}

/* Número de orden destacado en la segunda línea. */
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact :is(.okd-order-number, .order-number) {
    font-size: 18px !important;
    line-height: 1.12 !important;
}

.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-number-icon {
    width: 25px !important;
    height: 25px !important;
    flex-basis: 25px !important;
    font-size: 9px !important;
}

/* Etiquetas internas: Sede, Motorizado, Fecha, Tarifa, etc. */
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field :is(span, small),
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-label {
    font-size: 8.5px !important;
    line-height: 1.24 !important;
}

/* Valores generales dentro de la tarjeta. */
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field :is(strong, b),
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-value {
    font-size: 11px !important;
    line-height: 1.34 !important;
}

/* Nombre del comercio/sede y del motorizado: más grandes y legibles. */
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-store :is(strong, b, .okd-order-field-value),
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-driver :is(strong, b, .okd-order-field-value) {
    font-size: 12.5px !important;
    font-weight: 850 !important;
    line-height: 1.38 !important;
}

/* Conserva una separación amplia entre icono y nombre. */
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-store,
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-driver {
    grid-template-columns: 24px minmax(0, 1fr) !important;
    column-gap: 22px !important;
    min-height: 44px !important;
    padding: 8px 10px !important;
}

.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-store .okd-order-field-icon,
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-driver .okd-order-field-icon {
    width: 24px !important;
    height: 24px !important;
    flex-basis: 24px !important;
    font-size: 9px !important;
}

/* Monto de la tarifa más grande, centrado y en negrita. */
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-fee {
    min-height: 56px !important;
    padding: 9px 11px !important;
}

.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-fee .okd-order-fee-label {
    font-size: 8.5px !important;
}

.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-fee .okd-order-fee-value,
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-fee :is(strong, b) {
    font-size: 18px !important;
    font-weight: 900 !important;
    line-height: 1.08 !important;
}

.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-open-hint,
.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-open-hint span {
    font-size: 9px !important;
}

.orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-open-hint i {
    font-size: 9px !important;
}

.orders-grid.okd-orders-flat-grid > .okd-order-group-heading h3,
.orders-grid.okd-orders-flat-grid > .okd-order-group-subtitle h3 {
    font-size: 11.5px !important;
}

.orders-grid.okd-orders-flat-grid > .okd-order-group-heading .okd-order-group-count,
.orders-grid.okd-orders-flat-grid > .okd-order-group-subtitle .okd-order-group-count {
    font-size: 9px !important;
}

@media (max-width: 560px) {
    .orders-grid.okd-orders-flat-grid > .okd-order-card-compact {
        font-size: 11.5px !important;
    }

    .orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-store :is(strong, b, .okd-order-field-value),
    .orders-grid.okd-orders-flat-grid > .okd-order-card-compact .okd-order-field-driver :is(strong, b, .okd-order-field-value) {
        font-size: 13px !important;
    }
}


/* ================================================================
 * Búsqueda pública compacta
 * - Sin id_store: solo título, campo y lupa unidos.
 * - Con id_store: el bloque visible no se renderiza desde index.php.
 * ================================================================ */
.lookup-card-search-only {
    display: grid;
    padding: 19px 22px 17px;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    overflow: visible;
}

.lookup-card-search-only .lookup-title {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.11em;
}

.lookup-row-attached {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 0;
}

.lookup-row-attached input {
    min-width: 0;
    height: 52px;
    border-radius: 14px 0 0 14px;
}

.lookup-row-attached input:focus {
    position: relative;
    z-index: 2;
}

.lookup-row-attached button {
    width: 56px;
    min-width: 56px;
    min-height: 52px;
    height: 52px;
    padding: 0;
    border-radius: 0 14px 14px 0;
    box-shadow: 0 9px 21px rgba(99, 30, 160, 0.20);
}

.lookup-row-attached button i {
    margin: 0;
    font-size: 17px;
}

.lookup-card-search-only .form-message {
    min-height: 0;
    margin-top: 0;
}

.lookup-card-search-only .form-message:empty {
    display: none;
}

@media (max-width: 680px) {
    .lookup-card-search-only {
        padding: 16px;
        gap: 9px;
    }
}

@media (max-width: 470px) {
    .lookup-row.lookup-row-attached {
        grid-template-columns: minmax(0, 1fr) 52px;
    }

    .lookup-row-attached button {
        width: 52px;
        min-width: 52px;
    }
}

/* =====================================================================
 * V19 — INSTALACIÓN PWA, NOTIFICACIONES Y CONTADOR DE GRUPOS
 * ===================================================================== */
.topbar-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.install-app-button {
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 13px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    color: #6d198f;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(41, 13, 73, 0.20);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.install-app-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 11px 24px rgba(41, 13, 73, 0.25);
}

.install-app-button:disabled {
    opacity: 0.62;
    cursor: wait;
    transform: none;
}

.install-app-button i {
    font-size: 11px;
}

body.pwa-modal-open {
    overflow: hidden;
}

.pwa-modal-card {
    width: min(100%, 430px);
}

.customer-modal-icon.notification {
    background: linear-gradient(135deg, #7f00b2, #1e91ed);
}

.ios-install-steps {
    display: grid;
    margin: 2px 0 19px;
    gap: 9px;
    text-align: left;
}

.ios-install-steps > div {
    display: grid;
    grid-template-columns: 39px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border: 1px solid rgba(127, 0, 178, 0.12);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(171, 73, 204, 0.07), rgba(76, 161, 245, 0.08));
}

.ios-install-steps > div > span {
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, #8e22bb, #1e91ed);
    font-size: 14px;
}

.ios-install-steps p {
    min-width: 0;
    margin: 0;
    color: var(--okd-muted);
    font-size: 10px;
    line-height: 1.38;
    overflow-wrap: anywhere;
}

.ios-install-steps strong {
    display: block;
    margin-bottom: 2px;
    color: var(--okd-ink);
    font-size: 11px;
    font-weight: 900;
}

/* El contador deja de ser un círculo fijo: crece según la cantidad. */
.orders-grid.okd-orders-flat-grid > .okd-order-group-heading,
.orders-grid.okd-orders-flat-grid > .okd-order-group-subtitle {
    grid-template-columns: minmax(0, max-content) minmax(18px, 1fr) max-content !important;
}

.orders-grid.okd-orders-flat-grid > .okd-order-group-heading .okd-order-group-count,
.orders-grid.okd-orders-flat-grid > .okd-order-group-subtitle .okd-order-group-count {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 36px !important;
    max-width: none !important;
    height: 30px !important;
    padding: 0 10px !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(127, 0, 178, 0.18) !important;
    border-radius: 999px !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #8e22bb, #1e91ed) !important;
    box-shadow: 0 6px 15px rgba(96, 35, 151, 0.17) !important;
    font-family: "Montserrat", "Inter", sans-serif !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

@media (max-width: 760px) {
    .topbar {
        gap: 9px;
    }

    .topbar-actions {
        gap: 6px;
    }

    .install-app-button {
        min-height: 31px;
        padding: 0 10px;
        gap: 6px;
        font-size: 8.5px;
    }

    .install-app-button i {
        font-size: 9px;
    }
}

@media (max-width: 470px) {
    .topbar {
        padding-right: max(9px, env(safe-area-inset-right, 0px));
        padding-left: max(9px, env(safe-area-inset-left, 0px));
    }

    .brand {
        gap: 8px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }

    .brand strong {
        font-size: 15px;
    }

    .brand small {
        display: none;
    }

    .install-app-button {
        min-height: 30px;
        padding: 0 9px;
        font-size: 8px;
    }

    .live-indicator {
        min-width: 28px;
        max-width: 58px !important;
        min-height: 30px;
        padding: 0 8px;
        font-size: 7px;
    }

    .orders-grid.okd-orders-flat-grid > .okd-order-group-heading,
    .orders-grid.okd-orders-flat-grid > .okd-order-group-subtitle {
        grid-template-columns: minmax(0, auto) minmax(12px, 1fr) max-content !important;
        gap: 8px !important;
    }

    .orders-grid.okd-orders-flat-grid > .okd-order-group-heading .okd-order-group-count,
    .orders-grid.okd-orders-flat-grid > .okd-order-group-subtitle .okd-order-group-count {
        min-width: 34px !important;
        height: 28px !important;
        padding: 0 9px !important;
        font-size: 11px !important;
    }
}

/* =====================================================================
 * V20 — IDENTIDAD VISUAL DEL LOGO EN HEADER, PWA Y NOTIFICACIONES
 * ===================================================================== */
.brand-mark.brand-mark-logo {
    display: flex;
    width: 48px;
    height: 48px;
    min-width: 48px;
    padding: 0;
    align-items: center;
    justify-content: center;
    overflow: visible;
    border: 0;
    border-radius: 0;
    color: #ffffff;
    background: transparent;
    box-shadow: none;
}

.brand-mark.brand-mark-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 6px 10px rgba(35, 7, 62, 0.18));
    pointer-events: none;
    user-select: none;
}

.brand > div,
.detail-brand > span:last-child {
    min-width: 0;
}

@media (max-width: 760px) {
    .brand-mark.brand-mark-logo {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }
}

@media (max-width: 470px) {
    .brand-mark.brand-mark-logo {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .brand,
    .detail-brand {
        gap: 10px;
    }
}

/* V22: permiso de notificaciones como primer paso al abrir la PWA */
.okd-standalone .pwa-modal#notificationPromptModal:not([hidden]) {
    z-index: 30000;
}

.okd-standalone .pwa-modal#notificationPromptModal:not([hidden]) .customer-modal-backdrop {
    background: rgba(22, 11, 31, .76);
}

.okd-standalone .pwa-modal#notificationPromptModal:not([hidden]) .pwa-modal-card {
    position: relative;
    z-index: 2;
}

/* =====================================================================
 * V23 — REGISTRO PREVIO DEL CLIENTE Y DATOS FIJOS EN LA SOLICITUD
 * ===================================================================== */
.customer-request-card {
    display: grid;
    gap: 15px;
}

.customer-profile-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(150px, .75fr) minmax(170px, .85fr);
    gap: 10px;
}

.customer-profile-summary[hidden] {
    display: none !important;
}

.customer-profile-summary article {
    display: grid;
    min-width: 0;
    min-height: 74px;
    padding: 13px 14px;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(127, 0, 178, .12);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(171, 73, 204, .07), rgba(76, 161, 245, .07));
}

.customer-profile-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #8e22bb, #1e91ed);
    box-shadow: 0 8px 18px rgba(91, 30, 146, .18);
    font-size: 14px;
}

.customer-profile-summary article > div {
    min-width: 0;
}

.customer-profile-summary small,
.customer-profile-summary strong {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.customer-profile-summary small {
    margin-bottom: 4px;
    color: var(--okd-muted);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .07em;
    line-height: 1.25;
    text-transform: uppercase;
}

.customer-profile-summary strong {
    color: var(--okd-ink);
    font-family: "Montserrat", "Inter", sans-serif;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.35;
}

.customer-registration-card {
    width: min(100%, 470px);
    max-height: min(92dvh, 720px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.customer-registration-card > p {
    max-width: 390px;
    margin-inline: auto;
}

.customer-registration-form {
    display: grid;
    margin: 17px 0 7px;
    gap: 7px;
    text-align: left;
}

.customer-registration-form label {
    margin: 4px 2px 0;
    color: var(--okd-ink);
    font-size: 9px;
    font-weight: 850;
}

.registration-input {
    display: grid;
    min-width: 0;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: stretch;
    border: 1px solid rgba(127, 0, 178, .15);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 7px 18px rgba(75, 32, 109, .06);
}

.registration-input > i {
    display: grid;
    min-height: 48px;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #8e22bb, #1e91ed);
    font-size: 13px;
}

.registration-input input {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0 13px;
    border: 0;
    outline: 0;
    color: var(--okd-ink);
    background: #fff;
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 750;
}

.registration-input:focus-within {
    border-color: rgba(30, 145, 237, .62);
    box-shadow: 0 0 0 3px rgba(30, 145, 237, .10), 0 9px 22px rgba(75, 32, 109, .08);
}

.registration-message {
    min-height: 17px;
    margin: 7px 0 5px;
    text-align: center;
}

.customer-registration-card .customer-modal-primary {
    width: 100%;
}

.detail-status.status-completed,
.detail-status.status-delivered {
    background: rgba(25, 175, 105, .28) !important;
}

.detail-status.status-cancelled,
.detail-status.status-canceled,
.detail-status.status-undelivered,
.detail-status.status-lost {
    background: rgba(201, 46, 73, .32) !important;
}

.detail-status.status-delivering,
.detail-status.status-assigned {
    background: rgba(30, 145, 237, .28) !important;
}

@media (max-width: 760px) {
    .customer-profile-summary {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .customer-profile-summary article {
        min-height: 66px;
        padding: 11px 12px;
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 11px;
    }

    .customer-profile-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 13px;
    }

    .customer-profile-summary strong {
        font-size: 11.5px;
    }
}

@media (max-width: 470px) {
    .customer-registration-card {
        width: min(100%, 420px);
        padding: 20px 17px;
    }

    .registration-input {
        grid-template-columns: 39px minmax(0, 1fr);
    }

    .registration-input > i,
    .registration-input input {
        min-height: 46px;
    }

    .registration-input input {
        padding-inline: 11px;
        font-size: 11px;
    }
}

/* ========================================================================
 * V24 — SOLICITUD COMPACTA, CLIENTE SIMPLE Y MAPA GPS BLOQUEADO
 * ======================================================================== */
.customer-request-card-compact {
    display: grid;
    gap: 12px;
    padding: 16px !important;
}

.customer-request-card-compact .request-heading {
    margin: 0;
}

.customer-request-card-compact .request-heading .eyebrow {
    font-size: 9px;
}

.customer-profile-name-only {
    display: flex !important;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 10px 13px;
    align-items: center;
    gap: 13px;
    border: 1px solid rgba(127, 0, 178, .12);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(127, 0, 178, .055), rgba(76, 161, 245, .07));
    box-shadow: none;
}

.customer-profile-name-only[hidden] {
    display: none !important;
}

.customer-profile-name-only .customer-profile-icon {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: var(--okd-gradient-horizontal);
    box-shadow: 0 5px 13px rgba(127, 0, 178, .18);
    font-size: 12px;
}

.customer-profile-name-only > strong {
    min-width: 0;
    color: var(--okd-ink);
    font-family: "Montserrat", "Inter", sans-serif;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.customer-request-card-compact .request-quote-panel {
    margin: 0;
}

.customer-request-card-compact .request-map-section {
    margin: 0;
    padding: 11px;
    border-radius: 14px;
}

.customer-request-card-compact .request-map-heading {
    margin-bottom: 8px;
    align-items: center;
}

.customer-request-card-compact .request-map-heading h3 {
    margin-top: 2px;
    font-size: 14px;
}

.customer-request-card-compact .request-map-heading > small {
    display: inline-flex;
    min-height: 25px;
    padding: 0 8px;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    color: #fff;
    background: var(--okd-gradient-horizontal);
    font-size: 7px;
    font-weight: 850;
    white-space: nowrap;
}

.customer-map-locked {
    height: 160px !important;
    min-height: 160px !important;
    max-height: 160px !important;
    cursor: default !important;
    border-radius: 12px !important;
    touch-action: none;
    user-select: none;
}

.customer-map-locked .leaflet-control-zoom {
    display: none !important;
}

.customer-map-locked .leaflet-marker-icon,
.customer-map-locked .leaflet-tile-pane,
.customer-map-locked .leaflet-map-pane {
    cursor: default !important;
}

.customer-request-card-compact .register-button {
    margin-top: 0;
}

.customer-registration-form .registration-input input {
    text-transform: uppercase;
}

@media (max-width: 760px) {
    .customer-request-card-compact {
        gap: 10px;
        padding: 14px !important;
    }

    .customer-profile-name-only {
        min-height: 45px;
        padding: 9px 11px;
        gap: 11px;
    }

    .customer-profile-name-only > strong {
        font-size: 13px;
    }

    .customer-map-locked {
        height: 145px !important;
        min-height: 145px !important;
        max-height: 145px !important;
    }
}

@media (max-width: 470px) {
    .customer-request-card-compact .request-map-section {
        padding: 9px;
    }

    .customer-request-card-compact .request-map-heading {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .customer-request-card-compact .request-map-heading > small {
        max-width: none;
        text-align: center;
    }

    .customer-map-locked {
        height: 132px !important;
        min-height: 132px !important;
        max-height: 132px !important;
    }
}


/* ========================================================================
 * V25 — NOMBRE CON ESPACIOS, CLIENTE EXISTENTE Y CONFIRMACIÓN DE ORDEN
 * ======================================================================== */
.registration-input.is-readonly {
    border-color: rgba(30, 145, 237, .24);
    background: rgba(76, 161, 245, .06);
}

.registration-input input[readonly] {
    color: var(--okd-purple-deep);
    background: rgba(76, 161, 245, .06);
    cursor: default;
}

#registrationName {
    text-transform: uppercase;
    white-space: pre-wrap;
}

.order-success-card {
    width: min(100%, 420px);
}

.order-success-card > p strong {
    display: inline-block;
    color: var(--okd-purple-deep);
    font-family: "Montserrat", "Inter", sans-serif;
    font-size: 1.08em;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.order-success-card > small {
    display: block;
    margin-top: 10px;
    color: var(--okd-muted);
    font-size: 9px;
    font-weight: 750;
}

.order-success-progress {
    width: 100%;
    height: 6px;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(127, 0, 178, .10);
}

.order-success-progress > span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: var(--okd-gradient-horizontal);
    transform-origin: left center;
    transform: scaleX(0);
}

.order-success-card.redirecting .order-success-progress > span {
    animation: okd-order-redirect-progress 2s linear forwards;
}

@keyframes okd-order-redirect-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* ========================================================================
 * V26 — UBICACIÓN MANUAL DE RESPALDO Y MAPA COMPACTO INTERACTIVO
 * ======================================================================== */
.customer-request-card-compact .map-search {
    margin: 0 0 10px;
    padding: 11px;
    border: 1px solid rgba(30, 145, 237, .17);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(127, 0, 178, .055), rgba(76, 161, 245, .085));
}

.customer-request-card-compact .map-search label {
    gap: 9px;
    font-size: 10px;
}

.customer-request-card-compact .map-search label i {
    color: var(--okd-blue);
    font-size: 12px;
}

.customer-request-card-compact .map-search input {
    min-height: 43px;
    padding: 0 12px;
    font-size: 11px;
}

.customer-request-card-compact .map-search p {
    font-size: 8.5px;
}

.customer-request-card-compact .address-results button {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 11px;
    overflow-wrap: anywhere;
}

.customer-request-card-compact .address-results button i {
    flex: 0 0 auto;
    margin-top: 3px;
    color: var(--okd-purple);
}

.customer-request-card-compact .address-results button span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.customer-map-manual {
    height: 160px !important;
    min-height: 160px !important;
    max-height: 160px !important;
    border: 2px solid rgba(30, 145, 237, .38) !important;
    border-radius: 12px !important;
    cursor: crosshair !important;
    touch-action: pan-x pan-y pinch-zoom !important;
    user-select: none;
    box-shadow: 0 0 0 4px rgba(76, 161, 245, .08) !important;
}

.customer-map-manual .leaflet-container,
.customer-map-manual .leaflet-map-pane,
.customer-map-manual .leaflet-tile-pane {
    cursor: crosshair !important;
}

.customer-map-manual .leaflet-marker-icon {
    cursor: grab !important;
}

.customer-map-manual .leaflet-marker-icon:active {
    cursor: grabbing !important;
}

.customer-request-card-compact #requestMapMode {
    transition: background .18s ease, color .18s ease;
}

.customer-map-manual + .selected-location,
.customer-request-card-compact .request-selected-location {
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .customer-map-manual {
        height: 145px !important;
        min-height: 145px !important;
        max-height: 145px !important;
    }
}

@media (max-width: 470px) {
    .customer-map-manual {
        height: 132px !important;
        min-height: 132px !important;
        max-height: 132px !important;
    }

    .customer-request-card-compact .map-search input {
        font-size: 10.5px;
    }
}

/* ================================================================
   OKDelivery Cliente v28: menú tipo Driver, Órdenes, Alertas y Perfil
   ================================================================ */
:root {
    --okd-customer-bottom-nav: 76px;
}

body {
    padding-bottom: calc(var(--okd-customer-bottom-nav) + env(safe-area-inset-bottom, 0px));
}

.customer-app-shell {
    min-height: calc(100vh - var(--okd-topbar-height) - var(--okd-customer-bottom-nav));
    padding-bottom: 34px;
}

.customer-page[hidden] {
    display: none !important;
}

.customer-page {
    width: 100%;
    animation: customer-page-in 0.18s ease both;
}

@keyframes customer-page-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.customer-bottom-navigation {
    position: fixed;
    z-index: 1200;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: calc(var(--okd-customer-bottom-nav) + env(safe-area-inset-bottom, 0px));
    padding: 7px max(10px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(10px, env(safe-area-inset-left, 0px));
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--okd-line);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -8px 28px rgba(70, 38, 112, 0.10);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.customer-bottom-navigation a {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    border-radius: 13px;
    color: #91899b;
    font-size: 9px;
    font-weight: 850;
    text-decoration: none;
    transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.customer-bottom-navigation a i {
    font-size: 19px;
}

.customer-bottom-navigation a.active {
    color: var(--okd-purple-deep);
    background: linear-gradient(135deg, rgba(171, 73, 204, 0.11), rgba(76, 161, 245, 0.11));
}

.customer-bottom-navigation a:active {
    transform: scale(0.96);
}

.customer-bottom-navigation a b {
    position: absolute;
    top: 2px;
    left: calc(50% + 8px);
    display: grid;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: var(--okd-red);
    box-sizing: content-box;
    font-size: 7px;
    line-height: 1;
}

.customer-access-message {
    display: flex;
    width: min(100%, 640px);
    margin: 0 auto;
    padding: 24px;
    align-items: center;
    gap: 17px;
    border: 1px solid var(--okd-line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--okd-shadow-md);
}

.customer-access-message[hidden] {
    display: none !important;
}

.customer-access-message.is-validating {
    border-color: rgba(30, 145, 237, 0.18);
}

.customer-access-message.is-invalid {
    border-color: rgba(212, 59, 85, 0.20);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(212, 59, 85, 0.035));
}

.customer-access-icon {
    display: grid;
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 19px;
    color: #fff;
    background: var(--okd-gradient);
    box-shadow: 0 13px 27px rgba(91, 28, 146, 0.22);
    font-size: 22px;
}

.customer-access-message.is-invalid .customer-access-icon {
    background: linear-gradient(135deg, #c92e49, #e1546d);
}

.customer-access-message > div {
    min-width: 0;
}

.customer-access-message h1 {
    margin: 0;
    color: var(--okd-ink);
    font-family: "Montserrat", "Inter", sans-serif;
    font-size: clamp(20px, 4.4vw, 28px);
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.customer-access-message p {
    margin: 8px 0 0;
    color: var(--okd-muted);
    font-size: 11px;
    line-height: 1.55;
}

.customer-page-heading {
    display: flex;
    margin-bottom: 15px;
    padding: 4px 2px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.customer-page-heading h1 {
    margin: 0;
    font-family: "Montserrat", "Inter", sans-serif;
    font-size: clamp(27px, 5vw, 38px);
    letter-spacing: -0.055em;
    line-height: 1;
}

.customer-page-heading p {
    max-width: 620px;
    margin: 8px 0 0;
    color: var(--okd-muted);
    font-size: 11px;
    line-height: 1.5;
}

.customer-orders-filters {
    display: grid;
    margin-bottom: 16px;
    padding: 18px;
    grid-template-columns: minmax(220px, 1.35fr) repeat(2, minmax(145px, 0.65fr)) auto;
    align-items: end;
    gap: 11px;
    border: 1px solid var(--okd-line);
    border-radius: 21px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--okd-shadow-sm);
}

.customer-orders-filters label {
    display: grid;
    min-width: 0;
    gap: 7px;
    color: var(--okd-ink);
    font-size: 9px;
    font-weight: 850;
}

.customer-orders-filters label > div {
    position: relative;
}

.customer-orders-filters label > div > i {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 14px;
    color: var(--okd-violet);
    transform: translateY(-50%);
    font-size: 12px;
}

.customer-orders-filters input {
    width: 100%;
    height: 47px;
    padding: 0 13px;
    border: 1px solid rgba(127, 0, 178, 0.16);
    border-radius: 14px;
    color: var(--okd-ink);
    background: #fff;
    outline: none;
    font-size: 10px;
}

.customer-orders-filters label > div input {
    padding-left: 38px;
}

.customer-orders-filters input:focus {
    border-color: var(--okd-violet);
    box-shadow: 0 0 0 4px rgba(171, 73, 204, 0.10);
}

.customer-filter-actions {
    display: flex;
    gap: 8px;
}

.customer-filter-button,
.customer-filter-clear,
.customer-orders-view-all,
.customer-alerts-clear,
.customer-profile-register,
.customer-profile-save,
.customer-profile-logout {
    display: inline-flex;
    min-height: 47px;
    padding: 0 16px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    font-size: 9px;
    font-weight: 850;
    transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.customer-filter-button,
.customer-profile-save,
.customer-profile-register {
    border: 0;
    color: #fff;
    background: var(--okd-gradient-horizontal);
    box-shadow: 0 11px 22px rgba(99, 30, 160, 0.20);
}

.customer-filter-clear,
.customer-orders-view-all,
.customer-alerts-clear {
    border: 1px solid var(--okd-line);
    color: var(--okd-purple-deep);
    background: #fff;
}

.customer-filter-button:hover,
.customer-filter-clear:hover,
.customer-orders-view-all:hover,
.customer-alerts-clear:hover,
.customer-profile-save:hover,
.customer-profile-register:hover,
.customer-profile-logout:hover {
    transform: translateY(-1px);
    filter: saturate(1.06);
}

.customer-filter-button:disabled,
.customer-profile-save:disabled,
.customer-profile-logout:disabled {
    opacity: 0.58;
    cursor: wait;
    transform: none;
}

.customer-orders-results-card {
    margin-top: 0;
}

.customer-orders-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.customer-orders-view-all {
    min-height: 38px;
    padding: 0 13px;
}

.customer-orders-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.customer-pagination {
    display: flex;
    margin-top: 18px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
}

.customer-pagination button,
.customer-pagination span {
    display: grid;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    place-items: center;
    border: 1px solid var(--okd-line);
    border-radius: 11px;
    color: var(--okd-purple-deep);
    background: #fff;
    font-size: 9px;
    font-weight: 850;
}

.customer-pagination button.active {
    border-color: transparent;
    color: #fff;
    background: var(--okd-gradient-horizontal);
    box-shadow: 0 8px 17px rgba(99, 30, 160, 0.19);
}

.customer-pagination button:disabled {
    opacity: 0.38;
    cursor: default;
}

.customer-alerts-heading {
    align-items: center;
}

.customer-alerts-clear {
    min-height: 39px;
}

.customer-alerts-list {
    display: grid;
    gap: 10px;
}

.customer-alert-card {
    position: relative;
    display: flex;
    min-width: 0;
    padding: 16px;
    align-items: center;
    gap: 13px;
    border: 1px solid var(--okd-line);
    border-radius: 18px;
    color: inherit;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--okd-shadow-sm);
    text-decoration: none;
}

.customer-alert-card.is-unread {
    border-color: rgba(127, 0, 178, 0.25);
    background: linear-gradient(135deg, rgba(171, 73, 204, 0.065), rgba(76, 161, 245, 0.065)), #fff;
}

.customer-alert-card.is-unread::before {
    content: "";
    position: absolute;
    top: 15px;
    right: 15px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--okd-purple);
    box-shadow: 0 0 0 4px rgba(171, 73, 204, 0.11);
}

.customer-alert-icon {
    display: grid;
    flex: 0 0 auto;
    width: 45px;
    height: 45px;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    background: var(--okd-gradient);
    box-shadow: 0 10px 21px rgba(91, 28, 146, 0.18);
    font-size: 16px;
}

.customer-alert-copy {
    min-width: 0;
    flex: 1;
}

.customer-alert-copy > div {
    display: flex;
    padding-right: 13px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.customer-alert-copy strong {
    overflow: hidden;
    font-family: "Montserrat", "Inter", sans-serif;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-alert-copy time {
    flex: 0 0 auto;
    color: var(--okd-muted);
    font-size: 7px;
    font-weight: 750;
}

.customer-alert-copy p {
    margin: 6px 0 0;
    color: var(--okd-muted);
    font-size: 9px;
    line-height: 1.45;
}

.customer-alert-arrow {
    flex: 0 0 auto;
    color: var(--okd-violet);
    font-size: 11px;
}

.customer-profile-hero {
    position: relative;
    padding: 27px 22px;
    overflow: hidden;
    border-radius: 25px;
    color: #fff;
    background: var(--okd-gradient);
    box-shadow: 0 20px 44px rgba(91, 28, 146, 0.24);
    text-align: center;
}

.customer-profile-hero::before,
.customer-profile-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
}

.customer-profile-hero::before {
    top: -80px;
    right: -35px;
    width: 170px;
    height: 170px;
}

.customer-profile-hero::after {
    bottom: -45px;
    left: -30px;
    width: 100px;
    height: 100px;
}

.customer-profile-avatar {
    position: relative;
    z-index: 1;
    display: grid;
    width: 70px;
    height: 70px;
    margin: 0 auto 13px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 23px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.27);
    font-size: 27px;
}

.customer-profile-hero .eyebrow,
.customer-profile-hero h1,
.customer-profile-hero p {
    position: relative;
    z-index: 1;
    color: #fff;
}

.customer-profile-hero .eyebrow {
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.75);
}

.customer-profile-hero h1 {
    margin: 0;
    font-family: "Montserrat", "Inter", sans-serif;
    font-size: clamp(24px, 5vw, 33px);
    letter-spacing: -0.05em;
}

.customer-profile-hero p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 10px;
}

.customer-profile-panel {
    margin-top: 15px;
    padding: 20px;
    border: 1px solid var(--okd-line);
    border-radius: 21px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--okd-shadow-sm);
}

.customer-profile-panel .empty-state {
    min-height: 210px;
}

.customer-profile-form {
    display: grid;
    gap: 14px;
}

.customer-profile-form label {
    display: grid;
    gap: 7px;
    color: var(--okd-ink);
    font-size: 10px;
    font-weight: 850;
}

.customer-profile-input {
    position: relative;
}

.customer-profile-input > i {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 15px;
    color: var(--okd-violet);
    transform: translateY(-50%);
}

.customer-profile-input input {
    width: 100%;
    height: 52px;
    padding: 0 15px 0 43px;
    border: 1px solid rgba(127, 0, 178, 0.17);
    border-radius: 15px;
    color: var(--okd-ink);
    background: #fff;
    outline: none;
    font-size: 11px;
    font-weight: 700;
}

.customer-profile-input input:focus {
    border-color: var(--okd-violet);
    box-shadow: 0 0 0 4px rgba(171, 73, 204, 0.10);
}

.customer-profile-input.is-readonly input {
    color: var(--okd-muted);
    background: #f6f4f8;
}

.customer-profile-save {
    width: 100%;
    margin-top: 2px;
}

.customer-profile-logout-area {
    margin-top: 15px;
    text-align: center;
}

.customer-profile-logout {
    min-width: 190px;
    border: 1px solid rgba(212, 59, 85, 0.18);
    color: var(--okd-red);
    background: rgba(255, 255, 255, 0.95);
}

.customer-profile-register {
    margin-top: 12px;
}

#legacyLookupControls,
#legacyOrdersContainer {
    display: none !important;
}

.detail-shell {
    padding-bottom: calc(var(--okd-customer-bottom-nav) + 32px);
}

@media (min-width: 680px) {
    .customer-bottom-navigation {
        right: 50%;
        left: 50%;
        width: min(100%, 660px);
        transform: translateX(-50%);
        border: 1px solid var(--okd-line);
        border-bottom: 0;
        border-radius: 22px 22px 0 0;
    }
}

@media (max-width: 820px) {
    .customer-orders-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-filter-order,
    .customer-filter-actions {
        grid-column: 1 / -1;
    }

    .customer-filter-actions > button {
        flex: 1;
    }
}

@media (max-width: 620px) {
    .customer-shell.customer-app-shell {
        padding-right: 13px;
        padding-left: 13px;
    }

    .customer-access-message {
        padding: 20px 17px;
        align-items: flex-start;
    }

    .customer-access-icon {
        width: 50px;
        height: 50px;
        border-radius: 17px;
        font-size: 19px;
    }

    .customer-orders-filters {
        padding: 15px;
        grid-template-columns: 1fr;
    }

    .customer-filter-order,
    .customer-filter-actions {
        grid-column: auto;
    }

    .customer-orders-grid {
        grid-template-columns: 1fr;
    }

    .customer-orders-heading {
        align-items: center;
    }

    .customer-alerts-heading {
        align-items: flex-start;
    }

    .customer-alerts-clear {
        min-width: 42px;
        padding: 0 11px;
    }

    .customer-alerts-clear i {
        margin: 0;
    }

    .customer-alerts-clear {
        font-size: 0;
    }

    .customer-alerts-clear i {
        font-size: 12px;
    }

    .customer-alert-copy > div {
        display: block;
    }

    .customer-alert-copy time {
        display: block;
        margin-top: 4px;
    }
}


/* V31 — llamada visual discreta para instalar sin ocultar el botón */
.install-app-button.install-attention {
    animation: okd-install-attention 1.25s ease-in-out 3;
}
@keyframes okd-install-attention {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-1px) scale(1.045); box-shadow: 0 0 0 5px rgba(255,255,255,.18), 0 12px 25px rgba(41,13,73,.28); }
}

html.okd-standalone .install-app-button {
    display: none !important;
}
