:root {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
    background: #f3f6fb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f3f6fb;
    color: #172033;
}

a {
    color: #1f5eff;
}

h1, h2, h3, p {
    line-height: 1.3;
}

/* ---------- Login ---------- */

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 18px 50px rgba(23, 32, 51, 0.12);
}

.login-card h1 {
    margin: 0 0 8px;
}

.login-card p {
    margin-top: 0;
    color: #657089;
}

/* ---------- Formularios ---------- */

label {
    display: block;
    margin-top: 18px;
    font-weight: 600;
}

input,
select {
    width: 100%;
    margin-top: 8px;
    padding: 12px 14px;
    border: 1px solid #cad2df;
    border-radius: 9px;
    background: #fff;
    color: #172033;
    font: inherit;
}

input:focus,
select:focus {
    outline: 2px solid rgba(31, 94, 255, 0.2);
    border-color: #1f5eff;
}

button {
    width: 100%;
    margin-top: 22px;
    padding: 12px 16px;
    border: 0;
    border-radius: 9px;
    background: #1f5eff;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    filter: brightness(0.96);
}

/* ---------- Alertas ---------- */

.alert {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 9px;
    background: #fff0f0;
    color: #a12626;
    border: 1px solid #f3caca;
}

.notice-success {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 9px;
    background: #e3f8e9;
    color: #176934;
    border: 1px solid #bde7c8;
}

.job-reference {
    margin-top: 8px;
}

/* ---------- Barra superior ---------- */

.topbar {
    min-height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 16px 28px;
    background: #172033;
    color: #fff;
    box-shadow: 0 3px 12px rgba(23, 32, 51, 0.12);
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.brand strong {
    font-size: 17px;
}

.brand span {
    color: #aeb9cf;
    font-size: 14px;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.admin-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.admin-nav a:hover {
    text-decoration: underline;
}

/* ---------- Layout ---------- */

.container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 28px;
}

.container.narrow,
.narrow {
    max-width: 1000px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.section-heading h1,
.panel-title h2 {
    margin: 0;
}

.section-heading p,
.panel-title p {
    margin: 6px 0 0;
    color: #7a859d;
}

/* ---------- Tarjetas ---------- */

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

.cards-six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards article {
    min-width: 0;
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 8px 26px rgba(23, 32, 51, 0.07);
    border: 1px solid #e9edf3;
}

.cards span {
    display: block;
    color: #657089;
}

.cards strong {
    display: block;
    margin-top: 10px;
    font-size: 30px;
}

/* ---------- Paneles ---------- */

.panel {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 8px 26px rgba(23, 32, 51, 0.07);
    border: 1px solid #e9edf3;
}

.panel + .panel {
    margin-top: 24px;
}

.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.panel-title input {
    width: min(380px, 100%);
    margin: 0;
}

/* ---------- Tablas ---------- */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #e7ebf1;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    font-size: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #657089;
    background: #fafbfc;
}

tbody tr:hover {
    background: #fafcff;
}

/* ---------- Botones / links ---------- */

.button-link {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 9px;
    background: #1f5eff;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.button-link:hover {
    filter: brightness(0.96);
}

.button-link.secondary {
    background: #e8edf5;
    color: #25314a;
}

.button-link.small {
    padding: 7px 10px;
    font-size: 13px;
}

.button-link.danger {
    background: #b42318;
    color: #fff;
}

/* ---------- Badges ---------- */

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
}

.badge-pending,
.badge-warning {
    background: #fff4ce;
    color: #795b00;
}

.badge-processing {
    background: #e7efff;
    color: #214eac;
}

.badge-success {
    background: #e3f8e9;
    color: #176934;
}

.badge-error {
    background: #ffe5e5;
    color: #9a2323;
}

.badge-expired,
.badge-neutral {
    background: #eceff4;
    color: #596274;
}

/* ---------- Filtros / paginación ---------- */

.filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 200px auto auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.filters input,
.filters select,
.filters button {
    margin: 0;
    min-height: 42px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.pagination a {
    min-width: 36px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #edf1f7;
    color: #263249;
    text-align: center;
    text-decoration: none;
}

.pagination a.active {
    background: #1f5eff;
    color: #fff;
}

/* ---------- Detalle ---------- */

.detail-grid {
    display: grid;
}

.detail-row {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid #e7ebf1;
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-row span {
    color: #68738a;
}

.detail-row strong {
    overflow-wrap: anywhere;
}

/* ---------- Reset password ---------- */

.user-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e7ebf1;
}

.user-summary span {
    display: block;
    margin-bottom: 5px;
    color: #68738a;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-row input {
    width: auto;
    margin: 3px 0 0;
}

.password-rules {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 9px;
    background: #f0f4fa;
    color: #536078;
}

/* ---------- Ficha de usuario ---------- */

.user-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-bottom: 22px;
    border-bottom: 1px solid #e7ebf1;
}

.user-hero h2 {
    margin: 0 0 4px;
}

.user-hero p {
    margin: 0 0 10px;
    color: #68738a;
}

.avatar {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #1f5eff;
    color: #fff;
    font-size: 28px;
    font-weight: 800;
}

.user-detail-grid {
    margin-top: 8px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.action-grid form {
    margin: 0;
}

.admin-action-card {
    width: 100%;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    padding: 18px;
    border: 1px solid #dce3ed;
    border-radius: 12px;
    background: #fff;
    color: #172033;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
    margin: 0;
}

.admin-action-card:hover {
    border-color: #9eb7ff;
    background: #f8faff;
}

.admin-action-card strong {
    font-size: 16px;
}

.admin-action-card span {
    color: #68738a;
    font-weight: 400;
    line-height: 1.45;
}

.admin-action-card.danger {
    border-color: #efb6b6;
}

.admin-action-card.danger strong {
    color: #a12626;
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
    .cards,
    .cards-six {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters {
        grid-template-columns: 1fr 1fr;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .topbar,
    .section-heading,
    .panel-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-nav {
        flex-wrap: wrap;
    }

    .container {
        padding: 18px;
    }

    .cards,
    .cards-six,
    .filters,
    .user-summary {
        grid-template-columns: 1fr;
    }

    .panel-title input {
        width: 100%;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* =========================================================
   Worker heartbeat v0.6.1
   ========================================================= */

.worker-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e9edf3;
    box-shadow: 0 8px 26px rgba(23, 32, 51, 0.07);
}

.worker-status-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.worker-status-main strong {
    display: block;
    margin-top: 3px;
    font-size: 22px;
}

.worker-caption,
.worker-details span {
    color: #68738a;
    font-size: 13px;
}

.worker-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex: 0 0 16px;
}

.worker-online .worker-dot {
    background: #27a857;
    box-shadow: 0 0 0 6px rgba(39, 168, 87, 0.12);
}

.worker-offline .worker-dot {
    background: #c93030;
    box-shadow: 0 0 0 6px rgba(201, 48, 48, 0.12);
}

.worker-details {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.worker-details span {
    display: block;
    margin-bottom: 5px;
}

.worker-details strong {
    display: block;
    overflow-wrap: anywhere;
}

@media (max-width: 1200px) {
    .worker-details {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .worker-card {
        grid-template-columns: 1fr;
    }

    .worker-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .worker-details {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   v0.7 - Password visibility controls
   ========================================================= */

.password-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.password-input-wrap input {
    margin-top: 0;
}

.password-toggle {
    width: auto;
    min-width: 82px;
    margin: 0;
    padding: 12px 14px;
    background: #e8edf5;
    color: #25314a;
    border: 1px solid #cad2df;
}

.password-toggle:hover {
    background: #dde4ef;
    filter: none;
}

@media (max-width: 520px) {
    .password-input-wrap {
        grid-template-columns: 1fr;
    }

    .password-toggle {
        width: 100%;
    }
}

/* =========================================================
   v0.9 - Admin notifications
   ========================================================= */

.notification-stats {
    margin-bottom: 24px;
}

.notification-filters {
    grid-template-columns: minmax(280px, 1fr) 190px auto auto;
}

.notifications-table td {
    vertical-align: top;
}

.notification-error,
.notification-result {
    margin-top: 7px;
    max-width: 360px;
}

.notification-error summary,
.notification-result summary {
    cursor: pointer;
    color: #68738a;
    font-size: 12px;
}

.notification-error div,
.notification-result div {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f6f8fb;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.45;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 850px) {
    .notification-filters {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   v1.0 - Admin audit
   ========================================================= */

.audit-stats {
    margin-bottom: 24px;
}

.audit-filters {
    grid-template-columns:
        minmax(260px, 1fr)
        220px
        170px
        auto
        auto;
}

.audit-table td {
    vertical-align: top;
}

.audit-event {
    display: inline-block;
    padding: 4px 7px;
    border-radius: 6px;
    background: #f0f4fa;
    color: #33415c;
    font-size: 12px;
    white-space: nowrap;
}

.audit-detail {
    min-width: 110px;
    max-width: 420px;
}

.audit-detail summary {
    cursor: pointer;
    color: #1f5eff;
    font-size: 12px;
    font-weight: 600;
}

.audit-detail div {
    margin-top: 7px;
    padding: 9px 10px;
    border-radius: 8px;
    background: #f6f8fb;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
    font-size: 12px;
}

@media (max-width: 1000px) {
    .audit-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 650px) {
    .audit-filters {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   v1.2 - Identidad visual DESAB
   Basado en Autogestión DESAB
   ========================================================= */

:root {
    --desab-green-950: #0d3f27;
    --desab-green-900: #10492d;
    --desab-green-850: #115431;
    --desab-green-800: #086b4c;
    --desab-green-700: #087354;
    --desab-green-600: #14916f;
    --desab-green-500: #1b9879;
    --desab-green-100: #e8f5ef;
    --desab-orange: #e49a20;

    --desab-text: #173725;
    --desab-muted: #6e7c75;
    --desab-border: #d8e2dc;
    --desab-bg: #f5f8f6;
}

/* ---------- General ---------- */

body {
    background: var(--desab-bg);
    color: var(--desab-text);
}

a {
    color: var(--desab-green-700);
}

a:hover {
    color: var(--desab-green-900);
}

button,
.button-link {
    background: var(--desab-green-600);
}

button:hover,
.button-link:hover {
    background: var(--desab-green-700);
    filter: none;
}

.button-link.secondary,
.password-toggle {
    background: #edf3ef;
    color: var(--desab-green-900);
    border-color: var(--desab-border);
}

.button-link.secondary:hover,
.password-toggle:hover {
    background: #e1ebe5;
}

input:focus,
select:focus {
    border-color: var(--desab-green-600);
    outline-color: rgba(20, 145, 111, 0.18);
}

.panel,
.cards article,
.worker-card {
    border-color: #e2e9e5;
    box-shadow: 0 8px 26px rgba(13, 63, 39, 0.07);
}

tbody tr:hover {
    background: #f4faf7;
}

/* ---------- Admin topbar ---------- */

.topbar {
    min-height: 72px;
    padding: 11px 28px;
    background: linear-gradient(
        110deg,
        var(--desab-green-950),
        var(--desab-green-800)
    );
    border-bottom: 3px solid var(--desab-orange);
    box-shadow: 0 4px 18px rgba(13, 63, 39, 0.16);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    display: block;
    width: 166px;
    height: 52px;
    object-fit: contain;
    padding: 5px 10px;
    border-radius: 9px;
    background: #fff;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-copy strong {
    color: #fff;
    font-size: 15px;
}

.brand-copy span {
    color: #cbe1d5;
    font-size: 12px;
}

.admin-nav {
    gap: 8px;
}

.admin-nav a {
    padding: 9px 11px;
    border-radius: 8px;
    color: #f5fbf8;
    font-weight: 600;
    transition: background 0.15s ease;
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.11);
    text-decoration: none;
    color: #fff;
}

.admin-nav .nav-logout {
    border: 1px solid rgba(255, 255, 255, 0.34);
}

/* ---------- Cards / badges ---------- */

.cards strong {
    color: var(--desab-green-800);
}

.badge-success {
    background: #e2f5eb;
    color: #12663e;
}

.badge-processing {
    background: #e2f3ee;
    color: #0b6c53;
}

.pagination a.active {
    background: var(--desab-green-600);
}

.avatar {
    background: var(--desab-green-600);
}

/* ---------- Login DESAB ---------- */

.login-page.brand-login-page {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 7% 17%,
            rgba(255, 255, 255, 0.07) 0 19%,
            transparent 19.15%
        ),
        radial-gradient(
            circle at 96% 88%,
            rgba(255, 255, 255, 0.07) 0 17%,
            transparent 17.15%
        ),
        linear-gradient(
            120deg,
            var(--desab-green-950) 0%,
            var(--desab-green-850) 48%,
            #0b4429 100%
        );
}

.login-page.brand-login-page::before,
.login-page.brand-login-page::after {
    content: "";
    position: fixed;
    z-index: 0;
    border-radius: 50%;
    pointer-events: none;
}

.login-page.brand-login-page::before {
    width: 510px;
    height: 510px;
    left: -300px;
    top: -155px;
    background: rgba(255, 255, 255, 0.055);
}

.login-page.brand-login-page::after {
    width: 430px;
    height: 430px;
    right: -235px;
    bottom: -250px;
    background: rgba(255, 255, 255, 0.055);
}

.brand-login-card {
    position: relative;
    z-index: 1;
    width: min(505px, 100%);
    padding: 39px 40px 36px;
    border-radius: 20px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
}

.login-logo {
    display: block;
    width: min(315px, 92%);
    max-height: 130px;
    margin: 0 auto 28px;
    object-fit: contain;
}

.login-product-title {
    margin: 0;
    color: var(--desab-green-950);
    font-size: 21px;
    font-weight: 750;
}

.login-product-subtitle {
    margin: 3px 0 23px;
    color: #87918c;
}

.brand-login-card label {
    color: #344b3e;
}

.brand-login-card input {
    min-height: 51px;
    border-color: #cfdad3;
    border-radius: 4px;
}

.brand-login-card button[type="submit"] {
    min-height: 53px;
    margin-top: 26px;
    border-radius: 28px;
    background: var(--desab-green-600);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.login-footer {
    margin-top: 23px;
    padding-top: 18px;
    border-top: 1px solid #e5ebe7;
    text-align: center;
    color: #85918a;
    font-size: 12px;
}

/* ---------- Public password link ---------- */

.public-page.brand-public-page {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 5% 12%,
            rgba(255, 255, 255, 0.065) 0 18%,
            transparent 18.2%
        ),
        radial-gradient(
            circle at 98% 92%,
            rgba(255, 255, 255, 0.065) 0 17%,
            transparent 17.2%
        ),
        linear-gradient(
            120deg,
            var(--desab-green-950),
            var(--desab-green-850)
        );
}

.public-shell {
    position: relative;
    z-index: 1;
}

.public-brand {
    margin-bottom: 18px;
}

.public-brand-logo {
    display: block;
    width: min(300px, 80%);
    max-height: 118px;
    margin: 0 auto 12px;
    object-fit: contain;
    padding: 10px 18px;
    border-radius: 12px;
    background: #fff;
}

.public-brand h1 {
    color: #fff;
}

.public-brand p {
    color: #c6ddd1;
}

.public-card {
    border: 0;
    border-radius: 20px;
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.22);
}

.public-card h2 {
    color: var(--desab-green-900);
}

.public-meta div,
.password-rules {
    background: #f1f7f4;
}

.status-box.pending {
    background: #e9f4ef;
    color: #0c6e50;
}

.public-note {
    border-left: 3px solid var(--desab-orange);
    padding-left: 10px;
}

/* ---------- Form accents ---------- */

.checkbox-row input:checked {
    accent-color: var(--desab-green-600);
}

.notice-success {
    background: #e6f6ed;
    color: #155f3b;
    border-color: #bfdfcd;
}

.alert {
    border-left: 4px solid #bb3030;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-nav {
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .brand-logo {
        width: 145px;
        height: 46px;
    }

    .brand-copy {
        display: none;
    }

    .brand-login-card {
        padding: 28px 22px;
    }

    .login-logo,
    .public-brand-logo {
        width: min(270px, 90%);
    }
}

/* =========================================================
   v1.2.1 - Rediseño definitivo del link público
   ========================================================= */

body.desab-password-public {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at -3% 12%, rgba(255,255,255,.065) 0 19%, transparent 19.2%),
        radial-gradient(circle at 103% 92%, rgba(255,255,255,.065) 0 18%, transparent 18.2%),
        linear-gradient(135deg, #103f28 0%, #0d5432 48%, #0d4028 100%);
    color: #173725;
}

body.desab-password-public .public-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 42px 20px;
    background: transparent;
}

body.desab-password-public .public-shell {
    width: min(560px, 100%);
    margin: 0;
}

body.desab-password-public .public-card {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 38px 40px 34px;
    background: #ffffff;
    border: 0;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .25);
}

body.desab-password-public .public-logo-wrap {
    text-align: center;
    margin-bottom: 26px;
}

body.desab-password-public .public-brand-logo {
    width: min(310px, 88%);
    max-height: 120px;
    padding: 0;
    margin: 0 auto;
    background: transparent;
    border-radius: 0;
    object-fit: contain;
}

body.desab-password-public .public-heading {
    margin-bottom: 22px;
}

body.desab-password-public .public-heading h1 {
    margin: 0 0 5px;
    color: #123f27;
    font-size: 24px;
    line-height: 1.2;
}

body.desab-password-public .public-heading p {
    margin: 0;
    color: #7b8881;
    font-size: 14px;
}

body.desab-password-public .public-card h2 {
    margin: 0 0 18px;
    color: #123f27;
    font-size: 21px;
}

body.desab-password-public .public-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 25px;
}

body.desab-password-public .public-meta > div {
    padding: 13px 14px;
    background: #f2f7f4;
    border: 1px solid #dde8e1;
    border-radius: 10px;
}

body.desab-password-public .public-meta span {
    display: block;
    margin-bottom: 4px;
    color: #7d8982;
    font-size: 12px;
}

body.desab-password-public .public-meta strong {
    display: block;
    color: #214433;
    font-size: 14px;
    overflow-wrap: anywhere;
}

body.desab-password-public form {
    margin: 0;
}

body.desab-password-public label {
    display: block;
    margin: 17px 0 7px;
    color: #345443;
    font-size: 14px;
    font-weight: 700;
}

body.desab-password-public .password-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 8px;
    align-items: stretch;
    margin: 0;
}

body.desab-password-public .password-input-wrap input {
    width: 100%;
    min-width: 0;
    height: 48px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 14px;
    background: #fff;
    color: #1d3428;
    border: 1px solid #cbd8d0;
    border-radius: 7px;
    box-shadow: none;
}

body.desab-password-public .password-input-wrap input:focus {
    border-color: #15916f;
    outline: 3px solid rgba(21, 145, 111, .12);
}

body.desab-password-public .password-toggle {
    width: 92px;
    min-width: 92px;
    height: 48px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 10px;
    border: 1px solid #cbd8d0;
    border-radius: 7px;
    background: #edf4f0;
    color: #17583f;
    font-size: 13px;
    font-weight: 700;
}

body.desab-password-public .password-toggle:hover {
    background: #e0ece5;
}

body.desab-password-public .password-rules {
    margin-top: 19px;
    padding: 13px 14px;
    background: #f2f7f4;
    color: #5e7167;
    border: 1px solid #dce7e0;
    border-left: 4px solid #e49a20;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
}

body.desab-password-public button[type="submit"] {
    width: 100%;
    min-height: 52px;
    margin: 24px 0 0;
    padding: 0 20px;
    border: 0;
    border-radius: 28px;
    background: #16916f;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .02em;
    cursor: pointer;
}

body.desab-password-public button[type="submit"]:hover {
    background: #0e795b;
}

body.desab-password-public .public-note {
    margin: 20px 0 0;
    padding: 12px 14px;
    background: #fff9ef;
    color: #72511e;
    border: 1px solid #f0dfbf;
    border-left: 4px solid #e49a20;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
}

body.desab-password-public .alert,
body.desab-password-public .status-box {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 9px;
}

body.desab-password-public .status-box.success {
    background: #e7f6ed;
    color: #17603c;
}

body.desab-password-public .status-box.pending {
    background: #eaf5f1;
    color: #0d6b50;
}

body.desab-password-public .status-box.error,
body.desab-password-public .alert {
    background: #fff0f0;
    color: #a12626;
}

body.desab-password-public .public-footer {
    margin-top: 22px;
    padding-top: 17px;
    border-top: 1px solid #e4ebe6;
    color: #8b958f;
    text-align: center;
    font-size: 11px;
}

@media (max-width: 620px) {
    body.desab-password-public .public-page {
        padding: 18px 12px;
        align-items: flex-start;
    }

    body.desab-password-public .public-card {
        padding: 28px 20px 24px;
        border-radius: 16px;
    }

    body.desab-password-public .public-meta {
        grid-template-columns: 1fr;
    }

    body.desab-password-public .password-input-wrap {
        grid-template-columns: minmax(0, 1fr) 82px;
    }

    body.desab-password-public .password-toggle {
        width: 82px;
        min-width: 82px;
    }
}
/* =========================================================
   v1.7 - Notifier en Dashboard
   ========================================================= */

.notifier-card {
    margin: 22px 0;
    padding: 20px 22px;
    background: #fff;
    border: 1px solid #e2e9e5;
    border-radius: 16px;
    box-shadow: 0 8px 26px rgba(13, 63, 39, 0.07);
}

.notifier-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.notifier-status-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notifier-status-main strong {
    display: block;
    margin-top: 3px;
    color: #173725;
    font-size: 22px;
}

.notifier-dot {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 50%;
    box-shadow: 0 0 0 8px rgba(130, 145, 136, .12);
    background: #8a9890;
}

.notifier-ok .notifier-dot {
    background: #2ab36a;
    box-shadow: 0 0 0 8px rgba(42, 179, 106, .12);
}

.notifier-running .notifier-dot {
    background: #e49a20;
    box-shadow: 0 0 0 8px rgba(228, 154, 32, .14);
}

.notifier-error .notifier-dot {
    background: #c84444;
    box-shadow: 0 0 0 8px rgba(200, 68, 68, .12);
}

.notifier-details {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 18px;
}

.notifier-details > div {
    min-width: 0;
}

.notifier-details span {
    display: block;
    margin-bottom: 5px;
    color: #758199;
    font-size: 12px;
}

.notifier-details strong {
    color: #173725;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.notifier-summary {
    margin-top: 17px;
    padding: 10px 12px;
    background: #f3f7f5;
    border-left: 3px solid #e49a20;
    border-radius: 7px;
    color: #607067;
    font-size: 12px;
}

.notifier-error .notifier-summary {
    background: #fff1f1;
    border-left-color: #c84444;
    color: #8c3030;
}

@media (max-width: 1250px) {
    .notifier-details {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .notifier-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .notifier-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
/* =========================================================
   v1.8 - Usuarios del portal
   ========================================================= */

.portal-user-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 320px;
}

.portal-user-actions form {
    margin: 0;
}

.portal-user-actions button {
    margin: 0;
}

.portal-user-actions button:disabled {
    opacity: .42;
    cursor: not-allowed;
}

.portal-user-self {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    background: #edf5f0;
    color: #176044;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 800px) {
    .portal-user-actions {
        min-width: 0;
    }
}
/* =========================================================
   v1.9 - Recuperación de acceso
   ========================================================= */

.login-help {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
}

.login-help a {
    color: #0f7658;
    font-weight: 700;
}

.login-help a:hover {
    color: #0b5f47;
}
/* =========================================================
   v2.0 - Usuario conectado resaltado
   ========================================================= */

.admin-nav .logged-user {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: 5px;
    padding: 6px 11px 6px 7px;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 12px;
    background: rgba(255,255,255,.14);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.admin-nav .logged-user:hover {
    background: rgba(255,255,255,.22);
    color: #fff;
}

.logged-user-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    background: #e49a20;
    color: #173725;
    font-size: 15px;
    font-weight: 900;
}

.logged-user-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.12;
}

.logged-user-copy small {
    color: #cfe2d8;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.logged-user-copy strong {
    max-width: 170px;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logged-user-copy em {
    max-width: 170px;
    overflow: hidden;
    margin-top: 2px;
    color: #d6e7df;
    font-size: 10px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1050px) {
    .admin-nav .logged-user {
        order: -1;
        margin-left: 0;
    }
}
/* =========================================================
   v2.1 - Sesiones RDS
   ========================================================= */

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

.rds-filters {
    grid-template-columns:
        minmax(240px, 1fr)
        220px
        190px
        auto
        auto;
}

.rds-table code {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 6px;
    background: #eef4f0;
    color: #134f35;
    font-weight: 700;
}

.rds-worker-info {
    margin: 14px 2px 0;
    color: #6e7c75;
    font-size: 12px;
}

@media (max-width: 1000px) {
    .cards-four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rds-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .cards-four,
    .rds-filters {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   v2.3 - RBAC
   ========================================================= */

.role-help {
    margin: 8px 0 18px;
    padding: 12px 14px;
    border-left: 4px solid #e49a20;
    border-radius: 7px;
    background: #f4f7f5;
    color: #5e6b64;
    font-size: 12px;
    line-height: 1.6;
}

.role-badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.role-admin {
    background: #e7f5ed;
    color: #16643d;
}

.role-operator {
    background: #fff4d9;
    color: #8a5a00;
}

.role-auditor {
    background: #edf1f6;
    color: #4d5c71;
}

.logged-user-copy em {
    font-weight: 700;
}
/* =========================================================
   v2.3.4 - Auditoría de seguridad
   ========================================================= */

.audit-filters-v234 {
    display: grid;
    grid-template-columns:
        minmax(220px, 2fr)
        minmax(180px, 1fr)
        minmax(160px, 1fr)
        minmax(150px, 1fr)
        minmax(130px, 1fr)
        minmax(130px, 1fr);
    gap: 10px;
    align-items: end;
}

.audit-date-filter {
    margin: 0;
}

.audit-date-filter span {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #617069;
}

@media (max-width: 1200px) {
    .audit-filters-v234 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .audit-filters-v234 {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   v2.4.0 - Documentación técnica
   ========================================================= */
.docs-page {
    padding-bottom: 48px;
}
.docs-section {
    margin-bottom: 18px;
    scroll-margin-top: 90px;
}
.docs-section h2 {
    margin-top: 0;
}
.docs-section h3 {
    margin-top: 24px;
}
.docs-toc {
    margin-bottom: 18px;
}
.docs-grid-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 18px;
}
.docs-grid-links a {
    text-decoration: none;
    font-weight: 700;
}
.docs-warning {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-left: 4px solid #d78d19;
    background: #fff8e9;
    border-radius: 8px;
    line-height: 1.55;
}
.docs-code,
.docs-diagram,
.docs-source pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow-x: auto;
    padding: 14px;
    border-radius: 8px;
    background: #15211d;
    color: #edf5f1;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.55;
}
.docs-source {
    margin: 10px 0 18px;
    border: 1px solid #dbe4df;
    border-radius: 8px;
    padding: 10px 12px;
}
.docs-source summary {
    cursor: pointer;
    font-weight: 800;
}
.docs-list,
.docs-checklist {
    line-height: 1.65;
}
.docs-checklist li {
    margin-bottom: 6px;
}
@media (max-width: 1000px) {
    .docs-grid-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 650px) {
    .docs-grid-links {
        grid-template-columns: 1fr;
    }
}
.password-policy-helper {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #dfe5e2;
    border-radius: 8px;
    background: #f8faf9;
}

.password-policy-helper > strong {
    display: block;
    margin-bottom: 12px;
}

.password-policy-subtitle {
    margin: 14px 0 8px;
    font-size: 0.92rem;
    font-weight: 600;
}

.password-rule {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 6px 0;
    font-size: 0.92rem;
}

.password-rule .rule-icon {
    display: inline-block;
    min-width: 18px;
    font-weight: 700;
}

.password-rule[data-valid="true"] {
    color: #237a3b;
}

.password-rule[data-valid="false"] {
    color: #68726d;
}

.password-rule-result {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e7e4;
    font-weight: 600;
}

.password-policy-note {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e2e7e4;
    color: #68726d;
    font-size: 0.85rem;
    line-height: 1.45;
}
/* =========================================================
   Dashboard FEDEA - indicadores secundarios compactos
   ========================================================= */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    margin-top: 8px;
    margin-bottom: 12px;
}

.dashboard-cards article {
    min-height: 0;
    padding: 6px 10px;
    border-radius: 7px;
    box-shadow: none;
    background: #f8faf9;
}

.dashboard-cards span {
    margin: 0;
    font-size: 10px;
    line-height: 1.1;
}

.dashboard-cards strong {
    margin-top: 2px;
    font-size: 17px;
    line-height: 1;
}

.worker-card {
    margin-bottom: 12px;
}

.dashboard-cards + .panel {
    margin-top: 0;
}

@media (max-width: 1100px) {
    .dashboard-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

