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:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(246, 250, 254, 0.98) 100%);
    border-right: 1px solid rgba(203, 213, 225, 0.72);
    box-shadow: 18px 0 38px rgba(15, 23, 42, 0.05);
    z-index: 1020;
    transition: width 0.42s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.sidebar-brand {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid rgba(203, 213, 225, 0.62);
    background:
        linear-gradient(180deg, rgba(250, 252, 255, 0.95) 0%, rgba(241, 246, 251, 0.92) 100%);
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.sidebar-logo {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    text-decoration: none;
    letter-spacing: 0;
    font-weight: 600;
    font-size: 0.84rem;
    color: #243447;
}

.sidebar-logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(203, 213, 225, 0.75);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    flex: 0 0 42px;
}

.sidebar-logo-mark-fallback {
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #475569;
    background: #f8fbff;
}

.sidebar-logo-image {
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    object-fit: contain;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    transform: translateZ(0);
}

.sidebar-logo-text {
    display: inline-flex;
    align-items: center;
    font-size: 0.84rem;
    font-weight: 600;
    color: #41556a;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

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

.sidebar-footer {
    border-top: 1px solid rgba(203, 213, 225, 0.62);
    padding: 0.9rem 1rem 1rem;
    background:
        linear-gradient(180deg, rgba(241, 246, 251, 0.72) 0%, rgba(247, 250, 253, 0.95) 100%);
}

.main {
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.topbar-heading-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-heading {
    display: flex;
    flex-direction: column;
    gap: 0.03rem;
}

.topbar-heading h1 {
    color: #223244;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.topbar-heading small {
    color: #7b8da0 !important;
    font-size: 0.76rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.topbar-ncf-ticker {
    position: relative;
    min-width: 220px;
    max-width: min(42vw, 680px);
    height: 34px;
    margin-left: 0.6rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.topbar-ncf-ticker-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    min-width: max-content;
    height: 100%;
    will-change: transform;
    animation: topbarNcfTickerMove 20s linear infinite;
    transform: translate3d(0, 0, 0);
}

.topbar-ncf-ticker-track span {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding-right: 10rem;
    color: #facc15;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    text-shadow:
        0 0 6px rgba(250, 204, 21, 0.28),
        0 1px 0 rgba(120, 53, 15, 0.18);
}

.topbar-ncf-ticker-track span + span {
    padding-left: 5rem;
}

@keyframes topbarNcfTickerMove {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.sidebar-toggle-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    padding: 0;
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 55%),
        linear-gradient(180deg, #f9fbfe 0%, #edf4fb 100%);
    color: #385066;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 10px 22px rgba(15, 23, 42, 0.08);
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.sidebar-toggle-btn i {
    font-size: 0.95rem;
}

.sidebar-toggle-btn:hover {
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 58%),
        linear-gradient(180deg, #ffffff 0%, #e7f0fa 100%);
    border-color: rgba(100, 116, 139, 0.22);
    color: #22384b;
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 14px 28px rgba(15, 23, 42, 0.1);
}

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

.sidebar-toggle-btn[aria-pressed="true"] {
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 58%),
        linear-gradient(180deg, #e8f1fb 0%, #dbe8f6 100%);
    border-color: rgba(100, 116, 139, 0.26);
    color: #183248;
}

.topbar-profile-trigger {
    min-height: 42px;
    border: 1px solid rgba(212, 224, 237, 0.9);
    border-radius: 999px;
    padding: 0.12rem;
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.topbar-profile-copy {
    padding-inline: 0.8rem;
}

.topbar-profile-copy strong {
    font-size: 0.82rem;
    font-weight: 600;
}

.topbar-profile-trigger::after {
    display: none;
}

.topbar-profile-trigger:hover {
    background: #f8fbff;
}

.topbar-profile-trigger:focus-visible {
    outline: 0;
    border-color: rgba(212, 224, 237, 0.9);
    box-shadow: 0 0 0 0.2rem rgba(148, 163, 184, 0.22);
}

.topbar-profile-trigger:focus,
.topbar-profile-trigger:active,
.topbar-profile-trigger.show {
    border-color: rgba(212, 224, 237, 0.9);
    box-shadow: 0 0 0 0.2rem rgba(148, 163, 184, 0.2);
}

.topbar-avatar-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(203, 213, 225, 0.82);
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    flex: 0 0 40px;
}

.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: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 250, 253, 0.98) 100%);
    border: 1px solid rgba(203, 213, 225, 0.82) !important;
    padding: 0.4rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
}

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

.profile-menu-header strong {
    font-size: 0.86rem;
    font-weight: 600;
    color: #1f2f44;
    letter-spacing: 0.01em;
}

.profile-menu-header small {
    font-size: 0.74rem;
    letter-spacing: 0.02em;
    color: #8a9bb0 !important;
}

.topbar-profile-menu .dropdown-divider {
    margin: 0.35rem 0.35rem;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.topbar-profile-menu .dropdown-item {
    border-radius: 0.7rem;
    color: #3b5168;
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.topbar-profile-menu .dropdown-item:hover {
    background: #eef4fb;
    color: #1f2f44;
}

.topbar-profile-menu .dropdown-item i {
    font-size: 0.95rem;
    color: inherit;
    opacity: 0.85;
}

.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;
}

.app-shell.sidebar-collapsed .sidebar {
    width: 84px;
    overflow: visible;
    box-shadow: 10px 0 28px rgba(15, 23, 42, 0.04);
}

.app-shell.sidebar-collapsed .main {
    margin-left: 84px;
}

.app-shell.sidebar-collapsed .sidebar-brand {
    padding-inline: 0.5rem;
    justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-logo {
    width: 100%;
    justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-logo-text,
.app-shell.sidebar-collapsed .menu-link-left span,
.app-shell.sidebar-collapsed .menu-chevron,
.app-shell.sidebar-collapsed .sidebar-footer .btn span {
    display: none !important;
}

.app-shell.sidebar-collapsed .menu-link {
    justify-content: center;
    padding-inline: 0.5rem;
}

.app-shell.sidebar-collapsed .menu-link-left {
    width: 100%;
    justify-content: center;
    gap: 0;
}

.app-shell.sidebar-collapsed .menu-link-left i {
    font-size: 1rem;
}

.app-shell.sidebar-collapsed .sidebar-menu-scroll {
    overflow: visible;
}

.app-shell.sidebar-collapsed .menu-level-2,
.app-shell.sidebar-collapsed .menu-level-3 {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
}

.app-shell.sidebar-collapsed .sidebar-footer {
    padding-inline: 0.75rem;
}

.app-shell.sidebar-collapsed .sidebar-footer .btn {
    width: 100%;
    padding-inline: 0;
}

.sidebar-footer .btn {
    border-color: rgba(203, 213, 225, 0.82);
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
    color: #41566c;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.sidebar-footer .btn:hover {
    background: linear-gradient(180deg, #ffffff 0%, #eef4fa 100%);
    color: #23384b;
}

.app-shell.sidebar-collapsed .menu-item:hover > .menu-link,
.app-shell.sidebar-collapsed .menu-item:focus-within > .menu-link {
    background: linear-gradient(180deg, rgba(226, 237, 249, 0.95) 0%, rgba(214, 229, 244, 0.98) 100%);
    color: #1c3650;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.app-shell.sidebar-collapsed .menu-item:hover > .menu-link::after,
.app-shell.sidebar-collapsed .menu-item:focus-within > .menu-link::after {
    content: "";
    position: absolute;
    right: -10px;
    top: 50%;
    width: 8px;
    height: 8px;
    transform: translateY(-50%) rotate(45deg);
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(246,250,255,0.98) 100%);
    border-right: 1px solid rgba(214, 223, 234, 0.9);
    border-bottom: 1px solid rgba(214, 223, 234, 0.9);
    box-shadow: 8px 8px 18px rgba(15, 23, 42, 0.08);
    z-index: 1042;
}

.app-shell.sidebar-collapsed .menu-item:hover > .menu-link .menu-link-left span,
.app-shell.sidebar-collapsed .menu-item:focus-within > .menu-link .menu-link-left span {
    display: inline-flex !important;
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    min-height: 32px;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 0.7rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 250, 255, 0.985) 100%);
    border: 1px solid rgba(214, 223, 234, 0.95);
    box-shadow:
        0 22px 44px rgba(15, 23, 42, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    z-index: 1041;
    backdrop-filter: blur(6px);
}

.app-shell.sidebar-collapsed .menu-item:hover > .menu-collapse,
.app-shell.sidebar-collapsed .menu-item:focus-within > .menu-collapse {
    display: block !important;
    position: absolute;
    left: calc(100% + 12px);
    top: -6px;
    min-width: 200px;
    margin-top: 0;
    padding: 0.42rem;
    border-radius: 0.85rem;
    background:
        radial-gradient(circle at 20% 12%, rgba(148, 163, 184, 0.12), transparent 45%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.995) 0%, rgba(246, 250, 255, 0.99) 100%);
    border: 1px solid rgba(214, 223, 234, 0.92);
    box-shadow:
        0 28px 54px rgba(15, 23, 42, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
    z-index: 1045;
    backdrop-filter: blur(6px);
}

.app-shell.sidebar-collapsed .menu-item:hover > .menu-collapse .menu-link {
    border-radius: 0.62rem;
    padding: 0.36rem 0.55rem;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(226, 232, 240, 0.75);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
}

.app-shell.sidebar-collapsed .menu-item:hover > .menu-collapse .menu-link:hover,
.app-shell.sidebar-collapsed .menu-item:focus-within > .menu-collapse .menu-link:hover {
    background: rgba(226, 237, 248, 0.9);
    border-color: rgba(198, 210, 225, 0.9);
}

.app-shell.sidebar-collapsed .menu-item:hover > .menu-collapse .menu-link-left span,
.app-shell.sidebar-collapsed .menu-item:focus-within > .menu-collapse .menu-link-left span {
    display: inline-flex !important;
    position: static;
    transform: none;
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    white-space: normal;
}

.app-shell.sidebar-collapsed .menu-item:hover > .menu-collapse .menu-chevron,
.app-shell.sidebar-collapsed .menu-item:focus-within > .menu-collapse .menu-chevron {
    display: inline-flex !important;
}

.app-shell.sidebar-collapsed .menu-item::after {
    content: "";
    position: absolute;
    right: -16px;
    top: 0;
    width: 16px;
    height: 100%;
}

.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;
}

.factura-shell {
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
}

.factura-main-stack {
    display: grid;
    gap: 0.65rem;
    background: #ffffff;
    border: 1px solid #dce7f2;
    border-radius: 0.85rem;
    padding: 0.78rem 0.82rem;
}

.factura-panel {
    padding: 0.72rem 0.8rem;
}

.factura-layout > .col-12.col-xl-8 .factura-main-stack > .factura-panel,
.factura-layout > .col-12.col-xl-8 .factura-main-stack > .row > .col-12 > .factura-panel {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.factura-layout > .col-12.col-xl-8 .factura-main-stack > .factura-panel + .factura-panel,
.factura-layout > .col-12.col-xl-8 .factura-main-stack > .row + .factura-panel,
.factura-layout > .col-12.col-xl-8 .factura-main-stack > .factura-panel + .row,
.factura-layout > .col-12.col-xl-8 .factura-main-stack > .row + .row {
    border-top: 1px solid #e4edf5;
    padding-top: 0.65rem;
    margin-top: -0.1rem;
}

.factura-layout > .col-12.col-xl-8 .factura-main-stack > .row {
    --bs-gutter-y: 0;
}

.factura-tabs {
    border-bottom: 0;
}

.factura-tabs .nav-link {
    border: 1px solid #dce7f2;
    color: #5b738b;
    background: #f5f9fd;
    border-radius: 0.75rem 0.75rem 0 0;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
}

.factura-tabs .nav-link.active {
    background: #ffffff;
    color: #27445d;
    border-bottom-color: #ffffff;
}

.factura-main-stack-inner {
    display: grid;
    gap: 0.65rem;
}

.factura-general-panel {
    padding: 0.78rem 0.82rem;
}

.factura-subsection + .factura-subsection {
    border-top: 1px solid #e4edf5;
    margin-top: 0.7rem;
    padding-top: 0.7rem;
}

.factura-subsection-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5e7590;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.factura-shell .card-header {
    padding-bottom: 0.7rem !important;
}

.factura-shell .card-body {
    padding-top: 0.8rem !important;
}

.factura-form-grid {
    --bs-gutter-x: 0.7rem;
    --bs-gutter-y: 0.45rem;
}

.factura-shell .form-label {
    color: #51697f;
    font-size: 0.72rem;
}

.factura-shell .form-control,
.factura-shell .form-select {
    min-height: 2rem;
    padding-top: 0.32rem;
    padding-bottom: 0.32rem;
    font-size: 0.82rem;
}

.factura-shell .factura-input-locked[readonly] {
    background: #eef3f7;
    border-color: #d7e1ea;
    color: #607789;
    cursor: not-allowed;
}

.factura-sidebar {
    position: sticky;
    top: 1rem;
}

.factura-summary-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.factura-summary-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.factura-summary-top {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dbe7f1;
    margin-bottom: 0.75rem;
}

.factura-summary-kicker {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #688098;
}

.factura-summary-code {
    font-size: 1.05rem;
    font-weight: 700;
    color: #27445d;
}

.factura-summary-credit {
    font-size: 0.72rem;
    color: #2f8f57;
    white-space: nowrap;
    font-weight: 600;
}

.factura-summary-credit strong {
    font-weight: 700;
}

.factura-payment-box {
    border: 1px solid #dbe5ee;
    border-radius: 0.7rem;
    background: #fbfcfe;
    overflow: hidden;
}

.factura-payment-head,
.factura-payment-row,
.factura-payment-total {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    align-items: center;
    gap: 0.65rem;
    padding: 0.42rem 0.65rem;
}

.factura-payment-head {
    background: #f2f6fa;
    border-bottom: 1px solid #dbe5ee;
    font-size: 0.72rem;
    font-weight: 700;
    color: #607789;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.factura-payment-row + .factura-payment-row,
.factura-payment-extra + .factura-payment-row,
.factura-payment-row + .factura-payment-extra {
    border-top: 1px solid #e7eef5;
}

.factura-payment-row > span {
    font-size: 0.82rem;
    color: #465e74;
}

.factura-payment-row .form-control,
.factura-payment-extra .form-control,
.factura-payment-extra .form-select {
    min-height: 1.9rem;
    font-size: 0.79rem;
}

.factura-payment-extra {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 0.65rem;
    padding: 0.48rem 0.65rem 0.55rem;
    background: #f8fafc;
}

.factura-payment-total {
    border-top: 1px solid #dbe5ee;
    background: #f4f8fb;
    font-size: 0.82rem;
    color: #465e74;
}

.factura-payment-total strong {
    text-align: right;
    font-size: 0.9rem;
    color: #27445d;
}

@media (max-width: 767.98px) {
    .factura-payment-head,
    .factura-payment-row,
    .factura-payment-total {
        grid-template-columns: 1fr;
    }

    .factura-payment-extra {
        grid-template-columns: 1fr;
    }
}

.factura-summary-list {
    display: grid;
    gap: 0.45rem;
}

.factura-summary-row,
.factura-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.factura-summary-row {
    font-size: 0.88rem;
    color: #51687f;
}

.factura-summary-total {
    margin-top: 0.85rem;
    padding-top: 0.8rem;
    border-top: 1px solid #dbe7f1;
    font-size: 1rem;
    color: #1f3f58;
}

.factura-summary-total strong {
    font-size: 1.2rem;
}

.factura-action-stack {
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
}

.factura-form-footer {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin-top: 1rem;
    padding-top: 0.75rem;
}

.factura-form-footer-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #dce7f2;
    border-radius: 0.95rem;
    box-shadow: 0 10px 30px rgba(39, 68, 93, 0.08);
    backdrop-filter: blur(8px);
}

.factura-form-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
}

@media (max-width: 991.98px) {
    .factura-form-footer-inner {
        justify-content: flex-start;
    }

    .factura-form-footer-actions {
        justify-content: flex-start;
    }
}

.factura-checks-card {
    margin-bottom: 0.65rem;
}

.factura-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem 0.7rem;
}

.factura-check-item {
    margin: 0;
    min-height: 1.8rem;
    padding: 0.15rem 0 0.15rem 2.3rem;
    color: #425b73;
    font-size: 0.8rem;
}

.factura-check-item .form-check-input {
    margin-left: -2.3rem;
}

.factura-check-item .form-check-label {
    line-height: 1.2;
}

.factura-option-grid,
.factura-client-meta {
    display: grid;
    gap: 0.55rem;
}

.factura-option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.factura-option-item,
.factura-client-meta-item {
    border: 1px solid #dbe7f1;
    border-radius: 0.75rem;
    background: #f8fbfe;
    padding: 0.55rem 0.65rem;
}

.factura-option-label,
.factura-client-meta-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #71879d;
    margin-bottom: 0.2rem;
}

.factura-option-value,
.factura-client-meta-item strong {
    color: #29445c;
    font-size: 0.86rem;
}

.factura-detail-wrap {
    border-radius: 0.8rem;
}

.factura-detalle-table {
    margin-bottom: 0;
    table-layout: fixed;
}

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

.factura-notes {
    min-height: 80px;
}

@media (max-width: 1199.98px) {
    .factura-sidebar {
        position: static;
    }
}

@media (max-width: 767.98px) {
    .factura-option-grid,
    .factura-client-meta,
    .factura-check-grid {
        grid-template-columns: 1fr;
    }
}

.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-item {
    position: relative;
}

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

.menu-level-2,
.menu-level-3 {
    margin-left: 0.85rem;
    padding-left: 0.7rem;
    border-left: 1px solid rgba(203, 213, 225, 0.72);
}

.menu-link {
    width: 100%;
    border: 0;
    background: rgba(255, 255, 255, 0.28);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0.92rem;
    padding: 0.62rem 0.82rem;
    color: #465a70;
    text-decoration: none;
    font-size: 0.88rem;
    line-height: 1.2;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.menu-link:hover {
    background: rgba(226, 237, 248, 0.86);
    color: #22384b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.menu-link-active {
    background:
        linear-gradient(180deg, rgba(226, 237, 249, 0.98) 0%, rgba(214, 229, 244, 0.98) 100%);
    color: #173247;
    font-weight: 700;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 10px 20px rgba(148, 163, 184, 0.12);
}

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

.menu-link-left i {
    width: 1rem;
    text-align: center;
    font-size: 0.96rem;
    color: #60758a;
}

.menu-link-active .menu-link-left i,
.menu-link:hover .menu-link-left i,
.menu-toggle[aria-expanded="true"] .menu-link-left i {
    color: #29475f;
}

.menu-toggle[aria-expanded="true"] {
    background:
        linear-gradient(180deg, rgba(226, 237, 249, 0.92) 0%, rgba(217, 231, 245, 0.94) 100%);
    color: #1c3850;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.menu-chevron {
    transition: transform 0.16s ease;
    font-size: 0.72rem;
    color: #7b8da0;
}

.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: 1.2rem;
    border-bottom-right-radius: 1.2rem;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
}

.mobile-menu {
    background:
        radial-gradient(circle at 18% 10%, rgba(148, 163, 184, 0.16), transparent 40%),
        linear-gradient(180deg, #f9fbff 0%, #eef4fb 100%);
    border-bottom-left-radius: 1.25rem;
    border-bottom-right-radius: 1.25rem;
}

.mobile-menu-header {
    background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.9), rgba(248, 251, 255, 0.6) 60%),
        linear-gradient(180deg, rgba(246, 250, 255, 0.96) 0%, rgba(236, 244, 252, 0.96) 100%);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(214, 223, 234, 0.9);
}

.mobile-menu-brand {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: #1b2b40;
}

.mobile-menu-subtitle {
    font-size: 0.72rem;
    color: #7a8ca1;
    letter-spacing: 0.02em;
}

.mobile-menu-body {
    padding: 1rem 1.1rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
}

.mobile-menu-body .sidebar-nav {
    flex: 1;
}

.mobile-menu .menu-link {
    border-radius: 0.85rem;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.3rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-menu .menu-link:hover,
.mobile-menu .menu-link:focus-visible {
    background: rgba(226, 237, 248, 0.9);
    color: #1e3a8a;
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
    border-color: rgba(198, 210, 225, 0.9);
}

.mobile-menu .menu-level-2,
.mobile-menu .menu-level-3 {
    margin-left: 0.65rem;
    padding: 0.35rem 0.35rem 0.25rem;
    border-left: 2px solid rgba(214, 223, 234, 0.8);
    background: rgba(255, 255, 255, 0.55);
    border-radius: 0.85rem;
}

.mobile-menu .menu-link-left i {
    color: #60758a;
    transition: color 0.2s ease;
}

.mobile-menu .menu-link:hover .menu-link-left i,
.mobile-menu .menu-link:focus-visible .menu-link-left i {
    color: #2a4a66;
}

.mobile-menu .menu-link-active {
    background: linear-gradient(180deg, rgba(226, 237, 249, 0.95) 0%, rgba(214, 229, 244, 0.98) 100%);
    border-color: rgba(198, 210, 225, 0.95);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.1);
}

.mobile-menu-footer {
    margin-top: auto;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(214, 223, 234, 0.8);
}

.mensaje-wizard-steps {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.mensaje-step-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #52667c;
    background: #eef4fb;
    border: 1px solid rgba(214, 223, 234, 0.9);
}

.mensaje-step-badge.active {
    color: #1d3347;
    background: linear-gradient(180deg, #ffffff 0%, #edf3fa 100%);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.mensaje-step-panel {
    background: #fff;
    border: 1px solid rgba(214, 223, 234, 0.9);
    border-radius: 1rem;
    padding: 0.9rem;
}

.mensaje-accordion-item {
    border: 1px solid rgba(214, 223, 234, 0.9);
    border-radius: 0.9rem;
    overflow: hidden;
    margin-bottom: 0.65rem;
    background: #fff;
}

.mensaje-accordion-item .accordion-button {
    background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
    font-weight: 600;
}

.mensaje-accordion-item .accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(148, 163, 184, 0.18);
}

.mensaje-preview-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 0.8rem;
}

.mensaje-preview-card {
    width: min(520px, 100%);
    border-radius: 1rem;
    border: 1px solid rgba(214, 223, 234, 0.9);
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    padding: 1.1rem;
}

.mensaje-preview-head {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.6rem;
}

.mensaje-preview-title {
    font-size: 1.05rem;
    margin: 0;
    color: #162b40;
}

.mensaje-preview-note {
    font-size: 0.78rem;
    color: #6a7d92;
}

.mensaje-preview-message {
    font-size: 0.9rem;
    color: #33465a;
    margin-bottom: 0.8rem;
}

.mensaje-preview-image-wrap {
    display: flex;
    justify-content: center;
}

.mensaje-preview-image {
    border-radius: 0.8rem;
    max-width: 100%;
    height: auto;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.mensaje-popup-modal .modal-content {
    border-radius: 1rem;
    border: 1px solid rgba(214, 223, 234, 0.9);
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.mensaje-popup-modal .modal-header {
    border-bottom: 0;
}

.mensaje-popup-modal .modal-title {
    font-size: 1.05rem;
    color: #162b40;
}

.mensaje-popup-modal .mensaje-popup-note {
    font-size: 0.78rem;
    color: #6a7d92;
}

.mensaje-popup-modal .mensaje-popup-body {
    font-size: 0.95rem;
    color: #32465c;
}

.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;
}

.ncf-alert-row > td {
    background: #fff8dc !important;
}

.ncf-alert-row-danger > td {
    background: #ffe4e6 !important;
}

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

    .main {
        margin-left: 0;
    }

    .topbar {
        padding: 0.7rem 1rem;
    }

    .topbar-ncf-ticker {
        display: none;
    }

    .main-content {
        padding: 1rem;
    }

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

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