/* =========================================================
   Documentos Jurídicos — diseño institucional
   Paleta: navy #0B2D5C · azul #1456A0 · dorado #C99400 · fondo #F5F7FB
   ========================================================= */
:root {
    --doc-navy: #0B2D5C;
    --doc-navy-2: #0E3563;
    --doc-blue: #1456A0;
    --doc-blue-dark: #0F4483;
    --doc-gold: #C99400;
    --doc-gold-soft: #F5E7C1;
    --doc-bg: #F5F7FB;
    --doc-card: #FFFFFF;
    --doc-text: #1B2E4B;
    --doc-muted: #5D7091;
    --doc-border: #DCE5F0;
    --doc-shadow: 0 2px 10px rgba(11, 45, 92, .06);
    --doc-shadow-hover: 0 10px 26px rgba(11, 45, 92, .12);
}

* { box-sizing: border-box; }

body.doc-body {
    margin: 0;
    font-family: 'Poppins', 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    background: var(--doc-bg);
    color: var(--doc-text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ---------- Hero institucional ---------- */
.doc-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(115deg, #081E3D 0%, var(--doc-navy) 45%, #123E7C 100%);
    color: #fff;
    border-bottom: 3px solid var(--doc-gold);
}
.doc-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(520px 260px at 85% -40px, rgba(201, 148, 0, .22), transparent 60%),
        radial-gradient(700px 340px at 70% 120%, rgba(20, 86, 160, .45), transparent 60%),
        repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 2px, transparent 2px 14px);
    pointer-events: none;
}
.doc-hero::after {
    content: "";
    position: absolute;
    right: -120px;
    top: -120px;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(201, 148, 0, .35);
    border-radius: 50%;
    box-shadow: 0 0 0 40px rgba(201,148,0,.06), 0 0 0 90px rgba(255,255,255,.03);
    pointer-events: none;
}
.doc-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: 28px 60px 34px;
}
.doc-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    padding: 7px 13px;
    border-radius: 999px;
    transition: background .16s ease;
}
.doc-back:hover { background: rgba(255,255,255,.16); color: #fff; }
.doc-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--doc-gold-soft);
}
.doc-eyebrow::before {
    content: "";
    width: 34px;
    height: 2px;
    border-radius: 2px;
    background: var(--doc-gold);
}
.doc-hero-title {
    margin: 10px 0 0;
    font-size: clamp(30px, 3.4vw, 46px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.01em;
}
.doc-hero-title .white { color: #fff; }
.doc-hero-title .gold { color: var(--doc-gold); }
.doc-hero-desc {
    margin: 10px 0 0;
    max-width: 760px;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255,255,255,.82);
}
.doc-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}
.doc-crumb {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.16);
    padding: 6px 12px;
    border-radius: 999px;
}
.doc-crumb i { color: var(--doc-gold); font-size: 11px; }
.doc-crumb.current {
    background: var(--doc-gold);
    border-color: var(--doc-gold);
    color: #0B2D5C;
}
.doc-crumb.current i { color: #0B2D5C; }
.doc-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}
.doc-stat {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: rgba(255,255,255,.96);
    border-radius: 10px;
    padding: 8px 14px 8px 10px;
    font-size: 13px;
    color: var(--doc-navy);
}
.doc-stat i {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--doc-navy);
    color: #fff;
    font-size: 13px;
}
.doc-stat strong { font-weight: 800; }
.doc-stat span { color: var(--doc-muted); }

/* ---------- Layout ---------- */
.doc-main {
    flex: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 28px 60px 56px;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

/* ---------- Filtros ---------- */
.doc-filters-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 16px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--doc-navy);
    background: #fff;
    border: 1px solid var(--doc-border);
    border-radius: 12px;
    cursor: pointer;
    box-shadow: var(--doc-shadow);
}
.filter-card {
    background: #fff;
    border: 1px solid var(--doc-border);
    border-radius: 16px;
    box-shadow: var(--doc-shadow);
    overflow: hidden;
    position: sticky;
    top: 20px;
}
.filter-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--doc-navy) 0%, var(--doc-blue) 100%);
    color: #fff;
    border-bottom: 2px solid var(--doc-gold);
}
.filter-head-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.2);
    font-size: 15px;
}
.filter-head strong { font-size: 15px; font-weight: 700; }
.filter-head small { display: block; font-size: 11.5px; font-weight: 400; color: rgba(255,255,255,.75); }
.filter-clear {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.22);
    padding: 6px 11px;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
}
.filter-clear:hover { background: rgba(255,255,255,.22); }
.filter-body { padding: 6px 20px 20px; }
.filter-section { padding: 16px 0; border-bottom: 1px solid #EAF0F8; }
.filter-section:last-of-type { border-bottom: 0; }
.filter-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--doc-navy);
    margin: 0 0 12px;
}
.filter-title i { color: var(--doc-gold); font-size: 13px; }
.filter-title .count {
    margin-left: auto;
    font-size: 11px;
    background: #EEF3FA;
    color: var(--doc-blue);
    border-radius: 999px;
    padding: 2px 9px;
    letter-spacing: 0;
}
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: #33475F;
    cursor: pointer;
    padding: 7px 10px;
    border-radius: 9px;
    transition: background .14s ease;
}
.check-item:hover { background: #F2F6FC; }
.check-item input {
    appearance: none;
    width: 18px;
    height: 18px;
    flex: none;
    border: 1.5px solid #B9C7DC;
    border-radius: 6px;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    background: #fff;
    transition: all .14s ease;
}
.check-item input:checked {
    background: var(--doc-navy);
    border-color: var(--doc-navy);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}
.check-item .n {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--doc-blue);
    background: #EAF1FA;
    border-radius: 999px;
    padding: 1px 8px;
}
.filter-select, .filter-input {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    font-size: 13.5px;
    color: var(--doc-text);
    background: #F8FAFD;
    border: 1px solid var(--doc-border);
    border-radius: 10px;
    outline: none;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.filter-select:focus, .filter-input:focus {
    border-color: var(--doc-blue);
    box-shadow: 0 0 0 3px rgba(20, 86, 160, .12);
    background: #fff;
}
.filter-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filter-actions { display: flex; flex-direction: column; gap: 9px; padding-top: 16px; }
.btn-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--doc-blue) 0%, var(--doc-navy) 100%);
    border: 1px solid var(--doc-navy);
    border-radius: 11px;
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease;
}
.btn-apply:hover { box-shadow: 0 8px 18px rgba(11,45,92,.25); transform: translateY(-1px); }
.btn-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 11px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--doc-navy);
    background: #EEF3FA;
    border: 1px solid var(--doc-border);
    border-radius: 11px;
    text-decoration: none;
}
.btn-reset:hover { background: #E2EBF7; }

/* ---------- Buscador ---------- */
.search-card {
    background: #fff;
    border: 1px solid var(--doc-border);
    border-radius: 14px;
    box-shadow: var(--doc-shadow);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.search-box { position: relative; flex: 1; min-width: 0; }
.search-box > i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--doc-muted);
    font-size: 14px;
}
.search-box input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    font: inherit;
    font-size: 14px;
    border: 1px solid var(--doc-border);
    border-radius: 10px;
    background: #F8FAFD;
    outline: none;
    transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.search-box input:focus {
    background: #fff;
    border-color: var(--doc-blue);
    box-shadow: 0 0 0 3px rgba(20,86,160,.12);
}
.btn-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: var(--doc-blue);
    border: 1px solid var(--doc-blue);
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .14s ease;
}
.btn-search:hover { background: var(--doc-blue-dark); }
.view-toggle {
    display: flex;
    background: #EEF3FA;
    border: 1px solid var(--doc-border);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
    flex: none;
}
.view-btn {
    width: 40px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--doc-muted);
    cursor: pointer;
    font-size: 15px;
    transition: all .14s ease;
}
.view-btn.is-active { background: var(--doc-navy); color: #fff; box-shadow: 0 3px 8px rgba(11,45,92,.25); }

/* ---------- Results bar ---------- */
.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 2px 14px;
}
.results-count { font-size: 13.5px; color: var(--doc-muted); }
.results-count strong { color: var(--doc-navy); font-weight: 800; }
.sort-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--doc-muted);
    background: #fff;
    border: 1px solid var(--doc-border);
    border-radius: 10px;
    padding: 7px 7px 7px 13px;
    box-shadow: var(--doc-shadow);
}
.sort-wrap select {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--doc-navy);
    border: 1px solid var(--doc-border);
    border-radius: 8px;
    padding: 7px 10px;
    background: #F8FAFD;
    outline: none;
    cursor: pointer;
}
.active-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 2px 14px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #7A5B00;
    background: #FFF4D6;
    border: 1px solid #EBD48A;
    padding: 5px 6px 5px 12px;
    border-radius: 999px;
    text-decoration: none;
}
.chip i { font-size: 10px; }
.chip:hover { background: #FFEFB8; }

/* ---------- Cards ---------- */
.doc-list { display: flex; flex-direction: column; gap: 13px; }
.doc-list.is-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.doc-list.is-grid .doc-card { flex-direction: column; align-items: stretch; }
.doc-list.is-grid .doc-meta-row { flex-direction: column; align-items: stretch; }
.doc-card {
    --c: var(--doc-blue);
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--doc-card);
    border: 1px solid #E3EAF4;
    border-radius: 14px;
    padding: 18px 20px 18px 24px;
    box-shadow: var(--doc-shadow);
    overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease;
}
.doc-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--c);
}
.doc-card:hover { transform: translateY(-2px); box-shadow: var(--doc-shadow-hover); }
.doc-card[data-tint="blue"] { --c: #1456A0; --ct: #E7F0FC; }
.doc-card[data-tint="sky"] { --c: #1C8FD6; --ct: #E1F1FB; }
.doc-card[data-tint="green"] { --c: #1B7A5A; --ct: #E1F0E9; }
.doc-card[data-tint="purple"] { --c: #6B3FA0; --ct: #EFE7FA; }
.doc-card[data-tint="orange"] { --c: #B45309; --ct: #FEF0DC; }
.doc-card[data-tint="crimson"] { --c: #B83A4B; --ct: #F9E4E7; }
.doc-info { flex: 1; min-width: 0; }
.doc-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--doc-navy);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.doc-ref {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: var(--doc-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-resume {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: #43566F;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.doc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.doc-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--doc-blue);
    background: #EFF4FB;
    border: 1px solid #D9E5F5;
    padding: 2px 9px;
    border-radius: 999px;
}
.doc-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.doc-meta-row { display: flex; align-items: center; gap: 18px; }
.doc-date {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--doc-muted);
    white-space: nowrap;
}
.doc-date i { color: var(--doc-gold); }
.doc-actions { display: flex; align-items: center; gap: 9px; }
.btn-doc {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 700;
    padding: 9px 15px;
    border-radius: 9px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .14s ease;
    white-space: nowrap;
}
.btn-doc.view { color: var(--doc-blue); background: #fff; border-color: var(--doc-blue); }
.btn-doc.view:hover { background: #EAF1FA; }
.btn-doc.download { color: #fff; background: var(--doc-blue); border-color: var(--doc-blue); }
.btn-doc.download:hover { background: var(--doc-blue-dark); }
.btn-doc.is-disabled { opacity: .45; pointer-events: none; }

/* ---------- Empty ---------- */
.doc-empty {
    background: #fff;
    border: 1px dashed #B9C7DC;
    border-radius: 16px;
    padding: 48px 30px;
    text-align: center;
    color: var(--doc-muted);
}
.doc-empty i { font-size: 38px; color: #B9C7DC; }
.doc-empty h3 { margin: 14px 0 6px; font-size: 17px; color: var(--doc-navy); }
.doc-empty p { margin: 0 auto 18px; max-width: 460px; font-size: 13.5px; }

/* ---------- Pagination ---------- */
.doc-pagination { display: flex; justify-content: center; margin: 30px 0 10px; }
.doc-pagination nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.page-btn {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--doc-border);
    background: #fff;
    color: var(--doc-navy);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all .14s ease;
}
.page-btn:hover { background: #EDF3FA; }
.page-btn.is-current { background: var(--doc-blue); border-color: var(--doc-blue); color: #fff; box-shadow: 0 6px 14px rgba(20,86,160,.3); }
.page-btn.is-disabled { opacity: .4; pointer-events: none; }
.page-dots { color: var(--doc-muted); padding: 0 4px; }
.per-page { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--doc-muted); }
.per-page select {
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--doc-border);
    border-radius: 8px;
    padding: 6px 9px;
    background: #fff;
    color: var(--doc-navy);
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .doc-hero-inner, .doc-main { padding-inline: 28px; }
    .doc-list.is-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1023px) {
    .doc-main { grid-template-columns: 1fr; }
    .doc-filters-toggle { display: inline-flex; margin-bottom: 14px; }
    .filter-card { position: static; }
    .filter-card.is-collapsed .filter-body { display: none; }
    .doc-meta { align-items: stretch; width: 100%; }
    .doc-meta-row { justify-content: space-between; flex-wrap: wrap; }
}
@media (min-width: 1024px) {
    .filter-card .filter-body { display: block; }
}
@media (max-width: 640px) {
    .doc-hero-inner { padding: 22px 18px 28px; }
    .doc-main { padding: 18px 16px 44px; }
    .search-card { flex-wrap: wrap; }
    .search-box { flex-basis: 100%; }
    .btn-search { flex: 1; justify-content: center; }
    .doc-card { flex-direction: column; align-items: stretch; gap: 14px; }
    .doc-meta { align-items: stretch; }
    .doc-actions { flex-wrap: wrap; }
    .btn-doc { flex: 1; justify-content: center; }
}
