:root {
    --asx-brand: #093a8e;
    --asx-brand-dark: #062a67;
}

[hidden] {
    display: none !important;
}

.asx-control .navbar-logo {
    width: 44px;
    height: auto;
    object-fit: contain;
}

.asx-control .theme-text .nav-link {
    color: var(--asx-brand) !important;
    font-weight: 800;
}

.asx-avatar,
.asx-sidebar-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--asx-brand);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.asx-sidebar-avatar {
    width: 48px;
    height: 48px;
}

.asx-denied {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #f1f2f3;
}

.asx-denied .widget {
    width: min(100%, 460px);
}

.asx-section {
    display: none;
}

.asx-section.active {
    display: block;
}

.alert[data-global-message] {
    font-weight: 700;
}

.alert[data-global-message].is-error {
    color: #e7515a;
    background: rgba(231, 81, 90, 0.12);
}

.asx-kpi .widget-content {
    min-height: 138px;
}

.asx-kpi .w-value {
    margin-bottom: 12px;
    color: #0e1726;
    font-size: 32px;
    font-weight: 800;
}

.asx-kpi .w-title {
    color: #888ea8;
    font-size: 14px;
    font-weight: 700;
}

.status-bars,
.top-list,
.stats-list {
    display: grid;
    gap: 14px;
}

.bar-row {
    display: grid;
    grid-template-columns: 135px minmax(0, 1fr) 48px;
    gap: 12px;
    align-items: center;
    color: #888ea8;
    font-size: 13px;
    font-weight: 700;
}

.bar-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e0e6ed;
}

.bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--asx-brand), #4361ee);
}

.top-list article,
.stats-list article {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e6ed;
    color: #515365;
    font-weight: 700;
}

.top-list p,
.simple-chart p {
    margin: 0;
    color: #888ea8;
}

.review-list {
    display: grid;
    gap: 10px;
    max-height: 680px;
    overflow: auto;
}

.review-item {
    width: 100%;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    color: #3b3f5c;
    text-align: left;
}

.review-item:hover,
.review-item.active {
    border-color: var(--asx-brand);
    background: #f5f8ff;
}

.review-item strong,
.review-item p {
    display: block;
    margin: 0 0 8px;
}

.review-item p {
    color: #888ea8;
    font-size: 13px;
}

.review-detail {
    min-height: 540px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 16px;
    background: #f8f9fa;
}

.review-detail iframe {
    width: 100%;
    min-height: 360px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    background: #fff;
}

.review-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.review-actions textarea {
    min-height: 96px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 12px;
    resize: vertical;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 9px;
    background: #fff4df;
    color: #b66a00;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.status-aprobada {
    background: rgba(0, 171, 85, 0.12);
    color: #00ab55;
}

.status-rechazada {
    background: rgba(231, 81, 90, 0.12);
    color: #e7515a;
}

.simple-chart {
    display: flex;
    align-items: end;
    gap: 7px;
    min-height: 260px;
    padding-top: 20px;
}

.chart-bar {
    flex: 1;
    min-width: 10px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #4361ee, var(--asx-brand));
}

.table .btn {
    margin: 2px;
}

.form-check-primary .form-check-input:checked,
.btn-primary {
    border-color: var(--asx-brand) !important;
    background-color: var(--asx-brand) !important;
}

/* Editor de HTML del alta de landings */
.asx-code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    line-height: 1.55;
    background: #0e1726;
    color: #e0e6ed;
    border: 1px solid #1b2e4b;
    resize: vertical;
}

.asx-code:focus {
    background: #0e1726;
    color: #e0e6ed;
    border-color: #4361ee;
}

/* Tabs de la revision (publicada vs cambios propuestos) */
.review-tabs {
    margin-bottom: 12px;
}

.review-detail iframe {
    min-height: 460px;
}

/* Catalogo de bloques del editor */
.block-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
    background: #f8faff;
    padding: 4px;
}

.block-icon-empty {
    display: grid;
    place-items: center;
    color: #4361ee;
    font-size: 16px;
}

.block-editor-panel,
.landing-editor-panel {
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    background: #f8faff;
}

.blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Selector de cobertura geografica (Control + editor del dueño) */
.coverage-picker {
    padding: 14px 16px;
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    background: #fff;
}

.coverage-cities-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    background: #f8faff;
}

.coverage-city-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: 6px;
    font-size: 13px;
}

.coverage-city-item:hover {
    background: rgba(67, 97, 238, 0.08);
}

.coverage-city-item input {
    margin: 0;
}

.coverage-city-item span {
    color: #888ea8;
    font-size: 11.5px;
}

.coverage-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(67, 97, 238, 0.1);
    color: #4361ee;
    font-size: 11.5px;
    font-weight: 800;
}

body.dark .coverage-picker {
    background: #1b2e4b;
    border-color: #0e1726;
}

body.dark .coverage-cities-list {
    background: #0e1726;
    border-color: #0e1726;
}

.blocks-empty {
    grid-column: 1 / -1;
}

.block-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.block-card:hover {
    border-color: #4361ee;
    box-shadow: 0 8px 22px rgba(14, 23, 38, 0.1);
}

.block-card.is-inactive {
    opacity: .6;
}

.block-card-preview {
    height: 120px;
    overflow: hidden;
    background: #f1f3f9;
    border-bottom: 1px solid #e0e6ed;
}

.block-card-preview iframe {
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
}

.block-card-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 6px;
}

.block-card-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.block-card-copy strong {
    color: #0e1726;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.block-card-copy span {
    color: #888ea8;
    font-size: 12px;
}

.block-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px 14px;
}

/* Submenu (Landing page > Validacion / Bloques) */
.menu-categories .submenu a.active {
    color: #4361ee;
    font-weight: 800;
}

body.dark .block-icon,
body.dark .block-editor-panel,
body.dark .landing-editor-panel,
body.dark .block-card {
    border-color: #1b2e4b;
    background: #1b2e4b;
}

body.dark .block-card-preview {
    background: #0e1726;
    border-color: #0e1726;
}

body.dark .block-card-copy strong {
    color: #e0e6ed;
}

/* Banners de categoria */
.banner-thumb {
    width: 96px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
    background: #f1f2f3;
}

/* Modo oscuro (toggle de tema CORK) */
body.dark .review-item {
    background: #1b2e4b;
    border-color: #1b2e4b;
    color: #e0e6ed;
}

body.dark .review-item:hover,
body.dark .review-item.active {
    border-color: #4361ee;
    background: #0e1726;
}

body.dark .review-detail {
    background: #0e1726;
    border-color: #1b2e4b;
}

body.dark .bar-track {
    background: #1b2e4b;
}

body.dark .top-list article,
body.dark .stats-list article {
    border-color: #1b2e4b;
    color: #e0e6ed;
}

body.dark .banner-thumb {
    border-color: #1b2e4b;
    background: #1b2e4b;
}

@media (max-width: 991px) {
    .review-detail {
        margin-top: 16px;
    }
}

/* Icono cuadrado (1:1) de categoria: vista previa en el formulario y la tabla. */
.category-icon-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px dashed #c7cede;
    border-radius: 8px;
    background: #f6f8fc;
    overflow: hidden;
}

.category-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-icon-preview.is-empty::after {
    content: "1:1";
    font-size: 10px;
    font-weight: 700;
    color: #9aa6bf;
}

.category-icon-cell {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 6px;
    background: #f6f8fc;
}
