:root {
    --app-navbar-height: 78px;
    --logup-primary: #ff5c1a;
    --logup-secondary: #152238;
    --logup-accent: #5165ff;
    --logup-surface: #ffffff;
    --logup-muted: #8a94a6;
}

body {
    background-color: #eef2ff;
    background-image: radial-gradient(circle at 10% 20%, rgba(81, 101, 255, 0.12), transparent 55%),
        radial-gradient(circle at 90% 10%, rgba(255, 92, 26, 0.12), transparent 40%);
    font-family: "Inter", "Segoe UI", sans-serif;
    color: #1b2559;
}

.app-body {
    min-height: 100vh;
}

.navbar-brand {
    font-weight: 700;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

.app-layout {
  width: 100%;
}

.app-shell {
  width: 100%;
  max-width: 100%;
}

.app-content {
  max-width: 100%;
}

.app-navbar {
    background: linear-gradient(120deg, var(--logup-secondary), #0f172a);
    border: none;
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1050;
}

.app-navbar .navbar-brand {
    color: #fff;
    text-transform: uppercase;
}

.app-navbar .navbar-brand:hover {
    color: #fff;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 1.25rem;
    color: var(--logup-primary);
}

.brand-title {
    font-size: 1rem;
    letter-spacing: 0.15rem;
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.12rem;
    font-size: 0.65rem;
}

.app-navbar__user {
    color: #fff;
}

.app-navbar__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.btn-gradient {
    background: linear-gradient(120deg, var(--logup-primary), #ffa45c);
    border: none;
    color: #1b2559;
    font-weight: 600;
}

.btn-gradient:hover {
    color: #1b2559;
    opacity: 0.9;
}

.app-layout {
    padding: 0;
}

.app-shell {
    position: relative;
}

.app-shell > .app-content {
    min-width: 0;
}

.sidebar {
    min-height: calc(100vh - 88px);
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 45%),
        linear-gradient(180deg, #0f1b2f, var(--logup-secondary));
    color: #fff;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 260px;
}

.sidebar::after {
    content: "";
    position: absolute;
    inset: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.sidebar__inner {
    position: relative;
    z-index: 2;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar__menu {
    gap: 0.5rem;
}

.sidebar__menu .nav-link {
    color: #e7ecff;
    text-decoration: none;
    padding: 0.65rem 0.5rem;
    border-radius: 0.85rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar__menu .nav-link .bi {
    font-size: 1rem;
}

.sidebar__menu .nav-link.active,
.sidebar__menu .nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateX(4px);
}

.sidebar__chevron {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar__menu .nav-link:hover .sidebar__chevron,
.sidebar__menu .nav-link.active .sidebar__chevron {
    opacity: 0.8;
}

body.sidebar-collapsed .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-105%);
    box-shadow: none;
}

body.sidebar-collapsed .sidebar::after {
    display: none;
}

body.sidebar-collapsed .app-content {
    flex: 1 0 100%;
    max-width: 100%;
    width: 100%;
}

.app-content {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6));
    min-height: calc(100vh - 88px);
    padding-bottom: 2.5rem;
}

.card-logup {
    border: 1px solid rgba(21, 34, 56, 0.08);
    border-radius: 1rem;
    background: var(--logup-surface);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

.dashboard-header {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
}

.stat-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.stat-card__value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card__meta {
    color: var(--logup-muted);
    font-size: 0.85rem;
}

.bg-soft-primary {
    background: rgba(81, 101, 255, 0.15);
}

.bg-soft-success {
    background: rgba(18, 183, 106, 0.15);
}

.bg-soft-warning {
    background: rgba(255, 184, 0, 0.2);
}

.table-responsive{
    padding: 10px;
}

.table-responsive-rounded {
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.avatar,
.avatar-lg {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: rgba(81, 101, 255, 0.12);
    color: var(--logup-primary);
}

.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.2rem;
}

.card-logup .card-header {
    border-bottom: 1px solid rgba(21, 34, 56, 0.08);
}

.table.table-hover tbody tr:hover {
    background-color: rgba(81, 101, 255, 0.04);
}

.btn-group form {
    margin: 0;
}

.table-responsive-rounded > table {
    margin-bottom: 0;
}

.analytics-card {
    border: none;
    background: linear-gradient(135deg, #ffffff, #f5f7ff);
}

.chart-wrapper {
    height: 320px;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.bg-soft-primary.text-primary,
.badge.bg-soft-primary.text-primary {
    border: 1px solid rgba(81, 101, 255, 0.25);
}

footer {
    color: var(--logup-muted);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1040;
}

body.sidebar-open {
    overflow: hidden;
}

body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 992px) {
    .app-shell > .sidebar {
        flex: 0 0 260px;
        width: 260px;
        max-width: 260px;
    }

    .app-shell > .app-content {
        flex: 1 1 auto;
        width: auto;
        max-width: none;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        min-height: calc(100vh - var(--app-navbar-height));
        position: fixed;
        top: var(--app-navbar-height);
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        width: 100%;
        max-width: 300px;
        box-shadow: 0 22px 50px rgba(15, 23, 42, 0.38);
        border-right: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        z-index: 1055;
    }

    .sidebar__inner {
        padding: 0 1.25rem 1.5rem;
    }

    .app-navbar__user {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.75rem;
    }

    .app-content {
        min-height: calc(100vh - var(--app-navbar-height));
        padding: 1.5rem 1rem 2rem;
    }
}

#map-pedido {
    height: 320px;
    min-height: 280px;
    border-radius: .75rem;
}

.modal-direcciones__map {
    height: 320px;
    min-height: 260px;
    border-radius: .75rem;
    background-color: #f8f9fa;
}

.timeline {
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid rgba(13, 110, 253, 0.2);
}

.timeline-entry {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
}

.timeline-entry:last-child {
    margin-bottom: 0;
}

.timeline-point {
    position: absolute;
    left: -0.75rem;
    top: 0.25rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: #0d6efd;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
}

.pedido-zona-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .35rem .75rem;
    border-radius: 50rem;
    border: 1px solid rgba(13, 110, 253, 0.18);
    background-color: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.pedido-zona-badge[data-color] {
    color: #0c1427;
    border-color: rgba(12, 20, 39, 0.16);
}

.pedido-detalle-placeholder {
    color: #6c757d;
    font-size: .9rem;
}


.modal-content form {
     max-height: calc(100vh - 200px);
    /* límite dinámico */
    overflow-y: auto;
}

/* Estilos para el modal de corrección de direcciones */
.modal-direcciones {
    border: none;
    border-radius: 1.25rem;
    box-shadow: 0 24px 48px rgba(21, 34, 56, 0.18);
    overflow: hidden;
}

.modal-direcciones__lead {
    max-width: 30rem;
}

.modal-direcciones__tip {
    border-left: 4px solid var(--logup-primary);
    border-radius: 0.85rem;
    background: rgba(255, 92, 26, 0.08);
}

.modal-direcciones__card {
    border-radius: 1rem;
}

.modal-direcciones__card .card-header {
    border-radius: 1rem 1rem 0 0;
}

.modal-direcciones__step {
    font-weight: 600;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
}

.modal-direcciones__input-group .btn {
    white-space: nowrap;
}

.modal-direcciones__lista {
    gap: 0.75rem;
    display: flex;
    flex-direction: column;
}

.modal-direcciones__lista .list-group-item {
    border: 1px solid #e3e7ef;
    border-radius: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.modal-direcciones__empty {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fc;
}

.modal-direcciones__direccion-item {
    cursor: pointer;
    padding: 1rem 1.25rem;
}

.modal-direcciones__direccion-item .form-check-input {
    margin-top: 0;
    width: 1.05rem;
    height: 1.05rem;
}

.modal-direcciones__direccion-item:hover,
.modal-direcciones__direccion-item:focus-within {
    border-color: var(--logup-primary);
    box-shadow: 0 12px 32px rgba(21, 34, 56, 0.15);
    transform: translateY(-2px);
}

.modal-direcciones__direccion-item.is-selected {
    border-color: var(--logup-primary);
    background: rgba(255, 92, 26, 0.08);
    box-shadow: 0 14px 36px rgba(21, 34, 56, 0.22);
}

.modal-direcciones .modal-footer {
    border-top: none;
}

.import-processing-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1080;
    padding: 2rem;
    background: rgba(21, 34, 56, 0.65);
    backdrop-filter: blur(2px);
}

.import-processing-overlay__box {
    width: 100%;
    max-width: 24rem;
    padding: 2.25rem 2rem;
    border-radius: 1.5rem;
    background: rgba(21, 34, 56, 0.92);
    box-shadow: 0 24px 48px rgba(16, 34, 65, 0.35);
    text-align: center;
    color: #f8f9fc;
}

.import-processing-overlay__box .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

.import-processing-overlay__box p {
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Panel del conductor */
.icon-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline {
    position: relative;
    padding-left: 1.25rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    bottom: 0.5rem;
    left: 0.25rem;
    width: 2px;
    background: rgba(21, 34, 56, 0.12);
}

.timeline-item {
    position: relative;
    margin-left: 0.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.1rem;
    top: 1rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: var(--logup-primary);
    box-shadow: 0 0 0 4px rgba(255, 92, 26, 0.15);
}

.timeline-item .card-body {
    padding-left: 1rem;
}

.conductor-observacion {
    border-left: 4px solid var(--logup-primary);
}

/* Pedidos: acciones compactas en listado */
.acciones-pedido {
    gap: 0.4rem;
}

.btn-icon-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.65rem;
    min-width: 2.5rem;
}

.btn-icon-label .bi {
    font-size: 1rem;
}

.btn-icon-label__text {
    font-size: 0.85rem;
    font-weight: 600;
}

@media (max-width: 1199.98px) {
    .btn-icon-label__text {
        display: none;
    }
}

/* Estilos específicos para la pantalla de acceso */
.auth-body {
    min-height: 100vh;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.15), transparent 60%),
        linear-gradient(135deg, #0f1b32, #1b2740 45%, #23314f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

.auth-shell {
    width: 100%;
    max-width: 520px;
    position: relative;
    z-index: 1;
}

.auth-card {
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #fff;
    box-shadow: 0 20px 60px rgba(6, 17, 38, 0.25);
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 92, 26, 0.12);
    color: var(--logup-primary);
}

.auth-input .input-group-text {
    border-right: none;
    background: transparent;
    color: #93a0ba;
}

.auth-input .form-control {
    border-left: none;
    padding-left: 0;
}

.auth-input .form-control:focus {
    border-color: var(--logup-primary);
    box-shadow: none;
}

.auth-link {
    color: var(--logup-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
}

.auth-decoration {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
    z-index: 0;
}

.auth-decoration--one {
    top: -80px;
    left: -40px;
    background: #ff9f68;
}

.auth-decoration--two {
    bottom: -100px;
    right: -60px;
    background: #5462ff;
}

@media (max-width: 991.98px) {
    .modal-direcciones__tip {
        flex-direction: column;
        text-align: center;
    }

    .modal-direcciones__lead {
        max-width: 100%;
    }

    .modal-direcciones__lista {
        gap: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    .brand-title {
        font-size: 0.95rem;
    }

    .brand-subtitle {
        font-size: 0.6rem;
    }

    .app-navbar__user {
        width: 100%;
        justify-content: flex-end;
        text-align: right;
    }

    .dashboard-header {
        padding: 1.25rem;
    }

    .stat-card__value {
        font-size: 1.8rem;
    }
}

@media (max-width: 575.98px) {
    .auth-body {
        padding: 1.5rem 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .app-navbar {
        padding: 0.75rem 1rem;
    }

    .brand-icon {
        width: 38px;
        height: 38px;
    }

    .sidebar {
        max-width: 100%;
    }

    .app-content {
        padding-inline: 0.75rem;
    }
}
