﻿.cbm-page {
    --ink: #172b4b;
    --muted: #7b8da5;
    --border: #deE8f6;
    --blue: #2458ad;
    font-family: Inter,system-ui,sans-serif;
    color: var(--ink);
    background: #f6f9fe;
    min-height: 100%;
    padding: 15px
}

    .cbm-page * {
        box-sizing: border-box
    }

.cbm-shell {
    max-width: 1760px;
    margin: auto;
    display: grid;
    gap: 14px
}

.cbm-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 130px;
    border-radius: 22px;
    padding: 23px 30px;
    color: white;
    background: linear-gradient(115deg,#0c2144,#193d76 65%,#3474d0);
    box-shadow: 0 18px 36px #1b477e30
}

.cbm-hero__symbol {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    font-size: 28px;
    border-radius: 17px;
    border: 1px solid #ffffff45;
    background: #ffffff18;
    flex-shrink: 0
}

.cbm-hero h1 {
    margin: 6px 0;
    font-size: clamp(19px,2vw,29px);
    letter-spacing: -.035em
}

.cbm-hero p {
    margin: 0;
    font-size: 12px;
    color: #d4e5ff
}

.cbm-eyebrow {
    font-size: 10px;
    letter-spacing: .15em;
    font-weight: 850;
    color: #abd0fe
}

.cbm-hero__art {
    position: absolute;
    right: -12px;
    top: -65px;
    height: 240px;
    width: 360px;
    opacity: .35;
    pointer-events: none
}

    .cbm-hero__art::before, .cbm-hero__art::after {
        content: "";
        position: absolute;
        top: 34px;
        left: 65px;
        width: 180px;
        height: 180px;
        border: 1px solid #b9e6ff;
        border-radius: 50%
    }

    .cbm-hero__art::after {
        top: 6px;
        left: 37px;
        width: 235px;
        height: 235px
    }

    .cbm-hero__art span {
        position: absolute;
        height: 10px;
        width: 10px;
        background: #b8f4f0;
        border-radius: 50%
    }

        .cbm-hero__art span:nth-child(1) {
            top: 40px;
            left: 150px
        }

        .cbm-hero__art span:nth-child(2) {
            top: 145px;
            left: 72px
        }

        .cbm-hero__art span:nth-child(3) {
            top: 196px;
            left: 180px
        }

        .cbm-hero__art span:nth-child(4) {
            top: 106px;
            left: 265px
        }

.cbm-workspace {
    border: 1px solid var(--border);
    border-radius: 21px;
    overflow: hidden;
    background: white;
    box-shadow: 0 8px 35px #132e5c0b
}

.cbm-stepbar {
    display: grid;
    grid-template-columns: minmax(200px,1fr) minmax(200px,1fr) minmax(180px,.8fr);
    gap: 16px;
    align-items: end;
    padding: 20px;
    border-bottom: 1px solid var(--border)
}

.cbm-field {
    display: grid;
    gap: 7px;
    min-width: 0
}

    .cbm-field label {
        font-size: 11px;
        letter-spacing: .02em;
        font-weight: 850;
        color: #435c7b
    }

        .cbm-field label span {
            margin-right: 8px;
            color: #2563eb;
            font-size: 10px
        }

.cbm-control {
    height: 42px;
    padding: 0 13px;
    border: 1px solid #d8e4f2;
    border-radius: 11px;
    color: var(--ink);
    background: white;
    font: inherit;
    font-size: 12px;
    outline: none;
    width: 100%;
    min-width: 0
}

    .cbm-control:focus, .cbm-search:focus-within {
        border-color: #75aaff;
        box-shadow: 0 0 0 3px #3b82f614
    }

.cbm-stepbar__help {
    border-left: 2px solid #79aefe;
    padding: 4px 0 4px 13px;
    display: grid;
    gap: 5px
}

    .cbm-stepbar__help strong {
        font-size: 12px
    }

    .cbm-stepbar__help small {
        font-size: 10px;
        color: var(--muted);
        line-height: 1.5
    }

.cbm-toolbar {
    padding: 13px 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    border-bottom: 1px solid #ebf1f9
}

.cbm-search {
    width: clamp(185px,25vw,360px);
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    height: 40px;
    border-radius: 11px;
    border: 1px solid #d9e4f1
}

    .cbm-search span {
        font-size: 22px;
        color: #8da2bd
    }

.cbm-search__input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    font: inherit;
    font-size: 12px
}

.cbm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 39px;
    padding: 0 13px;
    background: white;
    border: 1px solid #dce6f2;
    color: #34506e;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-weight: 780;
    font-size: 11px;
    transition: background .16s,box-shadow .16s,transform .16s
}

    .cbm-btn:hover:not(:disabled) {
        background: #f3f8ff;
        box-shadow: 0 6px 15px #1b457a15;
        transform: translateY(-1px)
    }

    .cbm-btn:disabled {
        opacity: .5;
        cursor: not-allowed
    }

.cbm-btn--primary {
    background: #245bc0;
    border-color: #245bc0;
    color: white
}

    .cbm-btn--primary:hover:not(:disabled) {
        background: #154aab;
        color: white
    }

.cbm-btn--action {
    background: linear-gradient(120deg,#0c2e68,#276bd4);
    color: white;
    border: 0;
    box-shadow: 0 9px 20px #174f9a2a
}

    .cbm-btn--action:hover:not(:disabled) {
        background: linear-gradient(120deg,#113f85,#337de6);
        color: white
    }

.cbm-btn--muted {
    color: #8a9bad
}

.cbm-filter {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    color: #526b88;
    white-space: nowrap
}

    .cbm-filter input, .cbm-check {
        width: 16px;
        height: 16px;
        accent-color: #2c63c1
    }

.cbm-control--filter {
    width: 230px;
    max-width: 100%
}

.cbm-mini-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 10px 20px;
    border-bottom: 1px solid #edf2fa
}

    .cbm-mini-stats span {
        display: inline-flex;
        gap: 5px;
        align-items: center;
        padding: 5px 10px;
        border-radius: 999px;
        border: 1px solid #dce8fa;
        background: #f4f8ff;
        color: #45648a;
        font-size: 10px
    }

    .cbm-mini-stats b {
        color: #173e77
    }

.cbm-selection-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 20px;
    background: #fafcff;
    border-bottom: 1px solid #e6eff9
}

.cbm-selection-tools__spacer {
    flex: 1
}

.cbm-table-scroll {
    overflow: auto;
    max-height: 56vh;
    scrollbar-width: thin
}

.cbm-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 750px;
    font-size: 12px
}

    .cbm-table th {
        text-align: left;
        position: sticky;
        top: 0;
        z-index: 1;
        padding: 14px 12px;
        background: #f3f7fe;
        color: #6b809e;
        font-size: 10px;
        letter-spacing: .06em;
        text-transform: uppercase;
        border-bottom: 1px solid #dce7f5
    }

    .cbm-table td {
        padding: 12px;
        border-bottom: 1px solid #edf1f8
    }

    .cbm-table tr:hover td {
        background: #f7faff
    }

    .cbm-table tr.is-selected td {
        background: #eff6ff
    }

    .cbm-table td strong {
        display: block;
        font-weight: 800;
        color: #233954
    }

    .cbm-table td small {
        display: block;
        color: #97a6ba;
        margin-top: 4px;
        font-size: 10px
    }

.cbm-pill, .cbm-status {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #e1e9f3;
    font-size: 10px;
    color: #77899f;
    background: #f8fafc;
    font-weight: 750;
    white-space: nowrap
}

.cbm-pill--blue {
    background: #ebf4ff;
    border-color: #c8deff;
    color: #1b58ac
}

.cbm-status--active {
    background: #ecfbf4;
    color: #12805b;
    border-color: #c9f1df
}

.cbm-empty {
    padding: 45px 16px;
    text-align: center;
    color: #96a7bb;
    font-size: 12px
}

.cbm-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 13px;
    padding: 13px 20px;
    font-size: 11px;
    color: #7f91ab
}

    .cbm-pagination div {
        display: flex;
        align-items: center;
        gap: 10px
    }

.cbm-notice {
    padding: 13px 17px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 650
}

.cbm-notice--error {
    background: #fff3f3;
    border: 1px solid #fecaca;
    color: #b91c1c
}

.cbm-notice--success {
    background: #eafbf4;
    border: 1px solid #a7e8cf;
    color: #047857
}

.cbm-overlay {
    position: fixed;
    z-index: 2500;
    inset: 0;
    background: #071a3599;
    backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    padding: 15px
}

.cbm-modal {
    background: white;
    width: min(96vw,950px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    border-radius: 23px;
    overflow: hidden;
    box-shadow: 0 35px 110px #071a3570
}

.cbm-modal__header {
    background: linear-gradient(120deg,#102d5b,#245cb2);
    color: white;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 21px 25px
}

    .cbm-modal__header h2 {
        font-size: 21px;
        letter-spacing: -.025em;
        margin: 7px 0
    }

    .cbm-modal__header p {
        font-size: 12px;
        color: #d9e7ff;
        margin: 0
    }

.cbm-modal__close {
    width: 34px;
    height: 34px;
    border: 1px solid #ffffff40;
    border-radius: 11px;
    background: #ffffff18;
    color: white;
    cursor: pointer
}

.cbm-modal__body {
    overflow: auto;
    min-height: 0;
    display: grid;
    gap: 14px;
    padding: 20px 25px
}

.cbm-review-stats {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 8px
}

    .cbm-review-stats span {
        display: grid;
        gap: 3px;
        padding: 12px;
        background: #f4f8ff;
        border: 1px solid #e1eafa;
        border-radius: 12px;
        color: #677c9a;
        font-size: 10px
    }

    .cbm-review-stats b {
        color: #163d77;
        font-size: 20px
    }

.cbm-modal__tools {
    display: flex;
    align-items: center;
    gap: 12px
}

    .cbm-modal__tools span {
        font-size: 10px;
        white-space: nowrap;
        color: #8596ab
    }

.cbm-review-list {
    border: 1px solid #e4ebf5;
    border-radius: 12px;
    overflow: auto;
    max-height: 32vh
}

.cbm-review-item {
    padding: 10px 13px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eef3fa
}

    .cbm-review-item strong {
        font-size: 11px;
        display: block
    }

    .cbm-review-item small {
        font-size: 10px;
        display: block;
        margin-top: 4px;
        color: #94a3b8
    }

.cbm-remove {
    background: #fff1f2;
    border: 1px solid #ffe0e5;
    color: #b42338;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    padding: 7px 10px;
    font-size: 10px
}

.cbm-control--textarea {
    padding: 12px;
    min-height: 82px;
    resize: vertical
}

.cbm-field > small {
    color: #8b9ab0;
    font-size: 10px
}

.cbm-modal__footer {
    display: flex;
    gap: 9px;
    justify-content: flex-end;
    padding: 15px 25px;
    border-top: 1px solid #e9f0f9;
    background: #fafcff
}

@media(max-width:850px) {
    .cbm-stepbar {
        grid-template-columns: 1fr 1fr
    }

    .cbm-stepbar__help {
        grid-column: 1/-1
    }

    .cbm-hero__art {
        display: none
    }
}

@media(max-width:570px) {
    .cbm-page {
        padding: 9px
    }

    .cbm-hero {
        padding: 18px;
        border-radius: 16px
    }

    .cbm-stepbar {
        grid-template-columns: 1fr;
        padding: 13px
    }

    .cbm-stepbar__help {
        grid-column: auto
    }

    .cbm-search {
        width: 100%
    }

    .cbm-toolbar, .cbm-selection-tools, .cbm-mini-stats {
        padding: 10px 12px
    }

    .cbm-pagination {
        flex-wrap: wrap;
        padding: 12px
    }

    .cbm-review-stats {
        grid-template-columns: 1fr 1fr
    }

    .cbm-modal__header, .cbm-modal__body, .cbm-modal__footer {
        padding: 14px
    }
}

/* Cobertura comercial · Atelier Premium */
.cbm-coverage {
    border: 1px solid #dce7f5;
    background: linear-gradient(145deg,#fff,#f8fbff);
    border-radius: 19px;
    box-shadow: 0 9px 35px #0f2c5510;
    padding: 20px 23px;
    display: grid;
    gap: 14px
}

.cbm-coverage__intro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap
}

    .cbm-coverage__intro h2 {
        font-size: 17px;
        letter-spacing: -.025em;
        margin: 5px 0;
        color: #173056
    }

    .cbm-coverage__intro p {
        font-size: 11px;
        color: #71839c;
        margin: 0;
        line-height: 1.6
    }

.cbm-coverage__actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap
}

.cbm-coverage__metrics {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

    .cbm-coverage__metrics span {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        border: 1px solid #dbe7f4;
        border-radius: 999px;
        background: #fff;
        padding: 7px 12px;
        font-size: 11px;
        color: #64748b
    }

    .cbm-coverage__metrics b {
        color: #1a3663;
        font-size: 13px;
        font-variant-numeric: tabular-nums
    }

    .cbm-coverage__metrics .cbm-coverage__pending {
        background: #fff7ed;
        border-color: #fed7aa;
        color: #92400e
    }

.cbm-coverage__details {
    border: 1px solid #e1eaf5;
    border-radius: 12px;
    overflow: hidden
}

    .cbm-coverage__details summary {
        padding: 12px 15px;
        font-size: 12px;
        font-weight: 750;
        color: #234473;
        cursor: pointer;
        background: #f7faff
    }

.cbm-coverage__scroll {
    max-height: 300px;
    overflow: auto
}

    .cbm-coverage__scroll table {
        width: 100%;
        border-collapse: collapse;
        font-size: 11px
    }

    .cbm-coverage__scroll th, .cbm-coverage__scroll td {
        padding: 11px 14px;
        border-bottom: 1px solid #edf2f8;
        text-align: left
    }

    .cbm-coverage__scroll th {
        color: #64748b;
        background: #fafcff;
        position: sticky;
        top: 0
    }

.cbm-coverage__hint, .cbm-coverage__note {
    font-size: 11px;
    color: #73849d;
    line-height: 1.55
}

.cbm-modal--coverage {
    max-width: 600px
}

@media(max-width:640px) {
    .cbm-coverage {
        padding: 14px
    }

    .cbm-coverage__actions {
        width: 100%
    }

        .cbm-coverage__actions button {
            flex: 1
        }

    .cbm-coverage__metrics span {
        font-size: 10px
    }
}


/* ========= NUEVA CATEGORIA · MODAL ========= */
/* Complemento visual para creación de categoría en Matriz Comercial. */
.cbm-hero__actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    position: relative;
    z-index: 2;
}

.cbm-btn--new-category {
    background: #fff;
    color: #163b78;
    border: 1px solid rgba(255,255,255,.8);
    box-shadow: 0 12px 28px rgba(7,20,51,.13);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    white-space: nowrap;
    border-radius: 11px;
    min-height: 41px;
    padding: 0 15px;
}

    .cbm-btn--new-category:hover:not(:disabled) {
        background: #eaf3ff;
        transform: translateY(-1px);
    }

.cbm-category-modal {
    width: min(94vw,580px);
}

.cbm-category-modal__body {
    display: grid;
    gap: 18px;
}

.cbm-category-modal__columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: end;
}

.cbm-category-modal__active {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    border: 1px solid #dce7f5;
    background: #f7faff;
    border-radius: 10px;
    padding: 10px;
}

    .cbm-category-modal__active input {
        accent-color: #2563eb;
        width: 17px;
        height: 17px;
    }

.cbm-category-modal__note {
    background: #edf5ff;
    border: 1px solid #d5e8ff;
    color: #315785;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 11px;
    line-height: 1.7;
}

@media(max-width:740px) {
    .cbm-hero__actions {
        width: 100%;
        margin-left: 0;
    }

    .cbm-btn--new-category {
        width: 100%;
        justify-content: center;
    }

    .cbm-category-modal__columns {
        grid-template-columns: 1fr;
    }
}

/* Acceso al nuevo maestro de categorías */
.cbm-hero__actions a {
    text-decoration: none
}
