:root {
    --bg:#02060b;
    --panel:#08121d;
    --panel2:#0c1825;
    --text:#f4f7fb;
    --muted:#8c9bad;
    --blue:#1683ff;
    --cyan:#39cfff;
    --green:#31d081;
    --red:#ff6464;
    --border:rgba(255,255,255,.09);
}

* {
    box-sizing:border-box;
}

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

body {
    background:var(--bg);
    color:var(--text);

    font-family:
        "Segoe UI Variable",
        "Segoe UI",
        Arial,
        sans-serif;

    -webkit-font-smoothing:antialiased;
}

a {
    color:inherit;
    text-decoration:none;
}

button,
input {
    font:inherit;
}


/* AUTH */

.auth-layout {
    min-height:100vh;

    display:grid;
    grid-template-columns:1.05fr .95fr;
}


/* LEFT IMAGE */

.auth-visual {
    min-height:100vh;

    position:relative;

    background-image:
        url("/assets/auth-background.webp");

    background-size:cover;
    background-position:center;
}

.auth-visual::after {
    content:"";

    position:absolute;
    inset:0;

    background:
        linear-gradient(
            90deg,
            rgba(2,6,11,.18),
            rgba(2,6,11,.62)
        ),
        linear-gradient(
            to top,
            rgba(2,6,11,.85),
            transparent 55%
        );
}

.auth-branding {
    position:absolute;

    z-index:2;

    left:70px;
    right:70px;
    bottom:65px;
}

.auth-branding h1 {
    margin:18px 0 8px;

    max-width:620px;

    font-size:48px;
    line-height:1.05;

    letter-spacing:-2px;
}

.auth-branding p {
    max-width:540px;

    color:#c0c9d4;

    font-size:16px;
    line-height:1.7;
}


/* BRAND */

.brand {
    display:flex;
    align-items:center;
    gap:13px;
}

.brand-icon {
    width:53px;
    height:53px;

    display:grid;
    place-items:center;

    border-radius:14px;

    color:white;

    font-size:17px;
    font-weight:900;

    background:
        linear-gradient(145deg,#13263c,#07111d);

    border:
        1px solid rgba(57,207,255,.22);
}

.brand-text {
    display:flex;
    flex-direction:column;
}

.brand-text strong {
    font-size:18px;
}

.brand-text strong span {
    color:var(--cyan);
}

.brand-text small {
    margin-top:4px;

    color:#6f8197;

    font-size:7px;
    font-weight:700;

    letter-spacing:2.2px;
}


/* FORM SIDE */

.auth-main {
    min-height:100vh;

    padding:50px 9%;

    display:flex;
    flex-direction:column;
    justify-content:center;

    background:
        radial-gradient(
            circle at 70% 20%,
            rgba(22,131,255,.07),
            transparent 25%
        ),
        var(--bg);
}

.auth-top {
    position:absolute;
    top:35px;
    right:4%;

    color:#8393a7;
    font-size:13px;
}

.auth-top a {
    color:#49b9ff;
    font-weight:600;
}

.auth-card {
    width:100%;
    max-width:465px;

    margin:auto;
}

.auth-card h2 {
    margin:30px 0 7px;

    font-size:40px;
    line-height:1.08;
    letter-spacing:-1.7px;
}

.auth-description {
    margin:0 0 31px;

    color:var(--muted);

    font-size:15px;
    line-height:1.65;
}


/* FORMS */

.field {
    margin-bottom:17px;
}

.field label {
    display:block;

    margin-bottom:7px;

    color:#c1cad5;

    font-size:12px;
    font-weight:600;
}

.field input {
    width:100%;
    height:51px;

    padding:0 15px;

    color:white;

    background:#07111c;

    border:1px solid #203248;

    border-radius:9px;

    outline:none;

    transition:.2s;
}

.field input:focus {
    border-color:#278dff;

    box-shadow:
        0 0 0 3px rgba(22,131,255,.09);
}

.field-hint {
    display:block;

    margin-top:6px;

    color:#64778d;

    font-size:10px;
}

.form-row {
    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:15px;

    margin:7px 0 21px;
}

.checkbox {
    display:flex;
    align-items:center;

    gap:9px;

    color:#9ba9ba;

    font-size:12px;
}

.checkbox input {
    width:16px;
    height:16px;

    accent-color:var(--blue);
}

.primary-button {
    width:100%;
    height:51px;

    border:0;
    border-radius:9px;

    cursor:pointer;

    color:white;

    background:
        linear-gradient(135deg,#1989ff,#0766e7);

    font-weight:650;

    box-shadow:
        0 14px 32px rgba(22,131,255,.16);

    transition:.2s;
}

.primary-button:hover {
    transform:translateY(-1px);
}

.primary-button:disabled {
    opacity:.55;
    cursor:wait;
    transform:none;
}

.secondary-link {
    color:#49b9ff;

    font-size:12px;
    font-weight:600;
}

.form-message {
    min-height:22px;

    margin:16px 0;

    color:#ff8585;

    font-size:12px;
    line-height:1.5;
}

.form-message.success {
    color:#54d997;
}


/* CODE INPUT */

.code-input {
    height:67px !important;

    text-align:center;

    font-size:29px;

    font-weight:700;

    letter-spacing:14px;
}


/* FOOTER AUTH */

.auth-footer {
    margin-top:30px;

    padding-top:22px;

    border-top:1px solid var(--border);

    color:#586b81;

    font-size:10px;
}


/* DASHBOARD */

.dashboard-shell {
    min-height:100vh;

    display:grid;

    grid-template-columns:260px 1fr;

    background:#03080d;
}


/* SIDEBAR */

.sidebar {
    position:fixed;

    width:260px;
    height:100vh;

    padding:27px 20px;

    background:#050b12;

    border-right:1px solid var(--border);
}

.sidebar-brand {
    padding:0 7px 29px;

    border-bottom:1px solid var(--border);
}

.sidebar-menu {
    padding-top:24px;
}

.menu-title {
    margin:21px 10px 9px;

    color:#52667e;

    font-size:8px;
    font-weight:800;

    letter-spacing:1.7px;
}

.nav-item {
    width:100%;

    padding:11px 13px;

    margin:3px 0;

    display:flex;
    align-items:center;

    gap:11px;

    border:0;
    border-radius:9px;

    cursor:pointer;

    color:#91a1b4;

    background:transparent;

    text-align:left;

    font-size:13px;
}

.nav-item:hover,
.nav-item.active {
    color:white;

    background:#0b1826;
}

.nav-item .icon {
    width:21px;

    color:#36bfff;

    text-align:center;
}


/* DASH CONTENT */

.dashboard-main {
    grid-column:2;

    min-height:100vh;
}

.dashboard-header {
    height:76px;

    padding:0 38px;

    display:flex;
    align-items:center;
    justify-content:flex-end;

    border-bottom:1px solid var(--border);

    background:rgba(3,8,13,.85);
}

.user-menu {
    display:flex;
    align-items:center;

    gap:12px;
}

.user-avatar {
    width:38px;
    height:38px;

    display:grid;
    place-items:center;

    border-radius:50%;

    color:white;

    background:#0f2943;

    font-size:12px;
    font-weight:700;
}

.user-meta strong,
.user-meta span {
    display:block;
}

.user-meta strong {
    font-size:12px;
}

.user-meta span {
    margin-top:2px;

    color:#6f8197;

    font-size:9px;
}

.logout-button {
    margin-left:18px;

    padding:8px 11px;

    color:#8fa0b3;

    background:transparent;

    border:1px solid var(--border);

    border-radius:8px;

    cursor:pointer;

    font-size:10px;
}


/* CONTENT */

.dashboard-content {
    max-width:1300px;

    margin:auto;

    padding:52px 45px;
}

.dashboard-title {
    display:flex;
    justify-content:space-between;
    align-items:flex-end;

    gap:25px;
}

.dashboard-title h1 {
    margin:0;

    font-size:38px;
    letter-spacing:-1.5px;
}

.dashboard-title p {
    margin:7px 0 0;

    color:var(--muted);
}

.add-device {
    min-height:43px;

    padding:0 17px;

    color:white;

    background:#117af1;

    border:0;
    border-radius:8px;

    cursor:pointer;

    font-size:11px;
    font-weight:600;
}


/* STATS */

.stats {
    margin-top:36px;

    display:grid;
    grid-template-columns:repeat(3,1fr);

    gap:14px;
}

.stat-card {
    padding:23px;

    border-radius:14px;

    border:1px solid var(--border);

    background:#07111b;
}

.stat-card span {
    color:#708399;

    font-size:10px;
}

.stat-card strong {
    display:block;

    margin-top:7px;

    color:white;

    font-size:27px;
}


/* EMPTY DEVICE */

.devices-section {
    margin-top:42px;
}

.devices-section h2 {
    font-size:19px;
}

.empty-devices {
    min-height:310px;

    margin-top:15px;

    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;

    text-align:center;

    border-radius:16px;

    border:1px dashed #21364c;

    background:
        radial-gradient(
            circle,
            rgba(22,131,255,.05),
            transparent 45%
        );
}

.empty-icon {
    width:65px;
    height:65px;

    display:grid;
    place-items:center;

    border-radius:17px;

    color:#4ac2ff;

    background:#0b2033;

    font-size:25px;
}

.empty-devices h3 {
    margin:18px 0 7px;

    font-size:19px;
}

.empty-devices p {
    max-width:400px;

    margin:0;

    color:#75879c;

    font-size:13px;
    line-height:1.6;
}


/* MOBILE */

@media(max-width:900px) {

    .auth-layout {
        grid-template-columns:1fr;
    }

    .auth-visual {
        display:none;
    }

    .auth-main {
        padding:40px 25px;
    }

    .auth-card {
        max-width:470px;
    }

    .dashboard-shell {
        display:block;
    }

    .sidebar {
        display:none;
    }

    .dashboard-main {
        display:block;
    }

    .dashboard-header {
        padding:0 18px;
    }

    .dashboard-content {
        padding:35px 18px;
    }

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

    .dashboard-title {
        align-items:flex-start;
        flex-direction:column;
    }

}


/* =====================================================
   REAL DASHBOARD V2
===================================================== */

.content-section-title {
    margin-bottom:18px;

    display:flex;
    align-items:flex-end;
    justify-content:space-between;

    gap:25px;
}

.content-section-title h2 {
    margin:0;

    color:white;

    font-size:20px;
}

.content-section-title p {
    margin:4px 0 0;

    color:#72859b;

    font-size:12px;
}


/* DEVICES */

.device-grid {
    display:grid;

    grid-template-columns:
        repeat(3,minmax(0,1fr));

    gap:15px;
}

.device-card {
    min-height:300px;

    padding:23px;

    border-radius:16px;

    background:
        linear-gradient(
            145deg,
            #091520,
            #06101a
        );

    border:
        1px solid var(--border);
}

.device-card-top {
    display:flex;

    align-items:center;
    justify-content:space-between;
}

.device-icon {
    width:50px;
    height:50px;

    display:grid;
    place-items:center;

    border-radius:13px;

    color:#5ecaff;

    background:#0b2135;

    border:
        1px solid rgba(57,207,255,.14);

    font-size:12px;
    font-weight:800;
}

.device-state {
    display:flex;

    align-items:center;

    gap:6px;

    font-size:10px;

    font-weight:650;
}

.device-state span {
    width:7px;
    height:7px;

    border-radius:50%;
}

.device-state.online {
    color:#4cdb95;
}

.device-state.online span {
    background:#31d081;

    box-shadow:
        0 0 10px rgba(49,208,129,.6);
}

.device-state.offline {
    color:#8292a5;
}

.device-state.offline span {
    background:#576a80;
}

.device-card h3 {
    margin:
        23px 0 2px;

    color:white;

    font-size:20px;
}

.device-type {
    color:#58c4ff;

    font-size:10px;

    font-weight:650;
}

.device-info {
    margin-top:23px;

    display:grid;

    grid-template-columns:
        repeat(2,1fr);

    gap:14px;
}

.device-info span,
.device-info strong {
    display:block;
}

.device-info span {
    color:#61768d;

    font-size:9px;

    text-transform:uppercase;

    letter-spacing:.8px;
}

.device-info strong {
    margin-top:3px;

    color:#aab6c5;

    font-size:11px;

    font-weight:600;

    word-break:break-word;
}

.empty-add-button {
    width:auto;

    margin-top:20px;
}


/* LOCATIONS */

.location-grid {
    display:grid;

    grid-template-columns:
        repeat(3,minmax(0,1fr));

    gap:15px;
}

.location-card {
    min-height:145px;

    padding:22px;

    display:flex;

    gap:17px;

    align-items:flex-start;

    border-radius:15px;

    background:#07111b;

    border:
        1px solid var(--border);
}

.location-icon {
    width:48px;
    height:48px;

    flex:0 0 auto;

    display:grid;
    place-items:center;

    border-radius:12px;

    background:#0b2033;

    color:#46c1ff;

    font-size:21px;
}

.location-card h3 {
    margin:2px 0 4px;

    color:white;

    font-size:17px;
}

.location-card p {
    margin:0;

    color:#8b9bae;

    font-size:12px;
}

.location-card span {
    display:block;

    margin-top:7px;

    color:#5e7289;

    font-size:9px;
}


/* SECURITY */

.trusted-browser-list {
    display:flex;

    flex-direction:column;

    gap:10px;
}

.trusted-browser {
    min-height:92px;

    padding:17px 19px;

    display:flex;

    align-items:center;

    gap:16px;

    border-radius:13px;

    background:#07111b;

    border:
        1px solid var(--border);
}

.trusted-browser-icon {
    width:45px;
    height:45px;

    flex:0 0 auto;

    display:grid;
    place-items:center;

    border-radius:11px;

    color:#4cc4ff;

    background:#0b2033;
}

.trusted-browser-copy {
    flex:1;
}

.trusted-browser-copy h3 {
    margin:0;

    color:white;

    font-size:14px;
}

.trusted-browser-copy p {
    margin:3px 0;

    color:#8494a7;

    font-size:11px;
}

.trusted-browser-copy small {
    color:#5f738a;

    font-size:9px;
}

.revoke-browser {
    padding:8px 12px;

    color:#ff9292;

    background:transparent;

    border:
        1px solid rgba(255,100,100,.25);

    border-radius:7px;

    cursor:pointer;

    font-size:10px;
}

.browser-revoked {
    color:#66798e;

    font-size:8px;

    font-weight:800;

    letter-spacing:1px;
}

.empty-small {
    padding:30px;

    border-radius:12px;

    color:#718398;

    background:#07111b;

    border:
        1px dashed #20354b;

    font-size:12px;
}


/* MODAL */

.modal-backdrop {
    position:fixed;

    inset:0;

    z-index:5000;

    padding:20px;

    display:flex;

    align-items:center;
    justify-content:center;

    background:
        rgba(0,3,7,.80);

    backdrop-filter:
        blur(8px);
}

.modal {
    width:min(510px,100%);

    max-height:
        calc(100vh - 40px);

    overflow:auto;

    padding:28px;

    border-radius:18px;

    background:
        #07111b;

    border:
        1px solid #1d3045;

    box-shadow:
        0 35px 90px rgba(0,0,0,.5);
}

.modal-header {
    margin-bottom:24px;

    display:flex;

    align-items:flex-start;
    justify-content:space-between;

    gap:20px;
}

.modal-header h2 {
    margin:5px 0 0;

    color:white;

    font-size:26px;

    letter-spacing:-1px;
}

.modal-eyebrow {
    color:#43bfff;

    font-size:8px;

    font-weight:800;

    letter-spacing:2px;
}

.modal-close {
    width:35px;
    height:35px;

    flex:0 0 auto;

    display:grid;
    place-items:center;

    border:0;

    border-radius:8px;

    cursor:pointer;

    color:#95a5b6;

    background:#0d1b29;

    font-size:22px;
}

.modal-description {
    margin:
        -8px 0 24px;

    color:#8293a6;

    font-size:13px;

    line-height:1.6;
}

.modal-form {
    margin-top:10px;
}

.select-input {
    width:100%;
    height:51px;

    padding:0 14px;

    color:white;

    background:#07111c;

    border:
        1px solid #203248;

    border-radius:9px;

    outline:none;
}

.pairing-input {
    text-transform:uppercase;

    letter-spacing:1.5px;

    font-weight:650;
}

.inline-action {
    padding:0;

    color:#47bfff;

    background:transparent;

    border:0;

    cursor:pointer;

    font-size:11px;
}

.modal-actions {
    margin-top:25px;

    display:grid;

    grid-template-columns:
        .8fr 1.2fr;

    gap:10px;
}

.modal-primary {
    height:49px;
}

.modal-secondary {
    height:49px;

    color:#9eacbc;

    background:#0b1723;

    border:
        1px solid #1c3045;

    border-radius:9px;

    cursor:pointer;
}


/* PLACEHOLDER */

.coming-soon {
    min-height:350px;

    margin-top:40px;

    display:flex;

    flex-direction:column;
    align-items:center;
    justify-content:center;

    text-align:center;

    border-radius:16px;

    border:
        1px dashed #20364c;
}

.coming-soon h3 {
    margin:
        17px 0 5px;

    color:white;
}

.coming-soon p {
    max-width:350px;

    color:#718398;

    font-size:12px;
}


/* ERRORS */

.fatal-error {
    width:min(500px,calc(100% - 40px));

    margin:100px auto;

    padding:35px;

    text-align:center;

    color:white;

    border-radius:16px;

    background:#07111b;

    border:
        1px solid var(--border);
}

.fatal-error p {
    color:#ff8d8d;
}

.fatal-error .primary-button {
    max-width:200px;
}


/* RESPONSIVE */

@media(max-width:1150px) {

    .device-grid,
    .location-grid {
        grid-template-columns:
            repeat(2,1fr);
    }

}

@media(max-width:700px) {

    .device-grid,
    .location-grid {
        grid-template-columns:1fr;
    }

    .device-info {
        grid-template-columns:1fr;
    }

    .content-section-title {
        align-items:flex-start;

        flex-direction:column;
    }

    .modal-actions {
        grid-template-columns:1fr;
    }

}


/* ============================================================
   CENTRALHOMEBYTE ACCOUNT / PUBLIC ID V3
============================================================ */

.chb-device-access {
    margin-top:16px;
    padding-top:13px;
    border-top:1px solid #15283a;
}

.chb-access-badge {
    display:inline-flex;
    align-items:center;
    min-height:25px;
    padding:0 9px;
    border-radius:999px;
    font-size:10px;
    font-weight:700;
    letter-spacing:.04em;
}

.chb-access-badge.owned {
    color:#7ac8ff;
    background:rgba(17,122,241,.12);
    border:1px solid rgba(17,122,241,.25);
}

.chb-access-badge.shared {
    color:#aee9cc;
    background:rgba(56,190,130,.10);
    border:1px solid rgba(56,190,130,.25);
}

.chb-section-count {
    min-width:32px;
    height:32px;
    display:grid;
    place-items:center;
    border-radius:10px;
    color:#8ecfff;
    background:#0b2033;
    border:1px solid #19344b;
    font-size:12px;
    font-weight:700;
}

.chb-empty-shared {
    min-height:110px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:25px;
    border-radius:14px;
    border:1px dashed #21364c;
    color:#71859b;
    background:#07111b;
    text-align:center;
    font-size:13px;
}

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

.chb-account-card {
    padding:22px;
    border-radius:14px;
    border:1px solid var(--border);
    background:#07111b;
}

.chb-account-card strong {
    display:block;
    margin-top:8px;
    color:white;
    font-size:15px;
    word-break:break-word;
}

.chb-account-card small {
    display:block;
    margin-top:10px;
    color:#708399;
    font-size:11px;
    line-height:1.55;
}

.chb-account-label {
    display:block;
    color:#708399;
    font-size:10px;
    font-weight:700;
    letter-spacing:.07em;
}

.chb-id-card {
    grid-column:1 / -1;
}

.chb-id-row {
    margin-top:10px;
    display:flex;
    align-items:center;
    gap:12px;
}

.chb-id-row code {
    flex:1;
    min-width:0;
    padding:14px 15px;
    border-radius:9px;
    border:1px solid #19344b;
    color:#7fd5ff;
    background:#050c13;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Consolas,
        monospace;
    font-size:14px;
    letter-spacing:.035em;
    overflow-wrap:anywhere;
}

.chb-copy-id {
    min-height:45px;
    padding:0 16px;
    border:1px solid #225078;
    border-radius:9px;
    color:#9ddcff;
    background:#0b2033;
    cursor:pointer;
    font-weight:600;
}

.chb-copy-id:hover {
    background:#0e2a43;
}

.chb-copy-id:disabled {
    cursor:default;
    opacity:.8;
}

@media(max-width:700px) {

    .chb-account-grid {
        grid-template-columns:1fr;
    }

    .chb-id-row {
        align-items:stretch;
        flex-direction:column;
    }

    .chb-copy-id {
        width:100%;
    }
}


/* ============================================================
   DEVICE SHARING V5
============================================================ */

.chb-device-access {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.chb-share-device {
    min-height:30px;
    padding:0 12px;
    border-radius:8px;
    border:1px solid #225078;
    color:#9ddcff;
    background:#0b2033;
    cursor:pointer;
    font-size:11px;
    font-weight:600;
}

.chb-share-device:hover {
    background:#0e2a43;
}

.chb-share-permissions {
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:5px;
}

.chb-share-permissions-title {
    color:#708399;
    font-size:10px;
    font-weight:700;
    letter-spacing:.07em;
}

.chb-permission-row {
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:13px;
    border:1px solid #172a3d;
    border-radius:10px;
    background:#07111b;
    cursor:pointer;
}

.chb-permission-row input {
    margin-top:3px;
}

.chb-permission-row strong {
    display:block;
    color:#eaf4ff;
    font-size:12px;
}

.chb-permission-row small {
    display:block;
    margin-top:4px;
    color:#708399;
    line-height:1.45;
}

.chb-invitation-list {
    display:flex;
    flex-direction:column;
    gap:12px;
}

.chb-invitation-card {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:25px;
    padding:20px;
    border:1px solid #19344b;
    border-radius:14px;
    background:#07111b;
}

.chb-invitation-copy h3 {
    margin:6px 0;
    color:white;
    font-size:16px;
}

.chb-invitation-copy p {
    margin:0 0 12px;
    color:#8093a8;
    font-size:12px;
}

.chb-invitation-label {
    color:#65c4ff;
    font-size:9px;
    font-weight:700;
    letter-spacing:.08em;
}

.chb-invitation-meta {
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:5px;
}

.chb-invitation-meta span {
    min-width:48px;
    color:#61778d;
    font-size:10px;
}

.chb-invitation-meta code {
    color:#8ccfff;
    font-size:11px;
}

.chb-invitation-actions {
    display:flex;
    gap:9px;
}

.chb-accept-share,
.chb-reject-share {
    min-height:38px;
    padding:0 14px;
    border-radius:8px;
    cursor:pointer;
    font-size:11px;
    font-weight:600;
}

.chb-accept-share {
    border:1px solid #176fc6;
    color:white;
    background:#117af1;
}

.chb-reject-share {
    border:1px solid #3a4550;
    color:#b4c0cc;
    background:#101820;
}

@media(max-width:700px) {

    .chb-invitation-card {
        align-items:stretch;
        flex-direction:column;
    }

    .chb-invitation-actions {
        width:100%;
    }

    .chb-accept-share,
    .chb-reject-share {
        flex:1;
    }
}


/* ============================================================
   DYNAMIC SHARING V6
============================================================ */

.chb-device-type-badge {
    display:inline-flex;
    margin:0 0 18px;
    padding:6px 10px;
    border:1px solid #1c3b56;
    border-radius:999px;
    color:#7fcfff;
    background:#081a29;
    font-size:10px;
    font-weight:700;
}

.chb-share-section {
    margin-top:8px;
}

.chb-share-section[hidden] {
    display:none !important;
}

.chb-share-profile-list {
    display:flex;
    flex-direction:column;
    gap:9px;
    margin-top:10px;
}

.chb-share-profile {
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:14px;
    border:1px solid #172a3d;
    border-radius:11px;
    background:#07111b;
    cursor:pointer;
}

.chb-share-profile:hover {
    border-color:#225078;
    background:#091825;
}

.chb-share-profile input {
    margin-top:3px;
}

.chb-share-profile strong {
    display:block;
    color:#edf6ff;
    font-size:12px;
}

.chb-share-profile small {
    display:block;
    margin-top:4px;
    color:#71859a;
    font-size:11px;
    line-height:1.45;
}

.chb-required-permission {
    display:inline-block;
    margin-top:6px;
    color:#63bfff;
    font-size:9px;
    font-style:normal;
    font-weight:700;
    letter-spacing:.04em;
}

.chb-share-info {
    margin-top:16px;
    padding:13px 14px;
    border:1px solid #183752;
    border-radius:10px;
    background:#071725;
}

.chb-share-info strong {
    color:#8dd4ff;
    font-size:11px;
}

.chb-share-info p {
    margin:6px 0 0;
    color:#71869b;
    font-size:11px;
    line-height:1.55;
}


/* ============================================================
   NOTIFICATION PREFERENCES V7
============================================================ */

.chb-device-actions {
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.chb-notification-device {
    min-height:30px;
    padding:0 12px;
    border-radius:8px;
    border:1px solid #33485c;
    color:#b5c8db;
    background:#0b1722;
    cursor:pointer;
    font-size:11px;
    font-weight:600;
}

.chb-notification-device:hover {
    border-color:#47708f;
    background:#0e202f;
}

.chb-notification-groups {
    display:flex;
    flex-direction:column;
    gap:18px;
    margin-top:8px;
}

.chb-notification-group {
    display:flex;
    flex-direction:column;
    gap:8px;
}

.chb-notification-group-title {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.chb-notification-group-title > span {
    color:#698298;
    font-size:10px;
    font-weight:700;
    letter-spacing:.08em;
}

.chb-notification-all {
    padding:0;
    border:0;
    color:#5dbdff;
    background:transparent;
    cursor:pointer;
    font-size:10px;
}

.chb-notification-event-list {
    display:flex;
    flex-direction:column;
    gap:8px;
}

.chb-notification-event {
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:13px;
    border:1px solid #172a3d;
    border-radius:10px;
    background:#07111b;
    cursor:pointer;
}

.chb-notification-event:hover {
    border-color:#23445f;
}

.chb-notification-event input {
    margin-top:3px;
}

.chb-notification-event strong {
    display:block;
    color:#ecf6ff;
    font-size:12px;
}

.chb-notification-event small {
    display:block;
    margin-top:4px;
    color:#72869a;
    font-size:11px;
    line-height:1.45;
}

.chb-notification-empty {
    padding:18px;
    border:1px dashed #294055;
    border-radius:10px;
    color:#74899d;
    background:#08121c;
    font-size:12px;
    line-height:1.5;
}

@media(max-width:700px) {

    .chb-device-access {
        align-items:flex-start;
        flex-direction:column;
    }

    .chb-device-actions {
        width:100%;
    }

    .chb-notification-device,
    .chb-share-device {
        flex:1;
    }
}


/* ============================================================
   NOTIFICATION CHANNELS V8
============================================================ */

.chb-notification-event {
    display:flex;
    flex-direction:column;
    gap:12px;
}

.chb-notification-main {
    display:flex;
    align-items:flex-start;
    gap:12px;
    cursor:pointer;
}

.chb-notification-main input {
    margin-top:3px;
}

.chb-notification-main strong {
    display:block;
    color:#ecf6ff;
    font-size:12px;
}

.chb-notification-main small {
    display:block;
    margin-top:4px;
    color:#72869a;
    font-size:11px;
    line-height:1.45;
}

.chb-notification-channels {
    display:flex;
    align-items:center;
    gap:14px;
    padding-top:10px;
    margin-left:26px;
    border-top:1px solid #14283a;
}

.chb-channel-title {
    color:#60798f;
    font-size:10px;
}

.chb-channel-option {
    display:flex;
    align-items:center;
    gap:6px;
    color:#a8bbcc;
    font-size:11px;
    cursor:pointer;
}

.chb-channel-option input:disabled + span {
    opacity:.35;
}

@media(max-width:600px) {

    .chb-notification-channels {
        align-items:flex-start;
        flex-wrap:wrap;
    }

    .chb-channel-title {
        width:100%;
    }
}


/* ============================================================
   SECURITY PANEL
============================================================ */

.security-summary-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.security-summary-card {
    padding: 20px;
    border: 1px solid
        rgba(255,255,255,.08);
    border-radius: 16px;
    background:
        rgba(255,255,255,.035);
}

.security-summary-card span {
    display: block;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    opacity: .55;
}

.security-summary-card strong {
    font-size: 30px;
    line-height: 1;
}

.security-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.security-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid
        rgba(255,255,255,.07);
    border-radius: 14px;
    background:
        rgba(255,255,255,.025);
}

.security-row-revoked {
    opacity: .58;
}

.security-row-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    background:
        rgba(255,255,255,.06);
    font-size: 18px;
}

.security-row-main {
    min-width: 0;
    flex: 1;
}

.security-row-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}

.security-row-main p {
    margin: 0 0 4px;
    opacity: .72;
    font-size: 13px;
}

.security-row-main small {
    opacity: .48;
}

.security-current,
.security-revoked {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
}

.security-current {
    background:
        rgba(75, 180, 120, .14);
}

.security-revoked {
    background:
        rgba(255, 255, 255, .07);
}

.security-danger-button {
    flex: 0 0 auto;
    border: 1px solid
        rgba(255,110,110,.22);
    border-radius: 10px;
    padding: 9px 12px;
    background:
        rgba(255,90,90,.07);
    color: inherit;
    cursor: pointer;
}

.security-danger-button:hover {
    background:
        rgba(255,90,90,.13);
}

.security-danger-button:disabled {
    opacity: .45;
    cursor: default;
}

.security-history {
    display: flex;
    flex-direction: column;
}

.security-history-row {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 58px;
    border-bottom: 1px solid
        rgba(255,255,255,.06);
}

.security-history-row:last-child {
    border-bottom: 0;
}

.security-history-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: .42;
}

.security-history-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.security-history-main strong {
    font-size: 13px;
}

.security-history-main span,
.security-history-ip {
    font-size: 11px;
    opacity: .48;
}

.security-history-ip {
    text-align: right;
}

@media (max-width: 760px) {

    .security-summary-grid {
        grid-template-columns: 1fr;
    }

    .security-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .security-row-main {
        min-width:
            calc(100% - 60px);
    }

    .security-danger-button {
        width: 100%;
    }

    .security-history-ip {
        display: none;
    }
}


/* ============================================================
   SECURITY HISTORY - PLAN / DETAILS
============================================================ */

.security-history-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.security-history-select {
    min-width: 170px;
    padding: 9px 34px 9px 12px;
    border: 1px solid
        rgba(255,255,255,.10);
    border-radius: 10px;
    background:
        rgba(255,255,255,.04);
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.security-plan-limit {
    padding: 8px 11px;
    border: 1px solid
        rgba(255,255,255,.08);
    border-radius: 999px;
    background:
        rgba(255,255,255,.035);
    font-size: 11px;
    font-weight: 700;
    opacity: .68;
}

.security-history-row-rich {
    min-height: 76px;
    padding: 10px 0;
}

.security-history-device {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 600;
    opacity: .82;
}

.security-history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 3px;
}

.security-history-meta span {
    font-size: 11px;
    opacity: .48;
}

.security-history-detail {
    max-width: 220px;
    text-align: right;
    font-size: 11px;
    line-height: 1.45;
    opacity: .62;
}

@media (max-width: 760px) {

    .security-history-controls {
        width: 100%;
        margin-top: 10px;
        justify-content: flex-start;
    }

    .security-history-select {
        width: 100%;
    }

    .security-history-row-rich {
        align-items: flex-start;
    }

    .security-history-detail {
        display: none;
    }
}


/* Fix selector historial seguridad en tema oscuro */
.security-history-select {
    background-color: #15171b;
    color: #f5f7fa;
    border-color: rgba(255,255,255,.14);
    color-scheme: dark;
}

.security-history-select option {
    background-color: #15171b;
    color: #f5f7fa;
}


/* ============================================================
   SHARE MANAGEMENT
============================================================ */

.chb-share-management-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

.chb-share-management-row {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 15px;
    border: 1px solid
        rgba(255,255,255,.08);
    border-radius: 14px;
    background:
        rgba(255,255,255,.025);
}

.chb-share-management-main {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

.chb-share-management-main code {
    font-size: 11px;
    opacity: .7;
}

.chb-share-management-main span,
.chb-share-management-main small {
    font-size: 12px;
    opacity: .65;
}

.chb-share-management-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 760px) {

    .chb-share-management-row {
        flex-direction: column;
        align-items: stretch;
    }

    .chb-share-management-actions {
        width: 100%;
    }

    .chb-share-management-actions button {
        width: 100%;
    }
}


/* ============================================================
   KEYLINK SHARE PERMISSIONS
============================================================ */

.chb-share-section {
    margin-top:18px;
}

.chb-share-control-options {
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-top:8px;
}

.chb-share-section
.chb-permission-row {
    margin-top:8px;
}

#keyLinkShareDependencyHint {
    margin-top:12px;
    padding:10px 12px;
    border:1px solid rgba(80,170,255,.18);
    border-radius:9px;
    background:rgba(40,130,210,.07);
}


/* ============================================================
   KEYLINK SHARE CONTROL SELECT
============================================================ */

.chb-share-control-select {
    width:100%;
    min-height:44px;
    padding:0 42px 0 14px;
    border:1px solid #19344b;
    border-radius:10px;
    background:#07111b;
    color:#eaf4ff;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
    outline:none;
}

.chb-share-control-select:hover {
    border-color:#28577c;
}

.chb-share-control-select:focus {
    border-color:#3b8bc3;
    box-shadow:
        0 0 0 3px
        rgba(59,139,195,.10);
}

.chb-share-control-select option {
    background:#07111b;
    color:#eaf4ff;
}

#keyLinkShareControlHint {
    display:block;
    margin-top:8px;
    line-height:1.45;
}


/* ============================================================
   PERSONAL DEVICE ALIAS
============================================================ */

.chb-device-alias-button {
    min-height:30px;
    padding:0 12px;
    border-radius:8px;
    border:1px solid #31506b;
    background:#0a1723;
    color:#b8d8ee;
    font-size:11px;
    font-weight:600;
    cursor:pointer;
}

.chb-device-alias-button:hover {
    background:#102334;
    border-color:#427095;
}


/* ============================================================
   DEVICE OPTIONS V1
============================================================ */

.chb-device-access {
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:12px;
}

.chb-device-options {
    width:100%;
}

.chb-device-options-toggle {
    width:100%;
    min-height:40px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;

    padding:0 13px;

    border:1px solid #243c52;
    border-radius:10px;

    color:#c8d9e8;
    background:#0a1722;

    cursor:pointer;

    font-size:12px;
    font-weight:700;
}

.chb-device-options-toggle:hover {
    border-color:#3c6585;
    background:#0d1d2b;
}

.chb-device-options-toggle[
    aria-expanded="true"
] {
    border-color:#356787;
    background:#0d2030;
}

.chb-device-options-chevron {
    color:#6f8ca5;
    font-size:12px;
    transition:transform .15s ease;
}

.chb-device-options-toggle[
    aria-expanded="true"
]
.chb-device-options-chevron {
    transform:rotate(180deg);
}

.chb-device-options-menu {
    margin-top:8px;
    padding:6px;

    border:1px solid #1a3145;
    border-radius:11px;

    background:#07121c;
}

.chb-device-options-menu[hidden] {
    display:none;
}

.chb-device-option {
    width:100%;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:3px;

    padding:11px 12px;

    border:0;
    border-radius:8px;

    color:#bfd0df;
    background:transparent;

    cursor:pointer;
    text-align:left;
}

.chb-device-option:hover {
    background:#0d2130;
}

.chb-device-option-title {
    color:#dcebf7;
    font-size:12px;
    font-weight:700;
}

.chb-device-option-description {
    color:#668096;
    font-size:10px;
    font-weight:500;
    line-height:1.4;
}

.chb-device-option-primary
.chb-device-option-title {
    color:#79caff;
}

.chb-device-option-primary:hover {
    background:rgba(
        17,
        122,
        241,
        .10
    );
}

.chb-device-option-separator {
    height:1px;
    margin:5px 8px;
    background:#172b3d;
}

.chb-device-option-danger
.chb-device-option-title {
    color:#ff8585;
}

.chb-device-option-danger:hover {
    background:rgba(
        220,
        65,
        65,
        .08
    );
}


/*
   Neutralizamos estilos de botones antiguos
   cuando están dentro del nuevo menú.
*/

.chb-device-options-menu
.chb-notification-device,

.chb-device-options-menu
.chb-share-device,

.chb-device-options-menu
.chb-manage-shares,

.chb-device-options-menu
.chb-unclaim-device,

.chb-device-options-menu
.chb-device-alias-button {
    min-height:0;
    border:0;
    background:transparent;
    font-size:inherit;
}


/* ============================================================
   MOBILE
============================================================ */

@media(max-width:700px) {

    .chb-device-access {
        width:100%;
    }

    .chb-device-options {
        width:100%;
    }

    .chb-device-options-toggle {
        width:100%;
    }
}



/* ============================================================
   DEVICE OPTIONS
============================================================ */

.chb-device-access {
    position: relative;
}

.chb-device-options {
    position: relative;
    margin-top: 14px;
}

.chb-device-options-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;

    border: 1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.045);

    color: inherit;
    font: inherit;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.chb-device-options-toggle:hover {
    background:
        rgba(255, 255, 255, 0.08);

    border-color:
        rgba(255, 255, 255, 0.20);
}

.chb-options-chevron {
    font-size: 12px;

    transition:
        transform 0.15s ease;
}

.chb-device-options-toggle[
    aria-expanded="true"
]
.chb-options-chevron {
    transform:
        rotate(180deg);
}


.chb-device-options-menu {
    position: absolute;

    left: 0;
    right: 0;

    bottom: calc(100% + 8px);

    z-index: 30;

    padding: 7px;

    border: 1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 12px;

    background:
        rgba(22, 25, 32, 0.98);

    box-shadow:
        0 14px 36px
        rgba(0, 0, 0, 0.35);

    backdrop-filter:
        blur(16px);
}

.chb-device-options-menu[hidden] {
    display: none;
}


.chb-device-option {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 11px;

    padding: 11px 12px;

    border: 0;
    border-radius: 8px;

    background: transparent;

    color: inherit;

    font: inherit;
    text-align: left;

    cursor: pointer;
}

.chb-device-option:hover {
    background:
        rgba(255, 255, 255, 0.07);
}

.chb-option-icon {
    width: 22px;

    display: inline-flex;
    justify-content: center;

    opacity: 0.85;
}


.chb-device-option-separator {
    height: 1px;

    margin: 6px 5px;

    background:
        rgba(255, 255, 255, 0.09);
}

.chb-device-option-danger {
    color:
        #ff7878;
}


@media (
    max-width: 720px
) {

    .chb-device-options-menu {
        position: static;

        margin-top: 8px;

        box-shadow: none;
    }
}


/* ============================================================
   CHB KEYLINK KEYPAD
============================================================ */

.chb-keypad {
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
}

.chb-keypad-device {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
    text-align: center;
}

.chb-keypad-device span {
    font-size: 0.75rem;
    opacity: 0.65;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.chb-keypad-device strong {
    font-size: 1rem;
}

.chb-keypad-display {
    box-sizing: border-box;
    width: 100%;
    min-height: 92px;
    padding: 18px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.16);
    background: #111a14;
    box-shadow:
        inset 0 0 18px rgba(0,0,0,0.7);
    font-family:
        "Courier New",
        monospace;
}

.chb-keypad-display-line {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.55;
}

.chb-keypad-display-line.secondary {
    font-size: 0.86rem;
    opacity: 0.72;
}

.chb-keypad-status {
    min-height: 22px;
    margin: 10px 0 14px;
    text-align: center;
    font-size: 0.82rem;
    opacity: 0.72;
}

.chb-keypad-status.pending {
    opacity: 1;
}

.chb-keypad-status.success {
    opacity: 1;
}

.chb-keypad-status.error {
    opacity: 1;
}

.chb-keypad-grid {
    display: grid;
    grid-template-columns:
        repeat(3, 1fr);
    gap: 10px;
}

.chb-keypad-key {
    min-height: 64px;
    border-radius: 12px;
    border:
        1px solid
        rgba(255,255,255,0.13);
    background:
        rgba(255,255,255,0.055);
    color: inherit;
    font-size: 1.35rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform 0.08s ease,
        background 0.12s ease,
        border-color 0.12s ease;
}

.chb-keypad-key:hover {
    background:
        rgba(255,255,255,0.09);
    border-color:
        rgba(255,255,255,0.24);
}

.chb-keypad-key:active {
    transform: scale(0.96);
}

.chb-keypad-key:disabled {
    cursor: wait;
    opacity: 0.52;
}

.chb-keypad-help {
    margin-top: 14px;
    text-align: center;
    font-size: 0.78rem;
    line-height: 1.45;
    opacity: 0.55;
}

@media (max-width: 520px) {

    .chb-keypad-key {
        min-height: 58px;
    }

    .chb-keypad-display {
        min-height: 84px;
        padding: 16px;
    }
}


/* ============================================================
   CHB KEYLINK KEYPAD V2
============================================================ */

.chb-keypad-terminal {
    margin: 18px 0 14px;
}

.chb-keypad-terminal label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    opacity: 0.72;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chb-keypad-terminal-row {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto
        auto;
    gap: 8px;
}

.chb-keypad-terminal input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 0 13px;
    border-radius: 10px;
    border:
        1px solid
        rgba(255,255,255,0.14);
    background:
        rgba(255,255,255,0.045);
    color: inherit;
    font-family:
        "Courier New",
        monospace;
    font-size: 1rem;
    letter-spacing: 0.08em;
}

.chb-keypad-terminal input:focus {
    outline: none;
    border-color:
        rgba(255,255,255,0.35);
}

.chb-keypad-small-button {
    min-width: 52px;
}

.chb-keypad-indicators {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 10px;
    font-size: 0.76rem;
}

.chb-keypad-indicator {
    opacity: 0.7;
}

.chb-keypad-indicator.ok {
    opacity: 1;
}

.chb-keypad-indicator.bad {
    opacity: 1;
}

.chb-keypad-mode {
    margin-left: auto;
    font-weight: 700;
}

.chb-keypad-send {
    width: 100%;
    margin-top: 14px;
    min-height: 48px;
}

@media (max-width: 520px) {

    .chb-keypad-terminal-row {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    #keyLinkClear {
        grid-column:
            1 / -1;
    }

    .chb-keypad-mode {
        width: 100%;
        margin-left: 0;
    }
}


/* ============================================================
   CHB GENERIC STATUS LED / ISSUES UI
============================================================ */

.chb-status-led {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding:
        5px 9px;

    border-radius:
        999px;

    border:
        1px solid
        rgba(255,255,255,0.09);

    background:
        rgba(255,255,255,0.035);

    font-size:
        0.72rem;

    font-weight:
        700;

    letter-spacing:
        0.035em;

    white-space:
        nowrap;

    transition:
        opacity 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        color 0.18s ease;
}


.chb-status-led.ok {
    color:
        #63e6a6;

    border-color:
        rgba(99,230,166,0.28);

    background:
        rgba(99,230,166,0.08);
}


.chb-status-led.warning {
    color:
        #ffc857;

    border-color:
        rgba(255,200,87,0.30);

    background:
        rgba(255,200,87,0.08);
}


.chb-status-led.critical {
    color:
        #ff7070;

    border-color:
        rgba(255,112,112,0.30);

    background:
        rgba(255,112,112,0.09);
}


.chb-status-led.info {
    color:
        #7eb9ff;

    border-color:
        rgba(126,185,255,0.28);

    background:
        rgba(126,185,255,0.08);
}


.chb-status-led.inactive {
    color:
        rgba(255,255,255,0.38);

    opacity:
        0.72;
}


.chb-status-led.neutral {
    color:
        rgba(255,255,255,0.66);
}


.chb-keypad-indicators {
    gap:
        8px;

    margin-top:
        12px;
}


.chb-keypad-mode-row {
    display:
        flex;

    align-items:
        center;

    margin-top:
        10px;
}


.chb-keypad-mode-badge {
    display:
        inline-flex;

    padding:
        5px 9px;

    border-radius:
        8px;

    border:
        1px solid
        rgba(255,255,255,0.09);

    background:
        rgba(255,255,255,0.035);

    font-size:
        0.72rem;

    font-weight:
        800;

    letter-spacing:
        0.06em;
}


.chb-keypad-mode-badge.warning {
    color:
        #ffc857;
}


.chb-keypad-mode-badge.critical {
    color:
        #ff7070;
}


/* ============================================================
   GENERIC ISSUE PANEL
============================================================ */

.chb-issues-panel {
    margin-top:
        12px;

    border:
        1px solid
        rgba(255,255,255,0.08);

    border-radius:
        12px;

    background:
        rgba(255,255,255,0.025);

    overflow:
        hidden;
}


.chb-issues-panel summary {
    cursor:
        pointer;

    list-style:
        none;

    padding:
        10px 12px;

    user-select:
        none;
}


.chb-issues-panel summary::-webkit-details-marker {
    display:
        none;
}


.chb-issues-list {
    display:
        grid;

    gap:
        8px;

    padding:
        0 10px 10px;
}


.chb-issues-empty {
    padding:
        10px 8px;

    font-size:
        0.78rem;

    opacity:
        0.60;
}


.chb-issue-item {
    padding:
        10px 11px;

    border-radius:
        9px;

    border:
        1px solid
        rgba(255,255,255,0.07);

    background:
        rgba(0,0,0,0.14);
}


.chb-issue-item.warning {
    border-color:
        rgba(255,200,87,0.20);
}


.chb-issue-item.critical {
    border-color:
        rgba(255,112,112,0.25);
}


.chb-issue-item.info {
    border-color:
        rgba(126,185,255,0.20);
}


.chb-issue-head {
    display:
        flex;

    align-items:
        center;

    gap:
        7px;

    font-size:
        0.80rem;
}


.chb-issue-dot {
    font-size:
        0.72rem;
}


.chb-issue-item.warning
.chb-issue-dot {
    color:
        #ffc857;
}


.chb-issue-item.critical
.chb-issue-dot {
    color:
        #ff7070;
}


.chb-issue-item.info
.chb-issue-dot {
    color:
        #7eb9ff;
}


.chb-issue-severity {
    margin-left:
        auto;

    font-size:
        0.64rem;

    opacity:
        0.55;

    text-transform:
        uppercase;

    letter-spacing:
        0.06em;
}


.chb-issue-meta {
    margin-top:
        5px;

    padding-left:
        18px;

    font-size:
        0.71rem;

    opacity:
        0.62;
}


.chb-issue-description {
    margin-top:
        6px;

    padding-left:
        18px;

    font-size:
        0.73rem;

    line-height:
        1.4;

    opacity:
        0.72;
}


@media (max-width: 520px) {

    .chb-keypad-indicators {
        gap:
            6px;
    }

    .chb-status-led {
        font-size:
            0.67rem;

        padding:
            5px 7px;
    }
}



/* ============================================================
   CHB KEYLINK COMPACT UI
============================================================ */

.chb-keypad {
    max-width: 360px;
}


/* ------------------------------------------------------------
   Encabezado del dispositivo
------------------------------------------------------------ */

.chb-keypad-device {
    margin-bottom: 10px;
}

.chb-keypad-device span {
    font-size: 0.68rem;
    opacity: 0.55;
}

.chb-keypad-device strong {
    font-size: 0.92rem;
}


/* ------------------------------------------------------------
   Display más compacto
------------------------------------------------------------ */

.chb-keypad-display {
    min-height: 68px;

    padding:
        12px 14px;

    border-radius:
        10px;
}

.chb-keypad-display-line {
    font-size: 0.92rem;
    line-height: 1.2;
}

.chb-keypad-display-line.secondary {
    margin-top: 4px;

    font-size: 0.74rem;
}


/* ------------------------------------------------------------
   LEDs
------------------------------------------------------------ */

.chb-keypad-indicators {
    margin-top: 8px;

    gap:
        5px;
}

.chb-status-led {
    padding:
        4px 7px;

    font-size:
        0.64rem;

    border-radius:
        7px;

    letter-spacing:
        0.02em;
}


/* ------------------------------------------------------------
   Modo
------------------------------------------------------------ */

.chb-keypad-mode-row {
    margin-top: 7px;
}

.chb-keypad-mode-badge {
    padding:
        4px 7px;

    font-size:
        0.64rem;

    border-radius:
        7px;
}


/* ------------------------------------------------------------
   Incidencias
------------------------------------------------------------ */

.chb-issues-panel {
    margin-top: 7px;

    border-radius:
        9px;
}

.chb-issues-panel summary {
    padding:
        7px 9px;
}

.chb-issues-list {
    gap:
        6px;

    padding:
        0 7px 7px;
}

.chb-issue-item {
    padding:
        8px 9px;

    border-radius:
        7px;
}

.chb-issue-head {
    font-size:
        0.72rem;
}

.chb-issue-meta,
.chb-issue-description {
    font-size:
        0.66rem;
}


/* ------------------------------------------------------------
   Campo de secuencia
------------------------------------------------------------ */

.chb-keypad-terminal {
    margin:
        10px 0 8px;
}

.chb-keypad-terminal label {
    margin-bottom:
        4px;

    font-size:
        0.66rem;
}

.chb-keypad-terminal-row {
    gap:
        6px;
}

.chb-keypad-terminal input {
    min-height:
        38px;

    padding:
        0 10px;

    border-radius:
        8px;

    font-size:
        0.88rem;
}

.chb-keypad-small-button {
    min-width:
        44px;

    min-height:
        38px;

    padding:
        0 9px;
}


/* ------------------------------------------------------------
   Teclado numérico
------------------------------------------------------------ */

.chb-keypad-grid {
    gap:
        6px;
}

.chb-keypad-key {
    min-height:
        42px;

    padding:
        0;

    border-radius:
        9px;

    font-size:
        1rem;

    font-weight:
        700;
}


/* ------------------------------------------------------------
   Botón enviar
------------------------------------------------------------ */

.chb-keypad-send {
    min-height:
        40px;

    margin-top:
        9px;

    font-size:
        0.82rem;
}


/* ------------------------------------------------------------
   Estado y ayuda
------------------------------------------------------------ */

.chb-keypad-status {
    min-height:
        18px;

    margin:
        7px 0 6px;

    font-size:
        0.72rem;
}

.chb-keypad-help {
    font-size:
        0.66rem;

    line-height:
        1.35;

    opacity:
        0.55;
}


/* ------------------------------------------------------------
   Footer modal
------------------------------------------------------------ */

.chb-keypad .modal-actions {
    margin-top:
        8px;
}

.chb-keypad .modal-actions button {
    min-height:
        36px;

    padding:
        6px 12px;
}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 520px) {

    .chb-keypad {
        max-width:
            100%;
    }

    .chb-keypad-display {
        min-height:
            62px;

        padding:
            10px 12px;
    }

    .chb-keypad-display-line {
        font-size:
            0.86rem;
    }

    .chb-keypad-indicators {
        gap:
            4px;
    }

    .chb-status-led {
        padding:
            3px 6px;

        font-size:
            0.60rem;
    }

    .chb-keypad-key {
        min-height:
            39px;

        font-size:
            0.94rem;
    }

    .chb-keypad-terminal input {
        min-height:
            36px;
    }

    .chb-keypad-small-button {
        min-height:
            36px;
    }

    .chb-keypad-send {
        min-height:
            38px;
    }
}



/* ============================================================
   DEVICE ISSUE NOTIFICATION PREFERENCES
============================================================ */

.chb-issue-notification-section {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,.10);
}

.chb-issue-section-head {
    margin-bottom: 14px;
}

.chb-issue-section-head h3 {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 700;
}

.chb-issue-section-head p {
    margin: 0;
    opacity: .68;
    font-size: 13px;
    line-height: 1.45;
}

.chb-issue-notification-list {
    display: grid;
    gap: 10px;
}

.chb-issue-notification-card {
    padding: 14px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    background: rgba(255,255,255,.025);
}

.chb-issue-notification-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.chb-issue-notification-head strong {
    font-size: 14px;
}

.chb-issue-notification-meta {
    margin-top: 4px;
    font-size: 11px;
    opacity: .58;
}

.chb-issue-notification-description {
    margin: 9px 0 12px;
    font-size: 12px;
    line-height: 1.45;
    opacity: .72;
}

.chb-issue-lifecycle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding-top: 9px;
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,.07);
}

.chb-issue-lifecycle-title {
    min-width: 145px;
    font-size: 12px;
    font-weight: 600;
    opacity: .78;
}

.chb-issue-channel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    cursor: pointer;
}

.chb-issue-channel input {
    margin: 0;
}

.chb-issue-notification-empty {
    padding: 14px;
    border-radius: 10px;
    border: 1px dashed rgba(255,255,255,.10);
    font-size: 12px;
    opacity: .6;
}


@media (max-width: 600px) {

    .chb-issue-lifecycle {
        align-items: flex-start;
    }

    .chb-issue-lifecycle-title {
        width: 100%;
        min-width: 0;
    }

}


/* ============================================================
   CHB NOTIFICATION CONFIGURATOR V2
============================================================ */

.chb-notify-config {
    display: grid;
    gap: 16px;
}

.chb-notify-summary {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.025);
}

.chb-notify-summary-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: rgba(255,255,255,.06);
}

.chb-notify-summary strong {
    display: block;
    margin-bottom: 3px;
}

.chb-notify-summary p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    opacity: .68;
}


.chb-notify-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 5px;
    border-radius: 12px;
    background: rgba(255,255,255,.035);
}

.chb-notify-tab {
    border: 0;
    padding: 10px 14px;
    border-radius: 9px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    opacity: .65;
}

.chb-notify-tab.active {
    background: rgba(255,255,255,.09);
    opacity: 1;
}

.chb-notify-tab small {
    margin-left: 6px;
    opacity: .55;
}


.chb-notify-pane {
    display: none;
}

.chb-notify-pane.active {
    display: block;
}


.chb-notify-section-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.chb-notify-section-intro strong {
    display: block;
    margin-bottom: 4px;
}

.chb-notify-section-intro p {
    margin: 0;
    max-width: 460px;
    font-size: 12px;
    line-height: 1.45;
    opacity: .65;
}


.chb-notify-quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.chb-notify-quick-actions button {
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 8px;
    padding: 6px 9px;
    background: rgba(255,255,255,.035);
    color: inherit;
    font-size: 11px;
    cursor: pointer;
}

.chb-notify-quick-actions button:hover {
    background: rgba(255,255,255,.08);
}


.chb-notify-issues-content {
    display: grid;
    gap: 16px;
}

.chb-notify-issue-category {
    display: grid;
    gap: 8px;
}

.chb-notify-category-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chb-notify-category-title {
    font-size: 13px;
    font-weight: 700;
}

.chb-notify-category-count {
    margin-top: 2px;
    font-size: 10px;
    opacity: .5;
}

.chb-notify-category-items {
    display: grid;
    gap: 8px;
}


.chb-notify-issue-card {
    padding: 13px;
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.022);
}

.chb-notify-issue-title {
    font-size: 13px;
    font-weight: 700;
}

.chb-notify-badge {
    display: inline-flex;
    margin-top: 5px;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: rgba(255,255,255,.06);
}

.chb-notify-badge.severity-critical {
    background: rgba(255,80,80,.13);
}

.chb-notify-badge.severity-warning {
    background: rgba(255,190,60,.11);
}

.chb-notify-badge.severity-info {
    background: rgba(80,170,255,.11);
}


.chb-notify-issue-description {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.45;
    opacity: .62;
}


.chb-notify-state-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 9px;
    margin-top: 9px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.chb-notify-state-text strong {
    display: block;
    font-size: 11px;
}

.chb-notify-state-text span {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    opacity: .5;
}


.chb-notify-channel-set {
    display: flex;
    gap: 6px;
}

.chb-notify-channel-pill {
    position: relative;
    cursor: pointer;
}

.chb-notify-channel-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chb-notify-channel-pill span {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.09);
    font-size: 10px;
    opacity: .55;
}

.chb-notify-channel-pill input:checked + span {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.18);
    opacity: 1;
}


.chb-notify-empty {
    padding: 18px;
    border-radius: 10px;
    border: 1px dashed rgba(255,255,255,.10);
    text-align: center;
    opacity: .55;
    font-size: 12px;
}


@media (max-width: 650px) {

    .chb-notify-section-intro {
        display: grid;
    }

    .chb-notify-quick-actions {
        justify-content: flex-start;
    }

    .chb-notify-state-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .chb-notify-channel-set {
        width: 100%;
    }

    .chb-notify-channel-pill {
        flex: 1;
    }

    .chb-notify-channel-pill span {
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }

}


/* ============================================================
   ACTIVITY NOTIFICATIONS - SAME STYLE AS ISSUES
============================================================ */

.chb-notify-activity-content {
    display: grid;
    gap: 10px;
}

.chb-notify-activity-card {
    padding: 13px;
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.022);
}

.chb-notify-activity-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.chb-notify-activity-title {
    font-size: 13px;
    font-weight: 700;
}

.chb-notify-activity-description {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.45;
    opacity: .62;
}


/* MASTER ENABLE */

.chb-notify-enable-pill {
    position: relative;
    cursor: pointer;
    flex: 0 0 auto;
}

.chb-notify-enable-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chb-notify-enable-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 6px 9px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.09);
    font-size: 10px;
    opacity: .48;
    transition:
        background .15s ease,
        border-color .15s ease,
        opacity .15s ease;
}

.chb-notify-enable-pill input:checked + span {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.18);
    opacity: 1;
}


/* CHANNELS */

.chb-notify-activity-card
.chb-notify-channel-set {
    display: flex;
    gap: 6px;
}

.chb-notify-activity-card
.chb-notify-channel-pill {
    position: relative;
    cursor: pointer;
}

.chb-notify-activity-card
.chb-notify-channel-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chb-notify-activity-card
.chb-notify-channel-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 6px 9px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.09);
    font-size: 10px;
    opacity: .55;
    transition:
        background .15s ease,
        border-color .15s ease,
        opacity .15s ease;
}

.chb-notify-activity-card
.chb-notify-channel-pill input:checked + span {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.18);
    opacity: 1;
}


/* DISABLED EVENT */

.chb-notify-activity-card:has(
    .chb-notification-toggle:not(:checked)
)
.chb-notify-channel-set {
    opacity: .35;
}


/* MOBILE */

@media (max-width: 650px) {

    .chb-notify-activity-top {
        align-items: flex-start;
    }

    .chb-notify-enable-pill span {
        min-width: 62px;
    }

}



/* ============================================================
   CHB FIRMWARE OTA V2
============================================================ */

.chb-firmware-available {
    margin-top: 14px;
    padding: 10px 11px 10px 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid rgba(84,177,255,.17);
    border-radius: 12px;
    background:
        linear-gradient(
            135deg,
            rgba(63,148,219,.07),
            rgba(63,148,219,.025)
        );
}

.chb-firmware-update-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chb-firmware-update-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #58b7f1;
    box-shadow:
        0 0 0 4px rgba(88,183,241,.09);
}

.chb-firmware-update-copy strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
}

.chb-firmware-update-copy small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    opacity: .45;
}

.chb-firmware-update-button {
    height: 32px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(110,190,245,.18);
    border-radius: 9px;
    background: rgba(78,164,225,.10);
    color: inherit;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform .15s ease,
        background .15s ease,
        border-color .15s ease;
}

.chb-firmware-update-button:hover {
    transform: translateY(-1px);
    background: rgba(78,164,225,.17);
    border-color: rgba(110,190,245,.30);
}

.chb-firmware-update-button span {
    font-size: 13px;
    opacity: .7;
}


.chb-ota-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    padding: 22px;
    display: grid;
    place-items: center;
    background: rgba(4,8,14,.77);
    backdrop-filter: blur(12px);
    animation:
        chbOtaFade .16s ease-out;
}

@keyframes chbOtaFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.chb-ota-modal {
    width: min(530px,100%);
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 20px;
    background:
        linear-gradient(
            180deg,
            rgba(25,31,42,.99),
            rgba(14,19,27,.995)
        );
    box-shadow:
        0 30px 100px rgba(0,0,0,.48);
    animation:
        chbOtaRise .18s ease-out;
}

@keyframes chbOtaRise {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.99);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.chb-ota-header {
    padding: 21px 22px 17px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.chb-ota-header-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    border: 1px solid rgba(91,181,241,.16);
    background: rgba(72,159,219,.08);
    font-size: 20px;
}

.chb-ota-header-copy {
    flex: 1;
    min-width: 0;
}

.chb-ota-eyebrow {
    display: block;
    margin: 1px 0 4px;
    font-size: 9px;
    letter-spacing: .095em;
    opacity: .38;
}

.chb-ota-header h3 {
    margin: 0;
    font-size: 19px;
    letter-spacing: -.01em;
}

.chb-ota-header p {
    margin: 3px 0 0;
    font-size: 11px;
    opacity: .52;
}

.chb-ota-x {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: inherit;
    font-size: 21px;
    opacity: .45;
    cursor: pointer;
}

.chb-ota-x:hover {
    opacity: .9;
    background: rgba(255,255,255,.05);
}


#firmwareUpdateIntro,
.chb-ota-progress {
    padding:
        0 22px
        21px;
}


.chb-ota-version-flow {
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 13px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    background: rgba(255,255,255,.022);
}

.chb-ota-version-flow > div:not(.chb-ota-arrow) {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chb-ota-version-flow span {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .38;
}

.chb-ota-version-flow strong {
    font-size: 17px;
}

.chb-ota-version-flow .target {
    text-align: right;
}

.chb-ota-version-flow .target strong {
    color: #78c8f8;
}

.chb-ota-arrow {
    opacity: .3;
    font-size: 18px;
}


.chb-ota-release-notes {
    margin-top: 12px;
    padding: 13px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,.018);
}

.chb-ota-release-notes span {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .36;
}

.chb-ota-release-notes p {
    margin: 5px 0 0;
    font-size: 11px;
    line-height: 1.55;
    opacity: .67;
}


.chb-ota-file-info {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 10px;
}

.chb-ota-file-info span {
    opacity: .4;
}

.chb-ota-file-info strong {
    font-weight: 600;
    opacity: .76;
}


.chb-ota-safety {
    margin-top: 14px;
    padding: 11px 12px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border-radius: 11px;
    border: 1px solid rgba(244,190,88,.11);
    background: rgba(244,190,88,.035);
}

.chb-ota-safety > span {
    font-size: 13px;
}

.chb-ota-safety p {
    margin: 0;
    font-size: 10px;
    line-height: 1.5;
    opacity: .58;
}


.chb-ota-progress-heading {
    margin-top: 5px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.chb-ota-progress-heading > div {
    min-width: 0;
}

.chb-ota-progress-heading span {
    display: block;
    font-size: 14px;
    font-weight: 700;
}

.chb-ota-progress-heading small {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    opacity: .43;
}

.chb-ota-progress-heading > strong {
    font-size: 28px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -.04em;
}


.chb-ota-progress-track {
    height: 8px;
    margin-top: 15px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.055);
}

.chb-ota-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(
            90deg,
            #3d99dc,
            #73cafa
        );
    box-shadow:
        0 0 18px rgba(87,181,239,.20);
    transition:
        width .32s ease;
}


.chb-ota-byte-progress {
    margin-top: 10px;
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 10px;
}

.chb-ota-byte-progress strong {
    font-size: 11px;
}

.chb-ota-byte-progress span {
    opacity: .43;
}

.chb-ota-real-percent {
    margin-left: auto;
}


.chb-ota-phases {
    margin-top: 21px;
    display: grid;
    grid-template-columns:
        repeat(4,1fr);
    gap: 5px;
}

.chb-ota-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    font-size: 9px;
    opacity: .25;
}

.chb-ota-phase-dot {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.17);
    border-radius: 50%;
    font-size: 9px;
}

.chb-ota-phase.active {
    opacity: .95;
}

.chb-ota-phase.active
.chb-ota-phase-dot {
    border-color: #64bdf1;
    box-shadow:
        0 0 0 4px rgba(100,189,241,.07);
}

.chb-ota-phase.done {
    opacity: .65;
}

.chb-ota-phase.done
.chb-ota-phase-dot {
    background: rgba(93,188,241,.15);
    border-color: rgba(93,188,241,.34);
}


.chb-ota-result {
    margin-top: 20px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: 13px;
    background: rgba(72,194,128,.055);
    border: 1px solid rgba(72,194,128,.13);
}

.chb-ota-result-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    border-radius: 50%;
    background: rgba(72,194,128,.13);
}

.chb-ota-result strong {
    font-size: 11px;
}

.chb-ota-result span {
    font-size: 10px;
    opacity: .5;
}


.chb-ota-actions {
    padding: 14px 22px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,.055);
}

.chb-ota-button {
    min-height: 37px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 10px;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform .15s ease,
        background .15s ease,
        opacity .15s ease;
}

.chb-ota-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.chb-ota-button:disabled {
    cursor: default;
    opacity: .48;
}

.chb-ota-button-primary {
    border: 1px solid rgba(96,190,244,.25);
    background:
        linear-gradient(
            180deg,
            rgba(64,157,219,.30),
            rgba(52,135,193,.23)
        );
    color: inherit;
}

.chb-ota-button-primary:hover:not(:disabled) {
    background:
        linear-gradient(
            180deg,
            rgba(72,169,231,.38),
            rgba(55,144,204,.31)
        );
}

.chb-ota-button-secondary {
    border: 1px solid rgba(255,255,255,.07);
    background: rgba(255,255,255,.025);
    color: inherit;
    opacity: .7;
}

.chb-ota-close-subtle {
    margin-left: auto;
}


@media (max-width: 580px) {

    .chb-ota-overlay {
        padding: 12px;
        align-items: end;
    }

    .chb-ota-modal {
        width: 100%;
        border-radius: 19px;
    }

    .chb-ota-header {
        padding:
            18px 17px
            15px;
    }

    #firmwareUpdateIntro,
    .chb-ota-progress {
        padding:
            0 17px
            18px;
    }

    .chb-ota-actions {
        padding:
            13px 17px
            17px;
    }

    .chb-ota-version-flow {
        padding: 13px;
    }

    .chb-ota-phases {
        gap: 2px;
    }

    .chb-ota-phase {
        font-size: 8px;
    }

    .chb-firmware-available {
        align-items: center;
    }
}



/* ============================================================
   GENERIC DEVICE SETTINGS V1
============================================================ */

.chb-settings {
    width: min(760px, 100%);
}

.chb-settings-device-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}

.chb-settings-device-head > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chb-settings-device-head span {
    color: var(--muted, #8a98a8);
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.chb-settings-device-head strong {
    font-size: 14px;
}

.chb-settings-sync {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}

.chb-settings-sync > span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.chb-settings-sync.applied {
    color: #77d6a0;
    background: rgba(70,190,120,.055);
    border-color: rgba(70,190,120,.14);
}

.chb-settings-sync.applied > span {
    background: #5fd091;
}

.chb-settings-sync.pending {
    color: #e9bd6b;
    background: rgba(230,177,74,.055);
    border-color: rgba(230,177,74,.15);
}

.chb-settings-sync.pending > span {
    background: #e7b65e;
}

.chb-settings-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    margin-bottom: 17px;
    padding-bottom: 3px;
}

.chb-settings-tab {
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #8e9cab;
    font-size: 10px;
    font-weight: 650;
    cursor: pointer;
}

.chb-settings-tab:hover {
    color: #dce8f1;
    background: rgba(255,255,255,.03);
}

.chb-settings-tab.active {
    color: #eaf6ff;
    border-color: rgba(95,188,245,.16);
    background: rgba(73,164,220,.08);
}

.chb-settings-panel {
    display: none;
}

.chb-settings-panel.active {
    display: block;
}

.chb-settings-section-head {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 16px;
}

.chb-settings-section-head h3 {
    margin: 0 0 4px;
    font-size: 14px;
}

.chb-settings-section-head p {
    margin: 0;
    color: #7f8d9c;
    font-size: 10px;
    line-height: 1.5;
}

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

.chb-settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chb-settings-field > span {
    color: #8997a6;
    font-size: 9px;
}

.chb-settings-field input {
    width: 100%;
    height: 42px;
    padding: 0 11px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    outline: none;
    background: rgba(8,13,20,.78);
    color: #eef5fb;
}

.chb-settings-field input:focus {
    border-color: rgba(91,185,242,.34);
}

.chb-settings-unit-input {
    position: relative;
}

.chb-settings-unit-input input {
    padding-right: 44px;
}

.chb-settings-unit-input em {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: #6f7f8e;
    font-size: 9px;
    font-style: normal;
}

.chb-settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 15px;
    padding: 14px 15px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 12px;
    background: rgba(255,255,255,.018);
}

.chb-settings-toggle-row > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chb-settings-toggle-row strong {
    font-size: 11px;
}

.chb-settings-toggle-row small {
    color: #798796;
    font-size: 9px;
    line-height: 1.45;
}

.chb-settings-switch {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 23px;
}

.chb-settings-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chb-settings-switch span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #303943;
    cursor: pointer;
    transition: .18s ease;
}

.chb-settings-switch span:after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #d3dbe2;
    transition: .18s ease;
}

.chb-settings-switch
input:checked + span {
    background: #328ec7;
}

.chb-settings-switch
input:checked + span:after {
    transform: translateX(19px);
    background: white;
}

.chb-settings-switch
input:disabled + span {
    opacity: .48;
    cursor: not-allowed;
}

.chb-settings-current-network {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    background: rgba(255,255,255,.02);
}

.chb-settings-network-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    background: rgba(73,164,220,.08);
    color: #72c7f5;
}

.chb-settings-network-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chb-settings-network-main span {
    color: #697888;
    font-size: 8px;
}

.chb-settings-network-main strong {
    font-size: 12px;
}

.chb-settings-network-main small {
    color: #7f8e9d;
    font-size: 9px;
}

.chb-settings-full-button {
    width: 100%;
    margin-top: 10px;
}

.chb-settings-note {
    margin-top: 13px;
    padding: 12px 13px;
    border: 1px solid rgba(91,185,242,.10);
    border-radius: 11px;
    background: rgba(91,185,242,.025);
}

.chb-settings-note strong {
    color: #afdff8;
    font-size: 9px;
}

.chb-settings-note p {
    margin: 4px 0 0;
    color: #748493;
    font-size: 9px;
    line-height: 1.5;
}

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

.chb-settings-info-item {
    padding: 12px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 11px;
    background: rgba(255,255,255,.018);
}

.chb-settings-info-item span {
    display: block;
    margin-bottom: 5px;
    color: #6e7d8c;
    font-size: 8px;
    text-transform: uppercase;
}

.chb-settings-info-item strong {
    font-size: 10px;
    word-break: break-word;
}

.chb-settings-version-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 10px;
}

.chb-settings-version-card > div {
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
}

.chb-settings-version-card span {
    display: block;
    margin-bottom: 4px;
    color: #738291;
    font-size: 8px;
}

.chb-settings-version-card strong {
    font-size: 10px;
}

.chb-settings-message {
    min-height: 18px;
    margin-top: 12px;
    font-size: 9px;
}

.chb-settings-message.success {
    color: #6ed397;
}

.chb-settings-message.error {
    color: #ef7b80;
}

.chb-settings-error {
    padding: 15px;
}

.chb-settings-error strong {
    font-size: 12px;
}

.chb-settings-error p {
    color: #8795a3;
    font-size: 10px;
}


@media (max-width: 620px) {

    .chb-settings-device-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .chb-settings-form-grid,
    .chb-settings-info-grid,
    .chb-settings-version-card {
        grid-template-columns: 1fr;
    }

    .chb-settings-toggle-row {
        align-items: flex-start;
    }
}



/* ============================================================
   DEVICE SETTINGS - CUSTOMER UI POLISH
============================================================ */

.chb-settings-device-head span {
    font-size: 11px;
}

.chb-settings-device-head strong {
    font-size: 16px;
}

.chb-settings-sync {
    font-size: 11px;
    padding: 8px 11px;
}

.chb-settings-tab {
    padding: 10px 14px;
    font-size: 12px;
}

.chb-settings-section-head h3 {
    font-size: 17px;
}

.chb-settings-section-head p {
    font-size: 12px;
    line-height: 1.55;
}

.chb-settings-field > span {
    font-size: 11px;
}

.chb-settings-field input {
    height: 45px;
    font-size: 14px;
}

.chb-settings-unit-input em {
    font-size: 11px;
}

.chb-settings-toggle-row strong {
    font-size: 13px;
}

.chb-settings-toggle-row small {
    font-size: 11px;
    line-height: 1.5;
}

.chb-settings-network-main span {
    font-size: 10px;
}

.chb-settings-network-main strong {
    font-size: 14px;
}

.chb-settings-network-main small {
    font-size: 11px;
}

.chb-settings-note strong {
    font-size: 11px;
}

.chb-settings-note p {
    font-size: 11px;
    line-height: 1.5;
}

.chb-settings-info-item span {
    font-size: 10px;
}

.chb-settings-info-item strong {
    font-size: 13px;
    line-height: 1.4;
}

.chb-settings-message {
    font-size: 11px;
}



/* ============================================================
   DEVICE SETTINGS - WIFI CUSTOMER UI V1
============================================================ */

.chb-settings-wifi-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.chb-settings-wifi-network {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 12px;
    background: rgba(255,255,255,.025);
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition:
        border-color .15s ease,
        background .15s ease;
}

.chb-settings-wifi-network:hover {
    background: rgba(255,255,255,.05);
}

.chb-settings-wifi-network.is-selected {
    border-color: rgba(255,255,255,.28);
    background: rgba(255,255,255,.07);
}

.chb-settings-wifi-network div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.chb-settings-wifi-network strong {
    font-size: 13px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chb-settings-wifi-network small {
    font-size: 11px;
    opacity: .68;
}

.chb-settings-wifi-network > span {
    flex: 0 0 auto;
    font-size: 10px;
    opacity: .72;
}

.chb-settings-wifi-empty {
    padding: 16px;
    border: 1px dashed rgba(255,255,255,.12);
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
    opacity: .72;
}

.chb-settings-wifi-connect {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}

.chb-settings-wifi-connect[hidden] {
    display: none;
}

.chb-settings-wifi-selected {
    display: grid;
    gap: 3px;
    margin-bottom: 13px;
}

.chb-settings-wifi-selected > span {
    font-size: 10px;
    opacity: .62;
}

.chb-settings-wifi-selected > strong {
    font-size: 14px;
}

.chb-settings-wifi-selected > small {
    font-size: 11px;
    opacity: .7;
}

.chb-settings-wifi-connect
.chb-settings-field {
    margin-bottom: 12px;
}

.chb-settings-message {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,.04);
    font-size: 11px;
    line-height: 1.5;
}

.chb-settings-message[hidden] {
    display: none;
}

.chb-settings-message-success {
    background: rgba(255,255,255,.07);
}

.chb-settings-message-error {
    background: rgba(255,255,255,.055);
}



/* ============================================================
   SECURITY - PASSWORD
============================================================ */

.security-password-form {
    max-width: 760px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}

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

.security-password-grid .field:first-child {
    grid-column: 1 / -1;
}

.security-password-button {
    width: auto;
    min-width: 210px;
    margin-top: 5px;
    padding-left: 22px;
    padding-right: 22px;
}

@media (max-width: 760px) {

    .security-password-grid {
        grid-template-columns: 1fr;
    }

    .security-password-grid .field:first-child {
        grid-column: auto;
    }

    .security-password-button {
        width: 100%;
    }
}


/* ============================================================
   MOBILE DASHBOARD NAVIGATION
============================================================ */

.mobile-menu-button {
    display:none;

    width:42px;
    height:42px;

    align-items:center;
    justify-content:center;

    padding:0;

    border:1px solid var(--border);
    border-radius:10px;

    background:#08121d;
    color:#ffffff;

    font-size:23px;
    line-height:1;

    cursor:pointer;
}

.mobile-sidebar-overlay {
    display:none;
}

.sidebar {
    overflow-y:auto;
}


@media(max-width:900px) {

    .dashboard-header {
        justify-content:space-between;
        gap:14px;
    }

    .mobile-menu-button {
        display:flex;
        flex:0 0 auto;
    }


    .sidebar {
        display:block;

        top:0;
        left:0;

        width:min(300px, 86vw);
        height:100dvh;

        z-index:1200;

        transform:translateX(-105%);
        transition:transform .22s ease;

        box-shadow:
            20px 0 50px
            rgba(0,0,0,.35);
    }

    .sidebar.mobile-open {
        transform:translateX(0);
    }


    .mobile-sidebar-overlay {
        display:block;

        position:fixed;
        inset:0;

        z-index:1190;

        background:rgba(0,0,0,.62);

        opacity:0;
        visibility:hidden;

        transition:
            opacity .22s ease,
            visibility .22s ease;
    }

    .mobile-sidebar-overlay.open {
        opacity:1;
        visibility:visible;
    }


    body.mobile-menu-open {
        overflow:hidden;
    }


    .user-menu {
        min-width:0;
    }

    .user-meta {
        min-width:0;
    }

    .user-meta strong,
    .user-meta span {
        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
}


@media(max-width:520px) {

    .dashboard-header {
        height:68px;
        padding:0 14px;
    }

    .dashboard-content {
        padding:
            26px 14px;
    }

    .user-meta span {
        display:none;
    }

    .logout-button {
        padding:
            9px 10px;
    }
}


/* ============================================================
   CHB KEYLINK KEYPAD - MOBILE UX
============================================================ */

@media (max-width: 760px) {

    .keylink-keypad-backdrop {
        padding:10px;

        align-items:center;
        justify-content:center;

        min-height:100dvh;
    }


    .keylink-keypad-backdrop .modal {
        box-sizing:border-box;

        width:min(
            430px,
            calc(100vw - 20px)
        );

        max-height:
            calc(100dvh - 20px);

        margin:auto;

        padding:16px;

        overflow-x:hidden;
        overflow-y:auto;

        overscroll-behavior:contain;

        border-radius:16px;
    }


    .keylink-keypad-backdrop .modal-header {
        margin-bottom:12px;

        align-items:center;
    }


    .keylink-keypad-backdrop .modal-header h2 {
        font-size:21px;
        letter-spacing:-0.5px;
    }


    .keylink-keypad-backdrop .modal-eyebrow {
        font-size:7px;
    }


    .keylink-keypad-backdrop .modal-close {
        width:38px;
        height:38px;
    }


    .keylink-keypad-backdrop .chb-keypad {
        width:100%;
        max-width:none;
    }


    .keylink-keypad-backdrop
    .chb-keypad-device {
        margin-bottom:10px;
    }


    .keylink-keypad-backdrop
    .chb-keypad-display {
        min-height:72px;

        padding:12px 14px;
    }


    .keylink-keypad-backdrop
    .chb-keypad-display-line {
        font-size:0.98rem;
        line-height:1.35;
    }


    .keylink-keypad-backdrop
    .chb-keypad-display-line.secondary {
        font-size:0.82rem;
    }


    .keylink-keypad-backdrop
    .chb-keypad-indicators {
        gap:6px;

        margin-top:8px;
    }


    .keylink-keypad-backdrop
    .chb-keypad-mode-row {
        margin-top:7px;
    }


    .keylink-keypad-backdrop
    .chb-issues-panel {
        margin-top:8px;
    }


    .keylink-keypad-backdrop
    .chb-keypad-terminal {
        margin:10px 0;
    }


    .keylink-keypad-backdrop
    .chb-keypad-terminal input {
        min-height:48px;

        font-size:16px;

        touch-action:manipulation;

        -webkit-text-size-adjust:100%;
    }


    .keylink-keypad-backdrop
    .chb-keypad-terminal-row {
        grid-template-columns:
            minmax(0, 1fr)
            48px
            64px;

        gap:6px;
    }


    .keylink-keypad-backdrop
    #keyLinkClear {
        grid-column:auto;
    }


    .keylink-keypad-backdrop
    .chb-keypad-grid {
        gap:7px;
    }


    .keylink-keypad-backdrop
    .chb-keypad-key {
        min-height:52px;

        font-size:1.25rem;

        touch-action:manipulation;
    }


    .keylink-keypad-backdrop
    .chb-keypad-send {
        min-height:46px;

        margin-top:10px;
    }


    .keylink-keypad-backdrop
    .chb-keypad-status {
        min-height:18px;

        margin:7px 0;
    }


    .keylink-keypad-backdrop
    .chb-keypad-help {
        margin-top:7px;

        font-size:0.72rem;
    }


    .keylink-keypad-backdrop
    .modal-actions {
        margin-top:12px;
    }
}


@media (max-width: 390px) {

    .keylink-keypad-backdrop {
        padding:6px;
    }


    .keylink-keypad-backdrop .modal {
        width:
            calc(100vw - 12px);

        max-height:
            calc(100dvh - 12px);

        padding:13px;
    }


    .keylink-keypad-backdrop
    .chb-keypad-key {
        min-height:49px;
    }


    .keylink-keypad-backdrop
    .chb-keypad-terminal-row {
        grid-template-columns:
            minmax(0, 1fr)
            44px
            58px;
    }
}


/* ============================================================
   CHB UNIFIED UI V2
   Base visual global inspirada en Device Settings
============================================================ */

:root {
    --chb-surface-0:#050b12;
    --chb-surface-1:#07111b;
    --chb-surface-2:#0b1723;
    --chb-surface-3:#0e1d2c;

    --chb-border:#1d3045;
    --chb-border-soft:#16283b;

    --chb-text:#f4f8fc;
    --chb-muted:#8293a6;
    --chb-muted-2:#62778d;

    --chb-accent:#43bfff;
    --chb-accent-soft:rgba(67,191,255,.10);

    --chb-danger:#ff6778;
    --chb-danger-soft:rgba(255,103,120,.09);

    --chb-radius:14px;
    --chb-radius-lg:18px;
}


/* ============================================================
   MODALES
============================================================ */

.modal-backdrop {
    background:
        rgba(1,5,10,.84);

    backdrop-filter:
        blur(10px);
}

.modal {
    width:
        min(540px,100%);

    padding:24px;

    border:
        1px solid var(--chb-border);

    border-radius:
        var(--chb-radius-lg);

    background:
        linear-gradient(
            180deg,
            #091522 0%,
            #07111b 100%
        );

    box-shadow:
        0 30px 80px
        rgba(0,0,0,.55);
}

.modal-header {
    margin-bottom:20px;
}

.modal-header h2 {
    margin-top:4px;

    color:
        var(--chb-text);

    font-size:22px;
    font-weight:650;

    letter-spacing:-.55px;
}

.modal-eyebrow {
    color:
        var(--chb-accent);

    font-size:9px;

    letter-spacing:1.6px;
}

.modal-close {
    width:34px;
    height:34px;

    display:grid;
    place-items:center;

    padding:0;

    color:#91a4b7;

    background:
        var(--chb-surface-2);

    border:
        1px solid transparent;

    border-radius:10px;

    font-size:18px;

    transition:
        color .18s ease,
        background .18s ease,
        border-color .18s ease;
}

.modal-close:hover {
    color:#fff;

    background:#102235;

    border-color:#29435e;
}

.modal-description {
    color:
        var(--chb-muted);

    font-size:12px;
    line-height:1.65;
}


/* ============================================================
   CAMPOS
============================================================ */

.field {
    margin-bottom:16px;
}

.field label {
    display:block;

    margin-bottom:7px;

    color:#a8b7c7;

    font-size:11px;
    font-weight:650;

    letter-spacing:.2px;
}

.field input,
.field select,
.select-input,
.chb-ui-select {
    width:100%;
    min-height:48px;

    padding:
        0 13px;

    color:
        var(--chb-text);

    background:
        var(--chb-surface-1);

    border:
        1px solid var(--chb-border);

    border-radius:10px;

    outline:none;

    transition:
        border-color .18s ease,
        background .18s ease,
        box-shadow .18s ease;
}

.field input:focus,
.field select:focus,
.select-input:focus,
.chb-ui-select:focus {
    background:#091624;

    border-color:
        rgba(67,191,255,.72);

    box-shadow:
        0 0 0 3px
        rgba(67,191,255,.08);
}


/* ============================================================
   BOTONES GENERALES
============================================================ */

.primary-button,
.modal-primary,
.modal-secondary {
    min-height:44px;

    border-radius:10px;

    font-size:12px;
    font-weight:650;

    transition:
        transform .15s ease,
        border-color .18s ease,
        background .18s ease,
        opacity .18s ease;
}

.primary-button:hover:not(:disabled),
.modal-primary:hover:not(:disabled),
.modal-secondary:hover:not(:disabled) {
    transform:
        translateY(-1px);
}

.primary-button:disabled,
.modal-primary:disabled,
.modal-secondary:disabled {
    cursor:not-allowed;

    opacity:.55;
}

.chb-button-primary {
    color:#fff;

    background:
        linear-gradient(
            180deg,
            #168fd0 0%,
            #0876b6 100%
        );

    border:
        1px solid
        rgba(67,191,255,.42);
}

.modal-secondary {
    color:#b0bdca;

    background:
        var(--chb-surface-2);

    border:
        1px solid var(--chb-border);
}

.modal-secondary:hover:not(:disabled) {
    color:#fff;

    background:#102132;

    border-color:#2b455f;
}

.chb-button-danger-soft {
    color:#ff8593;

    background:
        var(--chb-danger-soft);

    border:
        1px solid
        rgba(255,103,120,.20);
}

.chb-button-danger-soft:hover:not(:disabled) {
    color:#ff9eaa;

    background:
        rgba(255,103,120,.13);

    border-color:
        rgba(255,103,120,.38);
}


/* ============================================================
   BOTON OPCIONES
============================================================ */

.chb-device-options {
    position:relative;
}

.chb-device-options-toggle {
    width:38px !important;
    height:36px !important;

    min-width:38px !important;

    padding:0 !important;

    display:grid !important;
    place-items:center !important;

    color:#91a4b7 !important;

    background:
        rgba(11,23,35,.88) !important;

    border:
        1px solid #1b3045 !important;

    border-radius:10px !important;

    font-size:0 !important;

    cursor:pointer;

    transition:
        color .18s ease,
        background .18s ease,
        border-color .18s ease,
        transform .15s ease;
}

.chb-device-options-toggle:hover {
    color:#fff !important;

    background:#102132 !important;

    border-color:#2b465f !important;

    transform:
        translateY(-1px);
}

.chb-device-options-toggle[
    aria-expanded="true"
] {
    color:
        var(--chb-accent) !important;

    background:
        var(--chb-accent-soft) !important;

    border-color:
        rgba(67,191,255,.32) !important;
}

.chb-options-dots {
    display:block;

    position:relative;

    top:-4px;

    color:currentColor;

    font-size:24px;
    font-weight:600;

    line-height:1;

    letter-spacing:1px;
}

.chb-options-chevron {
    display:none !important;
}


/* ============================================================
   MENU DE OPCIONES
============================================================ */

.chb-device-options-menu {
    min-width:218px;

    padding:6px;

    overflow:hidden;

    background:
        rgba(7,17,27,.98);

    border:
        1px solid var(--chb-border);

    border-radius:12px;

    box-shadow:
        0 22px 55px
        rgba(0,0,0,.46);

    backdrop-filter:
        blur(12px);
}

.chb-device-option {
    width:100%;

    min-height:40px;

    padding:
        8px 10px;

    display:flex;

    align-items:center;

    gap:10px;

    color:#aab8c7;

    background:
        transparent;

    border:0;

    border-radius:8px;

    font-size:12px;
    font-weight:550;

    text-align:left;

    cursor:pointer;

    transition:
        background .15s ease,
        color .15s ease;
}

.chb-device-option:hover {
    color:#fff;

    background:#0d1d2c;
}

.chb-option-icon {
    width:18px;
    height:18px;

    flex:
        0 0 18px;

    display:grid;
    place-items:center;

    color:#8198ae;
}

.chb-option-icon svg {
    width:17px;
    height:17px;

    fill:none;

    stroke:
        currentColor;

    stroke-width:1.7;

    stroke-linecap:round;
    stroke-linejoin:round;
}

.chb-device-option:hover
.chb-option-icon {
    color:
        var(--chb-accent);
}

.chb-device-option-separator {
    height:1px;

    margin:5px 6px;

    background:
        var(--chb-border-soft);
}

.chb-device-option-danger {
    color:#db7c87;
}

.chb-device-option-danger
.chb-option-icon {
    color:#cf6c78;
}

.chb-device-option-danger:hover {
    color:#ff909b;

    background:
        rgba(255,103,120,.07);
}


/* ============================================================
   SOLICITUDES DE DISPOSITIVOS
============================================================ */

.chb-claim-card {
    position:relative;

    padding:18px;

    display:grid;

    grid-template-columns:
        44px minmax(0,1fr);

    gap:14px;

    border:
        1px solid
        var(--chb-border-soft);

    border-radius:
        var(--chb-radius);

    background:
        linear-gradient(
            180deg,
            #091522 0%,
            #07111b 100%
        );

    box-shadow:
        0 12px 32px
        rgba(0,0,0,.15);

    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;
}

.chb-claim-card:hover {
    transform:
        translateY(-1px);

    border-color:#27445e;

    box-shadow:
        0 16px 38px
        rgba(0,0,0,.23);
}

.chb-claim-card-icon {
    width:44px;
    height:44px;

    display:grid;
    place-items:center;

    color:
        var(--chb-accent);

    background:
        rgba(67,191,255,.07);

    border:
        1px solid
        rgba(67,191,255,.18);

    border-radius:12px;
}

.chb-claim-card-icon svg {
    width:21px;
    height:21px;

    fill:none;

    stroke:
        currentColor;

    stroke-width:1.7;

    stroke-linecap:round;
    stroke-linejoin:round;
}

.chb-claim-card h3 {
    margin:
        1px 0 5px;

    color:
        var(--chb-text);

    font-size:14px;
    font-weight:650;
}

.chb-claim-card p {
    margin:
        0 0 3px;

    color:#a6b5c5;

    font-size:12px;
}

.chb-claim-card span,
.chb-claim-card small {
    color:
        var(--chb-muted);

    font-size:11px;
}

.chb-claim-review {
    width:auto;

    min-height:38px;

    padding:
        0 14px;

    font-size:11px;
}


/* ============================================================
   MODAL ACEPTAR CLAIM
============================================================ */

.chb-claim-modal-form {
    margin-top:4px;
}

.chb-claim-device {
    margin-bottom:22px;

    padding:14px;

    display:grid;

    grid-template-columns:
        42px minmax(0,1fr) auto;

    align-items:center;

    gap:12px;

    background:#08131e;

    border:
        1px solid
        var(--chb-border-soft);

    border-radius:12px;
}

.chb-claim-device-icon {
    width:42px;
    height:42px;

    display:grid;
    place-items:center;

    color:
        var(--chb-accent);

    background:
        rgba(67,191,255,.08);

    border-radius:10px;
}

.chb-claim-device-icon svg {
    width:21px;
    height:21px;

    fill:none;

    stroke:
        currentColor;

    stroke-width:1.7;

    stroke-linecap:round;
    stroke-linejoin:round;
}

.chb-claim-device-main {
    min-width:0;

    display:flex;

    flex-direction:column;

    gap:2px;
}

.chb-claim-device-main span,
.chb-claim-device-hardware span {
    color:#5f7890;

    font-size:8px;
    font-weight:800;

    letter-spacing:1.15px;
}

.chb-claim-device-main strong {
    overflow:hidden;

    color:#f5f8fb;

    font-size:13px;
    font-weight:650;

    white-space:nowrap;

    text-overflow:ellipsis;
}

.chb-claim-device-main small {
    color:
        var(--chb-muted);

    font-size:10px;
}

.chb-claim-device-hardware {
    display:flex;

    flex-direction:column;

    gap:3px;

    text-align:right;
}

.chb-claim-device-hardware strong {
    color:#9fb0c1;

    font-size:10px;
    font-weight:600;
}


/* ============================================================
   MENSAJES / ESTADOS
============================================================ */

.form-message {
    min-height:18px;

    color:
        var(--chb-muted);

    font-size:11px;

    line-height:1.5;
}

.form-message.error {
    color:#ff8593;
}

.form-message.success {
    color:#6ed9a7;
}

.empty-devices.chb-empty-state {
    border:
        1px dashed #1d344a;

    border-radius:
        var(--chb-radius-lg);

    background:
        linear-gradient(
            180deg,
            rgba(10,23,36,.56),
            rgba(7,17,27,.56)
        );
}


/* ============================================================
   MOBILE
============================================================ */

@media (
    max-width:600px
) {

    .modal {
        padding:19px;

        border-radius:15px;
    }

    .modal-header h2 {
        font-size:20px;
    }

    .chb-claim-device {
        grid-template-columns:
            38px minmax(0,1fr);
    }

    .chb-claim-device-hardware {
        grid-column:2;

        text-align:left;
    }

    .chb-device-options-menu {
        min-width:205px;
    }

    .modal-actions {
        grid-template-columns:
            1fr 1fr;
    }

}


/* CHB UNIFIED UI V2 */


/* ============================================================
   CHB DEVICE OPTIONS MENU - REFINEMENT V3
============================================================ */

.chb-device-options {
    position:relative !important;
}

.chb-device-options-toggle {
    width:34px !important;
    height:34px !important;
    min-width:34px !important;

    padding:0 !important;

    display:grid !important;
    place-items:center !important;

    border-radius:9px !important;
}

.chb-options-dots {
    top:-3px !important;

    font-size:21px !important;
    line-height:1 !important;

    letter-spacing:.5px !important;
}


/* MENU */

.chb-device-options-menu {
    position:absolute !important;

    right:0 !important;
    left:auto !important;

    bottom:calc(100% + 8px) !important;
    top:auto !important;

    width:218px !important;
    min-width:218px !important;

    padding:6px !important;

    display:block !important;

    border-radius:12px !important;

    background:
        rgba(7,17,27,.99) !important;

    border:
        1px solid #1d3045 !important;

    box-shadow:
        0 18px 45px
        rgba(0,0,0,.50) !important;

    z-index:120 !important;
}

.chb-device-options-menu[hidden] {
    display:none !important;
}


/* FILAS */

.chb-device-option {
    width:100% !important;

    min-height:36px !important;
    height:auto !important;

    padding:
        7px 9px !important;

    display:flex !important;

    flex-direction:row !important;

    align-items:center !important;

    justify-content:flex-start !important;

    gap:9px !important;

    text-align:left !important;

    color:#aab9c8 !important;

    background:
        transparent !important;

    border:0 !important;

    border-radius:8px !important;

    font-size:11px !important;

    font-weight:550 !important;

    line-height:1.2 !important;
}

.chb-device-option:hover {
    color:#ffffff !important;

    background:
        #0d1d2c !important;
}


/* ICONOS */

.chb-device-option
.chb-option-icon {
    width:17px !important;
    height:17px !important;

    min-width:17px !important;

    flex:
        0 0 17px !important;

    display:grid !important;

    place-items:center !important;

    margin:0 !important;
}

.chb-device-option
.chb-option-icon svg {
    width:16px !important;
    height:16px !important;

    display:block !important;
}


/* TEXTO */

.chb-device-option > span:not(.chb-option-icon) {
    display:block !important;

    margin:0 !important;

    flex:1 1 auto !important;

    white-space:nowrap !important;

    text-align:left !important;
}


/* SEPARADOR */

.chb-device-option-separator {
    height:1px !important;

    margin:
        5px 7px !important;

    background:
        #183047 !important;
}


/* DESVINCULAR */

.chb-device-option-danger {
    color:#e47d89 !important;
}

.chb-device-option-danger:hover {
    color:#ff98a3 !important;

    background:
        rgba(255,103,120,.08) !important;
}


/* MOBILE */

@media (max-width:600px) {

    .chb-device-options-menu {
        width:210px !important;
        min-width:210px !important;
    }

}

/* CHB DEVICE OPTIONS MENU - REFINEMENT V3 */


/* ============================================================
   CHB DEVICE OPTIONS POSITION V4
============================================================ */

/*
 * Contenedor de acciones de la tarjeta.
 * Lo llevamos a la esquina superior derecha.
 */

.chb-device-access {
    position:absolute !important;

    top:14px !important;
    right:14px !important;

    bottom:auto !important;
    left:auto !important;

    margin:0 !important;

    display:flex !important;

    align-items:flex-start !important;

    gap:8px !important;

    z-index:40 !important;
}


/*
 * La tarjeta debe actuar como referencia
 * para el posicionamiento absoluto.
 */

.device-card,
.chb-device-card,
article.device-card {
    position:relative !important;
}


/*
 * Botón ⋯
 */

.chb-device-options {
    position:relative !important;
}

.chb-device-options-toggle {
    width:34px !important;
    height:34px !important;

    min-width:34px !important;

    border-radius:9px !important;
}


/*
 * Menú desplegable:
 * ahora abre HACIA ABAJO.
 */

.chb-device-options-menu {
    position:absolute !important;

    top:calc(100% + 7px) !important;
    right:0 !important;

    bottom:auto !important;
    left:auto !important;

    width:218px !important;

    z-index:200 !important;
}


/*
 * Ya no usamos badge "Propio".
 */

.chb-access-badge.owned {
    display:none !important;
}


/*
 * Si es dispositivo compartido,
 * conservamos el badge pero lo dejamos
 * más discreto.
 */

.chb-access-badge.shared {
    min-height:26px !important;

    padding:0 9px !important;

    display:flex !important;
    align-items:center !important;

    border-radius:8px !important;

    font-size:9px !important;

    white-space:nowrap !important;
}


/*
 * En móvil conservamos margen cómodo.
 */

@media (max-width:600px) {

    .chb-device-access {
        top:11px !important;
        right:11px !important;
    }

    .chb-device-options-menu {
        width:210px !important;
    }

}

/* CHB DEVICE OPTIONS POSITION V4 */


/* ============================================================
   CHB DEVICE CARD LAYOUT V5
   Reserva superior: estado a la izquierda / opciones a la derecha
============================================================ */

.device-card {
    position:relative !important;

    padding-top:54px !important;
}


/* ESTADO ONLINE / OFFLINE
   Lo dejamos arriba a la izquierda.
*/

.device-card .device-status,
.device-card .status,
.device-card .online-status,
.device-card [class*="status"] {
    position:relative;
    z-index:10;
}


/* CONTENEDOR OPCIONES */

.chb-device-access {
    position:absolute !important;

    top:12px !important;
    right:12px !important;

    bottom:auto !important;
    left:auto !important;

    margin:0 !important;

    display:flex !important;
    align-items:center !important;

    gap:8px !important;

    z-index:50 !important;
}


/* Si queda algún badge owned viejo, fuera */

.chb-access-badge.owned {
    display:none !important;
}


/* Botón tres puntos */

.chb-device-options-toggle {
    width:34px !important;
    height:34px !important;

    min-width:34px !important;

    padding:0 !important;

    display:grid !important;
    place-items:center !important;

    border-radius:9px !important;
}


/* Menú abre hacia abajo */

.chb-device-options-menu {
    position:absolute !important;

    top:calc(100% + 7px) !important;
    right:0 !important;

    bottom:auto !important;
    left:auto !important;

    z-index:300 !important;
}


/* ============================================================
   FIRMWARE UPDATE PANEL
   Siempre dentro del flujo de la tarjeta, nunca absoluto.
============================================================ */

.chb-firmware-available {
    position:relative !important;

    top:auto !important;
    right:auto !important;
    bottom:auto !important;
    left:auto !important;

    width:100% !important;

    margin-top:14px !important;

    z-index:1 !important;
}


/* Evitar que su botón se monte sobre opciones */

.chb-firmware-update-button {
    position:relative !important;

    z-index:2 !important;
}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width:600px) {

    .device-card {
        padding-top:52px !important;
    }

    .chb-device-access {
        top:10px !important;
        right:10px !important;
    }

}

/* CHB DEVICE CARD LAYOUT V5 */


/* ============================================================
   CHB OPTIONS POSITION FIX V6
   Online arriba / opciones debajo
============================================================ */

.chb-device-access {
    position:absolute !important;

    top:46px !important;
    right:12px !important;

    bottom:auto !important;
    left:auto !important;

    margin:0 !important;

    z-index:60 !important;
}

.chb-device-options {
    position:relative !important;
}

.chb-device-options-toggle {
    width:32px !important;
    height:32px !important;

    min-width:32px !important;

    padding:0 !important;

    border-radius:8px !important;
}

.chb-options-dots {
    top:-3px !important;

    font-size:20px !important;
}


/* menú abre hacia abajo */

.chb-device-options-menu {
    position:absolute !important;

    top:calc(100% + 7px) !important;
    right:0 !important;

    bottom:auto !important;
    left:auto !important;

    z-index:400 !important;
}


/* ya no hace falta reservar tanto espacio arriba */

.device-card {
    padding-top:inherit;
}


/* móvil */

@media (max-width:600px) {

    .chb-device-access {
        top:43px !important;
        right:10px !important;
    }

}

/* CHB OPTIONS POSITION FIX V6 */


/* ============================================================
   CHB OPTIONS FINAL POSITION V7
============================================================ */

.chb-device-access {
    top:50px !important;
    right:10px !important;
}

.chb-device-options-toggle {
    width:31px !important;
    height:31px !important;
    min-width:31px !important;
}

.chb-options-dots {
    top:-3px !important;
    font-size:19px !important;
}

/*
 * Reserva visual para estado + menú.
 * El contenido normal comienza debajo.
 */
.device-card .device-info {
    position:relative !important;
    z-index:1 !important;
}

/*
 * Firmware update siempre debajo del bloque de información.
 */
.chb-firmware-available {
    clear:both !important;
    margin-top:14px !important;
}

/* CHB OPTIONS FINAL POSITION V7 */


/* ============================================================
   CHB DEVICE CARD PROTOTYPE V1
   Base oficial para todos los dispositivos CHB
============================================================ */


/* ------------------------------------------------------------
   TARJETA
------------------------------------------------------------- */

.device-card {
    position:relative !important;

    padding:22px !important;

    overflow:visible !important;
}


/* ------------------------------------------------------------
   CABECERA
   [ CHB ]                 [ Online ] [ ⋯ ]
------------------------------------------------------------- */

.device-card-top {
    width:100% !important;

    margin:0 0 22px !important;

    display:flex !important;

    align-items:center !important;

    justify-content:space-between !important;

    gap:14px !important;
}


.device-card-top-actions {
    margin-left:auto !important;

    display:flex !important;

    align-items:center !important;

    justify-content:flex-end !important;

    gap:9px !important;

    flex:0 0 auto !important;
}


/* ------------------------------------------------------------
   ONLINE / OFFLINE
------------------------------------------------------------- */

.device-card .device-state {
    position:static !important;

    top:auto !important;
    right:auto !important;
    bottom:auto !important;
    left:auto !important;

    margin:0 !important;

    flex:0 0 auto !important;

    white-space:nowrap !important;

    z-index:auto !important;
}


/* ------------------------------------------------------------
   SLOT DE ACCIONES
------------------------------------------------------------- */

.device-card-actions-slot {
    position:static !important;

    margin:0 !important;

    display:flex !important;

    align-items:center !important;

    gap:8px !important;

    flex:0 0 auto !important;
}


/* El contenedor viejo ya no participa */

.chb-device-access {
    display:none !important;
}


/* ------------------------------------------------------------
   BOTON OPCIONES
------------------------------------------------------------- */

.chb-device-options {
    position:relative !important;

    top:auto !important;
    right:auto !important;
    bottom:auto !important;
    left:auto !important;

    margin:0 !important;
}


.chb-device-options-toggle {
    width:30px !important;
    height:30px !important;

    min-width:30px !important;

    padding:0 !important;

    display:grid !important;

    place-items:center !important;

    color:#8197ab !important;

    background:#0a1825 !important;

    border:
        1px solid #1c3449 !important;

    border-radius:8px !important;
}


.chb-device-options-toggle:hover {
    color:#ffffff !important;

    background:#102335 !important;

    border-color:#2c4a65 !important;
}


.chb-options-dots {
    position:static !important;

    top:auto !important;

    margin-top:-5px !important;

    font-size:19px !important;

    line-height:1 !important;
}


/* ------------------------------------------------------------
   MENU
   Sale hacia abajo desde ⋯
------------------------------------------------------------- */

.chb-device-options-menu {
    position:absolute !important;

    top:calc(100% + 7px) !important;
    right:0 !important;

    bottom:auto !important;
    left:auto !important;

    width:218px !important;
    min-width:218px !important;

    z-index:500 !important;
}


.chb-device-options-menu[hidden] {
    display:none !important;
}


/* ------------------------------------------------------------
   BADGE SHARED
------------------------------------------------------------- */

.chb-access-badge.owned {
    display:none !important;
}


.chb-access-badge.shared {
    position:static !important;

    min-height:25px !important;

    padding:0 8px !important;

    display:flex !important;

    align-items:center !important;

    color:#88bedd !important;

    background:
        rgba(67,191,255,.07) !important;

    border:
        1px solid
        rgba(67,191,255,.17) !important;

    border-radius:7px !important;

    font-size:8px !important;

    font-weight:700 !important;

    letter-spacing:.4px !important;

    white-space:nowrap !important;
}


/* ------------------------------------------------------------
   TITULO Y DATOS
------------------------------------------------------------- */

.device-card > h3 {
    margin-top:0 !important;
}


.device-info {
    position:static !important;

    z-index:auto !important;
}


/* ------------------------------------------------------------
   ACTUALIZACION DE FIRMWARE
   Siempre debajo de device-info
------------------------------------------------------------- */

.chb-firmware-available {
    position:static !important;

    top:auto !important;
    right:auto !important;
    bottom:auto !important;
    left:auto !important;

    width:100% !important;

    margin:
        15px 0 0 !important;

    clear:both !important;

    z-index:auto !important;
}


/* ------------------------------------------------------------
   MOBILE
------------------------------------------------------------- */

@media (max-width:600px) {

    .device-card {
        padding:18px !important;
    }

    .device-card-top {
        margin-bottom:19px !important;
    }

    .device-card-top-actions {
        gap:7px !important;
    }

}


/* CHB DEVICE CARD PROTOTYPE V1 */
/* ============================================================
   CHB DESIGN SYSTEM · MODALS V1
============================================================ */


/* ============================================================
   CHB DESIGN SYSTEM · MODALS V1
============================================================ */

/*
 * Base visual:
 *
 * bg      #02060b
 * panel   #08121d
 * panel2  #0c1825
 * text    #f4f7fb
 * muted   #8c9bad
 * blue    #1683ff
 * cyan    #39cfff
 * green   #31d081
 * red     #ff6464
 */

:root {

    --chb-modal-bg:
        var(--panel, #08121d);

    --chb-modal-bg-soft:
        var(--panel2, #0c1825);

    --chb-modal-text:
        var(--text, #f4f7fb);

    --chb-modal-muted:
        var(--muted, #8c9bad);

    --chb-modal-blue:
        var(--blue, #1683ff);

    --chb-modal-cyan:
        var(--cyan, #39cfff);

    --chb-modal-green:
        var(--green, #31d081);

    --chb-modal-red:
        var(--red, #ff6464);

    --chb-modal-border:
        var(
            --border,
            rgba(255,255,255,.09)
        );

    --chb-modal-radius: 22px;

    --chb-control-radius: 12px;

}


/* ------------------------------------------------------------
   PAGE LOCK
------------------------------------------------------------ */

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


/* ------------------------------------------------------------
   BACKDROP
------------------------------------------------------------ */

.modal-backdrop {

    position: fixed;
    inset: 0;

    z-index: 4000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background:
        rgba(1, 5, 10, .76);

    -webkit-backdrop-filter:
        blur(14px);

    backdrop-filter:
        blur(14px);

    animation:
        chbModalBackdropIn
        .18s ease-out both;
}


/* ------------------------------------------------------------
   MODAL PANEL
------------------------------------------------------------ */

.modal.chb-modal {

    position: relative;

    width: min(
        100%,
        560px
    );

    max-height:
        min(88vh, 780px);

    overflow:
        hidden auto;

    color:
        var(--chb-modal-text);

    background:
        linear-gradient(
            145deg,
            rgba(12,24,37,.98),
            rgba(5,14,23,.985)
        );

    border:
        1px solid
        var(--chb-modal-border);

    border-radius:
        var(--chb-modal-radius);

    box-shadow:
        0 30px 90px
        rgba(0,0,0,.58),
        0 0 0 1px
        rgba(22,131,255,.03);

    animation:
        chbModalPanelIn
        .22s
        cubic-bezier(.2,.8,.2,1)
        both;
}


/*
 * Línea superior CHB.
 */
.modal.chb-modal::before {

    content: "";

    position: absolute;

    top: 0;
    left: 44px;
    right: 44px;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(57,207,255,.55),
            rgba(22,131,255,.85),
            transparent
        );

    pointer-events: none;
}


/* ------------------------------------------------------------
   HEADER
------------------------------------------------------------ */

.modal .modal-header {

    position: relative;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 18px;

    padding:
        24px
        24px
        20px;

    border-bottom:
        1px solid
        var(--chb-modal-border);

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.018),
            transparent
        );
}


.chb-modal-heading {
    min-width: 0;
}


.modal .modal-eyebrow {

    display: block;

    margin: 0 0 6px;

    color:
        var(--chb-modal-cyan);

    font-size: 10px;
    font-weight: 800;

    line-height: 1.2;

    letter-spacing: .18em;

    text-transform: uppercase;

    opacity: .9;
}


.modal .modal-header h2 {

    margin: 0;

    color:
        var(--chb-modal-text);

    font-size:
        clamp(
            21px,
            3vw,
            26px
        );

    font-weight: 720;

    line-height: 1.15;

    letter-spacing: -.025em;
}


/* ------------------------------------------------------------
   CLOSE
------------------------------------------------------------ */

.modal .modal-close {

    flex: 0 0 auto;

    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    margin: -3px -3px 0 0;
    padding: 0;

    border:
        1px solid
        rgba(255,255,255,.08);

    border-radius: 11px;

    color:
        var(--chb-modal-muted);

    background:
        rgba(255,255,255,.025);

    font-size: 22px;
    font-weight: 400;

    line-height: 1;

    cursor: pointer;

    transition:
        border-color .16s ease,
        background .16s ease,
        color .16s ease,
        transform .16s ease;
}


.modal .modal-close:hover {

    color:
        var(--chb-modal-text);

    border-color:
        rgba(57,207,255,.22);

    background:
        rgba(57,207,255,.07);
}


.modal .modal-close:active {
    transform: scale(.95);
}


/* ------------------------------------------------------------
   BODY
------------------------------------------------------------ */

.chb-modal-body {

    padding:
        22px
        24px
        24px;
}


.modal .modal-description {

    margin:
        0
        0
        16px;

    color:
        var(--chb-modal-muted);

    font-size: 14px;

    line-height: 1.65;
}


.modal .modal-description strong {

    color:
        var(--chb-modal-text);

    font-weight: 650;
}


/* ------------------------------------------------------------
   FORM
------------------------------------------------------------ */

.modal .modal-form {
    margin: 0;
}


.modal label {

    display: block;

    margin:
        18px
        0
        8px;

    color:
        #c6d1de;

    font-size: 12px;
    font-weight: 650;

    line-height: 1.3;
}


.modal
input:not([type="checkbox"])
:not([type="radio"])
:not([type="range"])
:not([type="color"]),

.modal select,

.modal textarea {

    width: 100%;

    min-height: 46px;

    box-sizing: border-box;

    padding:
        11px
        13px;

    color:
        var(--chb-modal-text);

    background:
        rgba(2,6,11,.62);

    border:
        1px solid
        rgba(255,255,255,.105);

    border-radius:
        var(--chb-control-radius);

    outline: none;

    font: inherit;

    transition:
        border-color .16s ease,
        box-shadow .16s ease,
        background .16s ease;
}


.modal textarea {

    min-height: 110px;

    resize: vertical;
}


.modal
input:not([type="checkbox"])
:not([type="radio"])
:not([type="range"])
:not([type="color"]):hover,

.modal select:hover,

.modal textarea:hover {

    border-color:
        rgba(255,255,255,.17);
}


.modal
input:not([type="checkbox"])
:not([type="radio"])
:not([type="range"])
:not([type="color"]):focus,

.modal select:focus,

.modal textarea:focus {

    border-color:
        rgba(22,131,255,.82);

    background:
        rgba(4,11,18,.86);

    box-shadow:
        0 0 0 3px
        rgba(22,131,255,.12);
}


.modal input::placeholder,
.modal textarea::placeholder {

    color:
        rgba(140,155,173,.55);
}


/* ------------------------------------------------------------
   OTP
------------------------------------------------------------ */

#unclaimSecurityCode {

    min-height: 54px;

    text-align: center;

    font-size: 22px;
    font-weight: 750;

    letter-spacing: .30em;

    font-variant-numeric:
        tabular-nums;
}


#unclaimCodeCountdown {

    display: inline-block;

    min-width: 57px;

    margin-left: 3px;

    padding:
        2px
        7px;

    color:
        var(--chb-modal-cyan);

    background:
        rgba(57,207,255,.07);

    border:
        1px solid
        rgba(57,207,255,.12);

    border-radius: 999px;

    font-variant-numeric:
        tabular-nums;

    text-align: center;
}


/* ------------------------------------------------------------
   MESSAGES
------------------------------------------------------------ */

.modal .form-message {

    min-height: 0;

    margin-top: 14px;

    color:
        var(--chb-modal-red);

    font-size: 12px;

    line-height: 1.5;
}


.modal .form-message:not(:empty) {

    padding:
        10px
        12px;

    background:
        rgba(255,100,100,.065);

    border:
        1px solid
        rgba(255,100,100,.14);

    border-radius: 10px;
}


.modal .form-message.success {

    color:
        var(--chb-modal-green);

    background:
        rgba(49,208,129,.065);

    border-color:
        rgba(49,208,129,.15);
}


/* ------------------------------------------------------------
   ACTIONS
------------------------------------------------------------ */

.modal .modal-actions {

    display: flex;
    align-items: center;
    justify-content: flex-end;

    flex-wrap: wrap;

    gap: 10px;

    margin-top: 24px;
    padding-top: 18px;

    border-top:
        1px solid
        var(--chb-modal-border);
}


.modal .modal-primary,
.modal .modal-secondary {

    min-height: 42px;

    padding:
        10px
        16px;

    border-radius: 11px;

    font-size: 13px;
    font-weight: 700;

    line-height: 1;

    cursor: pointer;

    transition:
        transform .14s ease,
        border-color .16s ease,
        background .16s ease,
        box-shadow .16s ease,
        opacity .16s ease;
}


.modal .modal-primary {

    color: #fff;

    border:
        1px solid
        rgba(57,207,255,.15);

    background:
        linear-gradient(
            135deg,
            var(--chb-modal-blue),
            #076ee8
        );

    box-shadow:
        0 8px 24px
        rgba(22,131,255,.20);
}


.modal .modal-primary:hover:not(:disabled) {

    transform:
        translateY(-1px);

    box-shadow:
        0 10px 30px
        rgba(22,131,255,.28);
}


.modal .modal-secondary {

    color:
        #c6d1de;

    border:
        1px solid
        rgba(255,255,255,.10);

    background:
        rgba(255,255,255,.025);
}


.modal .modal-secondary:hover:not(:disabled) {

    color:
        var(--chb-modal-text);

    border-color:
        rgba(255,255,255,.18);

    background:
        rgba(255,255,255,.055);
}


.modal
.modal-primary:active:not(:disabled),

.modal
.modal-secondary:active:not(:disabled) {

    transform: scale(.98);
}


.modal button:disabled {

    cursor:
        not-allowed;

    opacity: .46;
}


/* ------------------------------------------------------------
   SMALL INLINE ACTION / RESEND
------------------------------------------------------------ */

.modal .chb-modal-link {

    appearance: none;

    margin-right: auto;

    padding: 4px 1px;

    color:
        var(--chb-modal-cyan);

    border: 0;

    background:
        transparent;

    font-size: 12px;
    font-weight: 650;

    line-height: 1.3;

    text-decoration: none;

    cursor: pointer;

    transition:
        color .16s ease,
        opacity .16s ease;
}


.modal
.chb-modal-link:hover:not(:disabled) {

    color: #82e6ff;

    text-decoration: underline;

    text-underline-offset: 3px;
}


.modal .chb-modal-link:disabled {

    color:
        var(--chb-modal-muted);

    opacity: .42;

    cursor:
        not-allowed;

    text-decoration: none;
}


/* ------------------------------------------------------------
   ANIMATIONS
------------------------------------------------------------ */

@keyframes chbModalBackdropIn {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


@keyframes chbModalPanelIn {

    from {
        opacity: 0;

        transform:
            translateY(8px)
            scale(.985);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}


/* ------------------------------------------------------------
   MOBILE
------------------------------------------------------------ */

@media (max-width: 600px) {

    .modal-backdrop {

        align-items:
            flex-end;

        padding:
            12px;
    }


    .modal.chb-modal {

        width: 100%;

        max-height:
            calc(
                100dvh
                - 24px
            );

        border-radius:
            20px;
    }


    .modal .modal-header {

        padding:
            21px
            20px
            17px;
    }


    .chb-modal-body {

        padding:
            19px
            20px
            calc(
                20px
                + env(
                    safe-area-inset-bottom
                )
            );
    }


    .modal .modal-header h2 {

        font-size: 21px;
    }


    .modal .modal-actions {

        gap: 9px;
    }


    .modal .modal-primary,
    .modal .modal-secondary {

        flex:
            1 1
            140px;

        min-height:
            45px;
    }


    .modal .chb-modal-link {

        flex:
            1 0
            100%;

        order: -1;

        margin:
            0
            0
            2px;

        text-align: left;
    }

}


/* ------------------------------------------------------------
   ACCESSIBILITY
------------------------------------------------------------ */

@media (
    prefers-reduced-motion:
    reduce
) {

    .modal-backdrop,
    .modal.chb-modal {

        animation: none;
    }


    .modal *,
    .modal *::before,
    .modal *::after {

        transition-duration:
            .01ms !important;
    }

}



/* CHB HOME V2 */
.chb-new-home{display:grid;gap:18px;max-width:1100px}
.chb-home-welcome,.chb-home-account,.chb-home-links a{
 background:#08121d;border:1px solid rgba(255,255,255,.09);
 border-radius:16px}
.chb-home-welcome{padding:28px;background:linear-gradient(120deg,#0c1825,#08121d)}
.chb-home-welcome span{color:#39cfff;font-size:11px;letter-spacing:1.5px;font-weight:700}
.chb-home-welcome h2{color:#f4f7fb;font-size:26px;margin:12px 0 8px}
.chb-home-welcome p{color:#8c9bad;margin:0;line-height:1.6}
.chb-home-account{padding:24px}
.chb-home-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}
.chb-home-heading h3{color:#f4f7fb;margin:0;font-size:17px}
.chb-home-heading a{color:#39cfff;text-decoration:none;font-size:13px}
.chb-home-info{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin-top:25px}
.chb-home-info div{min-width:0}
.chb-home-info small{display:block;color:#8c9bad;font-size:11px;margin-bottom:9px}
.chb-home-info strong{display:block;color:#f4f7fb;font-size:14px;overflow-wrap:anywhere}
.chb-home-links{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.chb-home-links a{padding:20px;color:#f4f7fb;text-decoration:none;display:flex;justify-content:space-between;gap:10px}
.chb-home-links a span{color:#39cfff}
.chb-home-links a:hover,.chb-home-links a:focus-visible{border-color:#1683ff}
@media(max-width:700px){
 .chb-home-info,.chb-home-links{grid-template-columns:1fr}
 .chb-home-welcome,.chb-home-account{padding:20px}
 .chb-home-welcome h2{font-size:22px}
}
