/* ===== Estrados Public (CSS limpio, sin duplicados) ===== */
.estrados-public {
    --iem-purple: #a10085;
    --iem-pink: #ff2e93;
    --bg: #ffffff;
    --muted: #6b7280;
    --border: #ececec;
    --shadow: 0 10px 26px rgba(0, 0, 0, .10);
    --radius: 22px;

    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 14px 28px;
}

/* Header */
.estrados-header {
    text-align: center;
    margin: 6px auto 18px;
}

.estrados-title {
    margin: 0;
    font-weight: 800;
    letter-spacing: .5px;
    color: var(--iem-purple);
    font-size: clamp(1.4rem, 2.6vw, 2.1rem);
}

.estrados-divider {
    height: 3px;
    width: min(520px, 92%);
    margin: 10px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--iem-pink), var(--iem-purple));
    opacity: .9;
}

.estrados-subtitle {
    max-width: 760px;
    margin: 12px auto 0;
    color: #555;
    line-height: 1.55;
    font-size: .95rem;
}

/* Layout */
.estrados-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 22px;
    align-items: start;
}

/* Sidebar card */
.estrados-side {
    width: 100%;
}

.estrados-cats {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
}

/* Sidebar title */
.estrados-cats-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #111827;
    font-size: 1.02rem;
    margin: 2px 2px 12px;
}

.estrados-cats-title::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--iem-pink), var(--iem-purple));
    box-shadow: 0 6px 14px rgba(161, 0, 133, .18);
}

/* Category buttons (desktop) */
.estrados-cat {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: #f7f7f9;
    border-radius: 16px;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 10px 0;
    cursor: pointer;
    transition: transform .08s ease, border-color .15s ease, background .15s ease;
}

.estrados-cat:hover {
    transform: translateY(-1px);
    border-color: rgba(161, 0, 133, .20);
    background: #fafafa;
}

.estrados-cat .cat-name {
    font-weight: 800;
    color: #111827;
}

.estrados-cat .cat-total {
    font-size: .82rem;
    color: var(--muted);
}

.estrados-cat.is-active {
    background: #fde9f6;
    border-color: rgba(161, 0, 133, .35);
    box-shadow: 0 8px 18px rgba(161, 0, 133, .14);
    position: relative;
}

.estrados-cat.is-active::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--iem-pink), var(--iem-purple));
}

/* Mobile dropdown (premium select) */
.estrados-cat-select-wrap {
    position: relative;
    margin-top: 10px;
}

.estrados-cat-select-wrap::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: linear-gradient(90deg, var(--iem-pink), var(--iem-purple));
    opacity: .65;
    pointer-events: none;
}

.estrados-cat-select-wrap::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(161, 0, 133, .85);
    border-bottom: 2px solid rgba(161, 0, 133, .85);
    transform: translateY(-60%) rotate(45deg);
    pointer-events: none;
}

.estrados-cat-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    width: 100%;
    padding: 12px 44px 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .75);
    background: #fff;
    color: #111827;
    font-weight: 900;
    letter-spacing: .2px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .10);
    position: relative;
    z-index: 1;
    cursor: pointer;
    outline: none;
    transition: transform .08s ease, box-shadow .15s ease;
}

.estrados-cat-select:hover {
    box-shadow: 0 14px 28px rgba(0, 0, 0, .12);
    transform: translateY(-1px);
}

.estrados-cat-select:focus {
    box-shadow: 0 0 0 4px rgba(161, 0, 133, .16), 0 14px 28px rgba(0, 0, 0, .12);
}

.estrados-cat-help {
    margin-top: 8px;
    padding-left: 2px;
    font-size: .82rem;
    color: var(--muted);
}

/* Main */
.estrados-main {
    width: 100%;
    min-width: 0;
}

/* Table card */
.estrados-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* No horizontal scroll needed (2 cols) */
.estrados-table-scroll {
    width: 100%;
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
}

/* Table (2 cols) */
.estrados-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 0;
    table-layout: fixed;
}

.estrados-table thead th {
    background: var(--iem-purple);
    color: #fff;
    font-weight: 800;
    font-size: .92rem;
    padding: 14px 14px;
    white-space: normal;
}

.estrados-table thead th:first-child,
.estrados-table tbody td:first-child {
    width: 70%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.estrados-table thead th:last-child,
.estrados-table tbody td:last-child {
    width: 30%;
    text-align: center;
}

.estrados-table thead th:first-child {
    border-top-left-radius: 18px;
}

.estrados-table thead th:last-child {
    border-top-right-radius: 18px;
}

.estrados-table tbody td {
    padding: 14px 14px;
    border-bottom: 1px solid #efefef;
    font-size: .95rem;
    color: #111827;
    vertical-align: middle;
    white-space: normal;
}

.estrados-table tbody tr:last-child td {
    border-bottom: 0;
}

/* Documento button base (button reset incluido) */
.estrados-docbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;

    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
}

/* Documento button (ojo SVG, estilo como ejemplo) */
.estrados-docbtn--eye {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 18px rgba(0, 0, 0, .10);

    color: var(--iem-pink);
    transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}

.estrados-docbtn--eye:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(0, 0, 0, .12);
    background: #f8fafc;
}

.estrados-docbtn--eye:active {
    transform: translateY(0);
    box-shadow: 0 8px 14px rgba(0, 0, 0, .10);
}

.estrados-docbtn--eye:focus {
    outline: none;
}

.estrados-docbtn--eye:focus-visible {
    box-shadow: 0 0 0 4px rgba(161, 0, 133, .16), 0 14px 24px rgba(0, 0, 0, .12);
}

/* SVG ojo */
.estrados-eye {
    width: 18px;
    height: 18px;
    display: block;
}

.estrados-eye path,
.estrados-eye circle {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Loading / errors */
.estrados-loading {
    padding: 10px;
    color: var(--muted);
}

.estrados-loading-td {
    padding: 14px;
    color: var(--muted);
}

.estrados-error {
    padding: 10px;
    color: #b42318;
}

.estrados-error-td {
    padding: 14px;
    color: #b42318;
}

.estrados-empty {
    padding: 14px;
    color: var(--muted);
}

.estrados-muted {
    color: var(--muted);
}

/* Pager */
.estrados-pager {
    margin-top: 14px;
}

.estrados-pager-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.estrados-pager-btn {
    border: 1px solid rgba(161, 0, 133, .25);
    background: #fff;
    color: var(--iem-purple);
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
}

.estrados-pager-btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

.estrados-pager-mid {
    color: #374151;
    font-weight: 700;
    font-size: .92rem;
}

/* ===== Modal ===== */
html.estrados-modal-open,
body.estrados-modal-open {
    overflow: hidden;
}

.estrados-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.estrados-modal.is-open {
    display: block;
}

.estrados-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .55);
    backdrop-filter: blur(2px);
}

.estrados-modal-dialog {
    position: relative;
    margin: min(3vh, 24px) auto;
    width: min(1100px, 94vw);
    height: min(86vh, 760px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
    overflow: hidden;
    border-top: 6px solid var(--iem-purple);
    display: flex;
    flex-direction: column;
}

.estrados-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #b83280;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.estrados-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    color: #fff;
    min-width: 0;
}

.estrados-modal-title #estradosModalTitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.estrados-modal-close {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    color: #fff;
    opacity: .9;
    padding: 2px 8px;
}

.estrados-modal-close:hover {
    opacity: 1;
    color: #fff;
}

.estrados-modal-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 380px 1fr;
}

.estrados-modal-left {
    padding: 14px;
    overflow: auto;
    border-right: 1px solid #f1f1f1;
    background: #fff;
}

.estrados-modal-right {
    padding: 14px;
    background: #fff;
    min-width: 0;
}

.estrados-modal-footer {
    padding: 12px 14px;
    border-top: 1px solid #f1f1f1;
    background: #fff;
    display: flex;
    justify-content: flex-end;
}

.estrados-modal-btn {
    border: 1px solid rgba(161, 0, 133, .25);
    background: #fff;
    color: var(--iem-purple);
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 900;
    cursor: pointer;
}

.estrados-modal-btn:hover {
    background: #fde9f6;
}

/* Meta (panel izquierdo) */
.estrados-meta-title {
    font-weight: 900;
    color: var(--iem-purple);
    margin: 2px 0 10px;
}

.estrados-meta-row {
    padding: 10px 0;
    border-bottom: 1px solid #f2f2f2;
}

.estrados-meta-label {
    font-weight: 900;
    color: var(--iem-purple);
    font-size: .88rem;
    margin-bottom: 4px;
}

.estrados-meta-value {
    color: #111827;
    font-size: .95rem;
    line-height: 1.35;
}

.estrados-meta-link {
    color: #0b57d0;
    text-decoration: none;
    font-weight: 800;
}

.estrados-meta-link:hover {
    text-decoration: underline;
}

.estrados-meta-sep {
    height: 1px;
    background: #f1c7e2;
    margin: 12px 0;
}

.estrados-meta-note {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-size: .9rem;
}

/* PDF viewer */
.estrados-pdf-wrap {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.estrados-pdf {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Responsive */
@media (max-width: 991px) {
    .estrados-layout {
        grid-template-columns: 1fr;
    }

    .estrados-cats .estrados-cat {
        display: none;
    }

    .estrados-modal-dialog {
        width: 96vw;
        height: 92vh;
        margin: 2vh auto;
        border-radius: 16px;
    }

    .estrados-modal-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .estrados-modal-left {
        border-right: 0;
        border-bottom: 1px solid #f1f1f1;
        max-height: 40vh;
    }

    .estrados-modal-right {
        padding-top: 10px;
    }
}

@media (min-width: 992px) {
    .estrados-cat-select-wrap {
        display: none;
    }
}

@media (max-width: 520px) {
    .estrados-public {
        padding: 14px 10px 22px;
    }

    .estrados-cats {
        padding: 12px;
    }

    .estrados-cat {
        padding: 11px 11px;
    }
}