/* LexDom — formularios y cascada geográfica (compartido entre módulos) */

html {
    color-scheme: light;
}

.ld-address-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ld-address-block__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ld-address-block__title {
    font-size: 13px;
    font-weight: 800;
    color: #475569;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ld-address-block__hint {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    max-width: 420px;
    line-height: 1.35;
}

.ld-address-block__path {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border-radius: 10px;
    background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #dbeafe;
    font-size: 12px;
    font-weight: 700;
    color: #1e40af;
    line-height: 1.4;
}

.ld-address-block__path.is-empty {
    color: #94a3b8;
    background: #f8fafc;
    border-color: #e2e8f0;
    font-weight: 600;
}

.ld-address-block__path.is-loading {
    color: #64748b;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.ld-address-block__detail {
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px dashed #dbe5f1;
}

/* Cascada 4 + 3 columnas */
.ld-geo-cascade {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ld-geo-cascade__row {
    display: grid;
    gap: 8px 10px;
    align-items: end;
}

.ld-geo-cascade__row--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ld-geo-cascade__row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ld-geo-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #566b87;
    margin: 0;
    line-height: 1.2;
}

.ld-geo-field__step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 10px;
    font-weight: 900;
    flex-shrink: 0;
}

.ld-geo-field select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

@media (max-width: 1100px) {
    .ld-geo-cascade__row--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ld-geo-cascade__row--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ld-geo-cascade__row--4,
    .ld-geo-cascade__row--3 {
        grid-template-columns: 1fr;
    }
}

/* Utilidad compartida (formularios u-*) */
.u-field-span-4 {
    grid-column: 1 / -1;
}


/* === LexDom CRUD shell === */

    .u-page {
        height: calc(100vh - 46px);
        min-height: 0;
        overflow: hidden;
        padding: 5px 8px 8px;
        background: #f4f7fb;
        display: flex;
        flex-direction: column;
        gap: 6px;
        opacity: 0;
        transform: translateY(8px) scale(.99);
    }

        .u-page.page-enter {
            animation: pageIn .35s ease-out forwards;
        }

        .u-page.page-exit {
            animation: pageOut .22s ease-in forwards;
        }

    @keyframes pageIn {
        from {
            opacity: 0;
            transform: translateY(8px) scale(.99);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    @keyframes pageOut {
        from {
            opacity: 1;
            transform: translateY(0) scale(1);
        }

        to {
            opacity: 0;
            transform: translateY(8px) scale(.985);
        }
    }

    .u-breadcrumb {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        font-weight: 700;
        color: #64748b;
        line-height: 1;
    }

    .u-breadcrumb-link {
        border: none;
        background: transparent;
        padding: 0;
        color: #2563eb;
        font-size: 12px;
        font-weight: 800;
        cursor: pointer;
    }

        .u-breadcrumb-link:hover {
            text-decoration: underline;
        }

        .u-breadcrumb-link.muted {
            color: #64748b;
        }

    .u-breadcrumb-sep {
        color: #94a3b8;
    }

    .u-breadcrumb-current {
        color: #0f172a;
        font-weight: 900;
    }

    .u-head {
        flex-shrink: 0;
        display: flex;
        align-items: end;
        justify-content: space-between;
        gap: 12px;
    }

    .u-kicker {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 28px;
        padding: 0 14px;
        border-radius: 999px;
        background: linear-gradient(90deg, #3b82f6, #1d4ed8);
        color: #fff;
        font-size: 11px;
        font-weight: 900;
        margin-bottom: 5px;
    }

    .u-head h1 {
        margin: 0;
        font-size: 26px;
        line-height: 1;
        font-weight: 900;
        color: #11284a;
    }

    .u-head p {
        margin: 5px 0 0 0;
        font-size: 13px;
        color: #637793;
    }

    .u-head-actions {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .u-btn-new {
        min-width: 165px;
    }

    .u-btn-dark {
        min-width: 100px;
        background: linear-gradient(90deg, #334155, #1e293b);
        color: #fff;
        box-shadow: 0 5px 10px rgba(30,41,59,.14);
    }

    .u-shell {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
        background: rgba(255,255,255,.72);
        border: 1px solid #d7e0ec;
        border-radius: 18px;
        padding: 8px;
        box-shadow: 0 6px 14px rgba(15, 23, 42, .04);
        overflow: hidden;
    }

    .u-searchbar {
        flex-shrink: 0;
        display: grid;
        grid-template-columns: 1fr 46px;
        gap: 6px;
    }

    .u-main {
        flex: 1;
        min-height: 0;
        display: grid;
        grid-template-columns: 58% 42%;
        gap: 8px;
        overflow: hidden;
    }

    .u-card {
        min-height: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: rgba(255,255,255,.72);
        border: 1px solid #d7e0ec;
        border-radius: 16px;
        padding: 10px;
    }

    .u-card-title {
        font-size: 17px;
        font-weight: 900;
        color: #1f2937;
        margin-bottom: 8px;
        flex-shrink: 0;
        line-height: 1.1;
    }

    .u-form-scroll {
        flex: 1;
        min-height: 0;
        overflow: auto;
        padding-right: 4px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .u-form-section {
        border: 1px solid #dbe5f1;
        border-radius: 14px;
        background: rgba(255,255,255,.82);
        padding: 9px;
    }

    .u-section-title {
        font-size: 14px;
        font-weight: 900;
        color: #1f2937;
        margin-bottom: 8px;
    }

    .u-subhead-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 8px;
    }

    .u-subhead-space {
        margin-top: 14px;
    }

    .u-mini-title {
        font-size: 13px;
        font-weight: 900;
        color: #334155;
    }

    .u-list-stack {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .u-inline-empty {
        padding: 10px 12px;
        border-radius: 12px;
        background: #f8fbff;
        border: 1px dashed #d6e3f2;
        color: #64748b;
        font-size: 12px;
        font-weight: 700;
    }

    .u-inline-card {
        border: 1px solid #dbe5f1;
        border-radius: 12px;
        background: #fbfdff;
        padding: 8px;
    }

    .u-inline-grid {
        display: grid;
        gap: 8px;
        align-items: end;
    }

    .u-inline-grid-phone,
    .u-inline-grid-mail {
        grid-template-columns: 1.3fr .9fr 1fr auto;
    }

    .u-inline-actions {
        display: flex;
        align-items: end;
    }

    .u-check-wrap {
        display: flex;
        gap: 12px;
        align-items: center;
        flex-wrap: wrap;
        min-height: 34px;
    }

    .u-check {
        display: inline-flex;
        gap: 6px;
        align-items: center;
        font-size: 12px;
        font-weight: 800;
        color: #475569;
    }

    .u-check-card {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        border-radius: 12px;
        border: 1px solid #dbe5f1;
        background: #fbfdff;
        font-size: 12px;
        font-weight: 800;
        color: #334155;
    }

    .u-check-grid {
        margin-top: 10px;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .u-fields-grid {
        display: grid;
        gap: 6px 8px;
        align-content: start;
    }

    .u-grid-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .u-field {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .u-field-full {
        grid-column: 1 / -1;
    }

    .u-field-span-2 {
        grid-column: span 2;
    }

    .u-field label {
        font-size: 12px;
        font-weight: 800;
        color: #566b87;
        margin: 0;
        line-height: 1;
    }

    .u-input {
        width: 100%;
        height: 34px;
        border-radius: 10px;
        border: 1px solid #cfdae8;
        background: rgba(255,255,255,.88);
        padding: 0 10px;
        font-size: 13px;
        color: #253b59;
        outline: none;
        box-sizing: border-box;
    }

        .u-input:focus {
            border-color: #7ca8ff;
            box-shadow: 0 0 0 3px rgba(59,130,246,.08);
        }

    .u-textarea {
        width: 100%;
        min-height: 66px;
        border-radius: 10px;
        border: 1px solid #cfdae8;
        background: rgba(255,255,255,.88);
        padding: 8px 10px;
        font-size: 13px;
        color: #253b59;
        outline: none;
        box-sizing: border-box;
        resize: vertical;
    }

    .u-textarea-lg {
        min-height: 84px;
    }

    .u-btn {
        height: 34px;
        padding: 0 10px;
        border-radius: 10px;
        font-size: 12px;
        font-weight: 900;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        text-decoration: none;
        white-space: nowrap;
        border: none;
        cursor: pointer;
        transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    }

        .u-btn:hover:not(:disabled) {
            transform: translateY(-1px);
        }

        .u-btn:disabled {
            opacity: .65;
            cursor: not-allowed;
        }

    .u-btn-primary {
        background: linear-gradient(90deg, #3b82f6, #1d4ed8);
        color: #fff;
        box-shadow: 0 5px 10px rgba(37,99,235,.14);
    }

    .u-btn-soft {
        background: #eef2f7;
        color: #44586f;
        border: 1px solid #d5deea;
    }

    .u-btn-green {
        background: linear-gradient(90deg, #16a34a, #15803d);
        color: #fff;
    }

    .u-btn-yellow {
        background: linear-gradient(90deg, #eab308, #ca8a04);
        color: #fff;
    }

    .u-btn-red {
        background: linear-gradient(90deg, #dc2626, #b91c1c);
        color: #fff;
    }

    .u-btn-icon {
        padding: 0;
        font-size: 16px;
    }

    .u-form-actions {
        margin-top: 8px;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
        flex-shrink: 0;
    }

    .u-note {
        flex-shrink: 0;
        margin-top: 6px;
        padding: 8px 10px;
        border-radius: 9px;
        background: #f8fbff;
        border: 1px solid #dbe7f5;
        color: #496280;
        font-size: 12px;
        font-weight: 700;
        white-space: pre-wrap;
        word-break: break-word;
    }

    .u-grid-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 6px;
        flex-shrink: 0;
    }

    .u-count {
        color: #566b87;
        font-size: 12px;
        font-weight: 800;
        white-space: nowrap;
    }

    .u-table-wrap {
        flex: 1;
        min-height: 0;
        overflow: auto;
        border: 1px solid #d9e2ee;
        border-radius: 12px;
        background: rgba(255,255,255,.78);
    }

    .u-table {
        width: 100%;
        border-collapse: collapse;
    }

        .u-table thead th {
            position: sticky;
            top: 0;
            z-index: 1;
            background: #f4f7fb;
            text-align: left;
            padding: 8px 10px;
            font-size: 12px;
            font-weight: 900;
            color: #566b87;
            border-bottom: 1px solid #d9e2ee;
            white-space: nowrap;
        }

        .u-table tbody td {
            padding: 8px 10px;
            font-size: 12px;
            color: #334a68;
            border-bottom: 1px solid #e8edf5;
            vertical-align: middle;
            background: rgba(255,255,255,.5);
        }

        .u-table tbody tr:hover td {
            background: #f8fbff;
        }

    .u-selected td {
        background: #eef6ff !important;
    }

    .u-name-cell {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

        .u-name-cell strong {
            font-size: 12px;
            color: #1f2937;
        }

        .u-name-cell span {
            font-size: 11px;
            color: #64748b;
        }

    .u-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 34px;
        height: 22px;
        padding: 0 7px;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 900;
    }

        .u-badge.on {
            background: #e9f9ee;
            color: #15803d;
        }

        .u-badge.off {
            background: #fff1f2;
            color: #b91c1c;
        }

    .u-table-btn {
        height: 28px;
        padding: 0 10px;
        border-radius: 9px;
        border: 1px solid #cfe0ff;
        background: #eef4ff;
        color: #1d4ed8;
        font-size: 11px;
        font-weight: 900;
        cursor: pointer;
    }

    .u-state {
        padding: 8px 2px;
        color: #64748b;
        font-weight: 700;
        font-size: 12px;
    }

    .u-error {
        color: #b42318;
    }

    .u-empty {
        text-align: center;
        padding: 18px !important;
        color: #64748b;
        font-weight: 700;
    }

    @media (max-width: 1500px) {
        .u-inline-grid-phone,
        .u-inline-grid-mail {
            grid-template-columns: 1fr 1fr;
        }

        .u-inline-actions {
            grid-column: 1 / -1;
        }
    }

    @media (max-width: 1380px) {
        .u-page {
            height: auto;
            overflow: auto;
        }

        .u-shell,
        .u-main,
        .u-card {
            height: auto;
            overflow: visible;
        }

        .u-main {
            grid-template-columns: 1fr;
        }
    }

    @media (max-width: 980px) {
        .u-head {
            flex-direction: column;
            align-items: stretch;
        }

        .u-head-actions {
            width: 100%;
            flex-direction: column;
        }

        .u-searchbar {
            grid-template-columns: 1fr;
        }

        .u-grid-4,
        .u-form-actions,
        .u-inline-grid-phone,
        .u-inline-grid-mail {
            grid-template-columns: 1fr;
        }

        .u-field-span-2 {
            grid-column: auto;
        }

        .u-subhead-row {
            flex-direction: column;
            align-items: stretch;
        }
    }

.u-form-card { }
.u-grid-card { }
.u-fields-col { min-height: 0; display: flex; flex-direction: column; overflow: hidden; width: 100%; }
.u-check-box { display: flex; align-items: center; min-height: 34px; }
.u-main.roles-main, .u-main.sector-main, .u-main.calle-main, .u-main.barrio-main {
    grid-template-columns: 42% 58%;
}
.sector-searchbar, .barrio-searchbar, .calle-searchbar {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.1fr) minmax(0,1.1fr) 46px;
}
.calle-searchbar .u-input { font-size: 0.78rem; padding: 0.35rem 0.45rem; }
.ld-geo-cascade--compact .ld-geo-field--compact label { font-size: 0.72rem; margin-bottom: 0.15rem; }
.ld-geo-cascade--compact .u-input--compact { font-size: 0.78rem; padding: 0.35rem 0.45rem; }
.ld-geo-calle-otra { margin-top: 0.25rem; }
.ld-geo-field__hint { font-size: 0.68rem; color: #64748b; margin-top: 0.2rem; line-height: 1.25; }
.ld-geo-cascade__row--3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 8px; margin-top: 6px; }
.ld-geo-cascade__row--2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; margin-top: 6px; }
.sector-main, .barrio-main, .calle-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 42% 58%; gap: 8px; overflow: hidden; }
.sector-fields-grid, .barrio-fields-grid, .calle-fields-grid, .roles-fields-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; align-content: start;
}
.roles-form-body, .sector-form-body, .barrio-form-body, .calle-form-body {
    flex: 1; min-height: 0; display: flex; overflow: hidden;
}
.u-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }


/* === Casos (judicial) === */

    .u-page {
        height: calc(100vh - 46px);
        min-height: 0;
        overflow: hidden;
        padding: 5px 8px 8px;
        background: #f4f7fb;
        display: flex;
        flex-direction: column;
        gap: 6px;
        opacity: 0;
        transform: translateY(8px) scale(.99);
    }

        .u-page.page-enter {
            animation: pageIn .35s ease-out forwards;
        }

        .u-page.page-exit {
            animation: pageOut .22s ease-in forwards;
        }

    @keyframes pageIn {
        from {
            opacity: 0;
            transform: translateY(8px) scale(.99);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    @keyframes pageOut {
        from {
            opacity: 1;
            transform: translateY(0) scale(1);
        }

        to {
            opacity: 0;
            transform: translateY(8px) scale(.985);
        }
    }

    .u-breadcrumb {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        font-weight: 700;
        color: #64748b;
        line-height: 1;
    }

    .u-breadcrumb-link {
        border: none;
        background: transparent;
        padding: 0;
        color: #2563eb;
        font-size: 12px;
        font-weight: 800;
        cursor: pointer;
    }

        .u-breadcrumb-link:hover {
            text-decoration: underline;
        }

        .u-breadcrumb-link.muted {
            color: #64748b;
        }

    .u-breadcrumb-sep {
        color: #94a3b8;
    }

    .u-breadcrumb-current {
        color: #0f172a;
        font-weight: 900;
    }

    .u-head {
        flex-shrink: 0;
        display: flex;
        align-items: end;
        justify-content: space-between;
        gap: 12px;
    }

    .u-kicker {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 28px;
        padding: 0 14px;
        border-radius: 999px;
        background: linear-gradient(90deg, #3b82f6, #1d4ed8);
        color: #fff;
        font-size: 11px;
        font-weight: 900;
        margin-bottom: 5px;
    }

    .u-head h1 {
        margin: 0;
        font-size: 26px;
        line-height: 1;
        font-weight: 900;
        color: #11284a;
    }

    .u-head p {
        margin: 5px 0 0 0;
        font-size: 13px;
        color: #637793;
    }

    .u-head-actions {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .u-btn-new {
        min-width: 165px;
    }

    .u-btn-dark {
        min-width: 100px;
        background: linear-gradient(90deg, #334155, #1e293b);
        color: #fff;
        box-shadow: 0 5px 10px rgba(30,41,59,.14);
    }

    .u-shell {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
        background: rgba(255,255,255,.72);
        border: 1px solid #d7e0ec;
        border-radius: 18px;
        padding: 10px;
        box-shadow: 0 6px 14px rgba(15, 23, 42, .04);
        overflow: hidden;
    }

    .u-searchbar {
        flex-shrink: 0;
        display: grid;
        grid-template-columns: 1fr 46px;
        gap: 8px;
    }

    .u-page.casos-page .u-main {
        flex: 1;
        min-height: 0;
        display: grid;
        grid-template-columns: 1fr;
        overflow: hidden;
        padding-top: 10px;
    }

        .u-page.casos-page .u-main.with-grid {
            grid-template-rows: minmax(0, 1fr);
            gap: 0;
        }

        .u-page.casos-page .u-main.full-work {
            grid-template-rows: minmax(0, 1fr);
            gap: 0;
        }

    .u-card {
        min-height: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: rgba(255,255,255,.72);
        border: 1px solid #d7e0ec;
        border-radius: 16px;
        padding: 12px;
    }

    .u-form-card {
        min-height: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .u-page.casos-page .u-grid-card {
        min-height: 0;
        max-height: none;
    }

    .u-card-title {
        font-size: 17px;
        font-weight: 900;
        color: #1f2937;
        margin-bottom: 10px;
        flex-shrink: 0;
        line-height: 1.1;
    }

    .u-tabs {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        margin-bottom: 12px;
        flex-shrink: 0;
    }

    .u-tab {
        height: 32px;
        padding: 0 12px;
        border-radius: 10px;
        border: 1px solid #d7e0ec;
        background: #f8fbff;
        color: #506785;
        font-size: 12px;
        font-weight: 900;
        cursor: pointer;
        transition: all .15s ease;
    }

        .u-tab:hover {
            background: #eef6ff;
            color: #1d4ed8;
        }

        .u-tab.active {
            background: linear-gradient(90deg, #3b82f6, #1d4ed8);
            color: #fff;
            border-color: #1d4ed8;
            box-shadow: 0 5px 10px rgba(37,99,235,.14);
        }

    .u-form-scroll {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 4px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .u-form-section {
        border: 1px solid #dbe5f1;
        border-radius: 14px;
        background: rgba(255,255,255,.82);
        padding: 10px;
    }

    .u-section-title {
        font-size: 14px;
        font-weight: 900;
        color: #1f2937;
        margin-bottom: 10px;
    }

    .u-fields-grid {
        display: grid;
        gap: 8px 10px;
        align-content: start;
    }

    .u-grid-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .u-field {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .u-field-full {
        grid-column: 1 / -1;
    }

    .u-field-span-2 {
        grid-column: span 2;
    }

    .u-field label {
        font-size: 12px;
        font-weight: 800;
        color: #566b87;
        margin: 0;
        line-height: 1;
    }

    .u-input {
        width: 100%;
        height: 34px;
        border-radius: 10px;
        border: 1px solid #cfdae8;
        background: rgba(255,255,255,.88);
        padding: 0 10px;
        font-size: 13px;
        color: #253b59;
        outline: none;
        box-sizing: border-box;
    }

        .u-input:focus {
            border-color: #7ca8ff;
            box-shadow: 0 0 0 3px rgba(59,130,246,.08);
        }

    .u-textarea {
        width: 100%;
        min-height: 66px;
        border-radius: 10px;
        border: 1px solid #cfdae8;
        background: rgba(255,255,255,.88);
        padding: 8px 10px;
        font-size: 13px;
        color: #253b59;
        outline: none;
        box-sizing: border-box;
        resize: vertical;
    }

    .u-textarea-lg {
        min-height: 84px;
    }

    .u-btn {
        height: 34px;
        padding: 0 10px;
        border-radius: 10px;
        font-size: 12px;
        font-weight: 900;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        text-decoration: none;
        white-space: nowrap;
        border: none;
        cursor: pointer;
        transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    }

        .u-btn:hover:not(:disabled) {
            transform: translateY(-1px);
        }

        .u-btn:disabled {
            opacity: .65;
            cursor: not-allowed;
        }

    .u-btn-primary {
        background: linear-gradient(90deg, #3b82f6, #1d4ed8);
        color: #fff;
        box-shadow: 0 5px 10px rgba(37,99,235,.14);
    }

    .u-btn-green {
        background: linear-gradient(90deg, #16a34a, #15803d);
        color: #fff;
    }

    .u-btn-yellow {
        background: linear-gradient(90deg, #eab308, #ca8a04);
        color: #fff;
    }

    .u-btn-red {
        background: linear-gradient(90deg, #dc2626, #b91c1c);
        color: #fff;
    }

    .u-btn-icon {
        padding: 0;
        font-size: 16px;
    }

    .u-form-actions {
        margin-top: 10px;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        flex-shrink: 0;
    }

    .u-note {
        flex-shrink: 0;
        margin-top: 8px;
        padding: 8px 10px;
        border-radius: 9px;
        background: #f8fbff;
        border: 1px solid #dbe7f5;
        color: #496280;
        font-size: 12px;
        font-weight: 700;
        white-space: pre-wrap;
        word-break: break-word;
    }

    .u-inline-warning {
        margin-top: 6px;
        padding: 8px 10px;
        border-radius: 9px;
        background: #fff7ed;
        border: 1px solid #fed7aa;
        color: #9a3412;
        font-size: 12px;
        font-weight: 700;
    }

    .u-grid-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 10px;
        flex-shrink: 0;
    }

    .u-grid-head-filters {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .u-input-compact {
        width: auto;
        min-width: 170px;
        height: 30px;
        font-size: 12px;
        padding: 0 8px;
    }

    .u-count {
        color: #566b87;
        font-size: 12px;
        font-weight: 800;
        white-space: nowrap;
    }

    .u-table-wrap {
        flex: 1;
        min-height: 0;
        overflow: auto;
        border: 1px solid #d9e2ee;
        border-radius: 12px;
        background: rgba(255,255,255,.78);
    }

    .u-table-wrap-parts {
        min-height: 0;
        max-height: 220px;
    }

    /* Códigos (PAG-, REC-, FAC-…) en una sola línea; el ancho extra lo absorbe el scroll de u-table-wrap */
    .u-table th.u-td-nowrap,
    .u-table td.u-td-nowrap {
        white-space: nowrap;
    }

    /* Columna Acción visible al hacer scroll horizontal */
    .u-table-wrap-sticky-action {
        overflow-x: auto;
    }

    .u-table-sticky-action .u-th-action,
    .u-table-sticky-action .u-td-action {
        position: sticky;
        right: 0;
        z-index: 2;
        background: #f4f7fb;
        box-shadow: -4px 0 8px rgba(15, 23, 42, 0.06);
        min-width: 100px;
        text-align: center;
    }

    .u-table-sticky-action .u-td-action {
        background: rgba(255, 255, 255, 0.95);
    }

    .u-table-sticky-action tbody tr:hover .u-td-action {
        background: #f8fbff;
    }

    .u-table-sticky-action .u-selected .u-td-action {
        background: #eef6ff !important;
    }

    .u-partes-form-card {
        border: 2px solid #bfdbfe;
        background: #f8fbff;
    }

    .u-partes-list-first {
        margin-bottom: 12px;
    }

    .u-inline-hint {
        font-size: 13px;
        color: #64748b;
        margin: -4px 0 10px 0;
        line-height: 1.4;
    }

    .u-table {
        width: 100%;
        border-collapse: collapse;
    }

        .u-table thead th {
            position: sticky;
            top: 0;
            z-index: 1;
            background: #f4f7fb;
            text-align: left;
            padding: 8px 10px;
            font-size: 12px;
            font-weight: 900;
            color: #566b87;
            border-bottom: 1px solid #d9e2ee;
            white-space: nowrap;
        }

        .u-table tbody td {
            padding: 8px 10px;
            font-size: 12px;
            color: #334a68;
            border-bottom: 1px solid #e8edf5;
            vertical-align: middle;
            background: rgba(255,255,255,.5);
        }

        .u-table tbody tr:hover td {
            background: #f8fbff;
        }

    .u-selected td {
        background: #eef6ff !important;
    }

    .u-name-cell {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

        .u-name-cell strong {
            font-size: 12px;
            color: #1f2937;
        }

        .u-name-cell span {
            font-size: 11px;
            color: #64748b;
        }

    .u-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 34px;
        height: 22px;
        padding: 0 7px;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 900;
    }

        .u-badge.on {
            background: #e9f9ee;
            color: #15803d;
        }

        .u-badge.warn {
            background: #fff7ed;
            color: #c2410c;
        }

        .u-badge.off {
            background: #fff1f2;
            color: #b91c1c;
        }

        .u-badge.gray {
            background: #f1f5f9;
            color: #475569;
        }

    .u-table-btn {
        height: 28px;
        padding: 0 10px;
        border-radius: 9px;
        border: 1px solid #cfe0ff;
        background: #eef4ff;
        color: #1d4ed8;
        font-size: 11px;
        font-weight: 900;
        cursor: pointer;
    }

    .u-state {
        padding: 8px 2px;
        color: #64748b;
        font-weight: 700;
        font-size: 12px;
    }

    .u-error {
        color: #b42318;
    }

    .u-empty {
        text-align: center;
        padding: 18px !important;
        color: #64748b;
        font-weight: 700;
    }

    .u-placeholder-box {
        min-height: 220px;
        border: 1px dashed #cbd5e1;
        border-radius: 14px;
        background: #f8fbff;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 18px;
        text-align: center;
    }

    .u-placeholder-title {
        font-size: 15px;
        font-weight: 900;
        color: #1f2937;
    }

    .u-placeholder-text {
        font-size: 13px;
        color: #64748b;
        max-width: 520px;
    }

    .u-partes-panel {
        margin-bottom: 8px;
    }

    .u-partes-grid-wrap {
        margin-top: 8px;
    }

    @media (max-width: 1380px) {
        .u-page {
            height: auto;
            overflow: auto;
        }

        .u-shell,
        .u-card {
            height: auto;
            overflow: visible;
        }

        .u-page.casos-page .u-main,
        .u-page.casos-page .u-shell .u-main {
            height: auto;
            overflow: visible;
        }

            .u-page.casos-page .u-main,
            .u-page.casos-page .u-main.with-grid,
            .u-page.casos-page .u-main.full-work {
                grid-template-columns: 1fr;
                grid-template-rows: auto;
            }

        .u-page.casos-page .u-grid-card {
            max-height: none;
        }

        .u-table-wrap-parts {
            max-height: none;
        }
    }

    @media (max-width: 980px) {
        .u-head {
            flex-direction: column;
            align-items: stretch;
        }

        .u-head-actions {
            width: 100%;
            flex-direction: column;
        }

        .u-searchbar {
            grid-template-columns: 1fr;
        }

        .u-grid-4,
        .u-form-actions {
            grid-template-columns: 1fr;
        }

        .u-field-span-2 {
            grid-column: auto;
        }
    }

/* === Catálogos geo / roles (layout compacto) === */
.u-form-card { min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.u-grid-card { min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.u-fields-col { min-height: 0; display: flex; flex-direction: column; overflow: hidden; width: 100%; }
.u-field-check { display: grid; grid-template-columns: 1fr 48px; align-items: end; }
.u-check-box {
    height: 34px; border: 1px solid #cfdae8; border-radius: 10px;
    background: rgba(255,255,255,.88); display: flex; align-items: center; justify-content: center;
}
.roles-form-body, .sector-form-body, .barrio-form-body, .calle-form-body, .geo-form-body {
    flex: 1; min-height: 0; display: flex; overflow: hidden;
}
.u-main.roles-main, .u-main.sector-main, .u-main.barrio-main, .u-main.calle-main, .u-main.geo-catalog-main {
    grid-template-columns: 42% 58%;
}
.sector-searchbar, .barrio-searchbar, .calle-searchbar { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.1fr) minmax(0,1.1fr) 46px; }
.geo-search-2 { grid-template-columns: 1.2fr 1.2fr 46px; }
.geo-search-3 { grid-template-columns: 1fr 1fr 1fr 46px; }
.roles-fields-grid, .sector-fields-grid, .barrio-fields-grid, .calle-fields-grid, .geo-fields-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; align-content: start;
}
/* Solo formularios geo legacy (acciones dentro de u-fields-col) */
.u-fields-col > .u-form-actions { margin-top: auto; padding-top: 8px; }

/* Split CRUD: barra fija bajo el scroll, no al fondo del viewport */
.u-form-card > .u-form-actions {
    margin-top: 0;
    padding-top: 0;
}
@media (max-width: 1400px) {
    .sector-searchbar, .barrio-searchbar, .calle-searchbar, .geo-search-3 { grid-template-columns: 1fr 1fr; }
    .geo-search-2 { grid-template-columns: 1fr; }
    .u-main.sector-main, .u-main.barrio-main, .u-main.calle-main, .u-main.roles-main, .u-main.geo-catalog-main { grid-template-columns: 1fr; }
}


/* === Split CRUD (Clientes, Abogados, Usuarios) — no afectado por Casos === */
.u-page:not(.casos-page) > .u-shell > .u-main:not(.roles-main):not(.sector-main):not(.barrio-main):not(.calle-main):not(.geo-catalog-main) {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 58% 42%;
    grid-template-rows: unset;
    gap: 8px;
    overflow: hidden;
    padding-top: 0;
}

.u-page:not(.casos-page) .u-grid-card {
    min-height: 0;
    max-height: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* === Abogados / Usuarios: fotos y formulario lateral === */
.u-form-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
    align-items: start;
}

.u-form-body .u-fields-col {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.u-form-body .u-fields-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 8px;
    align-content: start;
}

.u-photo-col,
.u-carnet-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.u-photo-label-top {
    font-size: 11px;
    font-weight: 800;
    color: #566b87;
    line-height: 1.2;
}

.u-photo-preview {
    width: 100%;
    height: 148px;
    border-radius: 12px;
    border: 1px solid #dbe5f1;
    background: #f8fbff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.u-carnet-preview {
    width: 100%;
    height: 92px;
    border-radius: 12px;
    border: 1px solid #dbe5f1;
    background: #f8fbff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.u-photo-preview img,
.u-carnet-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.u-photo-empty {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
}

.u-media-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.u-photo-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.u-photo-buttons-stack {
    grid-template-columns: 1fr;
}

.u-photo-col > .u-btn,
.u-photo-col > label.u-btn,
.u-carnet-col .u-btn,
.u-carnet-col label.u-btn,
.u-photo-buttons .u-btn {
    width: 100%;
    font-size: 10px;
    padding: 0 6px;
    height: 30px;
}

.u-hidden {
    display: none !important;
}

.u-grid-photo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #dbe5f1;
}

.u-grid-photo-empty {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 700;
}

.u-form-card > .u-form-scroll {
    flex: unset;
    min-height: 0;
}

.casos-form-card > .casos-form-fields {
    flex: 0 1 auto;
}

.u-form-card > .u-form-actions {
    flex-shrink: 0;
    margin-top: 0;
    padding-top: 10px;
    padding-bottom: 6px;
}

/* === Responsive web: móvil (360px) → TV / 4K (2560px+) === */
:root {
    --ld-space: clamp(6px, 0.6vw, 12px);
    --ld-radius: clamp(10px, 0.8vw, 16px);
    --ld-font-label: clamp(11px, 0.75vw, 14px);
    --ld-font-body: clamp(12px, 0.85vw, 15px);
    --ld-font-small: clamp(10px, 0.7vw, 13px);
    --ld-font-title: clamp(17px, 1.4vw, 24px);
    --ld-font-h1: clamp(22px, 2.2vw, 36px);
    --ld-control-h: clamp(34px, 2.8vh, 46px);
    --ld-touch-min: 44px;
}

.u-page {
    padding: var(--ld-space) calc(var(--ld-space) + 2px);
}

.u-head h1 {
    font-size: var(--ld-font-h1);
}

.u-card-title,
.u-section-title {
    font-size: var(--ld-font-title);
}

.u-field label,
.u-mini-title {
    font-size: var(--ld-font-label);
}

.u-input,
.u-btn,
.u-textarea,
select.u-input {
    font-size: var(--ld-font-body);
    min-height: var(--ld-control-h);
}

.u-btn {
    height: var(--ld-control-h);
}

.u-table thead th,
.u-table tbody td {
    font-size: var(--ld-font-small);
}

.u-table thead th,
.u-table tbody td {
    padding: clamp(6px, 0.5vw, 10px) clamp(8px, 0.6vw, 12px);
}

/* Pantallas grandes (Full HD+) — legibilidad a distancia */
@media (min-width: 1920px) {
    .u-kicker {
        height: clamp(28px, 2.5vh, 36px);
        font-size: clamp(11px, 0.9vw, 14px);
        padding: 0 clamp(14px, 1.2vw, 20px);
    }

    .u-head p {
        font-size: clamp(13px, 1vw, 17px);
    }

    .u-shell {
        padding: clamp(8px, 0.8vw, 16px);
        border-radius: clamp(18px, 1.2vw, 24px);
    }

    .u-card {
        padding: clamp(10px, 0.9vw, 16px);
        border-radius: var(--ld-radius);
    }

    .u-table-btn {
        height: clamp(28px, 2.2vh, 38px);
        font-size: var(--ld-font-small);
        padding: 0 clamp(10px, 0.8vw, 14px);
    }
}

/* TV / ultra-wide (75", 4K) */
@media (min-width: 2560px) {
    .u-page {
        max-width: 3200px;
        margin-inline: auto;
        width: 100%;
    }

    .u-breadcrumb,
    .u-breadcrumb-link {
        font-size: clamp(12px, 0.85vw, 16px);
    }

    .u-count {
        font-size: clamp(11px, 0.8vw, 15px);
    }

    .u-page:not(.casos-page) > .u-shell > .u-main:not(.roles-main):not(.sector-main):not(.barrio-main):not(.calle-main):not(.geo-catalog-main) {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    }
}

/* Tablet y móvil */
@media (max-width: 1380px) {
    .u-page:not(.casos-page) > .u-shell > .u-main:not(.roles-main):not(.sector-main):not(.barrio-main):not(.calle-main):not(.geo-catalog-main) {
        grid-template-columns: 1fr;
        height: auto;
    }

    .u-page:not(.casos-page) .u-grid-card {
        min-height: min(420px, 50vh);
    }
}

@media (max-width: 980px) {
    .u-form-body {
        grid-template-columns: 1fr;
    }

    .u-form-body .u-fields-grid {
        grid-template-columns: 1fr 1fr;
    }

    .u-media-wrap {
        grid-template-columns: 1fr;
    }

    .u-photo-preview {
        height: clamp(140px, 40vw, 200px);
        max-width: 220px;
        margin-inline: auto;
    }

    .u-carnet-preview {
        max-width: 280px;
        margin-inline: auto;
    }

    .u-btn-new {
        min-width: unset;
        width: 100%;
    }

    .fs-back-btn {
        min-height: var(--ld-touch-min);
        padding: 0 18px;
        font-size: 14px;
    }
}

/* Móvil compacto */
@media (max-width: 640px) {
    .u-page {
        height: auto;
        min-height: calc(100vh - 46px);
        overflow: visible;
    }

    .u-shell,
    .u-main,
    .u-card,
    .u-table-wrap {
        height: auto;
        overflow: visible;
    }

    .u-grid-4,
    .u-grid-3,
    .u-form-body .u-fields-grid,
    .geo-fields-grid,
    .roles-fields-grid,
    .sector-fields-grid,
    .u-form-actions,
    .u-searchbar,
    .sector-searchbar,
    .barrio-searchbar,
    .calle-searchbar,
    .geo-search-2,
    .geo-search-3 {
        grid-template-columns: 1fr !important;
    }

    .u-field-span-2,
    .u-field-span-4,
    .u-field-full {
        grid-column: auto;
    }

    .u-input,
    .u-btn,
    select.u-input {
        min-height: var(--ld-touch-min);
        font-size: 16px; /* evita zoom iOS en focus */
    }

    .u-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .u-table {
        min-width: 520px;
    }

    .ld-geo-cascade__row--4,
    .ld-geo-cascade__row--3 {
        grid-template-columns: 1fr;
    }

    .ld-address-block__header {
        flex-direction: column;
    }

    .ld-address-block__path {
        min-width: unset;
        width: 100%;
    }
}

/* Layout fullscreen — touch en barra superior */
@media (max-width: 640px) {
    .fs-topbar {
        height: auto;
        min-height: 46px;
        padding: 6px 8px;
    }

    .fs-back-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Tribunales — filtros y agrupación por jurisdicción */
.u-grid-filters {
    padding: 0 clamp(8px, 0.6vw, 12px) clamp(8px, 0.6vw, 12px);
    border-bottom: 1px solid var(--ld-border, rgba(0, 0, 0, 0.08));
    margin-bottom: clamp(6px, 0.5vw, 10px);
}

.u-grid-filters-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.u-grid-filters-head .u-section-title {
    margin: 0;
}

.u-table-group-row td {
    background: rgba(15, 23, 42, 0.04);
    color: var(--ld-text-muted, #475569);
    font-weight: 600;
    font-size: var(--ld-font-small);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-top: 2px solid rgba(15, 23, 42, 0.08);
    padding-top: clamp(8px, 0.6vw, 12px);
    padding-bottom: clamp(4px, 0.35vw, 6px);
}

.u-table-group-row:first-child td {
    border-top: none;
}

/* === Reportes (pantalla completa) === */
.fs-content:has(.reporte-page) {
    overflow-y: auto;
    overflow-x: hidden;
}

.u-page.reporte-page {
    height: auto;
    min-height: calc(100vh - 46px);
    max-height: none;
    overflow: visible;
    opacity: 1;
    transform: none;
    animation: none;
}

.u-page.reporte-page .u-shell {
    flex: none;
    height: auto;
    overflow: visible;
}

.u-page.reporte-page .u-main.reporte-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: auto;
    overflow: visible;
    grid-template-columns: unset;
}

.u-page.reporte-page .u-card {
    height: auto;
    overflow: visible;
}

.u-page.reporte-page .reporte-filtros {
    flex: 0 0 auto;
}

.u-page.reporte-page .reporte-resultado {
    flex: 1 1 auto;
    min-height: 280px;
}

.u-page.reporte-page .reporte-resultado .u-table-wrap {
    overflow-x: auto;
    max-height: none;
}

.u-page.reporte-page .u-note {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
}

/* === Cobros (pantalla completa) === */
.fs-content:has(.cobros-page) {
    overflow-y: auto;
    overflow-x: hidden;
}

.u-page.cobros-page {
    height: auto;
    min-height: calc(100vh - 46px);
    max-height: none;
    overflow: visible;
    opacity: 1;
    transform: none;
    animation: none;
}

.u-page.cobros-page .u-shell {
    flex: none;
    height: auto;
    overflow: visible;
}

.u-page.cobros-page .u-card {
    height: auto;
    overflow: visible;
}

.u-page.cobros-page .u-table-wrap {
    overflow-x: auto;
    max-height: none;
}

.u-page.cobros-page .u-form-actions {
    flex-wrap: wrap;
    gap: 8px;
}

.u-page.cobros-page .cobros-borrador-banner {
    margin-top: 0.75rem;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.u-page.cobros-page .u-note {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
}

@media print {
    .fs-topbar,
    .u-breadcrumb,
    .u-head-actions,
    .reporte-filtros,
    .fs-back-btn {
        display: none !important;
    }

    .fs-content,
    .u-page.reporte-page,
    .u-page.reporte-page .u-shell {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }

    .u-page.reporte-page {
        padding: 0 !important;
    }

    .u-page.cobros-page,
    .u-page.cobros-page .u-shell {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }

    .u-page.cobros-page {
        padding: 0 !important;
    }
}

/* Impresión en la misma pestaña (respaldo) */
body.lexdom-printing * {
    visibility: hidden !important;
}

body.lexdom-printing #reporte-print-area,
body.lexdom-printing #reporte-print-area * {
    visibility: visible !important;
}

body.lexdom-printing #reporte-print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
    background: #fff;
}

/* Membrete impreso: oculto en pantalla, visible al imprimir reportes */
.reporte-print-only {
    display: none !important;
}

body.lexdom-printing .reporte-print-only {
    display: block !important;
}

body.lexdom-printing .u-grid-head {
    display: none !important;
}

/* RBAC — modo consulta */
.u-readonly-banner {
    margin: 0 0 12px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.08);
    color: #1e40af;
    font-size: clamp(13px, 0.9vw, 15px);
    font-weight: 700;
}

.u-msg {
    padding: 14px 16px;
    border-radius: 14px;
    font-size: clamp(13px, 0.9vw, 15px);
    font-weight: 700;
}

.u-msg-error {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: #b91c1c;
}

.u-searchbar-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.u-cell-wrap {
    max-width: 280px;
    word-break: break-word;
    font-size: clamp(12px, 0.85vw, 14px);
}

@media (max-width: 980px) {
    .u-searchbar-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .u-searchbar-filters {
        grid-template-columns: 1fr;
    }
}

/* ── Portal cliente (mensajes / solicitudes) ── */
.portal-page {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vw, 18px);
}

.portal-welcome h1 {
    margin: 0;
    font-size: clamp(20px, 3vw, 28px);
    color: #0f172a;
}

.portal-welcome p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: clamp(13px, 1.6vw, 15px);
}

.portal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-tab {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid #dbe5f1;
    background: #fff;
    font-weight: 700;
    font-size: clamp(12px, 1.5vw, 14px);
    cursor: pointer;
}

.portal-tab.active {
    background: #0b1738;
    color: #fff;
    border-color: #0b1738;
}

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

.portal-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: clamp(12px, 2vw, 18px);
}

.portal-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.portal-card-head h2 {
    margin: 0;
    font-size: clamp(15px, 2vw, 18px);
}

.portal-count, .portal-msg {
    font-size: clamp(12px, 1.4vw, 13px);
    color: #64748b;
}

.portal-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.portal-kpi {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
}

.portal-kpi-label {
    font-size: clamp(10px, 1.2vw, 11px);
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    font-weight: 700;
}

.portal-kpi-value {
    margin-top: 6px;
    font-size: clamp(18px, 2.5vw, 22px);
    font-weight: 800;
    color: #0f172a;
}

.portal-split {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 14px;
}

.portal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 480px;
    overflow: auto;
}

.portal-list-item {
    text-align: left;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    padding: 10px 12px;
    cursor: pointer;
    min-height: 44px;
}

.portal-list-item.active {
    border-color: #2563eb;
    background: #eff6ff;
}

.portal-list-item.unread {
    border-color: #93c5fd;
    background: #f0f9ff;
}

.portal-list-title {
    font-weight: 800;
    font-size: clamp(12px, 1.5vw, 13px);
}

.portal-list-meta {
    font-size: clamp(10px, 1.3vw, 11px);
    color: #64748b;
    margin-top: 2px;
}

.portal-list-amount, .portal-list-preview {
    font-size: clamp(11px, 1.4vw, 12px);
    margin-top: 4px;
    color: #334155;
}

.portal-detail h3 {
    margin: 0 0 8px;
    font-size: clamp(16px, 2vw, 18px);
}

.portal-totals {
    margin: 12px 0;
    font-size: clamp(12px, 1.5vw, 13px);
    display: grid;
    gap: 4px;
}

.portal-btn {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid #dbe5f1;
    background: #fff;
    font-weight: 700;
    font-size: clamp(12px, 1.5vw, 14px);
    cursor: pointer;
}

.portal-btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.portal-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.portal-empty, .portal-loading, .portal-alert {
    padding: 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: clamp(13px, 1.5vw, 14px);
}

.portal-alert {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.portal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.portal-field label {
    font-size: clamp(11px, 1.4vw, 12px);
    font-weight: 700;
    color: #475569;
}

.portal-input,
.portal-field input,
.portal-field select,
.portal-field textarea,
.portal-help-chat-input {
    color: #0f172a;
    background-color: #fff;
    caret-color: #0f172a;
    -webkit-text-fill-color: #0f172a;
}

.portal-input::placeholder,
.portal-field input::placeholder,
.portal-field textarea::placeholder,
.portal-help-chat-input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.portal-input:-webkit-autofill,
.portal-field input:-webkit-autofill,
.portal-field textarea:-webkit-autofill,
.portal-help-chat-input:-webkit-autofill {
    -webkit-text-fill-color: #0f172a;
    box-shadow: 0 0 0 1000px #fff inset;
}

.portal-field input,
.portal-field select,
.portal-field textarea {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #dbe5f1;
    border-radius: 12px;
    font-size: clamp(13px, 1.5vw, 14px);
}

.portal-field textarea {
    min-height: 100px;
    resize: vertical;
}

.portal-estado {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: clamp(10px, 1.2vw, 11px);
    font-weight: 800;
    text-transform: uppercase;
}

.portal-estado-abierto { background: #fef3c7; color: #92400e; }
.portal-estado-respondido { background: #dbeafe; color: #1e40af; }
.portal-estado-cerrado { background: #f1f5f9; color: #64748b; }

.portal-list-item.estado-abierto {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(90deg, #fffbeb 0%, #fff 28%);
}

.portal-list-item.estado-respondido {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(90deg, #eff6ff 0%, #fff 28%);
}

.portal-list-item.estado-cerrado {
    border-left: 4px solid #94a3b8;
    opacity: 0.92;
}

.portal-chat {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding: 8px 4px;
    margin-bottom: 12px;
}

.portal-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: clamp(13px, 1.5vw, 14px);
    line-height: 1.45;
}

.portal-bubble-cliente {
    align-self: flex-end;
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.portal-bubble-oficina {
    align-self: flex-start;
    background: #f1f5f9;
    color: #0f172a;
    border-bottom-left-radius: 4px;
}

.portal-bubble-meta {
    font-size: clamp(10px, 1.2vw, 11px);
    opacity: .85;
    margin-bottom: 4px;
    font-weight: 700;
}

.portal-adjuntos-block {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, .28);
}

.portal-bubble-oficina .portal-adjuntos-block {
    border-top-color: #cbd5e1;
}

.portal-adjuntos-title {
    font-size: clamp(10px, 1.2vw, 11px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
    opacity: .9;
}

.portal-adjuntos-msg {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.portal-adjunto-link {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: clamp(12px, 1.4vw, 14px);
    text-decoration: none;
    min-height: 44px;
    box-sizing: border-box;
}

.portal-bubble-cliente .portal-adjunto-link {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.portal-bubble-cliente .portal-adjunto-link:hover {
    background: rgba(255, 255, 255, .28);
}

.portal-bubble-oficina .portal-adjunto-link,
.portal-page .portal-adjunto-link {
    background: #fff;
    color: #1d4ed8;
    border: 1px solid #cbd5e1;
}

.portal-bubble-oficina .portal-adjunto-link:hover,
.portal-page .portal-adjunto-link:hover {
    background: #eff6ff;
}

.portal-adjunto-size {
    font-size: 11px;
    font-weight: 600;
    opacity: .85;
}

.portal-hilo-adjuntos-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 800;
}

.portal-reply-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}

.portal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-dot-unread {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    flex-shrink: 0;
}

.portal-card-head-stack {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.portal-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
}

.portal-filter-field {
    flex: 1 1 220px;
    min-width: min(100%, 220px);
    max-width: 420px;
}

.portal-filter-field label {
    display: block;
    font-size: clamp(11px, 1.2vw, 12px);
    font-weight: 700;
    color: #64748b;
    margin-bottom: 4px;
}

.portal-filter-select {
    min-height: 44px;
    width: 100%;
}

.portal-btn-primary-soft {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

@media (max-width: 980px) {
    .portal-split {
        grid-template-columns: 1fr;
    }

    .portal-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-filter-field {
        max-width: none;
    }
}

/* ——— Paneles informativos ——— */
.u-info-panel {
    margin-bottom: 16px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #f0f7ff 0%, #f8fbff 100%);
    font-size: clamp(13px, 1.5vw, 14px);
    line-height: 1.55;
    color: #334155;
}

.u-info-panel h2 {
    margin: 0 0 8px 0;
    font-size: clamp(15px, 1.8vw, 17px);
    font-weight: 900;
    color: #0f172a;
}

.u-info-panel p {
    margin: 0 0 10px 0;
}

.u-info-panel ul {
    margin: 0;
    padding-left: 1.25rem;
}

.u-info-panel li {
    margin-bottom: 6px;
}

.u-info-panel--portal {
    margin: 0 0 14px 0;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.u-info-panel--audit {
    max-width: 900px;
}

.portal-client-name {
    margin: 4px 0 2px 0;
    font-size: clamp(16px, 2vw, 18px);
    font-weight: 900;
    color: #0f172a;
}

/* ——— Calendario de plazos ——— */
.u-page.calendario-page .calendario-filtros {
    margin-bottom: 1rem;
}

.calendario-grupo {
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
}

.calendario-fecha-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #e2e8f0;
    text-transform: capitalize;
}

.calendario-lista {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.calendario-item {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.calendario-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.calendario-tipo {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.calendario-tipo.tipo-fecha {
    background: #dbeafe;
    color: #1d4ed8;
}

.calendario-tipo.tipo-tramite {
    background: #fef3c7;
    color: #b45309;
}

.calendario-estado {
    color: #64748b;
}

.calendario-item-titulo {
    font-weight: 800;
    color: #0f172a;
}

.calendario-item-sub {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.calendario-item-caso {
    margin-top: 0.45rem;
    font-size: 0.88rem;
}

.calendario-caso-link {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.calendario-caso-link:hover {
    text-decoration: underline;
}

.calendario-cliente {
    color: #64748b;
}

.calendario-urgencia-badge {
    font-weight: 800;
}

.calendario-grupo.calendario-urgencia--vencido,
.calendario-item.calendario-urgencia--vencido {
    border-left: 4px solid #dc2626;
}

.calendario-fecha-head.calendario-urgencia--vencido .calendario-urgencia-badge {
    color: #dc2626;
}

.calendario-grupo.calendario-urgencia--hoy,
.calendario-item.calendario-urgencia--hoy {
    border-left: 4px solid #ea580c;
    background: #fff7ed;
}

.calendario-fecha-head.calendario-urgencia--hoy .calendario-urgencia-badge {
    color: #ea580c;
}

.calendario-grupo.calendario-urgencia--semana,
.calendario-item.calendario-urgencia--semana {
    border-left: 4px solid #2563eb;
}

.calendario-fecha-head.calendario-urgencia--semana .calendario-urgencia-badge {
    color: #2563eb;
}

.calendario-item.calendario-urgencia--vencido {
    background: #fef2f2;
}

.ld-geo-field__abbr {
    display: inline-block;
    margin-left: 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    text-transform: none;
    letter-spacing: 0;
}

.u-note.u-warning,
.caso-guidance-warnings {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.caso-guidance-warnings ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.caso-guidance-warnings li {
    margin: 0.15rem 0;
}

.u-page.cobros-page .cobros-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.u-page.cobros-page .cobros-kpi-card {
    padding: 1rem 1.15rem;
}

.u-page.cobros-page .cobros-kpi-card strong {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
}

@media (max-width: 720px) {
    .calendario-fecha-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ——— Oficina: panel correo (columna derecha) ——— */
.oficina-page .oficina-mail-panel {
    border-left: 3px solid #2563eb;
}

.oficina-page .oficina-mail-intro {
    margin: 0 0 1rem;
    padding: 0.75rem 0.85rem;
    font-size: clamp(12px, 1.4vw, 13px);
    line-height: 1.5;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.oficina-page .oficina-mail-panel .u-hint {
    display: block;
    margin-top: 4px;
    font-size: clamp(11px, 1.3vw, 12px);
    color: #64748b;
    line-height: 1.4;
}

@media (max-width: 1380px) {
    .oficina-page .oficina-mail-panel {
        border-left: none;
        border-top: 3px solid #2563eb;
    }
}

@media (max-width: 980px) {
    .u-page.cobros-page .cobros-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .u-page.cobros-page .cobros-kpi-grid {
        grid-template-columns: 1fr;
    }

    .ld-geo-field__abbr {
        display: block;
        margin-left: 0;
    }
}

/* Login — responsive móvil / tablet */
.login-page.lg-wrap {
    padding: clamp(12px, 4vw, 20px);
    min-height: 100dvh;
}

.login-page .lg-card {
    max-width: min(470px, 100%);
    padding: clamp(16px, 4vw, 24px);
    border-radius: clamp(14px, 3vw, 18px);
}

.login-page .lg-title {
    font-size: clamp(26px, 7vw, 34px);
}

.login-page .lg-subtitle,
.login-page .lg-label,
.login-page .lg-check,
.login-page .lg-link,
.login-page .lg-note {
    font-size: clamp(12px, 3.2vw, 14px);
}

.login-page .lg-input,
.login-page .lg-btn {
    min-height: var(--ld-touch-min, 44px);
    font-size: clamp(14px, 3.5vw, 16px);
}

.login-page .lg-btn {
    padding: clamp(12px, 3vw, 14px);
}

.login-page .lg-eye {
    min-width: var(--ld-touch-min, 44px);
    min-height: var(--ld-touch-min, 44px);
}

.login-page .lg-row {
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .login-page .lg-logo {
        width: clamp(56px, 18vw, 78px);
        height: clamp(56px, 18vw, 78px);
    }

    .login-page .lg-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Documentos legales */
.doc-legales-page .doc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
    padding: 0 4px;
}

.doc-legales-page .doc-tab {
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 14px;
    border: 1px solid var(--ld-border, #e2e8f0);
    background: #fff;
    font-weight: 700;
    font-size: clamp(13px, 1.4vw, 14px);
    cursor: pointer;
}

.doc-legales-page .doc-tab.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-color: transparent;
}

.doc-legales-page .doc-generar-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.doc-legales-page .doc-generar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.doc-legales-page .doc-textarea {
    min-height: 280px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: clamp(12px, 1.35vw, 14px);
    line-height: 1.45;
    resize: vertical;
}

.doc-legales-page .doc-faltantes {
    margin: 12px 0 0;
    font-size: 12px;
    color: #92400e;
}

.doc-legales-page .doc-faltantes span {
    font-weight: 700;
}

.doc-legales-page .doc-msg-error {
    background: #fef2f2;
    color: #991b1b;
}

.doc-legales-page .doc-link-btn {
    background: none;
    border: none;
    color: #2563eb;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    padding: 0;
}

.doc-legales-page .doc-ayuda-lead {
    margin: 0 0 12px;
    color: #64748b;
    font-size: 14px;
}

@media (max-width: 980px) {
    .doc-legales-page .doc-generar-actions .u-btn {
        flex: 1 1 100%;
    }
}

.calendario-page .calendario-email-opciones {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
    padding-top: 8px;
}

.calendario-page .calendario-email-hint {
    font-size: 12px;
    color: #64748b;
    width: 100%;
}

.calendario-page .doc-msg-error {
    background: #fef2f2;
    color: #991b1b;
}

.casos-page .u-head p {
    display: none;
}

.casos-page .u-head {
    margin-bottom: 0;
}

.casos-page .u-breadcrumb {
    margin-bottom: 2px;
}

/* --- Rediseño visual Casos (mockup pestañas / encabezado) --- */
.casos-page {
    --navy: var(--ink);
    background: var(--bg);
    font-family: var(--font-body);
    opacity: 1; /* anula .u-page { opacity:0 } del CRUD hasta page-enter */
}

.casos-page .u-head h1,
.casos-page .u-kicker,
.casos-page .u-btn,
.casos-page .u-tab,
.casos-page .u-section-title,
.casos-page label,
.casos-page .casos-expediente-title {
    font-family: var(--font-ui);
}

.casos-page .u-shell,
.casos-page .u-card {
    background: #fff;
}

.casos-form-card {
    min-height: 0;
}

.casos-expediente-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 2px 0 14px;
}

.casos-expediente-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--primary-tint);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.casos-expediente-titles {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.casos-expediente-title {
    font-size: clamp(15px, 1.15vw, 18px);
    font-weight: 800;
    color: var(--navy);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.casos-expediente-sep {
    margin: 0 0.28em;
    color: var(--text-mut);
    font-weight: 700;
}

.casos-expediente-sub {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-2);
    font-family: var(--font-body);
}

.casos-form-card > .u-tabs.casos-tabs,
.casos-page .casos-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.casos-page .casos-tabs .u-tab {
    height: auto;
    min-height: 34px;
    padding: 6px 14px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 700;
    box-shadow: none;
    letter-spacing: 0;
}

.casos-page .casos-tabs .u-tab:hover {
    background: #fff;
    color: var(--navy);
    border-color: #d0d4e2;
}

.casos-page .casos-tabs .u-tab.active {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
    box-shadow: none;
}

.casos-page .casos-tabs .u-tab.u-tab--na:not(.active) {
    background: #F0F1F5;
    border: 1px dashed #C8CBD8;
    color: var(--text-mut);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    cursor: not-allowed;
}

.casos-page .casos-tabs .u-tab.u-tab--na:disabled {
    opacity: 1;
}

.casos-page .casos-tabs .u-tab.u-tab--na:not(.active):hover {
    background: #F0F1F5;
    color: var(--text-mut);
    border-color: #C8CBD8;
}

.casos-page .casos-tabs .u-tab.u-tab--na.active {
    text-decoration: none;
}

.casos-tab-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: var(--primary-tint);
    color: var(--primary);
    text-decoration: none;
    vertical-align: middle;
    line-height: 1.4;
}

.casos-page .casos-tabs .u-tab.active .casos-tab-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* Fase 7.1: Partes / equipo fuera del flujo diario */
.casos-page .casos-tabs-avanzado {
    position: relative;
    margin-left: auto;
}

.casos-page .casos-tabs-avanzado-summary {
    list-style: none;
    cursor: pointer;
    height: auto;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px dashed #C8CBD8;
    background: #F7F8FB;
    color: var(--text-mut);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    user-select: none;
}

.casos-page .casos-tabs-avanzado-summary::-webkit-details-marker {
    display: none;
}

.casos-page .casos-tabs-avanzado[open] > .casos-tabs-avanzado-summary,
.casos-page .casos-tabs-avanzado--open > .casos-tabs-avanzado-summary {
    border-color: #A8ADC0;
    color: var(--navy);
    background: #fff;
}

.casos-page .casos-tabs-avanzado-body {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid #D0D4E2;
    background: #fff;
    box-shadow: 0 8px 20px rgba(20, 28, 55, 0.12);
    min-width: 160px;
}

.casos-page .casos-judicial-mas {
    margin-top: 14px;
    border: 1px solid #E2E5EF;
    border-radius: 10px;
    padding: 8px 12px 12px;
    background: #FAFBFD;
}

.casos-page .casos-judicial-mas > summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    padding: 4px 0;
    user-select: none;
}

.casos-page .casos-judicial-mas-grid {
    margin-top: 10px;
}

/* —— Cobro de pesos (Fase 4) —— */
.casos-cobro-peso {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.casos-cobro-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.casos-cobro-kpi {
    background: #fff;
    border: 1px solid var(--border, #E3E5EE);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(18, 23, 43, 0.04);
}

.casos-cobro-kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #F0F2F8;
    color: var(--navy, #12172B);
    margin-bottom: 10px;
}

.casos-cobro-kpi-icon--blue {
    background: var(--primary-tint);
    color: var(--primary, #2E5AE6);
}

.casos-cobro-kpi-icon--red {
    background: rgba(220, 38, 38, 0.1);
    color: #DC2626;
}

.casos-cobro-kpi-label {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-mut, #8B90A0);
    margin-bottom: 4px;
}

.casos-cobro-kpi-value {
    font-family: var(--font-ui);
    font-size: clamp(1.05rem, 0.4vw + 1rem, 1.35rem);
    font-weight: 800;
    color: var(--navy, #12172B);
    letter-spacing: -0.02em;
}

.casos-cobro-kpi-value--blue { color: var(--primary, #2E5AE6); }
.casos-cobro-kpi-value--red { color: #DC2626; }

.casos-cobro-kpi-sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-mut, #8B90A0);
}

.casos-cobro-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.85fr);
    gap: 14px;
    align-items: start;
}

.casos-cobro-form-card {
    background: #fff;
    border: 1px solid var(--border, #E3E5EE);
    border-radius: 14px;
    padding: 18px 18px 16px;
}

.casos-cobro-form-title {
    font-family: var(--font-ui);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--navy, #12172B);
    margin-bottom: 14px;
}

.casos-cobro-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}

.casos-cobro-form-span {
    grid-column: 1 / -1;
}

.casos-cobro-form-foot {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-mut, #8B90A0);
    line-height: 1.45;
}

.casos-cobro-form-foot code {
    font-size: 11px;
    background: #F0F2F8;
    padding: 1px 5px;
    border-radius: 4px;
}

.casos-cobro-lock-hint {
    color: #9AA0B4;
    margin-top: 2px;
    flex-shrink: 0;
}

.casos-cobro-calc-panel {
    background: var(--navy, #12172B);
    color: #fff;
    border-radius: 14px;
    padding: 18px 18px 16px;
    min-height: 100%;
}

.casos-cobro-calc-title {
    font-family: var(--font-ui);
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.casos-cobro-calc-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
}

.casos-cobro-calc-row strong {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
}

.casos-cobro-calc-lock {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0 18px;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.48);
    line-height: 1.4;
}

.casos-cobro-progress-head {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.78);
}

.casos-cobro-progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.casos-cobro-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: #22C55E;
}

.casos-cobro-calc-foot {
    margin-top: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 1100px) {
    .casos-cobro-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .casos-cobro-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .casos-cobro-kpis {
        grid-template-columns: 1fr;
    }

    .casos-cobro-form-grid {
        grid-template-columns: 1fr;
    }
}

.casos-page .casos-btn-primary,
.casos-page .u-form-actions .u-btn-primary.casos-btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    border-radius: 9px;
    font-weight: 700;
    box-shadow: none;
}

.casos-page .casos-btn-ghost {
    background: var(--primary-tint) !important;
    border: 1px solid transparent !important;
    color: var(--primary) !important;
    border-radius: 9px;
    font-weight: 700;
}

.casos-page .casos-btn-ghost:hover {
    filter: brightness(0.98);
}

.casos-page .casos-btn-text {
    background: transparent !important;
    border: none !important;
    color: var(--text-2) !important;
    font-weight: 600;
    box-shadow: none;
    padding-left: 8px;
    padding-right: 8px;
}

.casos-page .casos-btn-text:hover:not(:disabled) {
    color: #b91c1c !important;
}

.casos-page .casos-btn-text:disabled {
    color: var(--text-mut) !important;
    opacity: 0.7;
}

.casos-form-card > .u-card-title {
    margin-bottom: 6px;
}

.casos-form-card > .u-tabs {
    margin-bottom: 8px;
}

.casos-page .casos-form-fields {
    flex: 0 1 auto;
    max-height: min(38vh, 340px);
    overflow-y: auto;
}

.casos-page .casos-general-section {
    padding: 8px;
    border: none;
    background: transparent;
}

.casos-page .casos-general-section .u-section-title {
    display: none;
}

.casos-page .u-caso-lifecycle-details {
    margin: 0 0 6px;
    font-size: 11px;
    color: #64748b;
}

.casos-page .u-caso-fin-secundario {
    margin: 0 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    padding: 8px 12px;
}

.casos-page .u-caso-fin-secundario summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    list-style: none;
}

.casos-page .u-caso-fin-secundario summary::-webkit-details-marker {
    display: none;
}

.casos-page .u-caso-lifecycle-details summary {
    cursor: pointer;
    font-weight: 700;
    color: #506785;
    list-style: none;
}

.casos-page .u-caso-lifecycle-details summary::-webkit-details-marker {
    display: none;
}

.casos-page .u-caso-lifecycle-details .u-caso-lifecycle {
    margin: 4px 0 0;
    line-height: 1.35;
    font-size: 11px;
}

.casos-page .casos-general-grid {
    gap: 6px 8px;
}

.casos-page .u-caso-meta-row {
    margin: 0;
}

.casos-page .u-caso-meta-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(108px, 1fr));
    gap: 6px 8px;
    width: 100%;
}

.casos-page .u-caso-meta-grid .u-field label {
    font-size: 11px;
}

.casos-page .u-caso-meta-grid .u-input {
    height: 30px;
    min-height: 30px;
    font-size: 12px;
    padding: 0 8px;
}

.casos-page .u-textarea-compact {
    min-height: 52px;
    height: 52px;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.35;
    resize: vertical;
}

.casos-page .casos-form-footer {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    border-top: 1px solid #dbe5f1;
    padding-top: 8px;
    margin-top: 4px;
}

.casos-page .casos-form-footer .u-form-actions {
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
}

.casos-page .casos-form-note {
    margin: 0;
    padding: 10px 12px;
    font-size: clamp(13px, 1.1vw, 16px);
    line-height: 1.45;
    border-radius: 8px;
}

.casos-page .casos-form-note-error {
    background: #fef2f2;
    border: 2px solid #dc2626;
    color: #991b1b;
    font-weight: 600;
}

.casos-page .casos-form-note-ok {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
}

.u-caso-fin-resumen {
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid #dbe3f0;
    border-radius: 10px;
    background: #f8fafc;
}

.u-caso-fin-resumen .u-caso-fin-table .u-table-total-row td {
    background: #f0f7ff;
    border-top: 2px solid #c7d9ef;
}

.u-caso-fin-gastos-det {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed #d7e0ec;
}

.u-cliente-fin-resumen {
    margin-bottom: 16px;
}

.u-cliente-fin-kpis {
    margin-bottom: 12px;
}

.u-cliente-fin-table .u-cell-sub {
    font-size: clamp(11px, 0.85vw, 13px);
    color: #64748b;
    margin-top: 2px;
}

.u-cliente-fin-det-row > td {
    padding: 0 8px 12px !important;
    background: #f8fbff;
    border-top: none !important;
}

.u-cliente-fin-subtable {
    margin: 4px 0 0;
    font-size: clamp(12px, 0.9vw, 14px);
}

.u-cliente-fin-subtable th,
.u-cliente-fin-subtable td {
    padding: 4px 8px !important;
}

.u-cliente-fin-gastos-details {
    margin-top: 8px;
    font-size: clamp(12px, 0.9vw, 14px);
}

.u-cliente-fin-gastos-details summary {
    cursor: pointer;
    font-weight: 700;
    color: #506785;
    padding: 4px 0;
}

.cli-ficha-print-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #93c5fd;
    border-radius: 10px;
}

.cli-ficha-print-hint {
    font-size: clamp(12px, 0.9vw, 14px);
    color: #475569;
    line-height: 1.4;
    max-width: 42rem;
}

.cli-ficha-print-error {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: clamp(12px, 0.9vw, 14px);
}

@media (max-width: 640px) {
    .cli-ficha-print-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .cli-ficha-print-bar .u-btn {
        width: 100%;
        min-height: 44px;
    }
}

.cli-list-print-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 0 0 12px;
    padding: 12px 14px;
    background: #eff6ff;
    border: 2px solid #2563eb;
    border-radius: 10px;
}

.cli-list-print-btn {
    font-weight: 800;
    white-space: normal;
    text-align: center;
    min-height: 44px;
}

.cli-list-print-note {
    font-size: clamp(12px, 0.9vw, 14px);
    color: #1e40af;
    line-height: 1.4;
    flex: 1;
    min-width: 200px;
}

.cli-list-print-build {
    font-size: clamp(11px, 0.85vw, 13px);
    font-weight: 700;
    color: #0f766e;
    white-space: nowrap;
}

.casos-page .casos-alert-error {
    margin: 0 0 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #fef2f2;
    border: 2px solid #dc2626;
    color: #7f1d1d;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.15);
}

.casos-page .casos-alert-error strong {
    display: block;
    font-size: clamp(15px, 1.25vw, 18px);
    margin-bottom: 6px;
    color: #b91c1c;
}

.casos-page .casos-alert-error p,
.casos-page .casos-alert-success p {
    margin: 0;
    font-size: clamp(14px, 1.15vw, 17px);
    line-height: 1.5;
}

.casos-page .casos-alert-guidance {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #e6c200;
    background: #fffbea;
    color: #5c4a00;
}

.casos-page .casos-alert-guidance strong {
    display: block;
    margin-bottom: 4px;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
}

.casos-page .casos-alert-guidance p {
    margin: 0;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
}

.casos-page .casos-alert-success {
    margin: 0 0 12px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
}

.casos-page .caso-guidance-compact {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 11px;
    line-height: 1.35;
}

.casos-page .caso-guidance-compact-label {
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
}

.casos-page .caso-guidance-compact-text {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.casos-page .u-casos-list-panel {
    flex: 1;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 2px;
}

.casos-page .u-casos-list-head {
    margin-bottom: 6px;
}

.casos-page .u-casos-list-head .u-card-title {
    margin-bottom: 0;
    font-size: 15px;
}

.casos-page .u-casos-table-wrap {
    flex: 1;
    min-height: 0;
}

.casos-page .u-table-compact thead th,
.casos-page .u-table-compact tbody td {
    padding: 5px 7px;
    font-size: 11px;
}

.casos-page .u-table-compact .u-badge {
    font-size: 10px;
    padding: 2px 6px;
}

.casos-page .u-caso-lifecycle {
    margin-bottom: 6px;
    line-height: 1.35;
}

.casos-page .u-grid-subtitle {
    margin: 4px 0 0;
    font-size: clamp(11px, 0.85vw, 13px);
}

@media (max-width: 980px) {
    .casos-page .u-caso-meta-grid {
        grid-template-columns: 1fr 1fr;
    }

    .casos-page .u-caso-meta-abogado {
        grid-column: 1 / -1;
    }

    .casos-page .casos-form-fields {
        max-height: none;
    }
}

/* Portal — informe expedientes (tipo FINENSA / cartera) */
.portal-informe-hint {
    margin: 0 0 14px;
    font-size: clamp(12px, 0.9vw, 14px);
    color: #64748b;
    line-height: 1.45;
}

.portal-expedientes-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.portal-expediente-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: clamp(14px, 1.2vw, 18px);
    background: #fff;
}

.portal-expediente-card.portal-expediente-cartera {
    border-left: 4px solid #0f766e;
}

.portal-expediente-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 10px;
}

.portal-expediente-codigo {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.portal-expediente-titulo {
    margin: 4px 0 0;
    font-size: clamp(16px, 1.1vw, 20px);
}

.portal-expediente-tipo {
    margin-top: 4px;
    font-size: 13px;
    color: #0f766e;
}

.portal-expediente-estado {
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #065f46;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.portal-expediente-resumen {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
    font-size: clamp(13px, 0.95vw, 15px);
    line-height: 1.45;
}

.portal-finensa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
    gap: 10px 16px;
    margin-bottom: 12px;
}

.portal-finensa-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.portal-finensa-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.portal-finensa-value {
    font-size: clamp(14px, 1vw, 16px);
    font-weight: 600;
    color: #0f172a;
}

.portal-expediente-ultimo {
    font-size: 13px;
    color: #334155;
    margin-bottom: 8px;
}

.portal-movimientos-details {
    margin: 8px 0;
    font-size: 13px;
}

.portal-movimientos-details summary {
    cursor: pointer;
    color: #0f766e;
    font-weight: 600;
}

.portal-movimientos-list {
    margin: 8px 0 0;
    padding-left: 18px;
}

.portal-movimientos-list li {
    margin-bottom: 6px;
    line-height: 1.4;
}

.portal-mov-fecha {
    color: #64748b;
    margin-right: 8px;
}

.portal-mov-tipo {
    font-weight: 600;
    margin-right: 6px;
}

.portal-expediente-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #64748b;
}

.portal-card-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.portal-resumen-alcance {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
}

.portal-resumen-alcance select {
    min-height: 40px;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
}

.portal-list-resumen {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: #475569;
}

.portal-list-item-cartera {
    border-left: 3px solid #0f766e;
}

.portal-informe-detail {
    min-height: 280px;
}

.portal-informe-doc-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.portal-informe-doc h3 {
    margin: 4px 0 0;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
}

.portal-informe-subtipo {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.portal-informe-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 6px;
}

.portal-informe-resumen-block {
    margin-bottom: 14px;
    padding: 12px 14px;
    background: #f0fdfa;
    border-left: 3px solid #0f766e;
    border-radius: 4px;
}

.portal-informe-resumen-block p {
    margin: 0;
    line-height: 1.5;
}

.portal-informe-grid {
    margin-bottom: 14px;
}

.portal-informe-movimientos {
    margin: 14px 0;
}

.portal-informe-foot-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 12px;
    color: #64748b;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.portal-informe-actions {
    margin-top: 16px;
}

/* Portal — detalle de expediente (mis casos) */
.portal-casos-layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: clamp(14px, 2vw, 22px);
    align-items: start;
}

.portal-casos-list-panel,
.portal-casos-detail-panel {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    padding: clamp(12px, 2vw, 16px);
}

.portal-casos-detail-panel {
    background: #fff;
    max-height: min(78vh, 920px);
    overflow-y: auto;
}

.portal-casos-panel-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.portal-casos-search {
    margin-bottom: 10px;
}

.portal-casos-search label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 6px;
}

.portal-casos-search .portal-input {
    width: 100%;
    min-height: 40px;
}

.portal-casos-list-scroll {
    max-height: min(65vh, 720px);
    overflow-y: auto;
    padding-right: 2px;
}

.portal-casos-list-panel .portal-list-item {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    padding: 12px 14px;
    background: #fff;
}

.portal-list-subtitle {
    font-size: clamp(12px, 1.4vw, 13px);
    color: #334155;
    margin-top: 2px;
    line-height: 1.35;
}

.portal-list-ultimo {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
    font-size: 11px;
    color: #475569;
    line-height: 1.4;
}

.portal-list-ultimo-label {
    font-weight: 700;
    color: #0f766e;
    margin-right: 4px;
}

.portal-list-ultimo-fecha {
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    font-size: 10px;
}

.portal-casos-empty {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.portal-caso-detail {
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2vw, 18px);
}

.portal-caso-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e2e8f0;
}

.portal-caso-header h3 {
    margin: 6px 0 0;
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    line-height: 1.3;
}

.portal-caso-estado-badge {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.portal-caso-detail--cartera .portal-caso-estado-badge {
    background: #f0fdfa;
    border-color: #99f6e4;
    color: #0f766e;
}

.portal-caso-section {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: clamp(12px, 2vw, 16px);
    background: #fff;
}

.portal-caso-section--resumen {
    background: #f0fdfa;
    border-color: #99f6e4;
}

.portal-caso-section--highlight {
    background: #fffbeb;
    border-color: #fcd34d;
    border-left-width: 4px;
}

.portal-caso-section-title {
    margin: 0 0 12px;
    font-size: clamp(12px, 1.4vw, 13px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
}

.portal-caso-section-count {
    font-weight: 600;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
}

.portal-caso-resumen-text {
    margin: 0;
    line-height: 1.6;
    font-size: clamp(13px, 1.5vw, 15px);
    color: #0f172a;
}

.portal-caso-dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 18px;
    margin: 0;
}

.portal-caso-dl div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.portal-caso-dl dt {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.portal-caso-dl dd {
    margin: 0;
    font-size: clamp(13px, 1.5vw, 14px);
    font-weight: 600;
    color: #0f172a;
}

.portal-caso-dl--inline {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.portal-caso-fin-grid {
    margin-bottom: 0;
}

.portal-finensa-item--accent .portal-finensa-value {
    color: #b45309;
    font-size: clamp(14px, 1.6vw, 16px);
}

.portal-caso-ultima-tipo {
    font-size: clamp(15px, 1.8vw, 17px);
    font-weight: 800;
    color: #92400e;
    margin-bottom: 4px;
}

.portal-caso-ultima-fecha {
    font-size: 12px;
    color: #78716c;
    margin-bottom: 10px;
    text-transform: capitalize;
}

.portal-caso-ultima-desc,
.portal-caso-ultima-ref,
.portal-caso-ultima-obs,
.portal-caso-ultima-monto {
    margin: 0 0 8px;
    font-size: clamp(13px, 1.5vw, 14px);
    line-height: 1.55;
    color: #334155;
}

.portal-caso-table-wrap {
    margin-bottom: 4px;
}

.portal-caso-table {
    font-size: clamp(12px, 1.4vw, 13px);
}

.portal-caso-empty-hint {
    margin: 0;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.portal-caso-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portal-caso-mov {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.portal-caso-mov--pago {
    border-color: #6ee7b7;
    background: #ecfdf5;
}

.portal-caso-mov-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 2px;
    border-right: 1px solid #e2e8f0;
    padding-right: 10px;
}

.portal-caso-mov-day {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.portal-caso-mov-month {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin-top: 4px;
    text-align: center;
}

.portal-caso-mov-tipo {
    font-weight: 800;
    font-size: clamp(13px, 1.5vw, 14px);
    color: #0f172a;
    margin-bottom: 4px;
}

.portal-caso-mov-desc {
    margin: 0 0 6px;
    line-height: 1.5;
    font-size: clamp(13px, 1.5vw, 14px);
    color: #334155;
}

.portal-caso-mov-meta {
    margin: 0 0 4px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
}

.portal-caso-mov-montos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #cbd5e1;
    font-size: 12px;
    color: #475569;
}

.portal-caso-footer {
    padding-top: 4px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 980px) {
    .portal-casos-layout {
        grid-template-columns: 1fr;
    }

    .portal-casos-detail-panel {
        max-height: none;
    }

    .portal-caso-mov {
        grid-template-columns: 52px minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .portal-caso-header {
        flex-direction: column;
    }

    .portal-caso-mov {
        grid-template-columns: 1fr;
    }

    .portal-caso-mov-date {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding-right: 0;
        padding-bottom: 8px;
    }

    .portal-caso-mov-month {
        margin-top: 0;
    }

    .portal-expediente-head {
        flex-direction: column;
    }

    .portal-expediente-foot {
        flex-direction: column;
    }

    .portal-informe-doc-head {
        flex-direction: column;
    }
}

/* Portal — centro de ayuda (drawer + chat) */
.portal-help-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 100020;
}

.portal-help-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 100vw);
    height: 100dvh;
    z-index: 100030;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.portal-help-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: clamp(14px, 2vw, 18px);
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc, #fff);
}

.portal-help-drawer-head h3 {
    margin: 0;
    font-size: clamp(16px, 2vw, 18px);
    font-weight: 900;
    color: #0f172a;
}

.portal-help-drawer-head p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.portal-help-close {
    border: none;
    background: #f1f5f9;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.portal-help-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.portal-help-tab {
    flex: 1;
    min-height: 44px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.portal-help-tab.active {
    background: #0b1738;
    color: #fff;
    border-color: #0b1738;
}

.portal-help-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 14px 14px;
}

.portal-help-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.portal-help-chat-welcome p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
}

.portal-help-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.portal-help-chip {
    text-align: left;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.portal-help-bubble {
    max-width: 92%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.portal-help-bubble--user {
    align-self: flex-end;
    background: #0b1738;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.portal-help-bubble--bot {
    align-self: flex-start;
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.portal-help-bubble-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0f766e;
    margin-bottom: 4px;
}

.portal-help-typing {
    font-style: italic;
    color: #64748b;
}

.portal-help-chat-error {
    margin: 0 0 8px;
    font-size: 12px;
    color: #b91c1c;
}

.portal-help-chat-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}

.portal-help-chat-input {
    width: 100%;
    min-height: 72px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.portal-help-chat-send {
    min-height: 44px;
    border: none;
    border-radius: 12px;
    background: #2563eb;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
}

.portal-help-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.portal-help-tours {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.portal-help-tour-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.portal-help-tour-card.is-done {
    border-color: #6ee7b7;
    background: #ecfdf5;
}

.portal-help-tour-card strong {
    font-size: 15px;
    color: #0f172a;
}

.portal-help-tour-card span {
    font-size: 13px;
    color: #475569;
    line-height: 1.45;
}

.portal-help-tour-card em {
    font-size: 11px;
    color: #94a3b8;
    font-style: normal;
}

.portal-help-tour-start {
    margin-top: 8px;
    min-height: 44px;
    border: none;
    border-radius: 12px;
    background: #0b1738;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
}

.portal-help-tours-hint {
    margin: 12px 0 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
}

@media (max-width: 640px) {
    .portal-help-drawer {
        width: 100vw;
    }
}

/* Modal aplicar pago — portal (ancho, una sola pantalla) */
.portal-pago-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

.portal-pago-modal {
    width: min(920px, 100%);
    max-height: calc(100vh - 24px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.portal-pago-modal-head,
.portal-pago-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding: 10px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.portal-pago-modal-foot {
    justify-content: flex-end;
    border-bottom: none;
    border-top: 1px solid #e2e8f0;
}

.portal-pago-modal-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #0b1738;
}

.portal-pago-modal-body {
    padding: 10px 18px 12px;
    overflow: visible;
    flex: 1 1 auto;
    min-height: 0;
}

.portal-pago-exp-line {
    margin: 0 0 8px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.35;
}

.portal-pago-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 14px;
    align-items: start;
}

.portal-pago-fields .portal-field {
    margin-bottom: 0;
    min-width: 0;
}

.portal-pago-fields .portal-field label {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.portal-pago-fields .portal-input {
    min-height: 40px;
    width: 100%;
    box-sizing: border-box;
}

.portal-input-readonly {
    background: #f8fafc !important;
    color: #334155 !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.portal-pago-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.portal-field-span-2 { grid-column: span 2; }
.portal-field-span-4 { grid-column: 1 / -1; }

.portal-field-check {
    display: flex;
    align-items: center;
}

.portal-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.35;
    color: #0f172a;
    margin: 0;
    min-height: 40px;
}

.portal-check input {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    accent-color: #2563eb;
}

.portal-pago-hint {
    margin: 0;
}

.portal-pago-hint .portal-informe-hint {
    margin: 0;
    line-height: 1.35;
    font-size: 12px;
}

.portal-pago-close {
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    min-width: 44px;
    min-height: 44px;
    line-height: 1;
}

@media (max-width: 900px) {
    .portal-pago-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-field-span-2,
    .portal-field-span-4 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .portal-pago-modal {
        width: 100%;
        max-height: calc(100vh - 16px);
        overflow-y: auto;
    }

    .portal-pago-fields {
        grid-template-columns: 1fr;
    }

    .portal-pago-backdrop {
        align-items: flex-start;
        padding: 8px;
    }
}

/* Modal aplicar pago — admin genérico */
.u-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.u-modal {
    width: min(520px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.u-modal--narrow { width: min(480px, 100%); }

.u-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.u-modal-head h3 { margin: 0; font-size: 17px; }

.u-modal-close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    min-width: 44px;
    min-height: 44px;
}

.u-modal-body { padding: 16px 18px; }

.u-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 18px 16px;
    border-top: 1px solid #e2e8f0;
}

/* Admin: texto visible al escribir (evita campos oscuros del sistema en dark mode) */
.u-input,
.u-textarea,
select.u-input,
.u-searchbar .u-input,
.u-modal .u-input,
.u-modal .u-textarea,
.u-modal select.u-input {
    color: #253b59;
    background-color: #fff;
    caret-color: #253b59;
    -webkit-text-fill-color: #253b59;
}

.u-input::placeholder,
.u-textarea::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.u-input:-webkit-autofill,
.u-textarea:-webkit-autofill,
select.u-input:-webkit-autofill {
    -webkit-text-fill-color: #253b59;
    box-shadow: 0 0 0 1000px #fff inset;
}

.u-section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.u-btn-sm {
    min-height: 36px;
    padding: 6px 14px;
    font-size: 13px;
}

.u-table-btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #1d4ed8;
}

.u-table-btn-primary:hover {
    background: #1d4ed8;
}

/* --- Fase 5: contraparte por rol (chips + grupos) --- */
.casos-contrapartes .casos-contraparte-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.casos-contrapartes .casos-contraparte-form-head .u-section-title {
    margin: 0;
}

.casos-contraparte-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--primary-tint, #EAEFFD);
    color: var(--primary, #2E5AE6);
    font-family: var(--font-ui);
    font-size: clamp(10px, 0.72vw, 12px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.casos-rol-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.casos-rol-chip {
    appearance: none;
    border: 1px solid var(--border, #E3E5EE);
    background: #fff;
    color: var(--navy, #12172B);
    font-family: var(--font-ui);
    font-size: clamp(13px, 0.9vw, 15px);
    font-weight: 600;
    padding: 8px 14px;
    min-height: 44px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.casos-rol-chip:hover {
    border-color: var(--primary, #2E5AE6);
    color: var(--primary, #2E5AE6);
}

.casos-rol-chip.is-active {
    background: var(--navy, #12172B);
    border-color: var(--navy, #12172B);
    color: #fff;
}

.casos-contraparte-grupo {
    margin: 0 0 16px;
    padding-top: 4px;
}

.casos-contraparte-grupo-title {
    font-family: var(--font-ui);
    font-size: clamp(11px, 0.78vw, 13px);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-mut, #9296A8);
    margin: 0 0 10px;
}

.casos-contraparte-ocultos-nota {
    margin: 4px 0 14px;
    padding: 12px 14px;
    border: 1.5px dotted var(--border, #E3E5EE);
    border-radius: 10px;
    background: #fafbff;
    color: var(--text-2, #5B5F72);
    font-size: clamp(12px, 0.85vw, 14px);
    line-height: 1.45;
}

@media (max-width: 640px) {
    .casos-rol-chips {
        gap: 6px;
    }

    .casos-rol-chip {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* =========================================================
   Portal — input compacto reutilizable + formulario solicitud
   ========================================================= */

.portal-input-compact {
    display: block;
    width: 100%;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    box-sizing: border-box;
    border: 1px solid #d0d7e2;
    border-radius: 8px;
    background: #fff;
    padding: 0 12px;
    font-size: 14px;
    line-height: 42px;
    color: #0f172a;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.portal-input-compact:focus {
    border-color: #3b5bdb;
    box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.12);
}

/* Anchos por contenido (campos cortos / fijos) — reutilizable en portal */
.portal-input-compact--cedula,
.portal-input-compact--tel {
    width: 190px;
    max-width: 100%;
}

.portal-input-compact--capital {
    width: 200px;
    max-width: 100%;
}

.portal-input-compact--pct {
    width: 110px;
    max-width: 100%;
}

.portal-input-compact--meses {
    width: 96px;
    max-width: 100%;
}

.portal-input-compact--date {
    width: 168px;
    max-width: 100%;
}

.portal-textarea-compact {
    display: block;
    width: 100%;
    min-height: 80px;
    height: 80px;
    box-sizing: border-box;
    border: 1px solid #d0d7e2;
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.45;
    color: #0f172a;
    outline: none;
    resize: vertical;
}

.portal-textarea-compact:focus {
    border-color: #3b5bdb;
    box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.12);
}

.portal-solicitud {
    width: 100%;
    max-width: 720px;
    margin-inline: auto;
    box-sizing: border-box;
}

.portal-solicitud-card,
.portal-solicitud .portal-card {
    width: 100%;
    max-width: 720px;
    margin-inline: auto;
    box-sizing: border-box;
}

.portal-solicitud-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    padding: clamp(16px, 2.2vw, 28px);
}

.portal-solicitud-card-head h2 {
    margin: 0;
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 800;
    color: #0b1738;
    line-height: 1.2;
}

.portal-solicitud-card-head p {
    margin: 6px 0 0;
    font-size: clamp(13px, 1.4vw, 15px);
    color: #64748b;
}

.portal-solicitud-body {
    border: 0;
    margin: 18px 0 0;
    padding: 0;
    min-inline-size: 0;
}

.portal-solicitud-body:disabled {
    opacity: 0.72;
}

.portal-solicitud .portal-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    align-self: start;
    margin-bottom: 0;
}

.portal-solicitud .portal-field label {
    font-size: 12px;
    font-weight: 700;
    color: #0b1738;
    line-height: 1.2;
}

.portal-solicitud .portal-field-full {
    grid-column: 1 / -1;
    margin-bottom: 14px;
}

.portal-solicitud-section {
    margin: 18px 0 0;
}

.portal-solicitud-section-title {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0b1738;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.portal-solicitud-section-hint {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #94a3b8;
}

.portal-solicitud-section--muted {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    padding: 12px 14px 14px;
}

.portal-solicitud-section--muted .portal-input-compact {
    background: #f1f5f9;
}

.portal-solicitud-grid {
    display: grid;
    gap: 12px 14px;
}

.portal-solicitud-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-solicitud-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-solicitud-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 14px;
    align-items: flex-start;
}

.portal-solicitud-row .portal-field {
    flex: 0 0 auto;
}

.portal-solicitud-docs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.portal-solicitud-doc-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.portal-solicitud-doc-chip.ok {
    border-color: #86efac;
    background: #f0fdf4;
}

.portal-solicitud-doc-icon {
    display: inline-flex;
    color: #64748b;
    flex-shrink: 0;
}

.portal-solicitud-doc-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.portal-solicitud-doc-text strong {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.portal-solicitud-doc-text em {
    font-size: 11px;
    font-style: normal;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-solicitud-attach-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #0b1738;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.portal-solicitud-attach-btn:hover {
    border-color: #0b1738;
    background: #f8fafc;
}

.portal-solicitud-file-hidden {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.portal-solicitud-remove-btn {
    height: 32px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.portal-solicitud-doc-ok {
    color: #166534;
    font-weight: 800;
}

.portal-solicitud-footer {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #eef2f7;
}

.portal-solicitud-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-sizing: border-box;
}

.portal-solicitud-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.portal-solicitud-btn-outline {
    border: 1.5px solid #0b1738;
    background: #fff;
    color: #0b1738;
}

.portal-solicitud-btn-solid {
    border: 1.5px solid #0b1738;
    background: #0b1738;
    color: #fff;
}

@media (max-width: 980px) {
    .portal-solicitud-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-solicitud-docs-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .portal-solicitud-grid-4,
    .portal-solicitud-grid-2 {
        grid-template-columns: 1fr;
    }

    .portal-solicitud-footer {
        justify-content: stretch;
    }

    .portal-solicitud-btn {
        flex: 1 1 auto;
        min-height: 44px;
        height: 44px;
    }

    .portal-input-compact {
        min-height: 44px;
        height: 44px;
        line-height: 44px;
    }
}

/* ---- Aviso inicial al cliente (expediente) ---- */
.caso-aviso-cliente {
    background: #fff;
    border: 1px solid var(--border, #E3E5EE);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
}

.caso-aviso-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.caso-aviso-title {
    font-family: var(--font-ui);
    font-size: clamp(1rem, 0.95rem + 0.2vw, 1.25rem);
    font-weight: 800;
    color: var(--navy, #12172B);
}

.caso-aviso-badge {
    font-size: clamp(0.75rem, 0.72rem + 0.15vw, 0.95rem);
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.caso-aviso-badge--ok {
    background: #DCFCE7;
    color: #166534;
}

.caso-aviso-badge--pend {
    background: #FEF3C7;
    color: #92400E;
}

.caso-aviso-banner {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: clamp(0.9rem, 0.85rem + 0.2vw, 1.15rem);
    margin-bottom: 12px;
}

.caso-aviso-rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin-bottom: 12px;
}

.caso-aviso-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: clamp(0.85rem, 0.82rem + 0.15vw, 1.05rem);
}

.caso-aviso-row span {
    color: var(--muted, #6B7280);
    font-size: 0.85em;
}

.caso-aviso-row strong {
    color: var(--navy, #12172B);
    word-break: break-word;
}

.caso-aviso-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 640px) {
    .caso-aviso-rows {
        grid-template-columns: 1fr;
    }

    .caso-aviso-actions .u-btn {
        flex: 1 1 100%;
        min-height: 44px;
    }
}

/* ---- Actos del expediente: Intimación de pago ---- */
.caso-intimacion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.caso-intimacion-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.caso-intimacion-sub,
.u-field-hint {
    color: var(--muted, #6B7280);
    font-size: clamp(0.8rem, 0.78rem + 0.12vw, 0.98rem);
}

.caso-intimacion-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: clamp(12px, 1vw, 20px);
    border: 1px solid var(--line, #E5E7EB);
    border-radius: 12px;
    background: #fff;
}

.caso-intimacion-resumen {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 16px;
}

.caso-intimacion-resumen > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: clamp(0.85rem, 0.82rem + 0.15vw, 1.05rem);
}

.caso-intimacion-resumen span {
    color: var(--muted, #6B7280);
    font-size: 0.85em;
}

.caso-intimacion-resumen strong {
    color: var(--navy, #12172B);
    word-break: break-word;
}

.caso-intimacion-letras {
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--navy, #12172B);
    font-size: clamp(0.82rem, 0.8rem + 0.12vw, 1rem);
}

.caso-intimacion .u-note-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.caso-intimacion .u-note-error ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.caso-intimacion-alguacil {
    max-width: 640px;
}

.caso-intimacion-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.caso-embargo-monto {
    max-width: 640px;
}

.caso-embargo-monto-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.caso-embargo-monto-row .u-input {
    flex: 1 1 200px;
    max-width: 280px;
}

.caso-embargo-bancos {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.caso-embargo-seleccion {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: embargo;
}

.caso-embargo-seleccion li {
    counter-increment: embargo;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 10px;
    border-radius: 999px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: var(--navy, #12172B);
    font-size: clamp(0.8rem, 0.78rem + 0.12vw, 0.98rem);
}

.caso-embargo-seleccion li::before {
    content: counter(embargo) ".";
    font-weight: 700;
}

.caso-embargo-quitar {
    min-width: 28px;
    min-height: 28px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #4338ca;
    font-size: 1.1em;
    cursor: pointer;
}

.caso-embargo-quitar:hover,
.caso-embargo-quitar:focus-visible {
    background: #c7d2fe;
}

.caso-embargo-lista {
    max-height: clamp(260px, 40vh, 560px);
    overflow-y: auto;
    border: 1px solid var(--line, #E5E7EB);
    border-radius: 10px;
    padding: 4px;
}

.caso-embargo-grupo {
    position: sticky;
    top: -4px;
    z-index: 1;
    padding: 6px 8px;
    background: #f8fafc;
    color: var(--muted, #6B7280);
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.caso-embargo-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 44px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
}

.caso-embargo-item:hover {
    background: #f8fafc;
}

.caso-embargo-item.on {
    background: #eef2ff;
}

.caso-embargo-item input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex: 0 0 auto;
}

.caso-embargo-item span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    font-size: clamp(0.85rem, 0.82rem + 0.15vw, 1.05rem);
}

.caso-embargo-item small {
    color: var(--muted, #6B7280);
    font-size: 0.85em;
    overflow-wrap: anywhere;
}

.caso-embargo-guardar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: clamp(0.85rem, 0.82rem + 0.15vw, 1.05rem);
}

.cli-representante-title label {
    font-weight: 700;
    color: var(--navy, #12172B);
    margin-top: 6px;
}

@media (max-width: 980px) {
    .caso-intimacion-resumen {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .caso-intimacion-resumen,
    .caso-intimacion-campos {
        grid-template-columns: 1fr;
    }

    .caso-intimacion-head .u-btn,
    .caso-intimacion-actions .u-btn {
        flex: 1 1 100%;
        min-height: 44px;
    }
}
