:root {
    --fol-theme-bg: #f4f7f8;
    --fol-theme-surface: #ffffff;
    --fol-theme-surface-soft: #f7faf9;
    --fol-theme-text: #273444;
    --fol-theme-muted: #667783;
    --fol-theme-border: #dce5e8;
    --fol-theme-shadow: rgba(31, 45, 61, .12);
}

.fol-theme-toggle {
    align-items: center;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 40px;
    height: 40px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background .2s ease, transform .2s ease;
    width: 40px;
}

.fol-theme-toggle:hover,
.fol-theme-toggle:focus {
    background: rgba(255, 255, 255, .28);
    color: inherit;
    outline: 2px solid rgba(255, 255, 255, .35);
    outline-offset: 2px;
    transform: translateY(-1px);
}

.fol-theme-toggle i { font-size: 1rem; pointer-events: none; }
.fol-theme-toggle-item { align-items: center; display: flex; margin-right: .55rem; }
.fol-theme-toggle-mobile { display: none; }
.navbar-horizontal:not(.background-fol-green) .fol-theme-toggle {
    background: #158c78;
    border-color: #158c78;
    color: #fff;
}
.navbar-horizontal:not(.background-fol-green) .fol-theme-toggle:hover,
.navbar-horizontal:not(.background-fol-green) .fol-theme-toggle:focus {
    background: #107461;
    border-color: #107461;
    color: #fff;
}

/* El encabezado público es claro aunque utilice navbar-dark. */
.navbar-horizontal.navbar-dark:not(.background-fol-green) .navbar-toggler-icon,
#sidenav-main.navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(21,140,120,1)' stroke-width='2.4' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
}
.navbar-horizontal.navbar-dark:not(.background-fol-green) .navbar-toggler,
#sidenav-main.navbar-light .navbar-toggler {
    border-color: rgba(21, 140, 120, .35) !important;
    color: #158c78 !important;
}
.fol-two-factor-logout-mobile { display: none; }

.fol-password-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: #667783;
    display: flex;
    height: 100%;
    justify-content: center;
    min-width: 48px;
    padding: 0 15px;
}

.fol-password-toggle:hover,
.fol-password-toggle:focus { color: #158c78; outline: 0; }

html[data-fol-theme="dark"] { color-scheme: dark; }
html[data-fol-theme="dark"] body,
html[data-fol-theme="dark"] .main-content {
    background: #0c141b !important;
    color: #e7edf2 !important;
}

html[data-fol-theme="dark"] .header {
    background: #0c141b !important;
}

html[data-fol-theme="dark"] .card,
html[data-fol-theme="dark"] .modal-content,
html[data-fol-theme="dark"] .dropdown-menu,
html[data-fol-theme="dark"] .list-group-item,
html[data-fol-theme="dark"] .navbar-collapse-header,
html[data-fol-theme="dark"] footer,
html[data-fol-theme="dark"] .bg-secondary,
html[data-fol-theme="dark"] .bg-white {
    background: #16222c !important;
    border-color: #30404c !important;
    color: #e7edf2 !important;
}

html[data-fol-theme="dark"] .card-header,
html[data-fol-theme="dark"] .card-footer,
html[data-fol-theme="dark"] .modal-header,
html[data-fol-theme="dark"] .modal-footer,
html[data-fol-theme="dark"] .table thead th {
    background: #1b2934 !important;
    border-color: #344550 !important;
    color: #dbe5eb !important;
}

html[data-fol-theme="dark"] .table,
html[data-fol-theme="dark"] .table td,
html[data-fol-theme="dark"] .table th {
    background-color: transparent !important;
    border-color: #30404c !important;
    color: #e7edf2 !important;
}

html[data-fol-theme="dark"] .table-hover tbody tr:hover { background: #20313d !important; }

html[data-fol-theme="dark"] h1,
html[data-fol-theme="dark"] h2,
html[data-fol-theme="dark"] h3,
html[data-fol-theme="dark"] h4,
html[data-fol-theme="dark"] h5,
html[data-fol-theme="dark"] h6,
html[data-fol-theme="dark"] label,
html[data-fol-theme="dark"] strong,
html[data-fol-theme="dark"] .text-dark,
html[data-fol-theme="dark"] .text-fol-grey { color: #edf3f7 !important; }

html[data-fol-theme="dark"] .text-muted,
html[data-fol-theme="dark"] .text-secondary,
html[data-fol-theme="dark"] small { color: #aebbc5 !important; }

html[data-fol-theme="dark"] .form-control,
html[data-fol-theme="dark"] .custom-select,
html[data-fol-theme="dark"] select,
html[data-fol-theme="dark"] textarea,
html[data-fol-theme="dark"] .input-group-text {
    background: #101b23 !important;
    border-color: #3a4b57 !important;
    color: #f1f5f8 !important;
}

html[data-fol-theme="dark"] .form-control::placeholder,
html[data-fol-theme="dark"] textarea::placeholder { color: #8797a3 !important; }
html[data-fol-theme="dark"] .fol-password-toggle { background: #101b23 !important; color: #aebbc5; }
html[data-fol-theme="dark"] .form-control:focus,
html[data-fol-theme="dark"] select:focus,
html[data-fol-theme="dark"] textarea:focus { border-color: #35b9a1 !important; box-shadow: 0 0 0 .15rem rgba(53,185,161,.18) !important; }
html[data-fol-theme="dark"] .input-group-alternative { box-shadow: 0 1px 3px rgba(0,0,0,.5) !important; }
html[data-fol-theme="dark"] .dropdown-item { color: #e7edf2 !important; }
html[data-fol-theme="dark"] .dropdown-item:hover,
html[data-fol-theme="dark"] .dropdown-item:focus { background: #233541 !important; }
html[data-fol-theme="dark"] .nav-link,
html[data-fol-theme="dark"] a:not(.btn) { color: #68d8c3; }
html[data-fol-theme="dark"] .sidenav,
html[data-fol-theme="dark"] .navbar-vertical { background: #111d25 !important; }
html[data-fol-theme="dark"] .navbar-vertical.navbar-light .navbar-nav .nav-link {
    color: #c5d1d8 !important;
}
html[data-fol-theme="dark"] .navbar-vertical.navbar-light .navbar-nav .nav-link:hover,
html[data-fol-theme="dark"] .navbar-vertical.navbar-light .navbar-nav .nav-link:focus,
html[data-fol-theme="dark"] .navbar-vertical.navbar-light .navbar-nav .nav-link[aria-expanded="true"] {
    background: #20313d !important;
    color: #f3f7f9 !important;
}
html[data-fol-theme="dark"] .navbar-vertical.navbar-light .navbar-nav .nav-link.active {
    background: #17463e !important;
    color: #fff !important;
}
html[data-fol-theme="dark"] .navbar-vertical.navbar-light .navbar-nav .nav-link.active::before {
    border-left-color: #68d8c3 !important;
}
html[data-fol-theme="dark"] .navbar-vertical.navbar-light .navbar-nav .nav-link i,
html[data-fol-theme="dark"] .navbar-vertical.navbar-light .navbar-nav .nav-link.active i {
    color: #57cfb8 !important;
}
html[data-fol-theme="dark"] .navbar-vertical .navbar-nav .nav-link[data-toggle="collapse"]::after {
    color: #b8c6cf !important;
}
html[data-fol-theme="dark"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(237,243,247,1)' stroke-width='2.4' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
}
html[data-fol-theme="dark"] .navbar-toggler {
    border-color: rgba(237, 243, 247, .42) !important;
    color: #edf3f7 !important;
}
html[data-fol-theme="dark"] .separator polygon,
html[data-fol-theme="dark"] .fill-secondary { fill: #0c141b !important; }
html[data-fol-theme="dark"] .fol-release-meta { background-color: #16222c !important; color: #aebbc5 !important; }
html[data-fol-theme="dark"] .cancel-card,
html[data-fol-theme="dark"] .cancel-body { background: #16222c !important; border-color: #30404c !important; color: #e7edf2 !important; }
html[data-fol-theme="dark"] .confirmation { background: #101b23 !important; border-color: #3a4b57 !important; }
html[data-fol-theme="dark"] .danger-panel { background: #321d20 !important; color: #ffb8b5 !important; }
html[data-fol-theme="dark"] .cancel-footer { color: #aebbc5 !important; }
html[data-fol-theme="dark"] .fol-dashboard-hero,
html[data-fol-theme="dark"] .doc-hero,
html[data-fol-theme="dark"] .doc-section,
html[data-fol-theme="dark"] .manual-hero,
html[data-fol-theme="dark"] .manual-section,
html[data-fol-theme="dark"] .contract-card {
    background: #16222c !important;
    border-color: #30404c !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .28) !important;
    color: #e7edf2 !important;
}
html[data-fol-theme="dark"] .fol-dashboard-hero h1,
html[data-fol-theme="dark"] .fol-dashboard-hero p,
html[data-fol-theme="dark"] .card-stats .h2,
html[data-fol-theme="dark"] .doc-title,
html[data-fol-theme="dark"] .doc-section h3,
html[data-fol-theme="dark"] .manual-title,
html[data-fol-theme="dark"] .manual-section h3,
html[data-fol-theme="dark"] .contract-title { color: #edf3f7 !important; }
html[data-fol-theme="dark"] .flow-box,
html[data-fol-theme="dark"] .flow-step,
html[data-fol-theme="dark"] .contract-summary,
html[data-fol-theme="dark"] .signature-box {
    background: #101b23 !important;
    border-color: #3a4b57 !important;
    color: #dbe5eb !important;
}
html[data-fol-theme="dark"] .flow-step strong { color: #edf3f7 !important; }
html[data-fol-theme="dark"] .signature-label,
html[data-fol-theme="dark"] .file-note { color: #aebbc5 !important; }
html[data-fol-theme="dark"] .signature-value { color: #edf3f7 !important; }
html[data-fol-theme="dark"] .code-pill,
html[data-fol-theme="dark"] code {
    background: #0b141a !important;
    border-color: #3a4b57 !important;
    color: #7be3cf !important;
}
html[data-fol-theme="dark"] .badge-soft { background: #203a38 !important; color: #7be3cf !important; }
html[data-fol-theme="dark"] .fol-zip-loading { background: rgba(7, 12, 16, .86) !important; }
html[data-fol-theme="dark"] .fol-zip-loading-box { background: #16222c !important; color: #edf3f7 !important; }
html[data-fol-theme="dark"] .alert-danger {
    background: #3a1d22 !important;
    border-color: #71313b !important;
    color: #ffbdc5 !important;
}
html[data-fol-theme="dark"] .alert-success {
    background: #15362f !important;
    border-color: #286957 !important;
    color: #a9ead8 !important;
}
html[data-fol-theme="dark"] .alert-warning {
    background: #3b3118 !important;
    border-color: #725e28 !important;
    color: #ffe09a !important;
}
html[data-fol-theme="dark"] .alert-info {
    background: #17313f !important;
    border-color: #2d6179 !important;
    color: #b7e6f7 !important;
}
html[data-fol-theme="dark"] .alert strong,
html[data-fol-theme="dark"] .alert .alert-inner--text { color: inherit !important; }
html[data-fol-theme="dark"] .modal .close {
    color: #fff !important;
    opacity: .85;
    text-shadow: none;
}
html[data-fol-theme="dark"] .custom-file-label {
    background: #101b23 !important;
    border-color: #3a4b57 !important;
    color: #aebbc5 !important;
}
html[data-fol-theme="dark"] .custom-file-label::after {
    background: #1b2934 !important;
    border-left-color: #3a4b57 !important;
    color: #dbe5eb !important;
}
html[data-fol-theme="dark"] .input-group-append .btn-outline-secondary,
html[data-fol-theme="dark"] button[data-toggle-password] {
    background: #101b23 !important;
    border-color: #3a4b57 !important;
    color: #aebbc5 !important;
}
html[data-fol-theme="dark"] .input-group-append .btn-outline-secondary:hover,
html[data-fol-theme="dark"] .input-group-append .btn-outline-secondary:focus,
html[data-fol-theme="dark"] button[data-toggle-password]:hover,
html[data-fol-theme="dark"] button[data-toggle-password]:focus {
    background: #20313d !important;
    color: #7be3cf !important;
}
html[data-fol-theme="dark"] .navbar-horizontal:not(.background-fol-green) {
    background: #101b23 !important;
    border-bottom: 1px solid #2d3d48;
}
html[data-fol-theme="dark"] .navbar-horizontal .nav-link,
html[data-fol-theme="dark"] .navbar-horizontal .text-fol-grey { color: #7be3cf !important; }
html[data-fol-theme="dark"] .fol-auth-intro p,
html[data-fol-theme="dark"] .fol-auth-points div,
html[data-fol-theme="dark"] .fol-auth-card-header p { color: #aebbc5 !important; }
html[data-fol-theme="dark"] .fol-auth-points i {
    background: #17352f !important;
    color: #7be3cf !important;
}
html[data-fol-theme="dark"] .page-item .page-link,
html[data-fol-theme="dark"] .page-item span {
    background: #16222c !important;
    border-color: #3a4b57 !important;
    color: #7be3cf !important;
}
html[data-fol-theme="dark"] .page-item .page-link:hover,
html[data-fol-theme="dark"] .page-item .page-link:focus {
    background: #20313d !important;
    border-color: #4a606e !important;
    color: #a9f1e3 !important;
}
html[data-fol-theme="dark"] .page-item.active .page-link,
html[data-fol-theme="dark"] .page-item.active span {
    background: #158c78 !important;
    border-color: #158c78 !important;
    color: #fff !important;
}
html[data-fol-theme="dark"] .page-item.disabled .page-link,
html[data-fol-theme="dark"] .page-item.disabled span {
    background: #111b22 !important;
    border-color: #2b3943 !important;
    color: #657580 !important;
}

/* Descarga de facturas: oferta, contratación y operación del producto. */
html[data-fol-theme="dark"] .fol-download-offer,
html[data-fol-theme="dark"] .fol-download-offer-main {
    background: #16222c !important;
    border-color: #30404c !important;
    color: #e7edf2 !important;
}
html[data-fol-theme="dark"] .fol-download-offer {
    box-shadow: 0 18px 42px rgba(0, 0, 0, .28) !important;
}
html[data-fol-theme="dark"] .fol-download-offer-main h1,
html[data-fol-theme="dark"] .fol-download-benefit strong { color: #edf3f7 !important; }
html[data-fol-theme="dark"] .fol-download-benefit i {
    background: #17352f !important;
    color: #7be3cf !important;
}
html[data-fol-theme="dark"] .fol-download-action h2,
html[data-fol-theme="dark"] .fol-download-action p,
html[data-fol-theme="dark"] .fol-download-action .price,
html[data-fol-theme="dark"] .fol-download-action small { color: #fff !important; }
html[data-fol-theme="dark"] .fol-invoice-banner {
    background: #17313f !important;
    border-color: #2d6179 !important;
    color: #c9edf8 !important;
}
html[data-fol-theme="dark"] .fol-invoice-banner strong { color: #edf8fc !important; }
html[data-fol-theme="dark"] .fol-security-note,
html[data-fol-theme="dark"] .security-note {
    background: #3b3118 !important;
    border-color: #b68a32 !important;
    color: #ffe09a !important;
}
html[data-fol-theme="dark"] .status-ok { background: #17352f !important; color: #8ce7d4 !important; }
html[data-fol-theme="dark"] .status-wait { background: #3b3118 !important; color: #ffe09a !important; }
html[data-fol-theme="dark"] .status-bad { background: #3a1d22 !important; color: #ffbdc5 !important; }

/* Flujo de pagos: cuenta nueva, adeudos, efectivo y pago confirmado. */
html[data-fol-theme="dark"] .card.background-fol-green {
    background: #158c78 !important;
    border-color: #158c78 !important;
    color: #fff !important;
}
html[data-fol-theme="dark"] .card.background-fol-green h1,
html[data-fol-theme="dark"] .card.background-fol-green h2,
html[data-fol-theme="dark"] .card.background-fol-green h3,
html[data-fol-theme="dark"] .card.background-fol-green h4,
html[data-fol-theme="dark"] .card.background-fol-green h5,
html[data-fol-theme="dark"] .card.background-fol-green p { color: #fff !important; }
html[data-fol-theme="dark"] .arrears-hero {
    background: linear-gradient(135deg, #101b23 0%, #16222c 100%) !important;
    border-color: #30404c !important;
}
html[data-fol-theme="dark"] .arrears-title { color: #edf3f7 !important; }
html[data-fol-theme="dark"] .arrears-user-card,
html[data-fol-theme="dark"] .reference-box,
html[data-fol-theme="dark"] .stores-box,
html[data-fol-theme="dark"] .payment-card-header,
html[data-fol-theme="dark"] .payment-card-body {
    background: #101b23 !important;
    border-color: #3a4b57 !important;
    color: #e7edf2 !important;
}
html[data-fol-theme="dark"] .arrears-user-card {
    box-shadow: 0 10px 22px rgba(0, 0, 0, .28) !important;
}
html[data-fol-theme="dark"] .disabled-field {
    background: #111b22 !important;
    color: #c9d4db !important;
}
html[data-fol-theme="dark"] .pending-icon,
html[data-fol-theme="dark"] .payment-icon,
html[data-fol-theme="dark"] .payment-step-number {
    background: #17352f !important;
    color: #7be3cf !important;
}
html[data-fol-theme="dark"] .reference-value { color: #edf3f7 !important; }
html[data-fol-theme="dark"] .store-badge {
    background: #203a38 !important;
    color: #8ce7d4 !important;
}
html[data-fol-theme="dark"] .payment-note {
    background: #17313f !important;
    border-color: #2d8c7a !important;
    color: #c9edf8 !important;
}
html[data-fol-theme="dark"] .payment-card {
    border-color: #30404c !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .3) !important;
}

@media (max-width: 767.98px) {
    .fol-theme-toggle-item { display: none !important; }
    .fol-theme-toggle-mobile {
        background: #158c78;
        border-color: rgba(255,255,255,.7);
        box-shadow: 0 5px 18px rgba(0,0,0,.2);
        color: #fff;
        display: inline-flex;
        z-index: 1090;
    }
    .fol-theme-toggle-in-navbar { position: absolute; right: 64px; top: 14px; }
    .fol-theme-toggle-floating { position: fixed; right: 14px; top: 14px; }
    .fol-theme-toggle-mobile:hover,
    .fol-theme-toggle-mobile:focus { background: #107461; color: #fff; }
    body { overflow-x: hidden; }
    .card-body { padding-left: 1.1rem; padding-right: 1.1rem; }
    .table-responsive { -webkit-overflow-scrolling: touch; }
    .form-control, select, textarea { font-size: 16px !important; }
    .fol-release-meta { max-width: calc(100vw - 24px); white-space: normal !important; }
    .fol-dashboard-hero { padding: 1.15rem !important; }
    .fol-dashboard-hero .btn { width: 100%; }
    .doc-hero, .doc-section { padding: 1.1rem !important; }
    .doc-hero .btn { display: block; margin: .55rem 0 0 !important; width: 100%; }
    .doc-section { overflow-wrap: anywhere; }
    .doc-section .table-responsive { margin-left: -.35rem; margin-right: -.35rem; width: calc(100% + .7rem); }
    .code-pill { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
    .manual-hero, .manual-section, .contract-card { padding: 1.1rem !important; }
    .manual-hero .btn, .contract-card .btn { margin-left: 0 !important; width: 100%; }
    .pagination { flex-wrap: wrap; gap: .25rem; justify-content: center !important; }
    .page-item .page-link, .page-item span { margin: 2px !important; }
    .fol-two-factor-navbar > .container > .navbar-toggler { display: none; }
    .fol-two-factor-navbar .navbar-brand img { max-width: 145px; }
    .fol-two-factor-navbar .fol-theme-toggle-in-navbar { right: 14px; }
    .fol-two-factor-logout-mobile {
        align-items: center;
        background: #158c78;
        border: 1px solid rgba(255,255,255,.7);
        border-radius: 20px;
        color: #fff !important;
        display: inline-flex !important;
        font-size: .78rem;
        font-weight: 700;
        gap: 5px;
        height: 40px;
        justify-content: center;
        padding: 0 12px;
        position: absolute;
        right: 64px;
        top: 14px;
        z-index: 1090;
    }
    .fol-two-factor-logout-mobile:hover,
    .fol-two-factor-logout-mobile:focus { background: #107461; color: #fff !important; }

    html[data-fol-theme="dark"] .navbar-collapse.collapsing,
    html[data-fol-theme="dark"] .navbar-collapse.show {
        background: #16222c !important;
        border: 1px solid #30404c;
        box-shadow: 0 22px 55px rgba(0, 0, 0, .42) !important;
    }
    html[data-fol-theme="dark"] .navbar-collapse .navbar-collapse-header {
        border-bottom-color: #30404c !important;
    }
    html[data-fol-theme="dark"] .navbar-collapse .navbar-toggler span {
        background: #edf3f7 !important;
    }
    html[data-fol-theme="dark"] .navbar-nav .nav-link {
        color: #dbe5eb !important;
    }
    html[data-fol-theme="dark"] .navbar-nav .nav-link:hover,
    html[data-fol-theme="dark"] .navbar-nav .nav-link:focus,
    html[data-fol-theme="dark"] .navbar-nav .nav-link.active {
        color: #7be3cf !important;
    }
}
