html, body {
    margin: 0;
    min-height: 100%;
}

.bg-soft {
    background:
        radial-gradient(circle at 12% 14%, rgba(148, 163, 184, 0.18), transparent 32%),
        radial-gradient(circle at 88% 82%, rgba(191, 219, 254, 0.28), transparent 34%),
        linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: #f3f7fc;
    border-right: 1px solid #dbe5ef;
    z-index: 1020;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #dbe5ef;
    background: #eff5fb;
}

.sidebar-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    letter-spacing: 0.18em;
    font-weight: 700;
    font-size: 0.84rem;
    color: #334155;
}

.sidebar-logo-image {
    max-height: 34px;
    width: auto;
    display: block;
}

.sidebar-menu-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.55rem;
}

.sidebar-footer {
    border-top: 1px solid #dbe5ef;
    padding: 0.9rem 1rem;
    background: #eff5fb;
}

.main {
    margin-left: 280px;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1010;
    min-height: 64px;
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(6px);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-heading h1 {
    color: #334155;
}

.topbar-avatar-btn {
    width: 42px;
    height: 42px;
    border: 1px solid #d4e0ed;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.topbar-avatar-btn::after {
    display: none;
}

.topbar-avatar-btn:hover {
    background: #f8fbff;
}

.topbar-avatar-btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.24);
}

.topbar-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar-avatar-fallback {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #3a536b;
    font-weight: 700;
    font-size: 0.92rem;
    background: linear-gradient(180deg, #eff5fb 0%, #e4edf7 100%);
}

.topbar-profile-menu {
    min-width: 240px;
    border-radius: 0.85rem;
    background: #ffffff;
    border: 1px solid #dbe5ef !important;
    padding: 0.35rem;
}

.profile-menu-header {
    padding: 0.45rem 0.55rem 0.35rem;
}

.topbar-profile-menu .dropdown-item {
    border-radius: 0.55rem;
    color: #415b73;
    padding: 0.55rem 0.65rem;
}

.topbar-profile-menu .dropdown-item:hover {
    background: #f2f7fc;
}

.password-rules-panel {
    border: 1px solid #dbe5ef;
    background: #f8fbff;
    border-radius: 0.65rem;
    padding: 0.65rem 0.75rem;
}

.rule-item {
    display: flex;
    align-items: center;
    color: #4c647b;
    font-size: 0.82rem;
}

.rule-item + .rule-item {
    margin-top: 0.2rem;
}

.twofactor-qr-wrap {
    width: 210px;
    height: 210px;
    border: 1px solid #dbe5ef;
    border-radius: 0.75rem;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.tracking-wide {
    letter-spacing: 0.2em;
}

.main-content {
    padding: 1.25rem;
}

.card {
    border: 1px solid #dfe8f2;
}

.employee-form .form-control,
.employee-form .form-select {
    border-color: #d6e1ec;
}

.employee-form .form-control:focus,
.employee-form .form-select:focus {
    border-color: #94bce5;
    box-shadow: 0 0 0 0.16rem rgba(59, 130, 246, 0.2);
}

.employee-photo-preview {
    max-height: 220px;
    object-fit: cover;
}

.section-card {
    background: #fff;
    border: 1px solid #dce7f2;
    border-radius: 0.8rem;
    padding: 0.85rem;
}

.section-title {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5e7590;
    margin-bottom: 0.55rem;
    font-weight: 700;
}

.cotizacion-detalle-table {
    table-layout: fixed;
}

.cotizacion-detalle-table th,
.cotizacion-detalle-table td {
    vertical-align: middle;
}

.cotizacion-detalle-input {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    height: 1.85rem;
}

.cotizacion-detalle-total {
    white-space: nowrap;
}

.cotizacion-totales-card {
    position: static;
}

@media (min-width: 1200px) {
    .cotizacion-totales-card {
        position: sticky;
        top: 1rem;
    }
}

.cotizacion-total-input {
    font-size: 1.05rem;
}

.cot-impuesto-pct {
    background-color: #fff7d1;
}

.toast-overlay-container {
    z-index: 2000;
    pointer-events: none;
}

.toast-overlay-container .toast {
    pointer-events: auto;
    min-width: 300px;
}

.app-toast {
    background: #ffffff;
    color: #334155;
    border: 1px solid #dbe5ef !important;
    position: relative;
    overflow: hidden;
    --toast-delay: 5000ms;
    --toast-accent: #94a3b8;
}

.app-toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--toast-accent);
    transform-origin: left center;
    animation: app-toast-countdown var(--toast-delay) linear forwards;
    animation-play-state: var(--toast-play-state, running);
}

.app-toast.is-restarting::before {
    animation: none;
}

.app-toast .toast-header {
    background: #f8fafc;
    color: #3f5368;
    border-bottom: 1px solid #e2e8f0;
}

.app-toast .toast-body {
    color: #334155;
}

.app-toast-success {
    --toast-accent: #16a34a;
}

.app-toast-warning {
    --toast-accent: #f59e0b;
}

.app-toast-info {
    --toast-accent: #0ea5e9;
}

.app-toast-danger {
    --toast-accent: #dc3545;
}

@keyframes app-toast-countdown {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

.app-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(241, 245, 249, 0.62);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2100;
}

.app-loading-overlay.is-visible {
    display: flex;
}

.app-loading-card {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dbe5ef;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    color: #475569;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    font-size: 0.9rem;
}

.employee-picker-table th,
.employee-picker-table td,
.dt-nowrap {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.employee-picker-modal .modal-content {
    border-radius: 0.95rem;
    overflow: hidden;
}

.employee-picker-modal .modal-header {
    background: linear-gradient(180deg, #f8fbff 0%, #f2f7fc 100%);
    border-bottom: 1px solid #dbe5ef;
    padding: 0.9rem 1rem;
}

.employee-picker-modal .modal-title {
    font-size: 1rem;
    color: #334a60;
}

.employee-picker-modal .modal-body {
    padding: 0.9rem 1rem 1rem;
}

.employee-picker-table tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.employee-picker-table tbody tr:hover {
    background-color: #eef5fc !important;
}

.employee-picker-modal .dataTables_wrapper .dataTables_filter input,
.employee-picker-modal .dataTables_wrapper .dataTables_length select {
    border: 1px solid #cfdae8;
    border-radius: 0.45rem;
    padding: 0.28rem 0.55rem;
    background: #fff;
}

.employee-picker-modal .dataTables_wrapper .dataTables_filter input {
    min-width: 260px;
}

.employee-picker-modal .dataTables_wrapper .dataTables_info,
.employee-picker-modal .dataTables_wrapper .dataTables_length,
.employee-picker-modal .dataTables_wrapper .dataTables_filter label {
    font-size: 0.82rem;
    color: #556b82;
}

.employee-picker-modal .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.4rem !important;
}

.employee-picker-table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #56708b;
    border-bottom-width: 1px !important;
}

.employee-picker-table tbody td {
    font-size: 0.86rem;
    color: #354f67;
}

.menu-level {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.menu-level-1 {
    padding: 0;
}

.menu-level-2,
.menu-level-3 {
    margin-left: 0.7rem;
    padding-left: 0.55rem;
    border-left: 1px solid #dbe5ef;
}

.menu-link {
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0.7rem;
    padding: 0.56rem 0.72rem;
    color: #415b73;
    text-decoration: none;
    font-size: 0.89rem;
    line-height: 1.2;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.menu-link:hover {
    background: #eaf1f9;
    color: #23384b;
}

.menu-link-active {
    background: #dbeaf8;
    color: #1f3850;
    font-weight: 600;
}

.menu-link-left {
    display: inline-flex;
    align-items: center;
    gap: 0.58rem;
}

.menu-link-left i {
    font-size: 0.92rem;
}

.menu-toggle[aria-expanded="true"] {
    background: #dbeaf8;
    color: #1f3850;
}

.menu-chevron {
    transition: transform 0.16s ease;
    font-size: 0.78rem;
}

.menu-toggle[aria-expanded="true"] .menu-chevron {
    transform: rotate(90deg);
}

.menu-collapse {
    margin-top: 0.14rem;
}

.menu-fab {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #d0deeb;
    background: #ffffff;
    color: #3f556c;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    position: sticky;
    top: 12px;
    z-index: 1030;
}

.menu-fab:hover {
    background: #f2f7fc;
}

.menu-fab:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.28);
}

.offcanvas {
    --bs-offcanvas-width: 300px;
    background: #f5f9fd;
}

.offcanvas.offcanvas-top {
    --bs-offcanvas-height: 70vh;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

.mobile-menu {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    border-bottom-left-radius: 1.2rem;
    border-bottom-right-radius: 1.2rem;
}

.mobile-menu-header {
    background: #f1f6fc;
    padding: 1rem 1.2rem;
}

.mobile-menu-brand {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: #1f2937;
}

.mobile-menu-subtitle {
    font-size: 0.75rem;
    color: #64748b;
}

.mobile-menu-body {
    padding: 1rem 1.2rem 1.4rem;
}

.mobile-menu .menu-link {
    border-radius: 0.75rem;
    padding: 0.65rem 0.8rem;
    margin-bottom: 0.2rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.mobile-menu .menu-link:hover,
.mobile-menu .menu-link:focus-visible {
    background: rgba(59, 130, 246, 0.12);
    color: #1e3a8a;
}

.pedido-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pedido-recibo {
    background: linear-gradient(180deg, #fff7c2 0%, #fff2a6 100%);
    border-radius: 1rem;
}

.pedido-recibo-header {
    padding: 1rem 1.2rem 0.6rem;
}

.pedido-recibo-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #4b3b00;
}

.pedido-recibo-subtitle {
    color: #7a6400;
}

.pedido-recibo-body {
    padding: 0.6rem 1.2rem 1rem;
}

.pedido-recibo-meta {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: 1fr;
    margin-bottom: 0.8rem;
}

.pedido-recibo-chip {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 0.75rem;
    padding: 0.6rem 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #6b5b00;
    font-size: 0.85rem;
}

.pedido-recibo-chip strong {
    color: #3d3200;
    font-weight: 700;
}

.pedido-recibo-total {
    background: #fff;
    border-radius: 0.85rem;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 700;
    color: #3d3200;
    box-shadow: inset 0 0 0 1px rgba(61, 50, 0, 0.08);
    margin-bottom: 0.9rem;
}

.pedido-recibo-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.pedido-recibo-item {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 0.9rem;
    padding: 0.8rem 0.9rem;
    box-shadow: inset 0 0 0 1px rgba(61, 50, 0, 0.06);
}

.pedido-recibo-item-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #3d3200;
}

.pedido-recibo-item-sub {
    font-size: 0.8rem;
    color: #7a6400;
}

.pedido-recibo-item-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem 0.8rem;
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: #6b5b00;
}

.pedido-recibo-item-meta strong {
    display: block;
    color: #3d3200;
    font-weight: 700;
}

.pedido-recibo-footer {
    padding: 0.6rem 1.2rem 1.1rem;
}

.offcanvas-header,
.offcanvas-footer {
    background: #eff5fb;
}

.offcanvas-title {
    letter-spacing: 0.18em;
    font-size: 0.85rem;
    color: #334155;
}

.offcanvas-logo-image {
    max-height: 30px;
    width: auto;
    display: block;
}

.touch-btn {
    min-height: 44px;
    font-weight: 500;
}

.locality-mode-tabs .nav-link {
    border-radius: 999px;
    font-size: 0.86rem;
}

.locality-map {
    width: 100%;
    min-height: 52vh;
    border: 1px solid #d5e2ee;
    border-radius: 0.7rem;
}

.field-help {
    border: 0;
    background: transparent;
    color: #94a3b8;
    padding: 0;
    line-height: 1;
    font-size: 0.72rem;
}

.field-help:hover,
.field-help:focus-visible {
    color: #64748b;
}

.tooltip-soft {
    --bs-tooltip-bg: #f8fafc;
    --bs-tooltip-color: #334155;
    --bs-tooltip-opacity: 1;
}

.tooltip-soft .tooltip-inner {
    font-size: 0.72rem;
    font-weight: 400;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    border-radius: 0.45rem;
    padding: 0.35rem 0.45rem;
}

.tooltip-soft .tooltip-arrow::before {
    border-top-color: #f8fafc !important;
}

.articulo-impuestos-list {
    min-height: 86px;
}

@media (max-width: 991.98px) {
    .sidebar {
        display: none !important;
    }

    .main {
        margin-left: 0;
    }

    .topbar {
        padding: 0.7rem 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .employee-form .card-header {
        padding-top: 0.85rem !important;
        padding-bottom: 0.85rem !important;
    }

    .locality-map {
        min-height: 62vh;
    }
}
