/* Admin Empresas Explorer — layout app con sidebar */

.page-empresas-explorer {
    background: #eef1f6;
    min-height: calc(100vh - 120px);
    padding: 0;
    margin: 0 -15px;
}

.page-empresas-explorer .portal-footer {
    margin-top: 0;
}

.ex-app {
    display: flex;
    min-height: calc(100vh - 64px);
    font-family: "Montserrat", sans-serif;
}

/* ── Sidebar ── */

.ex-sidebar {
    width: 272px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #141824 0%, #1a2030 100%);
    color: #c8cdd8;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: flex-start;
    min-height: calc(100vh - 64px);
    z-index: 10;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
}

.ex-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ex-sidebar-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #00c693 0%, #00a3ff 100%);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    box-shadow: 0 4px 14px rgba(0, 198, 147, 0.35);
}

.ex-sidebar-brand strong {
    display: block;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ex-sidebar-brand small {
    color: #6b7589;
    font-size: 11px;
}

.ex-nav {
    padding: 16px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ex-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 9px;
    color: #9aa3b5;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.ex-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
}

.ex-nav-item.is-active {
    background: rgba(0, 198, 147, 0.14);
    color: #00e6a8;
    box-shadow: inset 3px 0 0 #00c693;
}

.ex-nav-item .glyphicon {
    font-size: 13px;
    opacity: 0.85;
}

.ex-sidebar-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px 16px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ex-sidebar-stat {
    text-align: center;
    padding: 11px 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.ex-sidebar-stat span {
    display: block;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
}

.ex-sidebar-stat small {
    color: #6b7589;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.ex-sidebar-stat--green span { color: #00e6a8; }
.ex-sidebar-stat--navy span { color: #7eb8ff; }

.ex-sidebar-presets {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
}

.ex-sidebar-presets h4 {
    color: #6b7589;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 10px;
    font-weight: 700;
}

.ex-preset-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: #b8c0d0;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.ex-preset-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
}

.ex-preset-link em {
    font-style: normal;
    color: #00e6a8;
    font-weight: 700;
    font-size: 11px;
}

.ex-sidebar-links {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ex-sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7589;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

.ex-sidebar-link:hover {
    color: #fff;
    text-decoration: none;
}

/* ── Main area ── */

.ex-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #eef1f6;
}

.ex-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 32px 18px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ex-topbar-title h1 {
    margin: 0;
    font-size: 23px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.ex-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ex-result-count {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.ex-result-count strong {
    color: #0f172a;
    font-weight: 800;
}

.ex-content {
    padding: 24px 32px 48px;
    flex: 1;
}

.ex-btn {
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
}

/* ── KPIs ── */

.ex-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.ex-kpi {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 20px 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.ex-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 15px;
    margin-bottom: 12px;
}

.ex-kpi-value {
    display: block;
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.ex-kpi-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    font-weight: 600;
}

.ex-kpi--accent .ex-kpi-icon { background: #ecfdf5; color: #00a67d; }
.ex-kpi--accent .ex-kpi-value { color: #00a67d; }
.ex-kpi--green .ex-kpi-icon { background: #ecfdf5; color: #059669; }
.ex-kpi--green .ex-kpi-value { color: #059669; }
.ex-kpi--navy .ex-kpi-icon { background: #eff6ff; color: #2563eb; }
.ex-kpi--navy .ex-kpi-value { color: #2563eb; }
.ex-kpi--teal .ex-kpi-icon { background: #f0fdfa; color: #0d9488; }
.ex-kpi--teal .ex-kpi-value { color: #0d9488; }

a.ex-kpi.ex-kpi--link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.ex-kpi.ex-kpi--link:hover,
a.ex-kpi.ex-kpi--link:focus {
    text-decoration: none;
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.ex-sidebar-search {
    display: flex;
    gap: 8px;
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ex-sidebar-search .form-control {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: none;
}

.ex-sidebar-search .form-control::placeholder {
    color: #6b7589;
}

.ex-sidebar-search .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 198, 147, 0.5);
    color: #fff;
}

.ex-dash-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}

.ex-dash-search .form-control {
    width: 220px;
}

.ex-comp-row--link {
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    padding: 4px 6px;
    margin: 0 -6px 10px;
    transition: background 0.12s ease;
}

.ex-comp-row--link:hover,
.ex-comp-row--link:focus {
    text-decoration: none;
    color: inherit;
    background: #f8fafc;
}

.ex-copyable {
    cursor: copy;
    border-radius: 4px;
    padding: 1px 4px;
    margin: 0 -4px;
    transition: background 0.12s ease, color 0.12s ease;
}

.ex-copyable:hover {
    background: #ecfdf5;
    color: #059669;
}

.ex-copyable.is-copied {
    background: #d1fae5;
    color: #047857;
}

#exCopyFilterUrl.is-copied {
    border-color: #00c693;
    color: #059669;
}

/* ── Preset cards (dashboard) ── */

.ex-card--presets {
    margin-bottom: 24px;
}

.ex-card-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.ex-preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px 20px 20px;
}

.ex-preset-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: #0f172a;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.ex-preset-card:hover {
    border-color: #00c693;
    box-shadow: 0 4px 16px rgba(0, 198, 147, 0.12);
    transform: translateY(-1px);
    text-decoration: none;
    color: #0f172a;
}

.ex-preset-card--warning .ex-preset-icon { background: #fff7ed; color: #ea580c; }
.ex-preset-card--danger .ex-preset-icon { background: #fef2f2; color: #dc2626; }
.ex-preset-card--muted .ex-preset-icon { background: #f1f5f9; color: #64748b; }

.ex-preset-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #ecfdf5;
    color: #00a67d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.ex-preset-label {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.ex-preset-count {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.ex-preset-count small {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
}

/* ── Completeness bars ── */

.ex-completeness {
    padding: 12px 20px 16px;
}

.ex-comp-row {
    display: grid;
    grid-template-columns: 90px 1fr 40px;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ex-comp-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.ex-comp-bar {
    height: 8px;
    background: #eef1f5;
    border-radius: 999px;
    overflow: hidden;
}

.ex-comp-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #00c693, #00e6a8);
    border-radius: 999px;
    transition: width 0.3s;
}

.ex-comp-pct {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
}

/* ── Cards ── */

.ex-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.ex-card--flush {
    border-radius: 14px;
}

.ex-card--side {
    display: flex;
    flex-direction: column;
}

.ex-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eef1f5;
}

.ex-card-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}

.ex-dash-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}

.ex-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ex-stats-intro {
    padding: 16px 20px;
    margin-bottom: 20px;
}

.ex-stats-intro p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* ── Active filter chips (compact) ── */

.ex-active-filters--compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0 16px 10px;
    max-height: 52px;
    overflow-y: auto;
}

.ex-active-filters--compact:empty {
    display: none;
    padding: 0;
}

.ex-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    color: #047857;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
}

.ex-chip:hover {
    background: #d1fae5;
    text-decoration: none;
    color: #047857;
}

.ex-chip--data {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.ex-chip--data:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.ex-chip--clear {
    background: transparent;
    border-color: #e2e8f0;
    color: #64748b;
}

.ex-chip--clear:hover {
    background: #f1f5f9;
    color: #334155;
}

.ex-chip-x {
    font-size: 13px;
    line-height: 1;
    opacity: 0.6;
}

/* ── Compact filter bar ── */

.ex-browse-form {
    margin: 0;
}

.ex-filter-bar {
    border-bottom: 1px solid #eef1f5;
    background: #fff;
}

.ex-filter-bar-main {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    flex-wrap: wrap;
}

.ex-filter-bar-main .ex-input-search {
    flex: 1;
    min-width: 160px;
    border-radius: 8px !important;
    border-color: #e2e8f0 !important;
    font-size: 13px !important;
    height: 36px !important;
    padding: 0 12px !important;
    box-shadow: none !important;
}

.ex-filter-bar-main .ex-input-search:focus {
    border-color: #00c693 !important;
    box-shadow: 0 0 0 2px rgba(0, 198, 147, 0.12) !important;
}

.ex-select-compact {
    width: auto !important;
    min-width: 110px;
    max-width: 160px;
    height: 36px !important;
    border-radius: 8px !important;
    border-color: #e2e8f0 !important;
    font-size: 12px !important;
    padding: 0 8px !important;
    color: #475569;
}

.ex-btn-more {
    height: 36px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 0 12px !important;
    white-space: nowrap;
    position: relative;
}

.ex-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #00c693;
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    margin-left: 2px;
}

.ex-btn-search {
    height: 36px !important;
    width: 36px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    flex-shrink: 0;
}

/* ── Filter drawer (slide-over) ── */

.ex-filter-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    visibility: hidden;
}

.ex-filter-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
}

.ex-filter-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    transition: opacity 0.2s;
}

.ex-filter-drawer.is-open .ex-filter-drawer-backdrop {
    opacity: 1;
}

.ex-filter-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(420px, 92vw);
    height: 100%;
    background: #fff;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.ex-filter-drawer.is-open .ex-filter-drawer-panel {
    transform: translateX(0);
}

body.ex-drawer-open {
    overflow: hidden;
}

.ex-filter-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eef1f5;
    flex-shrink: 0;
}

.ex-filter-drawer-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.ex-filter-drawer-close {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 20px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
}

.ex-filter-drawer-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ex-filter-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.ex-filter-drawer-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eef1f5;
    flex-shrink: 0;
    background: #fafbfc;
}

.ex-drawer-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef1f5;
}

.ex-drawer-field label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.ex-drawer-group {
    border: 1px solid #eef1f5;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.ex-drawer-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: #f8fafc;
    border: none;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-align: left;
    cursor: pointer;
}

.ex-drawer-group-head .ex-drawer-chevron {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
    color: #94a3b8;
}

.ex-drawer-group.is-open .ex-drawer-chevron {
    transform: rotate(180deg);
}

.ex-drawer-group-body {
    display: none;
    padding: 10px 12px 12px;
    border-top: 1px solid #eef1f5;
}

.ex-drawer-group.is-open .ex-drawer-group-body {
    display: block;
}

.ex-filter-chips--compact {
    gap: 6px;
}

.ex-filter-chip--sm span {
    padding: 5px 10px;
    font-size: 11px;
}

.ex-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ex-filter-chip {
    display: inline-flex;
    margin: 0;
    cursor: pointer;
}

.ex-filter-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ex-filter-chip span {
    display: inline-block;
    padding: 7px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    transition: all 0.15s;
    user-select: none;
}

.ex-filter-chip:hover span {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.ex-filter-chip.is-active span,
.ex-filter-chip input:checked + span {
    background: #ecfdf5;
    border-color: #00c693;
    color: #047857;
}

.ex-btn-apply {
    border-radius: 8px !important;
    font-weight: 700 !important;
}

.ex-limit-notice {
    padding: 10px 20px;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    color: #92400e;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Contact icons ── */

.ex-contact-icons {
    display: inline-flex;
    gap: 4px;
}

.ex-ci {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.ex-ci--on {
    background: #ecfdf5;
    color: #059669;
}

.ex-ci--off {
    background: #f1f5f9;
    color: #cbd5e1;
}

.ex-id {
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.ex-web-link {
    color: #00a67d;
    font-weight: 600;
}

.ex-contact-cell {
    font-size: 12px;
}

.ex-contact-line {
    display: block;
    line-height: 1.5;
}

.ex-btn-view {
    border-radius: 6px !important;
    font-weight: 600 !important;
}

/* ── Tables ── */

.ex-table-wrap {
    overflow-x: auto;
}

.ex-table {
    margin: 0;
    font-size: 13px;
}

.ex-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #64748b;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    padding: 11px 14px !important;
    white-space: nowrap;
}

.ex-table tbody td {
    padding: 12px 14px !important;
    vertical-align: middle !important;
    border-top: 1px solid #f1f5f9 !important;
    color: #334155;
}

.ex-table--compact tbody td {
    padding: 9px 14px !important;
}

.ex-table tbody tr:hover {
    background: #f8fafc;
}

.ex-table--clickable tbody td a {
    font-weight: 700;
    color: #00a67d;
}

.ex-pct-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.ex-muted {
    color: #94a3b8;
}

.ex-link {
    font-size: 13px;
    font-weight: 700;
    color: #00a67d;
}

/* ── Badges ── */

.ex-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.ex-badge--live {
    background: #dcfce7;
    color: #15803d;
}

.ex-badge--sold {
    background: #dbeafe;
    color: #1d4ed8;
}

.ex-badge--off {
    background: #f1f5f9;
    color: #64748b;
}

/* ── Rank list ── */

.ex-rank-list {
    list-style: none;
    margin: 0;
    padding: 12px 16px 16px;
}

.ex-rank-list li a {
    display: grid;
    grid-template-columns: 1fr 80px 36px;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    text-decoration: none;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
}

.ex-rank-list li a:hover {
    color: #00a67d;
}

.ex-rank-bar {
    height: 6px;
    background: #eef1f5;
    border-radius: 999px;
    overflow: hidden;
}

.ex-rank-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #00c693, #00e6a8);
    border-radius: 999px;
}

.ex-rank-count {
    text-align: right;
    font-weight: 800;
    color: #64748b;
    font-size: 12px;
}

.ex-rank-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Detail view ── */

.ex-detail-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}

.ex-detail-form {
    padding: 24px;
}

.ex-form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eef1f5;
}

.ex-form-section:last-of-type {
    border-bottom: none;
}

.ex-form-section h3 {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 16px;
}

.ex-form-footer {
    padding-top: 8px;
}

.ex-check {
    font-weight: 600;
    font-size: 13px;
    margin-right: 16px;
    cursor: pointer;
}

.ex-detail-aside .ex-card {
    padding: 16px 20px;
    margin-bottom: 16px;
}

.ex-detail-aside h4 {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 12px;
}

.ex-meta-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ex-meta-list li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #f0f2f5;
}

.ex-meta-list li:last-child {
    border-bottom: none;
}

.ex-meta-list li span {
    color: #64748b;
}

.ex-meta-list li strong {
    color: #0f172a;
    text-align: right;
    max-width: 60%;
}

.ex-link-block {
    display: block;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 700;
    color: #00a67d;
}

.ex-detail-quality {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ex-dq {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.ex-dq--ok {
    background: #ecfdf5;
    color: #047857;
}

.ex-dq--missing {
    background: #fef2f2;
    color: #b91c1c;
}

.ex-stat-list {
    list-style: none;
    margin: 0;
    padding: 12px 20px 16px;
}

.ex-stat-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #f0f2f5;
}

.ex-stat-list li span {
    color: #64748b;
}

.ex-stat-list li strong {
    color: #0f172a;
}

/* ── Quick presets strip ── */

.ex-quick-presets {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ex-quick-presets::-webkit-scrollbar {
    display: none;
}

.ex-quick-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.ex-quick-pill {
    flex-shrink: 0;
    padding: 4px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: all 0.15s;
}

.ex-quick-pill:hover {
    background: #ecfdf5;
    border-color: #00c693;
    color: #047857;
    text-decoration: none;
}

/* ── Score badge ── */

.ex-score {
    display: inline-block;
    min-width: 36px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.ex-score--high { background: #dcfce7; color: #15803d; }
.ex-score--mid { background: #fef9c3; color: #a16207; }
.ex-score--low { background: #fee2e2; color: #b91c1c; }

.ex-score-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: conic-gradient(#00c693 calc(var(--score) * 1%), #eef1f5 0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    position: relative;
}

.ex-score-ring::before {
    content: "";
    position: absolute;
    inset: 6px;
    background: #fff;
    border-radius: 50%;
}

.ex-score-ring span {
    position: relative;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

/* ── Table UX ── */

.ex-table-wrap--sticky {
    max-height: calc(100vh - 280px);
    overflow: auto;
}

.ex-table-wrap--sticky thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 #e2e8f0;
}

.ex-table--hover tbody tr.ex-row-link,
.ex-table--hover tbody tr.ex-row-click {
    cursor: pointer;
    transition: background 0.1s;
}

.ex-table--hover tbody tr.ex-row-link:hover,
.ex-table--hover tbody tr.ex-row-click:hover {
    background: #f0fdf9 !important;
}

.ex-sector-tag {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748b;
}

.ex-empty-state {
    text-align: center;
    padding: 48px 24px 56px;
}

.ex-empty-icon {
    font-size: 40px;
    color: #cbd5e1;
    display: block;
    margin-bottom: 12px;
}

.ex-empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.ex-empty-state p {
    color: #64748b;
    margin-bottom: 16px;
}

/* ── Breadcrumb ── */

.ex-breadcrumb {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.ex-breadcrumb a {
    color: #00a67d;
    text-decoration: none;
}

.ex-breadcrumb a:hover {
    text-decoration: underline;
}

.ex-bc-sep {
    color: #cbd5e1;
    margin: 0 6px;
}

.ex-bc-current {
    color: #94a3b8;
}

.ex-topbar-title h1 {
    font-size: 20px;
}

/* ── DataTables compact ── */

.ex-dt-top,
.ex-dt-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 12px;
    color: #64748b;
    background: #fafbfc;
    border-top: 1px solid #eef1f5;
}

.ex-dt-top {
    border-top: none;
    border-bottom: 1px solid #eef1f5;
    flex-wrap: wrap;
    gap: 8px;
}

.ex-dt-top .dataTables_length label,
.ex-dt-top .dataTables_filter label {
    margin: 0;
    font-weight: 600;
    font-size: 12px;
    color: #64748b;
}

.ex-dt-top .dataTables_filter input {
    width: 160px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    padding: 0 10px;
    font-size: 12px;
    margin-left: 6px;
}

.ex-dt-bottom .pagination {
    margin: 0;
}

.ex-dt-bottom .pagination > li > a {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px !important;
    margin: 0 2px;
}

/* ── Dashboard preset scroll ── */

.ex-preset-scroll {
    display: flex;
    gap: 10px;
    padding: 12px 16px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ex-preset-card--scroll {
    flex: 0 0 140px;
    min-height: 100px;
}

.ex-preset-card--scroll .ex-preset-count {
    font-size: 15px;
}

/* ── Mobile sidebar ── */

.ex-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00c693, #00a3ff);
    border: none;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 4px 20px rgba(0, 198, 147, 0.4);
    cursor: pointer;
}

.ex-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 998;
}

.ex-btn-nav {
    border-radius: 6px !important;
    padding: 2px 8px !important;
}

.page-empresas-explorer .portal-footer {
    display: none;
}

/* ── Responsive ── */

@media (max-width: 1199px) {
    .ex-preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991px) {
    .ex-app {
        flex-direction: column;
    }

    .ex-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ex-sidebar-backdrop.is-open {
        display: block;
    }

    .ex-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(280px, 85vw);
        min-height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 999;
    }

    .ex-sidebar.is-open {
        transform: translateX(0);
    }

    .ex-sidebar-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .ex-sidebar-presets {
        display: block;
    }

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

    .ex-dash-grid,
    .ex-stats-grid,
    .ex-detail-grid {
        grid-template-columns: 1fr;
    }

    .ex-preset-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ex-table-wrap--sticky {
        max-height: none;
    }
}

@media (max-width: 575px) {
    .ex-content {
        padding: 16px;
    }

    .ex-topbar {
        padding: 16px;
    }

    .ex-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ex-preset-grid {
        grid-template-columns: 1fr;
    }

    .ex-filter-bar-main {
        flex-wrap: wrap;
    }

    .ex-select-compact {
        flex: 1;
        min-width: calc(50% - 8px);
        max-width: none;
    }
}
