@import url("https://fonts.googleapis.com/css2?family=Onest:wght@100..900&display=swap");
:root {
    --green: #44704A;
    --dark: #244034;
    --orange: #f09d23;
    --soft: #eff6f3;
    --text: #22322b;
    --muted: #6d7d73;
    --line: #dbe8e1;
    --white: #ffffff;
    --danger: #b3261e;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--soft); color: var(--text); }
a { color: var(--green); text-decoration: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; background: linear-gradient(180deg, var(--dark), #172a22); padding: 24px 18px; color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; font-size: 18px; margin-bottom: 28px; }
.brand img { width: 88px; max-height: 44px; object-fit: contain; filter: brightness(0) invert(1); }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a { color: rgba(255,255,255,.82); padding: 12px 14px; border-radius: 14px; font-weight: 650; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.main { margin-left: 270px; min-height: 100vh; padding: 28px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 24px; }
.eyebrow { margin: 0 0 4px; color: var(--green); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: 0; color: var(--dark); font-size: 30px; line-height: 1.1; }
h2 { color: var(--dark); margin-top: 0; }
.userbox { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(36,64,52,.08); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: 0 12px 34px rgba(36,64,52,.08); margin-bottom: 20px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.stat strong { display: block; color: var(--dark); font-size: 30px; }
.stat span { color: var(--muted); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 16px; border-radius: 14px; border: 1px solid transparent; background: var(--green); color: #fff; font-weight: 800; cursor: pointer; }
.btn:hover { background: var(--dark); color: #fff; }
.btn.secondary { background: var(--orange); color: var(--dark); }
.btn.ghost { background: #fff; color: var(--green); border-color: var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { min-height: 34px; padding: 7px 12px; border-radius: 11px; font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--dark); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; background: #f7fbf9; }
tr:hover td { background: #fbfdfc; }
.badge { display: inline-flex; padding: 5px 10px; border-radius: 999px; background: #e7f0ea; color: var(--dark); font-weight: 800; font-size: 12px; }
.badge.orange { background: #fff0db; color: #7a4900; }
.badge.green { background: #e5f2e8; color: var(--green); }
.badge.red { background: #ffe7e5; color: var(--danger); }
form .field { margin-bottom: 16px; }
label { display: block; margin-bottom: 7px; color: var(--dark); font-weight: 800; }
input, select, textarea { width: 100%; border: 1px solid #cddbd4; border-radius: 13px; padding: 12px 13px; font: inherit; background: #fff; color: var(--text); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(240,157,35,.22); border-color: var(--orange); }
.help { color: var(--muted); font-size: 13px; margin-top: 5px; }
.checkbox-list { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; max-height: 260px; overflow: auto; }
.checkbox-list label { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 650; }
.checkbox-list input { width: auto; }
.alert { border-radius: 16px; padding: 13px 16px; margin-bottom: 18px; font-weight: 700; }
.alert.success { background: #e5f2e8; color: var(--dark); }
.alert.error { background: #ffe7e5; color: var(--danger); }
.alert.info { background: #fff3df; color: #7a4900; }
.alert.warning { background: #fff3df; color: #7a4900; }
.auth-main { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, rgba(240,157,35,.18), transparent 32%), var(--soft); }
.auth-card { width: min(460px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 30px; box-shadow: 0 20px 60px rgba(36,64,52,.15); }
.auth-card img { width: 170px; display: block; margin: 0 auto 22px; }
.auth-card h1 { text-align: center; margin-bottom: 6px; }
.auth-card p { text-align: center; color: var(--muted); }
.hidden { display: none !important; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 18px; }
.kv dt { font-weight: 800; color: var(--dark); }
.kv dd { margin: 0; color: var(--text); }
.kv.kv-hide-empty dt.hidden, .kv.kv-hide-empty dd.hidden { display: none !important; }
@media (max-width: 980px) {
    .sidebar { position: static; width: auto; }
    .main { margin-left: 0; padding: 18px; }
    .stats, .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: flex-start; }
}
.mt-8 { margin-top: 8px; }
.actions.right { justify-content: flex-end; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.row-actions form { margin: 0; }
.icon-btn { width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--dark); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 900; font-size: 15px; line-height: 1; }
.icon-btn:hover { border-color: var(--green); color: var(--green); background: #f7fbf9; }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: #fff5f4; }
.icon-btn svg { width: 17px; height: 17px; display: block; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 31, 24, .48); display: none; align-items: center; justify-content: center; padding: 22px; z-index: 1000; }
.modal-backdrop.open { display: flex; }
.modal-card { width: min(760px, 100%); max-height: 88vh; overflow: auto; background: #fff; border-radius: 24px; border: 1px solid var(--line); box-shadow: 0 30px 90px rgba(0,0,0,.28); padding: 22px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; }
.modal-body .kv { grid-template-columns: 190px 1fr; }
.modal-template { display: none; }
.table-responsive { overflow-x: auto; }
.badge.blue { background: #e7eef8; color: #24476f; }
.badge.purple { background: #f0e8ff; color: #5a348d; }
.table-compact th, .table-compact td { padding: 9px 8px; font-size: 13px; }
.table-compact .help { font-size: 12px; }
.repeat-box { border: 1px dashed var(--line); border-radius: 18px; padding: 16px; background: #fbfdfc; }
.actions-final { justify-content: flex-end; margin-top: 4px; }
.mobile-menu-btn { display: none; }
.mobile-menu-backdrop { display: none; }
.alerts-widget { position: relative; }
.alert-bell { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--dark); cursor: pointer; position: relative; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.alert-bell:hover { border-color: var(--green); color: var(--green); background: #f7fbf9; }
.alert-count { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--orange); color: var(--dark); font-size: 11px; font-weight: 900; border: 2px solid #fff; }
.alerts-panel { position: absolute; top: calc(100% + 10px); right: 0; width: min(360px, 90vw); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 22px 70px rgba(36,64,52,.22); padding: 10px; z-index: 1200; display: none; }
.alerts-panel.open { display: block; }
.alerts-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.alerts-head a { font-weight: 800; font-size: 13px; }
.alert-item, .alert-list-item { display: grid; grid-template-columns: 12px 1fr; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 14px; color: var(--text); }
.alert-item:hover, .alert-list-item:hover { background: #f7fbf9; color: var(--text); }
.alert-item.unread, .alert-list-item.unread { background: #fffaf1; }
.alert-item strong, .alert-list-item strong { display: block; color: var(--dark); font-size: 14px; }
.alert-item small, .alert-list-item small { display: block; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.alert-list-item em { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; font-style: normal; }
.alert-dot { width: 10px; height: 10px; border-radius: 999px; margin-top: 5px; background: var(--green); }
.alert-dot.warning { background: var(--orange); }
.alert-dot.error { background: var(--danger); }
.alert-dot.info { background: #4f70a8; }
.alert-empty { padding: 18px 10px; color: var(--muted); text-align: center; }
.alerts-list { display: grid; gap: 8px; }

@media (max-width: 980px) {
    .mobile-menu-btn { display: inline-flex; position: fixed; top: 14px; left: 14px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 14px; align-items: center; justify-content: center; background: #fff; color: var(--dark); z-index: 1300; font-size: 22px; box-shadow: 0 8px 24px rgba(36,64,52,.12); }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: min(310px, 88vw); transform: translateX(-105%); transition: transform .22s ease; z-index: 1250; }
    body.menu-open .sidebar { transform: translateX(0); }
    .mobile-menu-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,31,24,.45); z-index: 1240; }
    body.menu-open .mobile-menu-backdrop { display: block; }
    .main { margin-left: 0; padding: 72px 16px 18px; }
    .topbar { flex-direction: column; align-items: stretch; }
    .userbox { justify-content: space-between; flex-wrap: wrap; }
    .alerts-panel { left: auto; right: 0; }
    .section-title { align-items: flex-start; flex-direction: column; }
}

/* Actualización 12 */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--dark); font-weight: 800; }
.tab span { display: inline-flex; min-width: 22px; height: 22px; align-items: center; justify-content: center; padding: 0 6px; border-radius: 999px; background: #eef6f2; color: var(--green); font-size: 12px; }
.tab.active { background: var(--green); border-color: var(--green); color: #fff; }
.tab.active span { background: rgba(255,255,255,.22); color: #fff; }
.row-disabled td { opacity: .72; background: #faf7f1; }
.check-inline { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.cal-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; background: var(--green); margin-left: 6px; }
.cal-dot.tarea { background: var(--orange); }
.cal-dot.acreditacion { background: #4f70a8; }
.cal-dot.liquidacion { background: #7a4fa8; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; }
.calendar-head { padding: 10px; background: var(--dark); color: #fff; font-weight: 900; text-align: center; font-size: 13px; }
.calendar-day { min-height: 132px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; position: relative; }
.calendar-day:nth-child(7n+7) { border-right: 0; }
.calendar-day.outside { background: #f7fbf9; color: var(--muted); }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--orange); }
.calendar-date { font-weight: 900; color: var(--dark); margin-bottom: 6px; }
.calendar-event { display: block; border-radius: 10px; padding: 7px 8px; margin-bottom: 6px; color: var(--dark); background: #e7f0ea; border-left: 4px solid var(--green); font-size: 12px; line-height: 1.25; }
.calendar-event strong { display: block; color: var(--dark); }
.calendar-event span { display: block; color: var(--muted); margin-top: 2px; }
.calendar-event:hover { background: #dfeee5; color: var(--dark); }
.calendar-event.orange, .calendar-event.tarea, .calendar-event.aviso { border-left-color: var(--orange); background: #fff3df; }
.calendar-event.blue, .calendar-event.reunion { border-left-color: #4f70a8; background: #e7eef8; }
.calendar-event.purple, .calendar-event.liquidacion { border-left-color: #7a4fa8; background: #f0e8ff; }
.calendar-event.green { border-left-color: var(--green); background: #e5f2e8; }
.calendar-event.red { border-left-color: var(--danger); background: #ffe7e5; }
.calendar-event.acreditacion { border-left-color: #4f70a8; background: #e7eef8; }

@media (max-width: 760px) {
    .calendar-grid { grid-template-columns: 1fr; border-radius: 14px; }
    .calendar-head { display: none; }
    .calendar-day { min-height: auto; border-right: 0; }
    .calendar-day.outside:empty { display: none; }
}

/* Actualización 13 */
.subcard { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fbfdfc; margin-top: 14px; }
.subcard h3 { margin: 0 0 6px; color: var(--dark); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.calendar-legend .cal-dot.curso { background: var(--green); }
.calendar-legend .cal-dot.acreditacion { background: var(--orange); }
.calendar-legend .cal-dot.liquidacion { background: #7a4fa8; }
.calendar-legend .cal-dot.tarea { background: #4f70a8; }
.calendar-legend .cal-dot.cancelado { background: var(--danger); }
.calendar-legend .cal-dot.finalizado { background: var(--dark); }
.calendar-event.curso { border-left-color: var(--green); background: #e5f2e8; }
.calendar-event.curso-liquidacion { border-left-color: #7a4fa8; background: #f0e8ff; }
.calendar-event.curso-finalizado { border-left-color: var(--dark); background: #e7eee9; }
.calendar-event.curso-cancelado { border-left-color: var(--danger); background: #ffe7e5; }
.calendar-event.acreditacion { border-left-color: var(--orange); background: #fff3df; }
.calendar-event.tarea, .calendar-event.reunion { border-left-color: #4f70a8; background: #e7eef8; }
.calendar-event.liquidacion { border-left-color: #7a4fa8; background: #f0e8ff; }
.calendar-list-type { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-weight: 800; font-size: 12px; background: #e5f2e8; color: var(--dark); }
.calendar-list-type.acreditacion { background: #fff3df; color: #7a4900; }
.calendar-list-type.liquidacion { background: #f0e8ff; color: #5a348d; }
.calendar-list-type.tarea, .calendar-list-type.reunion { background: #e7eef8; color: #24476f; }
.calendar-list-type.curso-cancelado { background: #ffe7e5; color: var(--danger); }
.calendar-list-type.curso-finalizado { background: #e7eee9; color: var(--dark); }
@media (max-width: 980px) { .grid.cols-4 { grid-template-columns: 1fr; } }

/* Update 29: compact linked lists for course/accreditation detail pages */
.compact-list {
    margin: 6px 0 0 18px;
    padding: 0;
}
.compact-list li {
    margin: 3px 0;
}
.mt-8 { margin-top: 8px; }

/* DataTables local */
.datatable-controls,
.datatable-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: .75rem 0;
}
.datatable-length,
.datatable-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #5f7068;
    font-size: .92rem;
}
.datatable-search label {
    font-weight: 700;
    color: #244034;
}
.datatable-search input {
    min-width: 360px;
}
th.datatable-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.4rem;
}
th.datatable-sortable::after {
    content: '↕';
    position: absolute;
    right: .45rem;
    opacity: .35;
    font-size: .8rem;
}
th.datatable-sortable.sort-asc::after { content: '↑'; opacity: .8; }
th.datatable-sortable.sort-desc::after { content: '↓'; opacity: .8; }
.datatable-info {
    color: #5f7068;
    font-size: .9rem;
}
.datatable-pager {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap;
}
.datatable-page {
    border: 1px solid #d7e5dd;
    background: #fff;
    color: #244034;
    border-radius: .55rem;
    padding: .35rem .6rem;
    cursor: pointer;
    font-weight: 700;
}
.datatable-page:hover:not(:disabled),
.datatable-page.active {
    background: #44704A;
    color: #fff;
    border-color: #44704A;
}
.datatable-page:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.datatable-dots {
    color: #78877f;
    padding: 0 .25rem;
}
.datatable-empty-row td {
    text-align: center;
    color: #78877f;
    padding: 1.2rem;
}
@media (max-width: 760px) {
    .datatable-controls,
    .datatable-summary {
        align-items: stretch;
        flex-direction: column;
    }
    .datatable-length,
    .datatable-search {
        width: 100%;
        justify-content: space-between;
    }
    .datatable-search {
        align-items: stretch;
        flex-direction: column;
    }
    .datatable-search input {
        min-width: 0;
        width: 100%;
    }
}
.row-unread td { background: #fff9ed; }

/* Update 32: DataTables y cabecera móvil */
.datatable-controls {
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}
.datatable-search {
    flex: 1 1 420px;
    max-width: 640px;
}
.datatable-search input {
    width: 100%;
    min-width: 420px;
    padding: 13px 15px;
}
.datatable-length {
    margin-left: auto;
    white-space: nowrap;
}
.datatable-summary {
    margin-top: 12px;
}
.datatable-pager {
    margin-left: auto;
}

@media (min-width: 981px) {
    .mobile-menu-btn { display: none !important; }
}

@media (max-width: 980px) {
    .mobile-menu-btn {
        display: inline-flex;
        position: static;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        border: 1px solid var(--line);
        border-radius: 14px;
        align-items: center;
        justify-content: center;
        background: #fff;
        color: var(--dark);
        z-index: auto;
        font-size: 22px;
        box-shadow: none;
        padding: 0;
        cursor: pointer;
    }
    .main { padding: 18px 16px; }
    .topbar {
        gap: 14px;
        margin-bottom: 18px;
    }
    .topbar > div:first-child {
        order: 2;
        width: 100%;
    }
    .topbar .userbox {
        order: 1;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        flex-wrap: nowrap;
        padding: 10px;
    }
    .userbox > span {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: center;
    }
    .userbox .btn.small {
        flex: 0 0 auto;
    }
    .alerts-widget {
        flex: 0 0 auto;
    }
    .alerts-panel {
        left: 0;
        right: auto;
        width: min(360px, calc(100vw - 32px));
    }
    h1 { font-size: 28px; }
    .datatable-controls {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    .datatable-search {
        flex: 1 1 auto;
        max-width: none;
    }
    .datatable-search input {
        min-width: 0;
        width: 100%;
    }
    .datatable-length {
        flex: 0 0 auto;
        margin-left: 0;
    }
}

@media (max-width: 620px) {
    .topbar .userbox {
        gap: 8px;
    }
    .alert-bell,
    .mobile-menu-btn {
        width: 40px;
        height: 40px;
    }
    .userbox .btn.small {
        padding: 7px 10px;
    }
    .datatable-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .datatable-search,
    .datatable-length {
        width: 100%;
    }
    .datatable-length {
        justify-content: flex-end;
    }
    .datatable-summary {
        align-items: stretch;
        flex-direction: column;
    }
    .datatable-pager {
        margin-left: 0;
        justify-content: flex-end;
    }
}

/* Actualización 57: rediseño visual base inspirado en panel administrativo moderno */
:root {
    --green: #3f7248;
    --green-2: #5e9968;
    --green-dark: #183829;
    --green-deep: #10261d;
    --orange: #f09d23;
    --soft: #f4f7f6;
    --soft-2: #eef5f1;
    --text: #24342d;
    --muted: #708078;
    --line: #dfe8e3;
    --white: #ffffff;
    --danger: #b3261e;
    --blue: #4f70a8;
    --purple: #7a4fa8;
    --sidebar-width: 288px;
    --shadow-sm: 0 8px 22px rgba(19, 46, 35, .07);
    --shadow-md: 0 16px 42px rgba(19, 46, 35, .11);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
}
html { min-height: 100%; }
body {
    min-height: 100%;
    background:
        radial-gradient(circle at top right, rgba(240, 157, 35, .10), transparent 32rem),
        linear-gradient(180deg, #f8faf9 0%, var(--soft) 42%, #edf4f0 100%);
    color: var(--text);
}
a { color: var(--green); }
.sidebar {
    width: var(--sidebar-width);
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(63, 114, 72, .34), transparent 34%),
        linear-gradient(180deg, var(--green-dark), var(--green-deep));
    box-shadow: 18px 0 48px rgba(16, 38, 29, .18);
    overflow-x: hidden;
    overflow-y: auto;
}
.sidebar::before {
    content: '';
    position: absolute;
    width: 210px;
    height: 210px;
    right: -96px;
    top: -86px;
    border-radius: 999px;
    background: rgba(240, 157, 35, .16);
    pointer-events: none;
}
.sidebar-inner {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}
.brand {
    min-height: 86px;
    padding: 12px 10px 22px;
    margin: 0 0 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.brand img {
    width: 214px;
    max-width: 100%;
    max-height: 68px;
    object-fit: contain;
    filter: none;
}
.sidebar-nav,
.sidebar nav {
    display: grid;
    gap: 7px;
    padding-top: 10px;
}
.nav-label {
    margin: 10px 10px 8px;
    color: rgba(255, 255, 255, .46);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.sidebar nav a,
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 15px;
    color: rgba(255, 255, 255, .78);
    font-weight: 750;
    border: 1px solid transparent;
}
.sidebar nav a:hover,
.sidebar nav a.active,
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .10);
    color: #fff;
    box-shadow: inset 3px 0 0 rgba(240, 157, 35, .92);
}
.nav-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .10);
    color: #fff;
    font-weight: 900;
    line-height: 1;
}
.sidebar nav a.active .nav-icon,
.sidebar-nav a.active .nav-icon {
    background: rgba(240, 157, 35, .95);
    color: var(--green-deep);
}
.sidebar-footer {
    margin-top: auto;
    padding: 18px 10px 2px;
    border-top: 1px solid rgba(255, 255, 255, .10);
    display: grid;
    gap: 12px;
}
.sidebar-footer p {
    margin: 0;
    color: rgba(255, 255, 255, .48);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.sidebar-footer img {
    display: block;
    max-width: 180px;
    max-height: 42px;
    object-fit: contain;
    opacity: .92;
}
.sidebar-footer img + img {
    max-width: 92px;
    max-height: 50px;
}
.main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 26px 30px 34px;
}
.topbar {
    min-height: 76px;
    padding: 13px 14px 13px 22px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(223, 232, 227, .92);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}
.page-title-block { min-width: 0; }
.eyebrow {
    color: var(--orange);
    font-size: 12px;
    letter-spacing: .13em;
}
h1 {
    color: var(--green-deep);
    font-size: clamp(25px, 2.2vw, 34px);
    font-weight: 850;
}
h2, h3 { color: var(--green-deep); }
.userbox {
    padding: 8px;
    border-radius: 18px;
    border-color: rgba(223, 232, 227, .95);
    box-shadow: none;
    background: #fff;
}
.user-name {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
    color: var(--green-deep);
}
.alert-bell {
    border-radius: 14px;
    background: var(--soft-2);
    border-color: transparent;
    color: var(--green);
    font-size: 13px;
}
.alert-bell span[aria-hidden="true"] {
    width: 9px;
    height: 9px;
    display: block;
    border-radius: 999px;
    background: var(--green);
    color: transparent;
    box-shadow: 0 0 0 6px rgba(63, 114, 72, .12);
}
.alert-count {
    background: var(--orange);
    color: #2d210c;
}
.card,
.auth-card,
.modal-card {
    border-color: rgba(223, 232, 227, .95);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.card { padding: 24px; }
.section-title {
    padding-bottom: 12px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.stats {
    gap: 18px;
}
.stat {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border: 1px solid rgba(223, 232, 227, .95);
    border-radius: 22px;
    box-shadow: var(--shadow-sm);
}
.stat::after {
    content: '';
    position: absolute;
    width: 76px;
    height: 76px;
    right: -26px;
    top: -26px;
    border-radius: 999px;
    background: rgba(240, 157, 35, .14);
}
.stat strong {
    color: var(--green-deep);
    font-size: 34px;
    letter-spacing: -.03em;
}
.stat span {
    color: var(--muted);
    font-weight: 750;
}
.btn {
    min-height: 40px;
    padding: 9px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--nde-primary);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: none;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.btn:hover {
    background: var(--green-dark);
    color: #fff;
    transform: none;
}
.btn.secondary {
    background: var(--orange);
    color: #2d210c;
}
.btn.ghost {
    background: #fff;
    color: var(--green);
    border-color: var(--line);
    box-shadow: none;
}
.btn.ghost:hover {
    background: var(--soft-2);
    color: var(--green-dark);
    border-color: rgba(63, 114, 72, .18);
}
.btn.danger {
    background: var(--danger);
    color: #fff;
}
input, select, textarea {
    border-radius: 12px;
    border-color: #d8e4de;
    background: #fff;
}
input:focus, select:focus, textarea:focus {
    outline: 4px solid rgba(63, 114, 72, .13);
    border-color: var(--green);
}
.checkbox-list,
.repeat-box,
.subcard {
    border-radius: 18px;
    background: #fbfdfc;
}
table {
    border-collapse: separate;
    border-spacing: 0;
}
th {
    background: #f2f7f4;
    color: #395247;
    border-bottom: 1px solid var(--line);
}
td { background: #fff; }
tr:hover td { background: #f7fbf9; }
.badge {
    min-height: 26px;
    align-items: center;
    border: 1px solid transparent;
    font-weight: 850;
}
.badge.green { background: #e6f4ea; color: #2d6940; border-color: #cde8d4; }
.badge.orange { background: #fff2dc; color: #80500b; border-color: #ffe0aa; }
.badge.red { background: #ffe9e6; color: var(--danger); border-color: #ffc8c1; }
.badge.blue { background: #e8f0fb; color: #24476f; border-color: #d3e0f3; }
.badge.purple { background: #f3ecff; color: #5a348d; border-color: #e2d3fb; }
.alert {
    border: 1px solid transparent;
    border-radius: 16px;
}
.alert.success { background: #e6f4ea; color: #244934; border-color: #cde8d4; }
.alert.error { background: #ffe9e6; color: var(--danger); border-color: #ffc8c1; }
.alert.info,
.alert.warning { background: #fff2dc; color: #80500b; border-color: #ffe0aa; }
.auth-main {
    background:
        radial-gradient(circle at top left, rgba(240,157,35,.22), transparent 24rem),
        radial-gradient(circle at bottom right, rgba(63,114,72,.16), transparent 28rem),
        linear-gradient(135deg, #f6faf7, #eef5f1);
}
.auth-card {
    padding: 34px;
}
.auth-card img {
    width: min(230px, 78%);
    margin-bottom: 24px;
}
.auth-card .btn { width: 100%; }
.datatable-page:hover:not(:disabled),
.datatable-page.active {
    background: var(--green);
    border-color: var(--green);
}
.calendar-head { background: var(--green-dark); }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--orange); }
.mobile-menu-btn {
    border-radius: 13px;
}
@media (max-width: 1180px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .sidebar {
        width: min(310px, 88vw);
        padding: 18px;
        overflow-y: auto;
    }
    .sidebar-inner { min-height: calc(100vh - 36px); }
    .main {
        margin-left: 0;
        padding: 18px 16px 22px;
    }
    .topbar {
        padding: 11px;
        border-radius: 20px;
    }
    .topbar > div:first-child {
        order: 2;
        width: 100%;
        padding: 2px 4px 4px;
    }
    .topbar .userbox {
        order: 1;
        width: 100%;
    }
    .brand { min-height: auto; padding-bottom: 18px; }
    .brand img { width: 206px; }
    .sidebar-footer { padding-bottom: 10px; }
}
@media (max-width: 620px) {
    .stats { grid-template-columns: 1fr; }
    .card { padding: 18px; border-radius: 20px; }
    .user-name { max-width: 140px; }
    .sidebar-footer img { max-width: 160px; }
}

/* Update 58: adaptación visual NiceDash comprada (PHP/MariaDB) */
:root,
html.green_theme {
    --mat-sys-primary: rgb(22, 90, 80);
    --mat-sys-primary-fixed-dim: rgba(22, 90, 80, 0.15);
    --mat-sys-secondary: rgb(194, 253, 117);
    --mat-sys-secondary-fixed-dim: rgba(194, 253, 117, 0.15);
    --mat-sys-tertiary: rgb(194, 253, 117);
    --mat-sys-background: #f5f5f5;
    --mat-sys-surface-bright: #f2f6fa;
    --mat-sys-surface: #fff;
    --mat-sys-surface-container: #fff;
    --mat-sys-on-background: #030e09;
    --mat-sys-outline: #e5e6e6;
    --mat-sys-outline-variant: #e5e6e6;
    --mat-sys-error: #ef4444;
    --mat-sys-error-fixed-dim: rgba(239, 68, 68, .15);
    --nde-primary: #165a50;
    --nde-primary-soft: rgba(22, 90, 80, .15);
    --nde-secondary: #f09d23;
    --nde-secondary-soft: rgba(194, 253, 117, .22);
    --nde-bg: #f2f6fa;
    --nde-surface: #ffffff;
    --nde-text: #030e09;
    --nde-muted: #6f7b76;
    --nde-border: #e5e6e6;
    --nde-shadow: 0 2px 10px rgba(0, 0, 0, .04);
    --nde-shadow-lg: 0 12px 40px rgba(3, 14, 9, .08);
    --nde-radius: 16px;
    --nde-header-height: 70px;
    --nde-sidebar-width: 270px;
    --nde-sidebar-mini: 87px;
    --green: var(--nde-primary);
    --dark: var(--nde-text);
    --orange: #f6b51e;
    --soft: var(--nde-bg);
    --text: var(--nde-text);
    --muted: var(--nde-muted);
    --line: var(--nde-border);
    --danger: var(--mat-sys-error);
}

html.light-theme,
body.nicedash-body {
    color-scheme: light;
}

body.nicedash-body {
    margin: 0;
    min-height: 100vh;
    background: var(--nde-bg);
    color: var(--nde-text);
    font-family: "Onest", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

body.nicedash-body a { color: var(--nde-primary); }
body.nicedash-body .hidden { display: none !important; }
body.nicedash-body .iconify { display: inline-flex; width: 1.25em; height: 1.25em; line-height: 1; }

body.nicedash-body .sidebar.sidebarNav {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--nde-sidebar-width);
    padding: 0;
    background: var(--nde-surface);
    color: var(--nde-text);
    border-right: 1px solid var(--nde-border);
    box-shadow: none;
    overflow: hidden;
    z-index: 1300;
    transition: width .28s cubic-bezier(.25,.8,.25,1), transform .28s ease, box-shadow .28s ease;
}

body.nicedash-body .sidebar-inner.flex-layout {
    height: 100vh;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.nicedash-body .sidebar-brand-row {
    min-height: var(--nde-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    white-space: nowrap;
}

body.nicedash-body .brand.branding {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-height: 46px;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body.nicedash-body .brand.branding img {
    width: 156px;
    max-width: 100%;
    max-height: 52px;
    object-fit: contain;
    filter: none;
}

body.nicedash-body .sidebar-nav.sidebar-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 20px 18px;
    display: block;
    scrollbar-width: thin;
    scrollbar-color: rgba(22,90,80,.25) transparent;
}

body.nicedash-body .sidebar-divider {
    height: 1px;
    display: block;
    margin: 0 0 12px;
    background: var(--nde-border);
    width: 100%;
}

body.nicedash-body .nav-label.nav-caption {
    margin: 0;
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--nde-muted);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: .06em;
    line-height: 140%;
    text-transform: uppercase;
}

body.nicedash-body .nav-label .caption-icon { display: none; }

body.nicedash-body .menu-list-item.nav-link,
body.nicedash-body .sidebar nav a.menu-list-item.nav-link {
    position: relative;
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 2px;
    padding: 11px 14px !important;
    border-radius: 10px;
    color: var(--nde-muted);
    font-size: 15px;
    font-weight: 500;
    line-height: 25px;
    white-space: nowrap;
    background: transparent;
    text-decoration: none;
    transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

body.nicedash-body .menu-list-item.nav-link .routeIcon,
body.nicedash-body .menu-list-item.nav-link .nav-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    font-size: 22px;
    color: currentColor;
}

body.nicedash-body .menu-list-item.nav-link:hover {
    color: var(--nde-primary);
    background: var(--nde-primary-soft);
}

body.nicedash-body .menu-list-item.nav-link.active,
body.nicedash-body .menu-list-item.nav-link.activeMenu {
    color: #fff;
    background: var(--nde-primary);
    box-shadow: 0 8px 22px rgba(22, 90, 80, .22);
}

body.nicedash-body .menu-list-item.nav-link.active .routeIcon,
body.nicedash-body .menu-list-item.nav-link.activeMenu .routeIcon {
    color: var(--nde-secondary);
}

body.nicedash-body .item-chip {
    margin-left: auto;
    min-width: 24px;
    height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--nde-primary);
    border: 1px solid var(--nde-primary);
    background: #fff;
}

body.nicedash-body .menu-list-item.active .item-chip { border-color: rgba(255,255,255,.5); color: #fff; background: rgba(255,255,255,.16); }

body.nicedash-body .sidebar-footer.profile-bar {
    flex: 0 0 auto;
    margin: 0 20px 18px;
    padding: 16px;
    border: 1px solid var(--nde-border);
    border-radius: var(--nde-radius);
    background: linear-gradient(180deg, #fff, #f8fafd);
    text-align: center;
    box-shadow: var(--nde-shadow);
}

body.nicedash-body .sidebar-footer.profile-bar p {
    margin: 0 0 10px;
    color: var(--nde-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

body.nicedash-body .sidebar-footer.profile-bar img {
    display: block;
    max-width: 170px;
    max-height: 42px;
    object-fit: contain;
    margin: 10px auto 0;
}

body.nicedash-body .main.contentWrapper {
    min-height: 100vh;
    margin-left: var(--nde-sidebar-width);
    padding: 0;
    background: var(--nde-bg);
    transition: margin-left .28s cubic-bezier(.25,.8,.25,1);
}

body.nicedash-body .topbar.mat-toolbar {
    position: sticky;
    top: 0;
    z-index: 980;
    min-height: var(--nde-header-height);
    height: var(--nde-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0;
    padding: 0 24px;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--nde-border);
    backdrop-filter: blur(14px);
    box-shadow: none;
}

body.nicedash-body .topbar-left,
body.nicedash-body .topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.nicedash-body .topbar-left { min-width: 0; flex: 1 1 auto; }
body.nicedash-body .topbar-right.userbox {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.nicedash-body .topbar-icon-btn,
body.nicedash-body .alert-bell.topbar-icon-btn,
body.nicedash-body .mobile-menu-btn.topbar-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--nde-text);
    cursor: pointer;
    font-size: 21px;
    box-shadow: none;
    padding: 0;
    transition: background-color .18s ease, color .18s ease;
}

body.nicedash-body .topbar-icon-btn:hover,
body.nicedash-body .alert-bell.topbar-icon-btn:hover {
    color: var(--nde-primary);
    background: var(--nde-primary-soft);
    border-color: transparent;
}

body.nicedash-body .sidebar-collapse-btn { display: inline-flex; }

body.nicedash-body .topbar-search {
    position: relative;
    width: min(340px, 40vw);
    min-width: 240px;
    margin: 0;
}

body.nicedash-body .topbar-search input {
    width: 100%;
    min-height: 44px;
    padding: 10px 46px 10px 16px;
    border: 1px solid var(--nde-border);
    border-radius: 12px;
    background: #fff;
    color: var(--nde-text);
    font: inherit;
    box-shadow: none;
}

body.nicedash-body .topbar-search input::placeholder { color: #8a9692; }
body.nicedash-body .topbar-search button {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--nde-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
body.nicedash-body .topbar-search button:hover { background: var(--nde-primary-soft); color: var(--nde-primary); }

body.nicedash-body .profile-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

body.nicedash-body .profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--nde-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(22,90,80,.18);
}

body.nicedash-body .user-name {
    max-width: 180px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--nde-text);
    font-weight: 600;
}

body.nicedash-body .logout-btn.btn.small {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 10px;
}

body.nicedash-body .alert-count {
    top: 2px;
    right: 1px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    border: 2px solid #fff;
    background: var(--mat-sys-error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

body.nicedash-body .alerts-widget { position: relative; }
body.nicedash-body .alerts-panel.topbar-dd,
body.nicedash-body .alerts-panel {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: min(380px, 92vw);
    padding: 0;
    overflow: hidden;
    display: none;
    border: 1px solid var(--nde-border);
    border-radius: var(--nde-radius);
    background: #fff;
    box-shadow: var(--nde-shadow-lg);
    z-index: 1600;
}
body.nicedash-body .alerts-panel.open { display: block; }
body.nicedash-body .alerts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 20px;
    margin: 0;
    border-bottom: 1px solid var(--nde-border);
}
body.nicedash-body .alerts-head strong { color: var(--nde-text); font-size: 18px; font-weight: 700; }
body.nicedash-body .alerts-head a { font-size: 13px; font-weight: 700; }
body.nicedash-body .topbar-chip {
    padding: 4px 8px;
    border-radius: 10px;
    background: var(--nde-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
body.nicedash-body .alert-item,
body.nicedash-body .alert-list-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
    padding: 13px 20px;
    border-radius: 0;
    color: var(--nde-text);
    background: #fff;
}
body.nicedash-body .alert-item:hover,
body.nicedash-body .alert-list-item:hover,
body.nicedash-body .alert-item.unread {
    background: #f8fafd;
}
body.nicedash-body .alert-icon,
body.nicedash-body .alert-dot {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--nde-primary-soft);
    color: var(--nde-primary);
    font-size: 22px;
}
body.nicedash-body .alert-dot { width: 10px; height: 10px; align-self: center; }
body.nicedash-body .alert-empty { padding: 18px 20px; color: var(--nde-muted); }

body.nicedash-body .body-wrapper { padding: 24px; }
body.nicedash-body .pageWrapper {
    width: 100%;
    max-width: 1368px;
    margin: 0 auto;
}

body.nicedash-body .breadcrumb-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 0;
    background: transparent;
}
body.nicedash-body .eyebrow {
    margin: 0 0 4px;
    color: var(--nde-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}
body.nicedash-body h1 {
    margin: 0;
    color: var(--nde-text);
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.02em;
}
body.nicedash-body h2 {
    margin: 0;
    color: var(--nde-text);
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
}
body.nicedash-body h3 { color: var(--nde-text); font-weight: 700; }
body.nicedash-body .breadcrumb-path {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--nde-muted);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
body.nicedash-body .breadcrumb-path strong { color: var(--nde-text); font-weight: 600; }

body.nicedash-body .card,
body.nicedash-body .stat,
body.nicedash-body .subcard,
body.nicedash-body .auth-card,
body.nicedash-body .modal-card {
    background: #fff;
    border: 1px solid var(--nde-border);
    border-radius: var(--nde-radius);
    box-shadow: var(--nde-shadow);
}
body.nicedash-body .card {
    padding: 24px;
    margin-bottom: 24px;
}
body.nicedash-body .subcard { padding: 18px; background: #fff; }
body.nicedash-body .stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}
body.nicedash-body .stat {
    position: relative;
    min-height: 116px;
    padding: 22px;
    overflow: hidden;
}
body.nicedash-body .stat::after {
    content: "";
    position: absolute;
    right: -36px;
    top: -36px;
    width: 118px;
    height: 118px;
    border-radius: 999px;
    background: var(--nde-secondary-soft);
}
body.nicedash-body .stat strong {
    position: relative;
    z-index: 1;
    display: block;
    color: var(--nde-text);
    font-size: 32px;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -.04em;
}
body.nicedash-body .stat span {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 7px;
    color: var(--nde-muted);
    font-size: 14px;
    font-weight: 500;
}

body.nicedash-body .grid { gap: 24px; }
body.nicedash-body .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

body.nicedash-body .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}
body.nicedash-body .btn,
body.nicedash-body button.btn,
body.nicedash-body a.btn {
    min-height: 40px;
    padding: 9px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--nde-primary);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: none;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
body.nicedash-body .btn:hover { background: #11483f; color: #fff; box-shadow: 0 6px 18px rgba(22,90,80,.18); }
body.nicedash-body .btn.secondary { background: var(--nde-secondary); color: var(--nde-text); }
body.nicedash-body .btn.secondary:hover { background: #d78208; color: var(--nde-text); }
body.nicedash-body .btn.ghost,
body.nicedash-body a.btn.ghost {
    background: #fff;
    color: var(--nde-primary);
    border-color: var(--nde-border);
}
body.nicedash-body .btn.ghost:hover { background: var(--nde-primary-soft); border-color: transparent; color: var(--nde-primary); box-shadow: none; }
body.nicedash-body .btn.danger { background: var(--mat-sys-error); color: #fff; }
body.nicedash-body .btn.small { min-height: 34px; padding: 7px 12px; border-radius: 10px; font-size: 13px; }

body.nicedash-body .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: var(--nde-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 18px;
    line-height: 1;
    transition: background-color .18s ease, color .18s ease;
}
body.nicedash-body .icon-btn:hover {
    background: var(--nde-primary-soft);
    color: var(--nde-primary);
}
body.nicedash-body .icon-btn.danger:hover { background: var(--mat-sys-error-fixed-dim); color: var(--mat-sys-error); }
body.nicedash-body .icon-btn svg,
body.nicedash-body .icon-btn .iconify { width: 20px; height: 20px; display: block; }
body.nicedash-body .row-actions { display: inline-flex; gap: 4px; align-items: center; margin: 0; }
body.nicedash-body .row-actions form { margin: 0; }

body.nicedash-body .table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
}
body.nicedash-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--nde-text);
}
body.nicedash-body th,
body.nicedash-body td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--nde-border);
    text-align: left;
    vertical-align: middle;
}
body.nicedash-body th {
    color: var(--nde-muted);
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}
body.nicedash-body tbody tr:last-child td { border-bottom: 0; }
body.nicedash-body tr:hover td { background: #f8fafd; }
body.nicedash-body .table-compact th,
body.nicedash-body .table-compact td { padding: 12px 14px; font-size: 13px; }

body.nicedash-body .badge,
body.nicedash-body .calendar-list-type,
body.nicedash-body .tab span {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--nde-primary-soft);
    color: var(--nde-primary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}
body.nicedash-body .badge.green { background: rgba(112,199,72,.15); color: #3d8f1f; }
body.nicedash-body .badge.orange { background: rgba(246,181,30,.15); color: #996d00; }
body.nicedash-body .badge.red { background: var(--mat-sys-error-fixed-dim); color: var(--mat-sys-error); }
body.nicedash-body .badge.blue { background: rgba(135,84,236,.15); color: #8754ec; }
body.nicedash-body .badge.purple { background: rgba(135,84,236,.15); color: #8754ec; }

body.nicedash-body form .field { margin-bottom: 18px; }
body.nicedash-body label {
    display: block;
    margin-bottom: 8px;
    color: var(--nde-text);
    font-size: 14px;
    font-weight: 600;
}
body.nicedash-body input,
body.nicedash-body select,
body.nicedash-body textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--nde-border);
    border-radius: 12px;
    padding: 11px 14px;
    font: inherit;
    background: #fff;
    color: var(--nde-text);
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
body.nicedash-body textarea { min-height: 104px; resize: vertical; }
body.nicedash-body input:focus,
body.nicedash-body select:focus,
body.nicedash-body textarea:focus {
    outline: 0;
    border-color: var(--nde-primary);
    box-shadow: 0 0 0 4px var(--nde-primary-soft);
}
body.nicedash-body input[type="checkbox"],
body.nicedash-body input[type="radio"] { width: auto; min-height: 0; accent-color: var(--nde-primary); }
body.nicedash-body .help { color: var(--nde-muted); font-size: 13px; margin-top: 6px; }
body.nicedash-body .checkbox-list {
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--nde-border);
    border-radius: 12px;
    background: #fff;
}

body.nicedash-body .alert {
    display: block;
    border-radius: 12px;
    padding: 13px 16px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    font-weight: 600;
}
body.nicedash-body .alert.success { background: rgba(112,199,72,.15); color: #2f7617; border-color: rgba(112,199,72,.28); }
body.nicedash-body .alert.error { background: var(--mat-sys-error-fixed-dim); color: var(--mat-sys-error); border-color: rgba(239,68,68,.28); }
body.nicedash-body .alert.info,
body.nicedash-body .alert.warning { background: rgba(246,181,30,.15); color: #996d00; border-color: rgba(246,181,30,.26); }

body.nicedash-body .kv { grid-template-columns: 190px 1fr; gap: 9px 18px; }
body.nicedash-body .kv dt { color: var(--nde-muted); font-weight: 600; }
body.nicedash-body .kv dd { color: var(--nde-text); }

body.nicedash-body .datatable-controls,
body.nicedash-body .datatable-summary {
    gap: 16px;
    margin: 14px 0;
}
body.nicedash-body .datatable-length,
body.nicedash-body .datatable-search,
body.nicedash-body .datatable-info {
    color: var(--nde-muted);
    font-size: 13px;
}
body.nicedash-body .datatable-search label { color: var(--nde-text); font-weight: 600; }
body.nicedash-body .datatable-search input {
    min-width: 360px;
    padding: 11px 14px;
}
body.nicedash-body .datatable-page {
    min-width: 36px;
    min-height: 34px;
    border: 1px solid var(--nde-border);
    background: #fff;
    color: var(--nde-text);
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    font-weight: 600;
}
body.nicedash-body .datatable-page:hover:not(:disabled),
body.nicedash-body .datatable-page.active {
    background: var(--nde-primary);
    color: #fff;
    border-color: var(--nde-primary);
}

body.nicedash-body .tabs { gap: 8px; }
body.nicedash-body .tab {
    border-color: var(--nde-border);
    border-radius: 999px;
    background: #fff;
    color: var(--nde-text);
    font-weight: 600;
}
body.nicedash-body .tab.active { background: var(--nde-primary); border-color: var(--nde-primary); color: #fff; }

body.nicedash-body .calendar-grid {
    border: 1px solid var(--nde-border);
    border-radius: var(--nde-radius);
    background: #fff;
}
body.nicedash-body .calendar-head { background: var(--nde-primary); color: #fff; }
body.nicedash-body .calendar-day { border-color: var(--nde-border); }
body.nicedash-body .calendar-day.outside { background: #f8fafd; }
body.nicedash-body .calendar-day.today { box-shadow: inset 0 0 0 2px var(--nde-secondary); }
body.nicedash-body .calendar-event {
    border-radius: 10px;
    border-left-color: var(--nde-primary);
    background: var(--nde-primary-soft);
}

body.nicedash-body .modal-backdrop { background: rgba(3,14,9,.50); z-index: 1900; }
body.nicedash-body .modal-card {
    width: min(800px, 100%);
    max-height: 88vh;
    padding: 0;
    overflow: hidden;
}
body.nicedash-body .modal-head {
    padding: 18px 22px;
    margin: 0;
    border-bottom: 1px solid var(--nde-border);
}
body.nicedash-body .modal-head h2 { font-size: 20px; }
body.nicedash-body .modal-body { padding: 20px 22px; overflow: auto; max-height: calc(88vh - 138px); }
body.nicedash-body .modal-card .actions.right { padding: 0 22px 20px; margin: 0; }

body.nicedash-body .auth-main.blank-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--nde-bg);
}
body.nicedash-body .auth-main.blank-layout::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 14% 12%, rgba(240,157,35,.16), transparent 28%), radial-gradient(circle at 90% 14%, rgba(22,90,80,.12), transparent 30%);
    pointer-events: none;
}
body.nicedash-body .auth-card {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .95fr);
    gap: 0;
    padding: 0;
    overflow: hidden;
}
body.nicedash-body .auth-card::after {
    content: "";
    display: block;
    min-height: 560px;
    background: url('img/nicedash/login-bg.webp') center / cover no-repeat;
}
body.nicedash-body .auth-card > * { margin-left: 0; }
body.nicedash-body .auth-card img,
body.nicedash-body .auth-card h1,
body.nicedash-body .auth-card p,
body.nicedash-body .auth-card form,
body.nicedash-body .auth-card .alert {
    grid-column: 1;
    width: min(100%, 420px);
    margin-left: 34px;
    margin-right: 34px;
}
body.nicedash-body .auth-card img {
    width: 172px;
    margin-top: 42px;
    margin-bottom: 34px;
    display: block;
}
body.nicedash-body .auth-card h1 {
    margin-top: 0;
    margin-bottom: 6px;
    text-align: left;
    font-size: 24px;
    font-weight: 800;
}
body.nicedash-body .auth-card p {
    margin-top: 0;
    margin-bottom: 26px;
    text-align: left;
    color: var(--nde-muted);
}
body.nicedash-body .auth-card .btn { width: 100%; min-height: 44px; }

body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav {
    width: var(--nde-sidebar-mini);
}
body.sidebar-collapsed.nicedash-body .main.contentWrapper {
    margin-left: var(--nde-sidebar-mini);
}
body.sidebar-collapsed.nicedash-body .brand.branding img {
    width: 54px;
    max-width: none;
    object-fit: contain;
    object-position: left center;
}
body.sidebar-collapsed.nicedash-body .sidebar-nav.sidebar-list {
    padding-left: 16px;
    padding-right: 16px;
}
body.sidebar-collapsed.nicedash-body .nav-label .caption-text,
body.sidebar-collapsed.nicedash-body .hide-menu,
body.sidebar-collapsed.nicedash-body .sidebar-footer.profile-bar,
body.sidebar-collapsed.nicedash-body .item-chip {
    display: none;
}
body.sidebar-collapsed.nicedash-body .nav-label .caption-icon { display: inline-flex; margin: 0 auto; }
body.sidebar-collapsed.nicedash-body .menu-list-item.nav-link { justify-content: center; padding: 11px !important; }
body.sidebar-collapsed.nicedash-body .menu-list-item.nav-link .routeIcon { flex-basis: 24px; }
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover {
    width: var(--nde-sidebar-width);
    box-shadow: var(--nde-shadow-lg);
}
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover .brand.branding img { width: 156px; }
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover .sidebar-nav.sidebar-list { padding-left: 20px; padding-right: 20px; }
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover .nav-label .caption-text,
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover .hide-menu,
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover .sidebar-footer.profile-bar,
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover .item-chip { display: inline-flex; }
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover .sidebar-footer.profile-bar { display: block; }
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover .nav-label .caption-icon { display: none; }
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover .menu-list-item.nav-link { justify-content: flex-start; padding: 11px 14px !important; }

@media (max-width: 1180px) {
    body.nicedash-body .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.nicedash-body .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
    body.nicedash-body .sidebar.sidebarNav {
        transform: translateX(-104%);
        width: var(--nde-sidebar-width);
        box-shadow: var(--nde-shadow-lg);
    }
    body.nicedash-body.menu-open .sidebar.sidebarNav { transform: translateX(0); }
    body.nicedash-body .mobile-menu-backdrop { display: none; }
    body.nicedash-body.menu-open .mobile-menu-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(3, 14, 9, .45);
        z-index: 1240;
    }
    body.nicedash-body .main.contentWrapper { margin-left: 0; }
    body.nicedash-body .topbar.mat-toolbar {
        padding: 0 16px;
        gap: 10px;
    }
    body.nicedash-body .sidebar-collapse-btn { display: none; }
    body.nicedash-body .mobile-menu-btn.topbar-icon-btn { display: inline-flex !important; }
    body.nicedash-body .sidebar-close.mobile-menu-btn {
        display: inline-flex !important;
        width: 40px;
        height: 40px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: var(--nde-text);
        align-items: center;
        justify-content: center;
        font-size: 22px;
    }
    body.nicedash-body .topbar-search { display: none; }
    body.nicedash-body .body-wrapper { padding: 18px 16px; }
    body.nicedash-body .breadcrumb-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 18px;
    }
    body.nicedash-body .breadcrumb-path { white-space: normal; }
    body.nicedash-body .topbar-right.userbox { gap: 6px; margin-left: auto; }
    body.nicedash-body .user-name { display: none; }
    body.nicedash-body .logout-btn { padding: 7px 9px; }
    body.nicedash-body .stats,
    body.nicedash-body .grid.cols-2,
    body.nicedash-body .grid.cols-3,
    body.nicedash-body .grid.cols-4 { grid-template-columns: 1fr; }
    body.nicedash-body .datatable-search input { min-width: 0; }
}

@media (max-width: 680px) {
    body.nicedash-body h1 { font-size: 24px; }
    body.nicedash-body .card { padding: 18px; }
    body.nicedash-body .section-title { flex-direction: column; align-items: flex-start; }
    body.nicedash-body .topbar-right.userbox .topbar-icon-btn:first-child { display: none; }
    body.nicedash-body .profile-avatar { width: 34px; height: 34px; }
    body.nicedash-body .auth-card {
        display: block;
        width: min(460px, 100%);
        min-height: 0;
    }
    body.nicedash-body .auth-card::after { display: none; }
    body.nicedash-body .auth-card img,
    body.nicedash-body .auth-card h1,
    body.nicedash-body .auth-card p,
    body.nicedash-body .auth-card form,
    body.nicedash-body .auth-card .alert {
        width: auto;
        margin-left: 24px;
        margin-right: 24px;
    }
    body.nicedash-body .auth-card img { margin-top: 30px; }
    body.nicedash-body .auth-card form { margin-bottom: 30px; }
    body.nicedash-body .kv { grid-template-columns: 1fr; }
    body.nicedash-body .kv dt { margin-top: 8px; }
}

/* Update 59: ajuste fino visual NiceDash */
body.nicedash-body,
body.nicedash-body .mat-drawer-container,
body.nicedash-body .mat-drawer,
body.nicedash-body .text-body,
body.nicedash-body p,
body.nicedash-body td,
body.nicedash-body .card,
body.nicedash-body .subcard {
    color: var(--mat-sys-on-background);
}
body.nicedash-body .help,
body.nicedash-body small,
body.nicedash-body .muted,
body.nicedash-body .eyebrow,
body.nicedash-body .datatable-info,
body.nicedash-body .datatable-length,
body.nicedash-body .breadcrumb-path a,
body.nicedash-body .breadcrumb-path span,
body.nicedash-body .kv dt {
    color: var(--nde-muted);
}

body.nicedash-body .brand.branding .brand-logo-mini { display: none; }
body.nicedash-body .brand.branding .brand-logo-full {
    display: block;
    width: 156px;
    max-height: 52px;
}
body.sidebar-collapsed.nicedash-body .brand.branding .brand-logo-full { display: none; }
body.sidebar-collapsed.nicedash-body .brand.branding .brand-logo-mini {
    display: block;
    width: 46px;
    max-height: 46px;
}
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover .brand.branding .brand-logo-full {
    display: block;
    width: 156px;
}
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover .brand.branding .brand-logo-mini { display: none; }

body.nicedash-body .menu-list-item.nav-link,
body.nicedash-body .sidebar nav a.menu-list-item.nav-link {
    color: var(--mat-sys-on-background);
    isolation: isolate;
    overflow: hidden;
    background: transparent !important;
    box-shadow: none !important;
}
body.nicedash-body .menu-list-item.nav-link::before,
body.nicedash-body .sidebar nav a.menu-list-item.nav-link::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background-color: transparent;
    opacity: 0;
    z-index: -1;
    transition: opacity .18s ease, background-color .18s ease;
}
body.nicedash-body .menu-list-item.nav-link:hover::before,
body.nicedash-body .menu-list-item.nav-link.active::before,
body.nicedash-body .menu-list-item.nav-link.activeMenu::before {
    background-color: var(--mat-sys-primary-fixed-dim);
    color: var(--mat-sys-primary);
    opacity: 1;
}
body.nicedash-body .menu-list-item.nav-link:hover,
body.nicedash-body .menu-list-item.nav-link.active,
body.nicedash-body .menu-list-item.nav-link.activeMenu,
body.nicedash-body .menu-list-item.nav-link:hover .routeIcon,
body.nicedash-body .menu-list-item.nav-link.active .routeIcon,
body.nicedash-body .menu-list-item.nav-link.activeMenu .routeIcon {
    color: var(--mat-sys-primary) !important;
}
body.nicedash-body .menu-list-item.nav-link .hide-menu { color: inherit; }
body.nicedash-body .menu-list-item.active .item-chip,
body.nicedash-body .menu-list-item.activeMenu .item-chip {
    background: #dcebe7;
    color: var(--mat-sys-primary);
    border-color: transparent;
}

body.nicedash-body .sidebar-footer.profile-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px;
    margin: 12px 18px 18px;
}
body.nicedash-body .sidebar-footer.profile-bar p { display: none !important; }
body.nicedash-body .sidebar-footer.profile-bar img {
    max-width: 100px;
    max-height: 34px;
    width: auto;
    margin: 0;
    object-fit: contain;
}
body.nicedash-body .sidebar-footer.profile-bar img + img { margin: 0; }
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover .sidebar-footer.profile-bar { display: flex; }

body.nicedash-body .breadcrumb-card.page-title-card {
    min-height: 70px;
    padding: 18px 22px;
    margin-bottom: 22px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
body.nicedash-body .breadcrumb-card.page-title-card h1 {
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0;
}
body.nicedash-body .breadcrumb-path {
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
}
body.nicedash-body .breadcrumb-path .breadcrumb-dot {
    width: 7px;
    height: 7px;
    min-width: 7px;
    border-radius: 999px;
    background: var(--mat-sys-on-background);
    display: inline-flex;
}
body.nicedash-body .breadcrumb-path strong {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 6px 12px;
    border-radius: 12px;
    color: var(--mat-sys-primary);
    background: #dcebe7;
    font-weight: 600;
}

body.nicedash-body input,
body.nicedash-body textarea,
body.nicedash-body select {
    color: var(--mat-sys-on-background);
}
body.nicedash-body select {
    min-height: 40px;
    appearance: none;
    -webkit-appearance: none;
    padding: 10px 42px 10px 14px;
    border-radius: 14px;
    border-color: var(--nde-border);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%23030e09' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px 18px;
}
body.nicedash-body select:focus {
    border-color: var(--mat-sys-primary);
    box-shadow: 0 0 0 3px var(--mat-sys-primary-fixed-dim);
}
body.nicedash-body select option:checked,
body.nicedash-body select option:hover {
    background: #dcebe7;
    color: var(--mat-sys-on-background);
}

body.nicedash-body .tabs { gap: 10px; }
body.nicedash-body .tab {
    min-height: 46px;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 700;
}
body.nicedash-body .tab.active {
    background: var(--mat-sys-primary);
    color: #fff;
    border-color: var(--mat-sys-primary);
}
body.nicedash-body .tab span,
body.nicedash-body .tab.active span {
    background: #dcebe7;
    color: var(--mat-sys-primary);
    font-weight: 800;
}

body.nicedash-body .datatable-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
}
body.nicedash-body .nicedash-search-field {
    position: relative;
    width: min(360px, 100%);
    margin: 0;
}
body.nicedash-body .nicedash-search-field .datatable-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    color: var(--nde-muted);
    pointer-events: none;
}
body.nicedash-body .datatable-search input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 14px 10px 46px;
    border-radius: 13px;
    border-color: var(--nde-border);
    color: var(--mat-sys-on-background);
}
body.nicedash-body .datatable-summary.mat-paginator-like {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 28px;
    margin: 18px 0 0;
    color: var(--mat-sys-on-background);
}
body.nicedash-body .datatable-length {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    color: var(--mat-sys-on-background);
}
body.nicedash-body .datatable-length select {
    width: 84px;
    min-height: 46px;
    padding: 9px 36px 9px 14px;
    border-radius: 14px;
}
body.nicedash-body .datatable-info {
    min-width: 105px;
    color: var(--mat-sys-on-background);
    font-size: 13px;
    white-space: nowrap;
}
body.nicedash-body .datatable-pager {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}
body.nicedash-body .datatable-page.datatable-page-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--mat-sys-on-background);
    box-shadow: none;
}
body.nicedash-body .datatable-page.datatable-page-icon:hover:not(:disabled) {
    background: var(--mat-sys-primary-fixed-dim);
    color: var(--mat-sys-primary);
}
body.nicedash-body .datatable-page.datatable-page-icon:disabled {
    color: rgba(3,14,9,.35);
    background: transparent;
    cursor: default;
}
body.nicedash-body th.datatable-sortable::after { color: var(--mat-sys-primary); }

body.nicedash-body .dashboard-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
}
body.nicedash-body .dashboard-toolbar label { margin: 0; font-size: 0; }
body.nicedash-body .dashboard-toolbar select { width: 180px; }
body.nicedash-body .dashboard-hero {
    min-height: 104px;
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 24px;
    background: var(--mat-sys-primary);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}
body.nicedash-body .dashboard-hero * { color: inherit; }
body.nicedash-body .dashboard-hero .hero-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 13px;
}
body.nicedash-body .dashboard-hero .hero-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #ff5656;
    border: 3px solid rgba(255,255,255,.18);
}
body.nicedash-body .dashboard-hero h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}
body.nicedash-body .dashboard-hero h2 span { color: var(--mat-sys-secondary); }
body.nicedash-body .dashboard-hero .btn {
    background: var(--mat-sys-secondary);
    color: var(--mat-sys-on-background);
    border-radius: 12px;
    box-shadow: none;
}
body.nicedash-body .dashboard-grid-main {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .95fr);
    gap: 24px;
    margin-bottom: 24px;
}
body.nicedash-body .overview-card,
body.nicedash-body .assets-card,
body.nicedash-body .mini-metric-card {
    background: #fff;
    border: 1px solid var(--nde-border);
    border-radius: 16px;
    box-shadow: var(--nde-shadow);
    padding: 24px;
}
body.nicedash-body .overview-card .overview-head,
body.nicedash-body .assets-card .overview-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 20px;
}
body.nicedash-body .overview-card h2,
body.nicedash-body .assets-card h2,
body.nicedash-body .mini-metric-card h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}
body.nicedash-body .metric-total {
    margin-top: 4px;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--mat-sys-on-background);
}
body.nicedash-body .metric-delta {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: rgba(240,157,35,.18);
    color: #3d8f1f;
}
body.nicedash-body .dashboard-chart-fake {
    height: 190px;
    margin-top: 28px;
    display: flex;
    align-items: end;
    gap: 4px;
    border-bottom: 1px solid var(--nde-border);
}
body.nicedash-body .dashboard-chart-fake .bar {
    flex: 1 1 0;
    min-width: 8px;
    border-radius: 8px 8px 0 0;
    background: #dce8e6;
    position: relative;
}
body.nicedash-body .dashboard-chart-fake .bar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    border-radius: 4px;
    background: var(--mat-sys-primary);
}
body.nicedash-body .asset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
body.nicedash-body .asset-tile {
    min-height: 100px;
    border-radius: 14px;
    padding: 22px 24px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 12px;
    background: #edf7e9;
}
body.nicedash-body .asset-tile:nth-child(2) { background: #ebe2fb; }
body.nicedash-body .asset-tile:nth-child(3) { background: #dfecec; }
body.nicedash-body .asset-tile:nth-child(4) { background: #fff3d9; }
body.nicedash-body .asset-tile:nth-child(5) { background: #ffe2e2; }
body.nicedash-body .asset-tile .tile-label { font-size: 14px; margin-bottom: 6px; }
body.nicedash-body .asset-tile strong { font-size: 20px; }
body.nicedash-body .asset-tile .iconify { font-size: 26px; color: var(--mat-sys-primary); }
body.nicedash-body .dashboard-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}
body.nicedash-body .mini-metric-card {
    min-height: 142px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}
body.nicedash-body .mini-metric-card .mini-value {
    font-size: 26px;
    font-weight: 800;
    margin: 6px 0;
}
body.nicedash-body .mini-bars {
    display: flex;
    align-items: end;
    gap: 6px;
    height: 62px;
}
body.nicedash-body .mini-bars span {
    width: 9px;
    border-radius: 999px 999px 4px 4px;
    background: var(--mat-sys-primary);
}
body.nicedash-body .mini-line {
    width: 140px;
    height: 70px;
}
body.nicedash-body .mini-line svg { width: 100%; height: 100%; }

@media (max-width: 1180px) {
    body.nicedash-body .dashboard-grid-main,
    body.nicedash-body .dashboard-mini-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    body.nicedash-body .dashboard-hero,
    body.nicedash-body .dashboard-toolbar,
    body.nicedash-body .breadcrumb-card.page-title-card,
    body.nicedash-body .datatable-summary.mat-paginator-like {
        align-items: flex-start;
        flex-direction: column;
    }
    body.nicedash-body .asset-grid { grid-template-columns: 1fr; }
    body.nicedash-body .datatable-summary.mat-paginator-like { gap: 14px; }
}


/* Update 60: ajustes de fidelidad NiceDash indicados en revisión visual */
body.nicedash-body {
    color: #030e09;
}

/* Menú lateral: estado normal, hover claro y activo verde oscuro como la plantilla original */
body.nicedash-body .menu-list-item.nav-link,
body.nicedash-body .sidebar nav a.menu-list-item.nav-link {
    position: relative;
    color: var(--mat-sys-on-background) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: hidden;
    isolation: isolate;
}
body.nicedash-body .menu-list-item.nav-link .routeIcon,
body.nicedash-body .menu-list-item.nav-link .nav-icon {
    color: currentColor !important;
    background: transparent !important;
}
body.nicedash-body .menu-list-item.nav-link::before,
body.nicedash-body .sidebar nav a.menu-list-item.nav-link::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background-color: transparent;
    opacity: 0;
    z-index: -1;
    transition: opacity .18s ease, background-color .18s ease;
}
body.nicedash-body .menu-list-item.nav-link:hover:not(.active):not(.activeMenu)::before,
body.nicedash-body .sidebar nav a.menu-list-item.nav-link:hover:not(.active):not(.activeMenu)::before {
    background-color: var(--mat-sys-primary-fixed-dim);
    opacity: 1;
}
body.nicedash-body .menu-list-item.nav-link:hover:not(.active):not(.activeMenu),
body.nicedash-body .menu-list-item.nav-link:hover:not(.active):not(.activeMenu) .routeIcon {
    color: var(--mat-sys-primary) !important;
}
body.nicedash-body .menu-list-item.nav-link.active::before,
body.nicedash-body .menu-list-item.nav-link.activeMenu::before,
body.nicedash-body .sidebar nav a.menu-list-item.nav-link.active::before,
body.nicedash-body .sidebar nav a.menu-list-item.nav-link.activeMenu::before {
    background-color: var(--mat-sys-primary);
    opacity: 1;
}
body.nicedash-body .menu-list-item.nav-link.active,
body.nicedash-body .menu-list-item.nav-link.activeMenu,
body.nicedash-body .menu-list-item.nav-link.active .hide-menu,
body.nicedash-body .menu-list-item.nav-link.activeMenu .hide-menu {
    color: #fff !important;
}
body.nicedash-body .menu-list-item.nav-link.active .routeIcon,
body.nicedash-body .menu-list-item.nav-link.activeMenu .routeIcon {
    color: var(--mat-sys-secondary) !important;
}
body.nicedash-body .menu-list-item.active .item-chip,
body.nicedash-body .menu-list-item.activeMenu .item-chip {
    background: #dcebe7 !important;
    color: var(--mat-sys-primary) !important;
    border-color: transparent !important;
}

/* Cabecera de página: bloque blanco con título izquierda y breadcrumb derecha */
body.nicedash-body .breadcrumb-card.page-title-card,
body.nicedash-body .breadcrumb-card {
    width: 100%;
    min-height: 70px;
    padding: 18px 22px !important;
    margin: 0 0 22px !important;
    background: #fff !important;
    border: 1px solid var(--mat-sys-outline) !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
}
body.nicedash-body .breadcrumb-card.page-title-card h1,
body.nicedash-body .breadcrumb-card h1 {
    color: #030e09 !important;
    font-size: 20px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
}
body.nicedash-body .breadcrumb-path {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
    color: #030e09;
}
body.nicedash-body .breadcrumb-path a {
    color: #030e09 !important;
    font-weight: 500;
}

/* Bloque superior de listados: buscador izquierda y acciones derecha dentro de la misma tarjeta blanca */
body.nicedash-body .datatable-controls {
    width: 100%;
    min-height: 82px;
    padding: 18px 22px !important;
    margin: 0 0 22px !important;
    background: #fff !important;
    border: 1px solid var(--mat-sys-outline) !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
}
body.nicedash-body .datatable-actions-slot {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}
body.nicedash-body .datatable-actions-slot .btn {
    margin: 0;
}
body.nicedash-body .actions:not(.row-actions):not(.right):not(.actions-final) {
    width: 100%;
    min-height: 82px;
    padding: 18px 22px;
    margin: 0 0 22px;
    background: #fff;
    border: 1px solid var(--mat-sys-outline);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
    justify-content: flex-end;
}

/* Si el buscador está dentro de una card de tabla, evitar que se vea como bloque doble */
body.nicedash-body .card > .tabs + .datatable-controls,
body.nicedash-body .card > .datatable-controls {
    box-shadow: none !important;
    border-color: var(--mat-sys-outline) !important;
}

/* Paginación Material/NiceDash: siempre a la derecha bajo la tabla y 20 registros por defecto desde JS */
body.nicedash-body .datatable-summary.mat-paginator-like,
body.nicedash-body .datatable-summary {
    width: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 28px !important;
    margin: 16px 0 0 !important;
    padding: 0 !important;
    color: #030e09 !important;
}
body.nicedash-body .datatable-length,
body.nicedash-body .datatable-info,
body.nicedash-body .datatable-pager {
    flex: 0 0 auto;
}
body.nicedash-body .datatable-length {
    margin-left: auto;
    color: #030e09 !important;
}
body.nicedash-body .datatable-info {
    min-width: 104px;
    text-align: left;
    color: #030e09 !important;
}
body.nicedash-body .datatable-pager {
    margin-left: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 14px !important;
}
body.nicedash-body .datatable-page.datatable-page-icon,
body.nicedash-body .datatable-page.datatable-page-icon.active {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #030e09 !important;
}
body.nicedash-body .datatable-page.datatable-page-icon:hover:not(:disabled) {
    background: var(--mat-sys-primary-fixed-dim) !important;
    color: var(--mat-sys-primary) !important;
}
body.nicedash-body .datatable-page.datatable-page-icon:disabled {
    opacity: 1 !important;
    color: rgba(3, 14, 9, .35) !important;
}

/* Select/dropdown más fiel al original */
body.nicedash-body select {
    color: #030e09 !important;
    border: 1px solid var(--mat-sys-outline) !important;
    background-color: #fff !important;
    border-radius: 14px !important;
}
body.nicedash-body select:focus,
body.nicedash-body select:focus-visible {
    border-color: var(--mat-sys-primary) !important;
    outline: 0 !important;
    box-shadow: 0 0 0 3px var(--mat-sys-primary-fixed-dim) !important;
}

@media (max-width: 760px) {
    body.nicedash-body .breadcrumb-card.page-title-card,
    body.nicedash-body .breadcrumb-card,
    body.nicedash-body .datatable-controls,
    body.nicedash-body .datatable-summary.mat-paginator-like,
    body.nicedash-body .datatable-summary {
        align-items: stretch !important;
        flex-direction: column !important;
    }
    body.nicedash-body .breadcrumb-path,
    body.nicedash-body .datatable-actions-slot,
    body.nicedash-body .datatable-length {
        margin-left: 0;
    }
    body.nicedash-body .nicedash-search-field,
    body.nicedash-body .datatable-search input {
        width: 100% !important;
    }
}

/* Update 61: integración más fiel de NiceDash y módulos base. */
:root,
html.light-theme {
    --mat-sys-primary: #166354;
    --mat-sys-primary-fixed-dim: #dfecea;
    --mat-sys-background: #F5F5F5;
    --mat-sys-surface: #ffffff;
    --mat-sys-on-background: #030e09;
    --mat-sys-outline: #dfe8e3;
    --mat-sys-outline-variant: #edf2ef;
    --mat-sys-secondary-container: #e9f3ee;
    --nde-bg: #F5F5F5;
    --nde-surface: #ffffff;
    --nde-text: #030e09;
    --nde-muted: #6f7b76;
    --nde-primary: #166354;
    --nde-primary-soft: #dfecea;
    --nde-radius: 16px;
    --nde-shadow: 0 2px 10px rgba(0,0,0,.04);
}
body.nicedash-body {
    background: var(--mat-sys-background) !important;
    color: var(--mat-sys-on-background) !important;
    font-family: Onest, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
body.nicedash-body.dark-mode,
html.dark-theme body.nicedash-body {
    --mat-sys-background: #111c17;
    --mat-sys-surface: #17261f;
    --mat-sys-on-background: #f3fbf7;
    --mat-sys-outline: #2d4439;
    --mat-sys-outline-variant: #22362d;
    --mat-sys-primary-fixed-dim: #21473f;
    --nde-bg: #111c17;
    --nde-surface: #17261f;
    --nde-text: #f3fbf7;
    --nde-muted: #a9bab2;
    background: var(--mat-sys-background) !important;
    color: var(--mat-sys-on-background) !important;
}
html .mdc-list-item__primary-text,
html .mat-drawer-container,
html .mat-drawer,
html .text-body {
    color: var(--mat-sys-on-background);
}
body.nicedash-body h1, body.nicedash-body h2, body.nicedash-body h3,
body.nicedash-body h4, body.nicedash-body h5, body.nicedash-body h6,
body.nicedash-body th, body.nicedash-body label,
body.nicedash-body .table-compact th {
    color: #030e09;
}
body.nicedash-body.dark-mode h1, body.nicedash-body.dark-mode h2, body.nicedash-body.dark-mode h3,
body.nicedash-body.dark-mode h4, body.nicedash-body.dark-mode h5, body.nicedash-body.dark-mode h6,
body.nicedash-body.dark-mode th, body.nicedash-body.dark-mode label,
body.nicedash-body.dark-mode .table-compact th {
    color: #f3fbf7;
}
body.nicedash-body .body-wrapper {
    background: var(--mat-sys-background) !important;
    min-height: calc(100vh - 70px);
    padding-bottom: 16px;
}
body.nicedash-body .pageWrapper { padding-bottom: 8px; }
body.nicedash-body .card,
body.nicedash-body .breadcrumb-card,
body.nicedash-body .datatable-controls,
body.nicedash-body .nice-card {
    background: var(--mat-sys-surface);
    border: 1px solid var(--mat-sys-outline);
    color: var(--mat-sys-on-background);
}

/* Topbar */
body.nicedash-body .topbar.mat-toolbar {
    height: 70px;
    min-height: 70px;
    background-color: var(--mat-sys-surface) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 28px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
body.nicedash-body .topbar-icon-btn,
body.nicedash-body .avatar-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border: 0;
    background: transparent;
    color: var(--mat-sys-on-background);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
}
body.nicedash-body .topbar-icon-btn:hover,
body.nicedash-body .avatar-btn:hover {
    background: var(--mat-sys-primary-fixed-dim);
    color: var(--mat-sys-primary);
}
body.nicedash-body .topbar-icon-btn .iconify { width: 22px; height: 22px; }
body.nicedash-body .topbar-left, body.nicedash-body .topbar-right { display:flex; align-items:center; gap:8px; }
body.nicedash-body .topbar-search { display:flex; align-items:center; gap:6px; background:transparent; border:0; }
body.nicedash-body .topbar-search input {
    width: 250px;
    height: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--mat-sys-on-background);
    display: none;
}
body.nicedash-body .topbar-search:focus-within input,
body.nicedash-body .topbar-search:hover input { display:block; }
body.nicedash-body .topbar-search button { border:0; background:transparent; width:42px; height:42px; border-radius:50%; cursor:pointer; color: var(--mat-sys-on-background); }
body.nicedash-body .topbar-search button:hover { background:var(--mat-sys-primary-fixed-dim); color:var(--mat-sys-primary); }
body.nicedash-body .theme-dark-icon { display:none; }
body.nicedash-body.dark-mode .theme-dark-icon { display:inline-block; }
body.nicedash-body.dark-mode .theme-light-icon { display:none; }

/* Sidebar */
body.nicedash-body .sidebar {
    background-color: var(--mat-sys-surface) !important;
    color: var(--mat-sys-on-background) !important;
    border-right: 1px solid var(--mat-sys-outline);
    box-shadow: none;
    width: 270px;
    padding: 0;
}
body.nicedash-body .sidebar-inner { height:100%; display:flex; flex-direction:column; padding: 20px 12px; }
body.nicedash-body .sidebar-brand-row { min-height: 56px; padding: 0 10px 12px; display:flex; align-items:center; justify-content:space-between; }
body.nicedash-body .brand-logo-full { max-width: 178px; max-height: 54px; }
body.nicedash-body .brand-logo-mini { display:none; width: 42px; height:auto; }
body.nicedash-body .sidebar-nav { flex:1; overflow:auto; padding: 0 4px 10px; }
body.nicedash-body .nav-caption {
    margin: 18px 12px 8px;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--nde-muted);
    font-weight: 600;
}
body.nicedash-body .sidebar-list.mdc-list .menu-list-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 9px 14px;
    margin: 3px 0;
    border-radius: 8px;
    color: var(--mat-sys-on-background) !important;
    font-weight: 500;
    overflow: hidden;
    background: transparent !important;
}
body.nicedash-body .sidebar-list.mdc-list .menu-list-item:before {
    content:"";
    position:absolute;
    inset:0;
    border-radius:8px;
    background-color: transparent;
    opacity:0;
    transition:.18s ease;
    z-index:0;
}
body.nicedash-body .sidebar-list.mdc-list .menu-list-item > * { position:relative; z-index:1; }
body.nicedash-body .sidebar-list.mdc-list .menu-list-item:hover:before {
    background-color: var(--mat-sys-primary-fixed-dim);
    color: var(--mat-sys-primary);
    opacity: 1;
}
body.nicedash-body .sidebar-list.mdc-list .menu-list-item:hover,
body.nicedash-body .sidebar-list.mdc-list .menu-list-item:hover .iconify,
body.nicedash-body .sidebar-list.mdc-list .menu-list-item:hover .mdc-list-item__primary-text {
    color: var(--mat-sys-primary) !important;
}
body.nicedash-body .sidebar-list.mdc-list .menu-list-item.active,
body.nicedash-body .sidebar-list.mdc-list .menu-list-item.activeMenu {
    color: #fff !important;
    background: var(--mat-sys-primary) !important;
}
body.nicedash-body .sidebar-list.mdc-list .menu-list-item.active:before,
body.nicedash-body .sidebar-list.mdc-list .menu-list-item.activeMenu:before { opacity:0; }
body.nicedash-body .sidebar-list.mdc-list .menu-list-item.active .iconify,
body.nicedash-body .sidebar-list.mdc-list .menu-list-item.active .mdc-list-item__primary-text,
body.nicedash-body .sidebar-list.mdc-list .menu-list-item.activeMenu .iconify,
body.nicedash-body .sidebar-list.mdc-list .menu-list-item.activeMenu .mdc-list-item__primary-text { color:#fff !important; }
body.nicedash-body .sidebar-list .routeIcon { width:22px; height:22px; min-width:22px; color: currentColor; }
body.nicedash-body .item-chip,
body.nicedash-body .mini-chip {
    margin-left:auto;
    display:inline-flex;
    min-width:22px;
    height:22px;
    padding: 0 7px;
    border-radius: 999px;
    align-items:center;
    justify-content:center;
    background: var(--mat-sys-primary);
    color:#fff;
    font-size:12px;
    font-weight:700;
}
body.nicedash-body .menu-list-item.active .item-chip { background:#fff; color:var(--mat-sys-primary); }
body.nicedash-body.sidebar-collapsed .sidebar { width: 82px; }
body.nicedash-body.sidebar-collapsed .main { margin-left: 82px; }
body.nicedash-body.sidebar-collapsed .brand-logo-full,
body.nicedash-body.sidebar-collapsed .hide-menu,
body.nicedash-body.sidebar-collapsed .caption-text,
body.nicedash-body.sidebar-collapsed .sidebar-footer { display:none !important; }
body.nicedash-body.sidebar-collapsed .brand-logo-mini { display:block; }
body.nicedash-body.sidebar-collapsed .sidebar-brand-row { justify-content:center; }
body.nicedash-body.sidebar-collapsed .menu-list-item { justify-content:center; padding: 10px; }
body.nicedash-body.sidebar-collapsed .item-chip { position:absolute; top:2px; right:4px; min-width:18px; height:18px; font-size:10px; }
body.nicedash-body .sidebar-footer { display:flex; align-items:center; justify-content:center; gap:10px; padding: 14px 6px 4px; border-top: 1px solid var(--mat-sys-outline); }
body.nicedash-body .sidebar-footer img { max-width: 44%; height:auto; object-fit:contain; }

/* Popovers */
body.nicedash-body .nice-popover {
    position:absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 90;
    width: 360px;
    max-width: calc(100vw - 28px);
    background: var(--mat-sys-surface);
    border: 1px solid var(--mat-sys-outline-variant);
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(0,0,0,.10);
    padding: 22px 28px;
    display:none;
}
body.nicedash-body .nice-popover.open { display:block; }
body.nicedash-body .popover-head { display:flex; align-items:center; justify-content:space-between; margin-bottom: 18px; }
body.nicedash-body .popover-head h3 { margin:0; font-size:18px; }
body.nicedash-body .topbar-chip { background: var(--mat-sys-primary); color:#fff; border-radius:999px; padding:6px 10px; font-size:13px; font-weight:700; }
body.nicedash-body .notification-list { display:flex; flex-direction:column; gap:12px; }
body.nicedash-body .notification-item { display:grid; grid-template-columns: 54px 1fr auto; gap:12px; align-items:center; color: var(--mat-sys-on-background); }
body.nicedash-body .notification-icon { width:54px; height:54px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:var(--mat-sys-primary); background:#e1eeeb; }
body.nicedash-body .notification-icon-2 { background:#ecffd9; color:#7bc83a; }
body.nicedash-body .notification-icon-3 { background:#fff2d8; color:#f4b23b; }
body.nicedash-body .notification-icon-4 { background:#e7f9dc; color:#68c44b; }
body.nicedash-body .notification-icon-5 { background:#ffe1e1; color:#ff5252; }
body.nicedash-body .notification-content strong { display:block; font-size:15px; }
body.nicedash-body .notification-content small { display:block; color: var(--nde-muted); line-height:1.25; max-height:38px; overflow:hidden; }
body.nicedash-body .notification-item time { font-size:13px; white-space:nowrap; }
body.nicedash-body .notification-footer { width:100%; justify-content:center; margin-top: 22px; }
body.nicedash-body .avatar-btn { padding:0; overflow:hidden; background: #d9f7fa; }
body.nicedash-body .avatar-btn img { width:42px; height:42px; border-radius:50%; object-fit:cover; display:block; }
body.nicedash-body .avatar-initials { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:800; color:transparent; }
body.nicedash-body .profile-dropdown { position:relative; }
body.nicedash-body .profile-panel { width: 360px; padding: 0; overflow:hidden; }
body.nicedash-body .profile-popover-head { text-align:center; padding: 30px 24px 24px; border-bottom:1px solid var(--mat-sys-outline); }
body.nicedash-body .profile-avatar-xl { width:92px; height:92px; margin:0 auto 16px; border-radius:50%; background:#aee9ee; position:relative; overflow:hidden; display:flex; align-items:center; justify-content:center; }
body.nicedash-body .profile-avatar-xl img { width:100%; height:100%; object-fit:cover; }
body.nicedash-body .profile-popover-head h3 { margin:0 0 6px; font-size:18px; }
body.nicedash-body .profile-popover-head p { margin:0; color:var(--nde-muted); display:flex; align-items:center; justify-content:center; gap:6px; }
body.nicedash-body .profile-links { padding: 22px 28px; display:flex; flex-direction:column; gap: 12px; }
body.nicedash-body .profile-links a { color: var(--nde-muted); display:flex; align-items:center; gap:12px; font-weight:600; }
body.nicedash-body .profile-links a:hover { color: var(--mat-sys-primary); }
body.nicedash-body .profile-links .iconify { width:20px; height:20px; }
body.nicedash-body .profile-logout { margin: 0 auto 24px; max-width: 130px; justify-content:center; background:#b4ff64; color:#030e09; }
body.nicedash-body .alert-count { position:absolute; top:2px; right:2px; background:#f44336; color:#fff; min-width:18px; height:18px; border-radius:999px; font-size:11px; display:flex; align-items:center; justify-content:center; font-weight:800; }

/* Page title and blocks */
body.nicedash-body .page-title-card {
    display:flex;
    justify-content:space-between;
    align-items:center;
    min-height:70px;
    padding: 18px 28px;
    border-radius: 16px;
    margin: 16px 0 22px;
    box-shadow: 0 1px 2px rgba(0,0,0,.02);
}
body.nicedash-body .page-title-block h1 { margin:0; font-size:20px; line-height:1.2; }
body.nicedash-body .breadcrumb-path { display:flex; align-items:center; gap:10px; color:#030e09; font-size:14px; }
body.nicedash-body .breadcrumb-path a { color:#030e09; }
body.nicedash-body .breadcrumb-path strong { background: var(--mat-sys-primary-fixed-dim); color: var(--mat-sys-primary); padding:7px 12px; border-radius: 12px; font-size:13px; }
body.nicedash-body .breadcrumb-dot { width:7px; height:7px; border-radius:50%; background:#030e09; }

/* Formularios, campos y acciones */
body.nicedash-body .field input,
body.nicedash-body .field select,
body.nicedash-body .field textarea,
body.nicedash-body input[type="text"],
body.nicedash-body input[type="email"],
body.nicedash-body input[type="password"],
body.nicedash-body input[type="number"],
body.nicedash-body input[type="date"],
body.nicedash-body input[type="search"],
body.nicedash-body select,
body.nicedash-body textarea {
    border: 1px solid var(--mat-sys-outline) !important;
    border-radius: 12px !important;
    min-height: 44px;
    padding: 10px 14px;
    color: var(--mat-sys-on-background) !important;
    background-color: var(--mat-sys-surface) !important;
    outline: none;
    box-shadow: none !important;
    font-size: 14px;
}
body.nicedash-body input:focus,
body.nicedash-body select:focus,
body.nicedash-body textarea:focus {
    border-color: var(--mat-sys-primary) !important;
    box-shadow: 0 0 0 1px var(--mat-sys-primary) inset !important;
}
body.nicedash-body input[type="date"] { color-scheme: light; }
body.nicedash-body.dark-mode input[type="date"] { color-scheme: dark; }
body.nicedash-body .field label { margin-bottom:8px; display:block; font-weight:600; }
body.nicedash-body .help, body.nicedash-body small, body.nicedash-body .muted { color: var(--nde-muted); }
body.nicedash-body .btn { border-radius: 12px; min-height: 40px; padding: 10px 18px; display:inline-flex; align-items:center; gap:8px; font-weight:700; }
body.nicedash-body .btn.ghost { background: transparent !important; border:1px solid var(--mat-sys-outline); color: var(--mat-sys-primary); }
body.nicedash-body .actions:not(.row-actions):not(.right) {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}
body.nicedash-body .form-actions-clean { display:flex; justify-content:flex-end; gap:12px; margin-top:22px; }

/* DataTables estilo Material/NiceDash */
body.nicedash-body .datatable-controls {
    min-height: 88px;
    border-radius: 16px;
    padding: 24px;
    margin: 0 0 22px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    box-shadow:none;
}
body.nicedash-body .datatable-search.nicedash-search-field { position:relative; max-width: 320px; width:100%; }
body.nicedash-body .datatable-search-icon { position:absolute; left:18px; top:50%; transform:translateY(-50%); width:20px; height:20px; color:#596962; }
body.nicedash-body .datatable-search input { padding-left: 48px !important; width:100%; }
body.nicedash-body .datatable-actions-slot { margin-left:auto; display:flex; justify-content:flex-end; gap:10px; align-items:center; }
body.nicedash-body .table-responsive { border-radius: 14px; overflow:auto; }
body.nicedash-body table { border-collapse: collapse; width:100%; }
body.nicedash-body .table-compact th,
body.nicedash-body .table-compact td { padding: 14px 16px; border-bottom: 1px solid var(--mat-sys-outline-variant); }
body.nicedash-body .table-compact th { color:#000000; font-weight:700; background: transparent; }
body.nicedash-body .table-compact tr:hover td { background: rgba(223,236,234,.38); }
body.nicedash-body .datatable-summary.mat-paginator-like,
body.nicedash-body .datatable-summary {
    width:100%;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:24px;
    padding: 18px 0 4px;
    margin: 0;
    background: transparent !important;
    border: 0 !important;
    box-shadow:none !important;
}
body.nicedash-body .datatable-length { display:flex; align-items:center; gap:10px; white-space:nowrap; color:#030e09; }
body.nicedash-body .datatable-length select {
    height:42px;
    min-height:42px;
    width:86px;
    border-radius:12px !important;
    padding: 8px 36px 8px 14px !important;
    appearance:auto;
}
body.nicedash-body .datatable-info { min-width: 96px; color:#030e09; }
body.nicedash-body .datatable-pager { display:flex; align-items:center; gap:10px; }
body.nicedash-body .datatable-page.datatable-page-icon {
    width:38px;
    height:38px;
    min-width:38px;
    border:0;
    background: transparent;
    color:#030e09;
    border-radius:50%;
    padding:0;
    cursor:pointer;
}
body.nicedash-body .datatable-page.datatable-page-icon:hover:not(:disabled) { background: var(--mat-sys-primary-fixed-dim); color: var(--mat-sys-primary); }
body.nicedash-body .datatable-page.datatable-page-icon:disabled { opacity:.35; cursor:default; background:transparent; }
body.nicedash-body .datatable-page.datatable-page-icon .iconify { width:22px; height:22px; }
body.nicedash-body th.datatable-sortable { cursor:pointer; }
body.nicedash-body th.datatable-sortable::after { color: var(--mat-sys-primary); margin-left:6px; }
body.nicedash-body .row-actions a,
body.nicedash-body .row-actions button,
body.nicedash-body .action-icon {
    width:34px; height:34px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center;
    border:0; background: transparent; color:#030e09; cursor:pointer;
}
body.nicedash-body .row-actions a:hover,
body.nicedash-body .row-actions button:hover,
body.nicedash-body .action-icon:hover { background:var(--mat-sys-primary-fixed-dim); color:var(--mat-sys-primary); }
body.nicedash-body .row-actions .iconify,
body.nicedash-body .action-icon .iconify { width:20px; height:20px; }

/* Login y pantallas auth */
body .auth-main.blank-layout {
    min-height: 100vh;
    background: #F5F5F5;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    padding: 30px 20px 70px;
}
.auth-shell {
    width:min(1024px, 100%);
    min-height: 680px;
    background:#fff;
    border:1px solid #dfe8e3;
    border-radius:16px;
    overflow:hidden;
    display:grid;
    grid-template-columns: 1fr 1fr;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.auth-pane { padding: 56px 32px; display:flex; align-items:center; }
.auth-form-wrap { max-width: 452px; width:100%; margin:0 auto; }
.auth-logo { max-width: 180px; margin-bottom: 36px; }
.auth-form-wrap h1 { margin:0 0 8px; font-size:22px; }
.auth-form-wrap p { color:#6f7b76; margin:0 0 28px; line-height:1.45; }
.auth-side {
    background-image: url('img/nicedash/login-bg.jpg');
    background-size: cover;
    background-position: center;
    min-height: 680px;
}
.auth-footer {
    position: fixed;
    bottom: 18px;
    left: 0;
    right: 0;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    padding: 0 80px;
    color:#596962;
    font-size:14px;
}
.auth-footer nav { display:flex; gap:20px; }
.auth-footer a { color:#166354; }
.two-step-inputs { display:grid; grid-template-columns: repeat(6, 1fr); gap:16px; margin: 18px 0 20px; }
.two-step-inputs input { text-align:center; font-size:22px; font-weight:700; height:54px; padding:0 !important; }
.auth-link-row { display:flex; justify-content:space-between; align-items:center; gap:14px; margin: 16px 0 20px; }

/* Apps nuevas */
.app-layout-two-col { display:grid; grid-template-columns: 310px 1fr; gap: 22px; }
.app-list-panel, .app-detail-panel { background: var(--mat-sys-surface); border:1px solid var(--mat-sys-outline); border-radius:16px; padding:22px; }
.app-list { display:flex; flex-direction:column; gap:10px; }
.app-list-item { display:flex; align-items:center; gap:12px; padding:12px; border-radius:12px; color:var(--mat-sys-on-background); }
.app-list-item:hover, .app-list-item.active { background: var(--mat-sys-primary-fixed-dim); color:var(--mat-sys-primary); }
.todo-status { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
.note-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap:18px; }
.note-card { border-radius:16px; padding:20px; border:1px solid var(--mat-sys-outline); background:#fff8df; min-height:170px; }
.note-card:nth-child(3n+2) { background:#e8f5e9; }
.note-card:nth-child(3n+3) { background:#e8e2fb; }
.chat-shell { display:grid; grid-template-columns: 320px 1fr; gap:22px; min-height:620px; }
.chat-list, .chat-window { background:var(--mat-sys-surface); border:1px solid var(--mat-sys-outline); border-radius:16px; overflow:hidden; }
.chat-list-head, .chat-window-head { padding:18px 20px; border-bottom:1px solid var(--mat-sys-outline); font-weight:800; }
.chat-messages { padding:22px; display:flex; flex-direction:column; gap:14px; max-height:430px; overflow:auto; }
.message { max-width:75%; padding:12px 16px; border-radius:18px; background:var(--mat-sys-primary-fixed-dim); }
.message.mine { align-self:flex-end; background:var(--mat-sys-primary); color:#fff; }
.chat-compose { display:flex; gap:12px; padding:18px; border-top:1px solid var(--mat-sys-outline); }
.chat-compose input { flex:1; }
.faq-list details { background:var(--mat-sys-surface); border:1px solid var(--mat-sys-outline); border-radius:14px; padding:18px 20px; margin-bottom:12px; }
.faq-list summary { cursor:pointer; font-weight:800; }
.error-page, .maintenance-page { min-height:100vh; display:flex; align-items:center; justify-content:center; flex-direction:column; text-align:center; padding:30px; background:#F5F5F5; }
.error-page img, .maintenance-page img { max-width: 420px; width:100%; margin-bottom:28px; }
.error-page h1, .maintenance-page h1 { font-size:32px; margin:0 0 10px; }
.liquidation-placeholder { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap:18px; }
.placeholder-card { background:var(--mat-sys-surface); border:1px solid var(--mat-sys-outline); border-radius:16px; padding:24px; min-height:160px; }

/* Footer */
body.nicedash-body .app-footer {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    padding: 20px 28px 28px;
    color:#596962;
    font-size:14px;
}
body.nicedash-body .app-footer nav { display:flex; gap:18px; flex-wrap:wrap; }
body.nicedash-body .app-footer a { color:#166354; font-weight:600; }

@media (max-width: 991px) {
    body.nicedash-body .topbar.mat-toolbar { padding:0 12px !important; }
    body.nicedash-body .topbar-search input { display:none !important; }
    body.nicedash-body .topbar-left, body.nicedash-body .topbar-right { gap:2px; }
    body.nicedash-body .topbar-icon-btn, body.nicedash-body .avatar-btn { width:38px; height:38px; min-width:38px; }
    body.nicedash-body .topbar-icon-btn .iconify { width:22px; height:22px; }
    body.nicedash-body .sidebar { transform: translateX(-100%); transition:.2s ease; z-index:100; }
    body.nicedash-body.menu-open .sidebar { transform: translateX(0); }
    body.nicedash-body .main { margin-left:0 !important; }
    body.nicedash-body .page-title-card { flex-direction:column; align-items:flex-start; gap:12px; }
    .app-layout-two-col, .chat-shell, .auth-shell { grid-template-columns:1fr; }
    .auth-side { display:none; }
    .auth-shell { min-height:auto; }
    .auth-pane { padding:36px 24px; }
    .auth-footer { position:static; padding:22px 10px 0; flex-direction:column; text-align:center; }
    body.nicedash-body .datatable-summary.mat-paginator-like, body.nicedash-body .datatable-summary { justify-content:flex-start; flex-wrap:wrap; }
    body.nicedash-body .datatable-controls { flex-direction:column; align-items:stretch; }
    body.nicedash-body .datatable-actions-slot { width:100%; margin-left:0; justify-content:flex-start; flex-wrap:wrap; }
    body.nicedash-body .app-footer { flex-direction:column; text-align:center; }
}
body.nicedash-body .checkbox-inline,
.auth-main .checkbox-inline { display:inline-flex; align-items:center; gap:10px; font-weight:600; color:var(--mat-sys-on-background, #030e09); }
body.nicedash-body .checkbox-inline input,
.auth-main .checkbox-inline input { width:20px; height:20px; min-height:20px; accent-color:#166354; }
.mt-16 { margin-top:16px; }
.mt-24 { margin-top:24px; }
.m-16 { margin:16px; }

/* Update 62 - Revisión integral NiceDash */
:root {
    --mat-sys-background: #F5F5F5;
    --mat-sys-surface: #ffffff;
    --mat-sys-on-background: #030e09;
    --mat-sys-primary: #166354;
    --mat-sys-primary-fixed-dim: #dfecea;
    --mat-sys-outline: #dfe8e3;
    --mat-sys-outline-variant: #edf2ef;
    --mat-sys-secondary: #6f7b76;
    --nde-radius: 16px;
}
html, body.nicedash-body { background:#F5F5F5 !important; color:#030e09 !important; font-family: Onest, Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
body.nicedash-body .body-wrapper { background:#F5F5F5 !important; }
body.nicedash-body .main.contentWrapper { background:#F5F5F5 !important; }

/* Topbar fiel a NiceDash */
body.nicedash-body .topbar.mat-toolbar { border-radius:0 !important; border:0 !important; box-shadow:none !important; margin:0 !important; height:70px; background:#fff !important; }
body.nicedash-body .userbox { background:transparent !important; border:0 !important; box-shadow:none !important; padding:0 !important; border-radius:0 !important; }
body.nicedash-body .topbar-left, body.nicedash-body .topbar-right { min-height:70px; }
body.nicedash-body .topbar-icon-btn { width:40px !important; height:40px !important; min-width:40px !important; color:#030e09; }
body.nicedash-body .topbar-icon-btn .iconify { width:23px !important; height:23px !important; }
body.nicedash-body .topbar-search { min-width:300px; background:transparent !important; }
body.nicedash-body .topbar-search input { display:block !important; width:250px !important; height:40px; color:#030e09; }
body.nicedash-body .topbar-search input::placeholder { color:#6f7b76; }
body.nicedash-body .topbar-search button { color:#030e09; }
body.nicedash-body .avatar-btn { width:40px !important; height:40px !important; min-width:40px !important; padding:0 !important; overflow:hidden; border:0 !important; background:transparent !important; }
body.nicedash-body .avatar-btn img { width:40px !important; height:40px !important; border-radius:50%; object-fit:cover; display:block; }
body.nicedash-body .avatar-initials, body.nicedash-body .profile-avatar-xl span { display:none !important; }

/* Popover perfil/notificaciones */
body.nicedash-body .profile-panel.nice-popover { width:360px; padding:0 !important; border-radius:18px !important; overflow:hidden; }
body.nicedash-body .profile-popover-head { text-align:center; padding:30px 20px 24px; border-bottom:1px solid var(--mat-sys-outline); }
body.nicedash-body .profile-avatar-xl { width:86px; height:86px; margin:0 auto 18px; border-radius:50%; overflow:hidden; background:#d3f3f1; }
body.nicedash-body .profile-avatar-xl img { width:100%; height:100%; object-fit:cover; }
body.nicedash-body .profile-popover-head h3 { margin:0 0 8px; font-size:18px; font-weight:800; color:#030e09; }
body.nicedash-body .profile-popover-head p { margin:0; color:#6f7b76; display:flex; align-items:center; justify-content:center; gap:7px; }
body.nicedash-body .profile-links { padding:20px 26px; display:grid; gap:2px; }
body.nicedash-body .profile-links a { display:flex; align-items:center; gap:12px; min-height:36px; color:#6f7b76; font-weight:600; border-radius:9px; padding:7px 0; }
body.nicedash-body .profile-links a:hover { color:#166354; }
body.nicedash-body .profile-links .iconify { width:21px; height:21px; color:currentColor; }
body.nicedash-body .profile-promo { display:flex; justify-content:center; align-items:center; color:#6f7b76; font-size:58px; height:78px; }
body.nicedash-body .profile-logout { margin:0 auto 30px; width:max-content; background:#f09d23 !important; color:#030e09 !important; min-height:40px; padding:9px 20px; border-radius:9px; }
body.nicedash-body .alerts-panel.nice-popover { width:360px; padding:26px 24px !important; border-radius:18px !important; }
body.nicedash-body .notification-item { display:grid; grid-template-columns:52px 1fr auto; gap:14px; align-items:center; padding:10px 0; color:#030e09; }
body.nicedash-body .notification-icon { width:48px; height:48px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:#dfecea; color:#166354; }
body.nicedash-body .notification-content strong { display:block; font-size:14px; }
body.nicedash-body .notification-content small { display:block; color:#030e09; font-size:12px; }
body.nicedash-body .notification-item time { font-size:13px; white-space:nowrap; }
body.nicedash-body .notification-footer { width:100%; margin-top:14px; }

/* Sidebar y minisidebar */
body.nicedash-body .sidebar { width:270px !important; }
body.nicedash-body .sidebar-nav { scrollbar-width:thin; scrollbar-color:#c3d3cd transparent; }
body.nicedash-body .nav-caption { margin:18px 12px 8px !important; padding-top:14px; border-top:1px solid #edf2ef; color:#6f7b76 !important; }
body.nicedash-body .nav-caption:first-child { border-top:0; padding-top:0; }
body.nicedash-body .sidebar-list.mdc-list .menu-list-item { border-radius:8px !important; min-height:44px; }
body.nicedash-body .sidebar-list.mdc-list .menu-list-item:hover { color:#166354 !important; }
body.nicedash-body .sidebar-list.mdc-list .menu-list-item.active, body.nicedash-body .sidebar-list.mdc-list .menu-list-item.activeMenu { background:#166354 !important; color:#fff !important; }
body.nicedash-body.sidebar-collapsed .sidebar { width:82px !important; overflow:visible; }
body.nicedash-body.sidebar-collapsed .main { margin-left:82px !important; }
body.nicedash-body.sidebar-collapsed .sidebar-nav { overflow:visible; }
body.nicedash-body.sidebar-collapsed .nav-caption { margin:16px 10px 8px !important; height:1px; padding:0; border-top:1px solid #edf2ef; }
body.nicedash-body.sidebar-collapsed .menu-list-item { width:52px; margin:5px auto !important; overflow:visible !important; position:relative; }
body.nicedash-body.sidebar-collapsed .menu-list-item .hide-menu { display:block !important; position:absolute; left:62px; top:50%; transform:translateY(-50%); background:#030e09; color:#fff !important; white-space:nowrap; padding:8px 12px; border-radius:8px; opacity:0; pointer-events:none; box-shadow:0 10px 30px rgba(0,0,0,.18); z-index:2500; }
body.nicedash-body.sidebar-collapsed .menu-list-item:hover .hide-menu { opacity:1; }
body.nicedash-body.sidebar-collapsed .menu-list-item .hide-menu::before { content:""; position:absolute; left:-5px; top:50%; width:10px; height:10px; background:#030e09; transform:translateY(-50%) rotate(45deg); }

/* Responsive: topbar en una sola línea y sidebar sin duplicados */
body.nicedash-body .mobile-menu-btn { position:static !important; box-shadow:none !important; }
@media (max-width:991px) {
    body.nicedash-body .topbar.mat-toolbar { padding:0 12px !important; display:flex !important; flex-direction:row !important; align-items:center !important; justify-content:space-between !important; }
    body.nicedash-body .topbar-left, body.nicedash-body .topbar-right { min-height:70px; display:flex !important; flex-direction:row !important; align-items:center !important; }
    body.nicedash-body .sidebar-collapse-btn { display:none !important; }
    body.nicedash-body .mobile-menu-btn { display:inline-flex !important; }
    body.nicedash-body .topbar-search { min-width:auto; }
    body.nicedash-body .topbar-search input { display:none !important; }
    body.nicedash-body .sidebar { position:fixed !important; transform:translateX(-100%) !important; z-index:1250 !important; }
    body.nicedash-body.menu-open .sidebar { transform:translateX(0) !important; }
    body.nicedash-body .main { padding-top:0 !important; }
}

/* Formularios NiceDash */
body.nicedash-body label { color:#030e09 !important; font-size:14px; font-weight:600; margin-bottom:8px; }
body.nicedash-body input:not([type="checkbox"]):not([type="radio"]), body.nicedash-body select, body.nicedash-body textarea,
.auth-main input:not([type="checkbox"]):not([type="radio"]), .auth-main select, .auth-main textarea {
    min-height:44px; border:1px solid #dfe8e3 !important; border-radius:10px !important; background:#fff !important; color:#030e09 !important; padding:10px 14px !important; box-shadow:none !important; font-size:14px;
}
body.nicedash-body textarea, .auth-main textarea { line-height:1.45; }
body.nicedash-body input:focus, body.nicedash-body select:focus, body.nicedash-body textarea:focus,
.auth-main input:focus, .auth-main select:focus, .auth-main textarea:focus { border-color:#166354 !important; outline:0 !important; box-shadow:0 0 0 2px rgba(22,99,84,.12) !important; }
body.nicedash-body input[disabled], body.nicedash-body input[readonly], body.nicedash-body select[disabled], body.nicedash-body textarea[disabled] { background:#f5f7f6 !important; color:#6f7b76 !important; }
body.nicedash-body input[type="checkbox"], body.nicedash-body input[type="radio"], .auth-main input[type="checkbox"], .auth-main input[type="radio"] { width:18px !important; height:18px !important; min-height:18px !important; padding:0 !important; accent-color:#166354; flex:0 0 auto; }
body.nicedash-body .checkbox-list { padding:10px 14px; max-height:280px; overflow:auto; }
body.nicedash-body .checkbox-list label { display:flex !important; align-items:center !important; gap:10px !important; min-height:38px; margin:0 !important; font-weight:600; }
body.nicedash-body input[type="date"] { position:relative; padding-right:42px !important; }
body.nicedash-body select { appearance:none; background-image:linear-gradient(45deg, transparent 50%, #166354 50%),linear-gradient(135deg, #166354 50%, transparent 50%) !important; background-position:calc(100% - 18px) 19px,calc(100% - 13px) 19px !important; background-size:5px 5px,5px 5px !important; background-repeat:no-repeat !important; }
body.nicedash-body .form-action-row { grid-column:1/-1; display:flex; justify-content:flex-end; gap:12px; margin-top:8px; }
body.nicedash-body .actions-final, body.nicedash-body form > .actions:last-child { background:transparent !important; border:0 !important; box-shadow:none !important; padding:0 !important; }
body.nicedash-body .breadcrumb-card + .actions, body.nicedash-body .page-title-card + .actions { background:#fff !important; border:1px solid #dfe8e3 !important; border-radius:16px !important; box-shadow:0 2px 10px rgba(0,0,0,.04) !important; padding:16px 18px !important; }
body.nicedash-body .btn.full-width { width:100%; }
body.nicedash-body .btn { border-radius:10px !important; font-weight:700; }
body.nicedash-body .btn.ghost { color:#166354 !important; }

/* DataTables NiceDash */
body.nicedash-body .datatable-controls { background:#fff !important; border:1px solid #dfe8e3 !important; border-radius:16px !important; padding:18px 22px !important; margin:0 0 18px !important; box-shadow:none !important; display:flex; justify-content:space-between; }
body.nicedash-body .nicedash-search-field { width:min(340px,100%); min-height:42px; border:1px solid #dfe8e3; border-radius:10px; padding:0 12px; display:flex; align-items:center; gap:10px; color:#6f7b76; }
body.nicedash-body .nicedash-search-field input { border:0 !important; padding:0 !important; min-height:40px; box-shadow:none !important; }
body.nicedash-body table { background:#fff; }
body.nicedash-body th { color:#000 !important; font-weight:700 !important; background:#fff !important; text-transform:none !important; letter-spacing:0 !important; }
body.nicedash-body td { color:#030e09; }
body.nicedash-body .datatable-summary { justify-content:flex-end !important; align-items:center !important; gap:28px !important; padding:18px 0 0 !important; }
body.nicedash-body .datatable-length { order:1; }
body.nicedash-body .datatable-info { order:2; }
body.nicedash-body .datatable-pager { order:3; }
body.nicedash-body .datatable-length select { appearance:none !important; border-color:#166354 !important; min-width:84px; height:44px; border-radius:10px !important; background-color:#fff !important; background-position:calc(100% - 18px) 19px,calc(100% - 13px) 19px !important; }
body.nicedash-body .datatable-page.datatable-page-icon { display:inline-flex; align-items:center; justify-content:center; }
body.nicedash-body .datatable-page.datatable-page-icon:hover:not(:disabled), body.nicedash-body .datatable-page.datatable-page-icon:focus-visible { background:#dfecea !important; color:#166354 !important; }
body.nicedash-body .datatable-page[title] { pointer-events:auto; }
body.nicedash-body .row-actions a, body.nicedash-body .row-actions button, body.nicedash-body .icon-btn, body.nicedash-body .action-icon { border-radius:50% !important; }
body.nicedash-body .row-actions a .iconify, body.nicedash-body .row-actions button .iconify, body.nicedash-body .icon-btn .iconify, body.nicedash-body .action-icon .iconify { width:20px !important; height:20px !important; }

/* Toastr */
.toast-container { position:fixed; top:84px; right:24px; z-index:3000; display:grid; gap:12px; width:min(380px, calc(100vw - 32px)); }
.toast { display:grid; grid-template-columns:24px 1fr 24px; align-items:center; gap:12px; padding:14px 14px; border-radius:12px; background:#fff; color:#030e09; border:1px solid #dfe8e3; box-shadow:0 12px 35px rgba(0,0,0,.12); animation:toastIn .22s ease; }
.toast .iconify { width:22px; height:22px; }
.toast button { border:0; background:transparent; cursor:pointer; font-size:22px; line-height:1; color:#6f7b76; }
.toast-success .iconify { color:#166354; } .toast-error .iconify { color:#d84343; } .toast-warning .iconify { color:#f0a020; } .toast-info .iconify { color:#3f6fb5; }
.toast.is-hiding { opacity:0; transform:translateX(14px); transition:.2s ease; }
@keyframes toastIn { from { opacity:0; transform:translateX(18px); } to { opacity:1; transform:translateX(0); } }

/* Auth */
.auth-main.blank-layout { background:#F5F5F5 !important; }
.auth-shell { min-height:680px !important; border-radius:16px !important; }
.auth-pane { align-items:center !important; }
.auth-side { background-image:url('img/nicedash/login-bg.jpg') !important; background-size:cover !important; background-position:center center !important; min-height:680px !important; }
.auth-logo { max-width:190px !important; }
.auth-help-block { margin-top:24px; display:grid; gap:12px; color:#6f7b76; }
.auth-secondary-btn { width:100%; justify-content:center; }

/* Chat, notas, FAQ y perfil */
.nicedash-chat-app { display:grid; grid-template-columns:340px 1fr; gap:24px; min-height:650px; }
.chat-sidebar, .chat-main { padding:0 !important; overflow:hidden; }
.chat-sidebar-head, .chat-main-head { display:flex; align-items:center; justify-content:space-between; padding:20px 22px; border-bottom:1px solid #dfe8e3; }
.chat-sidebar-head h2 { margin:0; font-size:20px; }
.chat-search { margin:16px; border:1px solid #dfe8e3; border-radius:10px; display:flex; align-items:center; gap:10px; padding:0 12px; }
.chat-search input { border:0 !important; min-height:42px; padding:0 !important; }
.chat-conversation-list { padding:0 12px 12px; display:grid; gap:4px; max-height:310px; overflow:auto; }
.chat-person { display:flex; gap:12px; align-items:center; border-radius:12px; padding:10px; color:#030e09; }
.chat-person:hover, .chat-person.active { background:#dfecea; color:#166354; }
.chat-person img, .chat-title-user img, .chat-bubble-row img { width:42px; height:42px; border-radius:50%; object-fit:cover; }
.chat-person span, .chat-title-user span { display:grid; }
.chat-person small, .chat-title-user small { color:#6f7b76; font-size:12px; }
.chat-new-form { padding:16px; border-top:1px solid #dfe8e3; }
.chat-title-user { display:flex; align-items:center; gap:12px; }
.chat-thread { padding:22px; min-height:480px; max-height:520px; overflow:auto; display:flex; flex-direction:column; gap:14px; background:#fff; }
.chat-bubble-row { display:flex; align-items:flex-end; gap:10px; max-width:78%; }
.chat-bubble-row.mine { align-self:flex-end; flex-direction:row-reverse; }
.chat-bubble { background:#f5f7f6; border-radius:16px 16px 16px 4px; padding:12px 14px; }
.chat-bubble-row.mine .chat-bubble { background:#166354; color:#fff; border-radius:16px 16px 4px 16px; }
.chat-bubble p { margin:5px 0; }
.chat-bubble small { opacity:.72; }
.chat-compose-v2 { display:flex; gap:12px; padding:18px; border-top:1px solid #dfe8e3; }
.chat-compose-v2 input { flex:1; }
.notes-app-shell { display:grid; grid-template-columns:320px 1fr; gap:24px; }
.notes-sidebar h2 { margin-top:0; }
.notes-form { display:grid; gap:14px; }
.notes-board { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:18px; align-content:start; }
.note-card-v2 { min-height:220px; border:0; border-radius:16px; padding:20px; background:#e8f5e9; box-shadow:none; display:flex; flex-direction:column; }
.note-card-v2.note-warning { background:#fff3df; } .note-card-v2.note-purple { background:#ede7fb; } .note-card-v2.note-danger { background:#ffe2e2; }
.note-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.note-pin { width:36px; height:36px; border-radius:50%; background:rgba(255,255,255,.62); display:flex; align-items:center; justify-content:center; }
.note-card-v2 h3 { margin:0 0 8px; }
.note-card-v2 p { flex:1; color:#030e09; }
.note-card-v2 small { color:#6f7b76; }
.empty-app-state { display:flex; min-height:230px; flex-direction:column; align-items:center; justify-content:center; text-align:center; color:#6f7b76; }
.empty-app-state .iconify { width:58px; height:58px; color:#166354; }
.faq-hero { text-align:center; padding:34px !important; }
.faq-hero .iconify { width:54px; height:54px; color:#166354; }
.faq-layout { display:grid; grid-template-columns:280px 1fr; gap:24px; }
.faq-categories { display:grid; gap:8px; align-content:start; }
.faq-categories h3 { margin-top:0; }
.faq-categories a { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; color:#030e09; font-weight:600; }
.faq-categories a.active, .faq-categories a:hover { background:#166354; color:#fff; }
.faq-accordion details { border-bottom:1px solid #dfe8e3; padding:18px 0; }
.faq-accordion details:last-child { border-bottom:0; }
.faq-accordion summary { list-style:none; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:12px; cursor:pointer; font-weight:800; }
.faq-accordion summary::-webkit-details-marker { display:none; }
.faq-accordion summary span:first-child { background:#dfecea; color:#166354; border-radius:999px; padding:4px 9px; font-size:12px; }
.faq-accordion p { color:#6f7b76; margin:14px 0 0; line-height:1.55; }
.profile-settings-shell { display:grid; grid-template-columns:320px 1fr; gap:24px; }
.profile-summary-card { background:#fff; border:1px solid #dfe8e3; border-radius:16px; overflow:hidden; text-align:center; padding-bottom:24px; }
.profile-cover { height:100px; background:linear-gradient(135deg,#dfecea,#f09d23); }
.profile-avatar-large { width:108px; height:108px; margin:-54px auto 12px; border:4px solid #fff; border-radius:50%; overflow:hidden; }
.profile-avatar-large img { width:100%; height:100%; object-fit:cover; }
.profile-badges { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }
.settings-tabs { display:flex; gap:10px; border-bottom:1px solid #dfe8e3; margin:-6px -6px 22px; padding:0 0 14px; }
.settings-tab { display:inline-flex; align-items:center; gap:8px; padding:9px 12px; border-radius:10px; font-weight:700; color:#6f7b76; }
.settings-tab.active { background:#166354; color:#fff; }
.nice-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }

@media (max-width:991px) { .nicedash-chat-app, .notes-app-shell, .faq-layout, .profile-settings-shell, .nice-form-grid { grid-template-columns:1fr; } body.nicedash-body .datatable-summary { justify-content:flex-start !important; flex-wrap:wrap; } body.nicedash-body .topbar-search { min-width:40px; } }

/* Update 64 - Ajustes finos NiceDash indicados en revisión visual */
body.nicedash-body,
body.nicedash-body .body-wrapper,
body.nicedash-body .main.contentWrapper {
    background: #F5F5F5 !important;
}

/* Evita el círculo naranja heredado del diseño anterior en sidebar/responsive. */
body.nicedash-body .sidebar.sidebarNav::before,
body.nicedash-body .sidebar::before {
    display: none !important;
    content: none !important;
}

/* Topbar: buscador siempre visible, texto a la izquierda y lupa dentro a la derecha. */
body.nicedash-body .topbar.mat-toolbar {
    background: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
body.nicedash-body .topbar-search {
    position: relative !important;
    display: block !important;
    width: 250px !important;
    min-width: 250px !important;
    height: 42px !important;
    margin: 0 0 0 8px !important;
    background: transparent !important;
    border: 0 !important;
}
body.nicedash-body .topbar-search input {
    display: block !important;
    width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 9px 46px 9px 16px !important;
    border: 1px solid #dfe8e3 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #030e09 !important;
    box-shadow: none !important;
}
body.nicedash-body .topbar-search button {
    position: absolute !important;
    top: 50% !important;
    right: 7px !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    color: #6f7b76 !important;
    padding: 0 !important;
}
body.nicedash-body .topbar-search button:hover {
    background: #dfecea !important;
    color: #166354 !important;
}

/* Topbar responsive: una sola línea, botón menú izquierda y perfil a la derecha. */
@media (max-width: 991px) {
    body.nicedash-body .topbar.mat-toolbar {
        padding: 0 12px !important;
        height: 68px !important;
        min-height: 68px !important;
    }
    body.nicedash-body .topbar-left {
        flex: 0 0 auto !important;
        min-width: 40px !important;
        gap: 0 !important;
    }
    body.nicedash-body .topbar-right {
        margin-left: auto !important;
        min-height: 68px !important;
        gap: 4px !important;
    }
    body.nicedash-body .topbar-search {
        display: none !important;
    }
    body.nicedash-body .mobile-menu-btn {
        display: inline-flex !important;
    }
    body.nicedash-body .sidebar-close.mobile-menu-btn {
        display: inline-flex !important;
    }
    body.nicedash-body .sidebar-collapse-btn {
        display: none !important;
    }
}

/* Campana: icono limpio y contador rojo superpuesto como en NiceDash. */
body.nicedash-body .alert-bell span[aria-hidden="true"],
body.nicedash-body .alert-bell > .iconify {
    width: 23px !important;
    height: 23px !important;
    display: inline-flex !important;
    background: transparent !important;
    box-shadow: none !important;
    color: currentColor !important;
}
body.nicedash-body .alert-count {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    min-width: 16px !important;
    height: 16px !important;
    padding: 0 4px !important;
    border-radius: 999px !important;
    background: #ff4b4b !important;
    color: #fff !important;
    border: 2px solid #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

/* Panel de notificaciones: no cortar textos y hover verde suave. */
body.nicedash-body .alerts-panel.nice-popover {
    width: 390px !important;
    max-width: calc(100vw - 28px) !important;
    padding: 26px 24px 22px !important;
    overflow: visible !important;
}
body.nicedash-body .notification-list {
    gap: 2px !important;
}
body.nicedash-body .notification-item {
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) auto !important;
    gap: 14px !important;
    align-items: center !important;
    padding: 12px 0 !important;
    margin: 0 -10px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    border-radius: 0 !important;
    text-decoration: none !important;
    overflow: visible !important;
}
body.nicedash-body .notification-item:hover,
body.nicedash-body .notification-item.unread:hover {
    background: #dfecea !important;
}
body.nicedash-body .notification-content {
    min-width: 0 !important;
    overflow: visible !important;
}
body.nicedash-body .notification-content strong,
body.nicedash-body .notification-content small {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-height: none !important;
}
body.nicedash-body .notification-item time {
    align-self: start !important;
    padding-top: 4px !important;
    color: #030e09 !important;
}

/* Perfil: avatar más proporcionado y popover sin bloque promocional. */
body.nicedash-body .avatar-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
}
body.nicedash-body .avatar-btn img {
    width: 38px !important;
    height: 38px !important;
    display: block !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}
body.nicedash-body .profile-promo {
    display: none !important;
}
body.nicedash-body .profile-panel.nice-popover {
    width: 360px !important;
    max-width: calc(100vw - 28px) !important;
}
body.nicedash-body .profile-links a {
    justify-content: flex-start !important;
}
body.nicedash-body .profile-links .mini-chip {
    margin-left: 8px !important;
}
body.nicedash-body .profile-logout {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 10px auto 26px !important;
}

/* Sidebar: líneas de sección separadas y minisidebar que se expande al pasar el ratón. */
body.nicedash-body .nav-caption {
    margin: 20px 12px 10px !important;
    padding-top: 16px !important;
    border-top: 1px solid #edf2ef !important;
}
body.nicedash-body .nav-caption:first-child,
body.nicedash-body .sidebar-nav .nav-caption:first-of-type {
    border-top: 0 !important;
    padding-top: 0 !important;
    margin-top: 6px !important;
}
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav {
    width: 82px !important;
    overflow: hidden !important;
    transition: width .22s ease, box-shadow .22s ease !important;
}
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover {
    width: 270px !important;
    overflow: hidden !important;
    box-shadow: 8px 0 34px rgba(3, 14, 9, .12) !important;
}
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover .brand-logo-full {
    display: block !important;
}
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover .brand-logo-mini {
    display: none !important;
}
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover .hide-menu,
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover .caption-text {
    display: inline-flex !important;
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover .hide-menu::before {
    display: none !important;
}
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover .menu-list-item {
    width: auto !important;
    justify-content: flex-start !important;
    padding: 9px 14px !important;
    margin: 3px 0 !important;
}
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover .item-chip {
    position: static !important;
    min-width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
    margin-left: auto !important;
}
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover .nav-caption {
    height: auto !important;
    margin: 20px 12px 10px !important;
    padding-top: 16px !important;
}
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover .sidebar-footer {
    display: flex !important;
}
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover .sidebar-brand-row {
    justify-content: space-between !important;
}

/* Buscadores de tablas: evitar icono/texto montados y duplicidades visuales. */
body.nicedash-body .datatable-controls {
    box-shadow: none !important;
}
body.nicedash-body .nicedash-search-field {
    position: relative !important;
    width: min(340px, 100%) !important;
    min-height: 42px !important;
    border: 1px solid #dfe8e3 !important;
    border-radius: 10px !important;
    background: #fff !important;
    padding: 0 !important;
    display: block !important;
}
body.nicedash-body .nicedash-search-field .datatable-search-icon {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    color: #6f7b76 !important;
    pointer-events: none !important;
}
body.nicedash-body .datatable-search input,
body.nicedash-body .nicedash-search-field input {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    border: 0 !important;
    background: transparent !important;
    padding: 8px 14px 8px 44px !important;
    box-shadow: none !important;
}

/* Selects y opciones: aproximación visual a NiceDash. */
body.nicedash-body select {
    border-radius: 10px !important;
    border-color: #dfe8e3 !important;
    color: #030e09 !important;
}
body.nicedash-body select:focus {
    border-color: #166354 !important;
    box-shadow: 0 0 0 2px rgba(22, 99, 84, .12) !important;
}
body.nicedash-body select option:checked,
body.nicedash-body select option:hover,
body.nicedash-body select option:focus {
    background: #dfecea !important;
    color: #030e09 !important;
}

/* Checklists de dictantes: menos separación y checkbox alineado. */
body.nicedash-body .checkbox-list {
    padding: 8px 12px !important;
    gap: 0 !important;
}
body.nicedash-body .checkbox-list label {
    min-height: 34px !important;
    padding: 4px 0 !important;
    gap: 10px !important;
    line-height: 1.25 !important;
}
body.nicedash-body .checkbox-list input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
}

/* Iconos de acciones: normalizar todos a tamaño y estilo Tabler/NiceDash. */
body.nicedash-body .row-actions,
body.nicedash-body td.row-actions {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
}
body.nicedash-body .row-actions a,
body.nicedash-body .row-actions button,
body.nicedash-body .icon-btn,
body.nicedash-body .action-icon {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border: 0 !important;
    background: transparent !important;
    color: #030e09 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-shadow: none !important;
}
body.nicedash-body .row-actions a:hover,
body.nicedash-body .row-actions button:hover,
body.nicedash-body .icon-btn:hover,
body.nicedash-body .action-icon:hover {
    background: #dfecea !important;
    color: #166354 !important;
}
body.nicedash-body .icon-btn.danger:hover,
body.nicedash-body .row-actions .danger:hover {
    background: rgba(239, 68, 68, .12) !important;
    color: #ef4444 !important;
}

/* Paginación: mantener alineación y dropdown limpio. */
body.nicedash-body .datatable-summary.mat-paginator-like,
body.nicedash-body .datatable-summary {
    justify-content: flex-end !important;
    align-items: center !important;
}
body.nicedash-body .datatable-page.datatable-page-icon {
    border: 0 !important;
    background: transparent !important;
    color: #6f7b76 !important;
}
body.nicedash-body .datatable-page.datatable-page-icon:hover:not(:disabled) {
    background: #dfecea !important;
    color: #166354 !important;
}
body.nicedash-body .datatable-length select {
    min-width: 84px !important;
    padding-right: 34px !important;
}

/* Mantenimiento con el SVG institucional recibido. */
.maintenance-page {
    background: #F5F5F5 !important;
}
.maintenance-page img {
    max-width: 420px !important;
}

/* Update 65 - correcciones finas solicitadas antes de liquidaciones */
:root,
html.light-theme {
    --nde-secondary: #f09d23 !important;
    --mat-sys-secondary: #f09d23 !important;
}
body.nicedash-body .btn.secondary,
body.nicedash-body a.btn.secondary,
body.nicedash-body button.btn.secondary {
    background: #f09d23 !important;
    color: #fff !important;
}
body.nicedash-body .btn.secondary:hover,
body.nicedash-body a.btn.secondary:hover,
body.nicedash-body button.btn.secondary:hover {
    background: #d78208 !important;
    color: #fff !important;
}
body.nicedash-body .metric-delta { background: rgba(240,157,35,.18) !important; color: #a65f00 !important; }
body.nicedash-body .auth-main.blank-layout::before { background: radial-gradient(circle at 14% 12%, rgba(240,157,35,.16), transparent 28%), radial-gradient(circle at 90% 14%, rgba(22,90,80,.12), transparent 30%) !important; }
body.nicedash-body .profile-cover { background: linear-gradient(135deg,#dfecea,#f09d23) !important; }

/* Footer siempre abajo aunque el contenido sea corto. */
body.nicedash-body .main.contentWrapper { min-height: 100vh !important; display: flex !important; flex-direction: column !important; }
body.nicedash-body .body-wrapper { flex: 1 0 auto !important; display: flex !important; flex-direction: column !important; }
body.nicedash-body .pageWrapper { flex: 1 0 auto !important; }
body.nicedash-body .app-footer { flex-shrink: 0 !important; margin-top: auto !important; }

/* Buscadores internos: un único campo, sin doble borde ni icono montado. No afecta al buscador topbar. */
body.nicedash-body .datatable-search.nicedash-search-field,
body.nicedash-body .app-search-field,
body.nicedash-body .chat-search {
    position: relative !important;
    width: min(360px, 100%) !important;
    min-height: 42px !important;
    border: 1px solid #dfe8e3 !important;
    border-radius: 12px !important;
    background: #fff !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
}
body.nicedash-body .datatable-search.nicedash-search-field .datatable-search-icon,
body.nicedash-body .app-search-field > .iconify,
body.nicedash-body .chat-search > .iconify {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    color: #030e09 !important;
    pointer-events: none !important;
    z-index: 2 !important;
}
body.nicedash-body .datatable-search.nicedash-search-field input,
body.nicedash-body .app-search-field input,
body.nicedash-body .chat-search input {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    height: 40px !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 8px 14px 8px 44px !important;
    color: #030e09 !important;
}
body.nicedash-body .datatable-search.nicedash-search-field:focus-within,
body.nicedash-body .app-search-field:focus-within,
body.nicedash-body .chat-search:focus-within {
    border-color: #166354 !important;
    box-shadow: 0 0 0 2px rgba(22,99,84,.12) !important;
}
body.nicedash-body .card .datatable-controls { border-color: transparent !important; }

/* Perfil y notificaciones */
body.nicedash-body .profile-panel.nice-popover { padding-bottom: 22px !important; }
body.nicedash-body .profile-logout {
    display: flex !important;
    width: max-content !important;
    margin: 18px auto 4px !important;
    padding: 10px 20px !important;
    background: #166354 !important;
    color: #fff !important;
    border-radius: 10px !important;
}
body.nicedash-body .profile-logout:hover { background: #11483f !important; color: #fff !important; }
body.nicedash-body .notification-icon { background: #f1f1f1 !important; color: #166354 !important; }
body.nicedash-body .notification-item:hover .notification-icon { background: #dfecea !important; }

/* Responsive topbar: menú izquierda, lupa/avisos/perfil derecha. */
body.nicedash-body .topbar-mobile-search-toggle { display: none !important; }
@media (max-width: 991px) {
    body.nicedash-body .topbar.mat-toolbar {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        padding: 0 14px !important;
        overflow: visible !important;
    }
    body.nicedash-body .topbar-left {
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }
    body.nicedash-body .topbar-right.userbox {
        margin-left: auto !important;
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 6px !important;
        width: auto !important;
    }
    body.nicedash-body .topbar-mobile-search-toggle { display: inline-flex !important; }
    body.nicedash-body .topbar-search {
        display: none !important;
        position: absolute !important;
        left: 14px !important;
        right: 14px !important;
        top: calc(100% + 8px) !important;
        width: auto !important;
        min-width: 0 !important;
        z-index: 1500 !important;
        margin: 0 !important;
    }
    body.nicedash-body.mobile-search-open .topbar-search { display: block !important; }
    body.nicedash-body .mobile-menu-btn.topbar-icon-btn { order: 0 !important; }
}

/* Botones secundarios visibles en hover. */
body.nicedash-body .btn.ghost:hover,
body.nicedash-body .datatable-actions-slot .btn.ghost:hover,
body.nicedash-body .actions .btn.ghost:hover {
    background: #dfecea !important;
    color: #166354 !important;
    border-color: #dfecea !important;
}

/* Flecha de todos los selects como el paginador. */
body.nicedash-body select {
    appearance: none !important;
    -webkit-appearance: none !important;
    padding-right: 42px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%23166354' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px 18px !important;
}
body.nicedash-body select option:checked { background: #dfecea !important; color: #030e09 !important; }

/* Botoneras de ficha: mismo bloque visual que los controles de tabla. */
body.nicedash-body .pageWrapper > .actions:not(.actions-final):not(.right):not(.row-actions),
body.nicedash-body .card > .actions:not(.actions-final):not(.right):not(.row-actions) {
    width: 100% !important;
    min-height: 72px !important;
    padding: 16px 20px !important;
    margin: 0 0 22px !important;
    background: #fff !important;
    border: 1px solid #dfe8e3 !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.04) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
}
body.nicedash-body .actions.actions-final {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Toasts con fondos diferenciados. */
.toast { border: 0 !important; color: #fff !important; box-shadow: 0 14px 34px rgba(0,0,0,.16) !important; }
.toast-success { background: #166354 !important; }
.toast-delete, .toast-error { background: #d84343 !important; }
.toast-warning { background: #f09d23 !important; color: #fff !important; }
.toast-info { background: #315d86 !important; }
.toast .iconify, .toast button { color: inherit !important; }

/* Todo App estilo NiceDash. */
.todo-app-shell { display: grid; grid-template-columns: 240px minmax(0,1fr); padding: 0 !important; overflow: hidden; min-height: 640px; }
.todo-sidebar { border-right: 1px solid #dfe8e3; padding: 22px 16px; }
.todo-sidebar h2 { margin: 0 0 22px; font-size: 23px; }
.todo-filter-list { display: grid; gap: 8px; }
.todo-filter-list a { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; color: #030e09; font-weight: 600; }
.todo-filter-list a:hover, .todo-filter-list a.active { background: #dfecea; color: #166354; }
.todo-count { min-width: 25px; height: 25px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 7px; background: #166354; color: #fff; font-weight: 700; }
.todo-count.danger { background: #ef4444; } .todo-count.success { background: #64c247; }
.todo-main-panel { min-width: 0; }
.todo-main-head { min-height: 66px; display: flex; align-items: center; gap: 18px; padding: 0 18px; border-bottom: 1px solid #dfe8e3; }
.todo-mark-all { margin: 0; }
.todo-left-chip { margin-left: auto; background: #166354; color: #fff; border-radius: 999px; padding: 5px 10px; font-weight: 700; }
.todo-add-row { display: grid; grid-template-columns: minmax(260px,1fr) 170px 140px 176px; gap: 12px; align-items: center; padding: 16px; border-bottom: 1px solid #dfe8e3; }
.todo-add-row .btn { min-width: 150px; }
.todo-list { padding: 0 16px 16px; }
.todo-item { min-height: 98px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto 38px; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid #dfe8e3; }
.todo-item-body strong { display: block; font-size: 16px; }
.todo-item-body p { margin: 4px 0; color: #6f7b76; }
.todo-item-body small { color: #030e09; }
.todo-check-form, .todo-delete-form { margin: 0; }
.todo-check { width: 26px; height: 26px; border: 1px solid #dfe8e3; background: #fff; border-radius: 6px; color: #166354; display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.todo-check.checked { background: #166354; border-color: #166354; color: #fff; }
.todo-item.done .todo-item-body strong { text-decoration: line-through; color: #6f7b76; }

/* Notes estilo NiceDash. */
.notes-app { display: grid; grid-template-columns: 290px minmax(0,1fr); padding: 0 !important; overflow: hidden; min-height: 646px; }
.notes-left-panel { border-right: 1px solid #dfe8e3; padding: 16px; min-width: 0; }
.notes-search-row { margin-bottom: 28px; }
.notes-side-title { font-weight: 700; margin-bottom: 12px; }
.notes-list { display: grid; gap: 10px; }
.notes-list-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; min-height: 68px; align-items: center; padding: 12px 14px; border-radius: 10px; color: #030e09; text-decoration: none; }
.notes-list-item strong { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notes-list-item small { display: block; color: #030e09; margin-top: 8px; font-size: 12px; }
.notes-list-item.note-primary, .note-card-v2.note-primary { background: #dfecea; color: #166354; }
.notes-list-item.note-warning, .note-card-v2.note-warning { background: #fff3d9; color: #f09d23; }
.notes-list-item.note-danger, .note-card-v2.note-danger { background: #ffe2e2; color: #ef4444; }
.notes-list-item.note-success, .note-card-v2.note-success { background: #f0ffd8; color: #3d8f1f; }
.notes-list-item.note-green, .note-card-v2.note-green { background: #eaf7e4; color: #64c247; }
.notes-list-item.active { box-shadow: inset 0 0 0 2px rgba(22,99,84,.15); }
.notes-editor-panel { min-width: 0; }
.notes-editor-head { min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid #dfe8e3; }
.notes-add-form { margin: 0; }
.notes-editor-form { padding: 20px 16px; }
.notes-editor-form textarea { min-height: 150px !important; }
.note-options-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.note-options-row h3 { margin: 0 0 12px; }
.note-color-picker { display: flex; align-items: center; gap: 12px; }
.note-color-dot { margin: 0; cursor: pointer; }
.note-color-dot input { position: absolute; opacity: 0; pointer-events: none; }
.note-color-dot span { width: 28px; height: 28px; display: inline-flex; border-radius: 999px; background: var(--note-color); position: relative; }
.note-color-dot input:checked + span::after { content: none !important; }
.note-color-dot input:checked + span { outline: 3px solid rgba(22,99,84,.22); outline-offset: 3px; }
.notes-empty-small { color: #6f7b76; padding: 10px; }

/* Chat: panel de usuarios/conversaciones a izquierda y conversación derecha. */
.nicedash-chat-app { grid-template-columns: 360px minmax(0,1fr) !important; min-height: 670px !important; }
.chat-sidebar, .chat-main { border-radius: 16px !important; }
.chat-conversation-list { max-height: 390px !important; }
.chat-person { min-height: 66px; }
.chat-person strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.chat-thread { background: #fbfcfc !important; }
.chat-compose-v2 { background: #fff; }

@media (max-width: 991px) {
    .todo-app-shell, .notes-app, .nicedash-chat-app { grid-template-columns: 1fr !important; }
    .todo-sidebar, .notes-left-panel { border-right: 0; border-bottom: 1px solid #dfe8e3; }
    .todo-add-row { grid-template-columns: 1fr; }
    .todo-item { grid-template-columns: 34px minmax(0,1fr) 38px; }
    .todo-item .badge { grid-column: 2; justify-self: start; }
}
body.nicedash-body .notes-list-item > a { min-width: 0; color: inherit !important; text-decoration: none !important; }

/* Update 66 - Correcciones finales solicitadas antes de liquidaciones */
body.nicedash-body .main.contentWrapper {
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}
body.nicedash-body .body-wrapper {
    flex: 1 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
}
body.nicedash-body .pageWrapper { flex: 1 0 auto !important; }
body.nicedash-body .app-footer {
    margin-top: auto !important;
    padding: 8px 32px 12px !important;
    min-height: 44px !important;
    align-items: center !important;
}

/* Sidebar contraído: mantener scroll vertical y expandir al hover sin perder texto. */
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav,
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin !important;
}
body.nicedash-body.sidebar-collapsed .sidebar-inner.flex-layout,
body.sidebar-collapsed.nicedash-body .sidebar-inner.flex-layout {
    min-height: 100vh !important;
    height: auto !important;
}
body.nicedash-body.sidebar-collapsed .sidebar-nav.sidebar-list,
body.sidebar-collapsed.nicedash-body .sidebar-nav.sidebar-list {
    overflow-y: visible !important;
    overflow-x: hidden !important;
}
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover,
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover {
    overflow-y: auto !important;
}
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover .sidebar-nav.sidebar-list,
body.sidebar-collapsed.nicedash-body .sidebar.sidebarNav:hover .sidebar-nav.sidebar-list {
    overflow-y: visible !important;
}

/* Topbar móvil: menú a la izquierda; lupa, avisos y perfil a la derecha. */
@media (max-width: 991px) {
    body.nicedash-body .topbar.mat-toolbar {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 12px !important;
    }
    body.nicedash-body .topbar-left {
        order: 1 !important;
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 40px !important;
        margin-right: 0 !important;
    }
    body.nicedash-body .topbar-right.userbox {
        order: 2 !important;
        margin-left: auto !important;
        flex: 0 0 auto !important;
        width: auto !important;
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
    }
    body.nicedash-body .topbar-left .mobile-menu-btn {
        display: inline-flex !important;
        order: 0 !important;
    }
    body.nicedash-body .topbar-left .sidebar-collapse-btn { display: none !important; }
    body.nicedash-body .topbar-search {
        display: none !important;
        position: absolute !important;
        left: 12px !important;
        right: 12px !important;
        top: calc(100% + 8px) !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        z-index: 1800 !important;
    }
    body.nicedash-body.mobile-search-open .topbar-search { display: block !important; }
    body.nicedash-body .topbar-mobile-search-toggle { order: 0 !important; display: inline-flex !important; }
    body.nicedash-body .alerts-widget { order: 1 !important; }
    body.nicedash-body .profile-dropdown { order: 2 !important; }
}

/* Perfil: botón cerrar sesión centrado, en una sola línea. */
body.nicedash-body .profile-logout {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 14px auto 26px !important;
    background: #166354 !important;
    color: #fff !important;
    min-width: 142px !important;
    width: auto !important;
    max-width: none !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    text-align: center !important;
}

/* Buscadores internos: no montar la lupa sobre el texto. No toca el buscador superior. */
body.nicedash-body .nicedash-search-field {
    position: relative !important;
    display: block !important;
    padding: 0 !important;
}
body.nicedash-body .nicedash-search-field .datatable-search-icon,
body.nicedash-body .datatable-controls .datatable-search-icon {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
    z-index: 2 !important;
}
body.nicedash-body .nicedash-search-field input,
body.nicedash-body .datatable-controls .nicedash-search-field input,
body.nicedash-body .datatable-search input {
    padding-left: 44px !important;
}
body.nicedash-body .chat-search {
    position: relative !important;
    display: block !important;
    padding: 0 !important;
    margin: 16px !important;
    border: 1px solid #dfe8e3 !important;
    border-radius: 12px !important;
    background: #fff !important;
}
body.nicedash-body .chat-search > .iconify {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #030e09 !important;
    pointer-events: none !important;
    z-index: 2 !important;
}
body.nicedash-body .chat-search input {
    width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    border: 0 !important;
    background: transparent !important;
    padding: 8px 12px 8px 44px !important;
    box-shadow: none !important;
}

/* Chat: lista de contactos a la izquierda y conversación a la derecha. */
body.nicedash-body .contact-chat-app .chat-sidebar { min-width: 0 !important; }
body.nicedash-body .contact-chat-app .chat-conversation-list {
    max-height: 520px !important;
    overflow-y: auto !important;
    padding: 0 12px 14px !important;
}
body.nicedash-body .contact-chat-app .chat-person {
    grid-template-columns: 44px minmax(0, 1fr) auto !important;
    display: grid !important;
    align-items: center !important;
    gap: 12px !important;
    min-height: 64px !important;
}
body.nicedash-body .contact-chat-app .chat-person span { min-width: 0 !important; }
body.nicedash-body .contact-chat-app .chat-person strong,
body.nicedash-body .contact-chat-app .chat-person small {
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
body.nicedash-body .chat-unread-chip {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #166354;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    font-weight: 800;
    font-size: 12px;
}

/* Update 67: ajustes finales NiceDash solicitados. */
body.nicedash-body select {
    appearance: none !important;
    -webkit-appearance: none !important;
    padding-right: 42px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%23166354' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px 18px !important;
}
body.nicedash-body .datatable-length select {
    background-position: right 14px center !important;
    background-size: 18px 18px !important;
}
body.nicedash-body .profile-actions,
body.nicedash-body .profile-panel .profile-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
    padding: 0 0 28px !important;
}
body.nicedash-body .profile-logout {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    width: auto !important;
    min-width: 128px !important;
    max-width: none !important;
    margin: 0 auto !important;
    background: #166354 !important;
    color: #fff !important;
    padding: 10px 18px !important;
    line-height: 1 !important;
    text-align: center !important;
}
body.nicedash-body .profile-logout:hover { background: #11483f !important; color: #fff !important; }
body.nicedash-body .app-footer.app-footer-centered {
    justify-content: center !important;
    text-align: center !important;
    padding: 10px 16px 8px !important;
    margin-top: auto !important;
    color: #52615b !important;
}
body.nicedash-body .app-footer.app-footer-centered nav { display: none !important; }
body.nicedash-body .body-wrapper { min-height: calc(100vh - 70px) !important; display:flex !important; flex-direction:column !important; }
body.nicedash-body .pageWrapper { flex: 1 0 auto !important; }
body.nicedash-body .sidebar-nav {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(22,99,84,.28) transparent;
}
body.nicedash-body .sidebar-nav::-webkit-scrollbar { width: 6px; }
body.nicedash-body .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(22,99,84,.28); border-radius: 99px; }
body.nicedash-body .breadcrumb-card.page-title-card {
    width: 100%;
}
@media (max-width: 767px) {
    body.nicedash-body .topbar {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    body.nicedash-body .topbar-left { order: 1 !important; flex: 0 0 auto !important; }
    body.nicedash-body .topbar-left .mobile-menu-btn { display: inline-flex !important; }
    body.nicedash-body .topbar-left .sidebar-collapse-btn { display: none !important; }
    body.nicedash-body .topbar-right { order: 2 !important; margin-left: auto !important; display: flex !important; align-items: center !important; gap: 10px !important; }
    body.nicedash-body .topbar-mobile-search-toggle { order: 1 !important; display: inline-flex !important; }
    body.nicedash-body .alerts-widget { order: 2 !important; display: block !important; }
    body.nicedash-body .profile-dropdown { order: 3 !important; display: block !important; }
    body.nicedash-body .breadcrumb-card.page-title-card { flex-direction: column !important; align-items: flex-start !important; gap: 10px !important; }
    body.nicedash-body .breadcrumb-path { justify-content: flex-start !important; width: 100% !important; }
}
body.nicedash-body .row-actions,
body.nicedash-body td.row-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    min-width: max-content !important;
}
body.nicedash-body td:has(.row-actions),
body.nicedash-body th[data-no-sort="1"]:last-child { white-space: nowrap !important; }
body.nicedash-body td:last-child .action-icon { flex: 0 0 auto !important; }
body.nicedash-body .datatable-controls { margin-bottom: 16px !important; }
body.nicedash-body .datatable-controls .field,
body.nicedash-body .datatable-controls form { margin: 0 !important; }
body.nicedash-body .datatable-controls .datatable-filter-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: 0 !important; }
body.nicedash-body .datatable-controls .datatable-filter-form label { font-weight: 700; }
body.nicedash-body .datatable-controls .datatable-filter-form select { min-width: 190px; width: auto; }
body.nicedash-body .chat-left-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid #dfe8e3;
}
body.nicedash-body .chat-left-profile img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
body.nicedash-body .chat-left-profile strong { display: block; color: #030e09; }
body.nicedash-body .chat-left-profile small { color: #6f7b76; }
body.nicedash-body .chat-sidebar-title { padding: 0 18px 8px; font-weight: 800; color: #030e09; }
body.nicedash-body .chat-search {
    margin: 16px 18px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0 12px !important;
    border: 1px solid #dfe8e3 !important;
    border-radius: 12px !important;
    background: #fff !important;
}
body.nicedash-body .chat-search .iconify { position: static !important; flex: 0 0 auto !important; width: 19px !important; height: 19px !important; color: #030e09 !important; }
body.nicedash-body .chat-search input { border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 0 !important; min-height: 42px !important; }
body.nicedash-body .chat-bubble { color: #030e09 !important; }
body.nicedash-body .chat-bubble-row.mine .chat-bubble,
body.nicedash-body .chat-bubble-row.mine .chat-bubble strong,
body.nicedash-body .chat-bubble-row.mine .chat-bubble p,
body.nicedash-body .chat-bubble-row.mine .chat-bubble small { color: #fff !important; }
body.nicedash-body .todo-sidebar h2 { margin-bottom: 28px !important; }
body.nicedash-body .todo-app-shell.sidebar-hidden { grid-template-columns: 1fr !important; }
body.nicedash-body .todo-app-shell.sidebar-hidden .todo-sidebar { display: none !important; }
body.nicedash-body .todo-app-shell .todo-mark-all .checkbox-inline { margin-top: 8px !important; }
body.nicedash-body .notes-app.sidebar-hidden { grid-template-columns: 1fr !important; }
body.nicedash-body .notes-app.sidebar-hidden .notes-left-panel { display: none !important; }
body.nicedash-body .notes-search-row .app-search-field .iconify { display: none !important; }
body.nicedash-body .notes-search-row .app-search-field input { padding-left: 14px !important; }
body.nicedash-body .account-setting-card { padding: 0 !important; overflow: hidden; }
body.nicedash-body .account-tabs { display: flex; gap: 0; border-bottom: 1px solid #dfe8e3; overflow-x: auto; }
body.nicedash-body .account-tabs a { min-height: 48px; display: inline-flex; align-items: center; gap: 7px; padding: 0 20px; color: #030e09; font-weight: 600; border-bottom: 2px solid transparent; }
body.nicedash-body .account-tabs a.active { border-color: #166354; color: #166354; }
body.nicedash-body .account-grid-top { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 18px; }
body.nicedash-body .account-inner-card { border: 1px solid #dfe8e3; border-radius: 16px; padding: 20px; }
body.nicedash-body .account-avatar-box { text-align: center; padding: 24px; }
body.nicedash-body .account-avatar-box img { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; margin: 16px auto; display: block; }
body.nicedash-body .account-personal { margin: 0 18px 18px; border: 1px solid #dfe8e3; border-radius: 16px; padding: 20px; }
body.nicedash-body .account-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
body.nicedash-body .account-form-grid .full { grid-column: 1 / -1; }
body.nicedash-body .account-actions { display: flex; justify-content: flex-end; gap: 12px; padding: 0 18px 18px; }
@media (max-width: 900px) {
    body.nicedash-body .account-grid-top,
    body.nicedash-body .account-form-grid { grid-template-columns: 1fr; }
}

/* Update 68: select SVG, chat logic polish, responsive topbar and dashboard cleanup. */
body.nicedash-body .field input,
body.nicedash-body .field select,
body.nicedash-body .field textarea,
body.nicedash-body input[type="text"],
body.nicedash-body input[type="email"],
body.nicedash-body input[type="password"],
body.nicedash-body input[type="number"],
body.nicedash-body input[type="date"],
body.nicedash-body input[type="search"],
body.nicedash-body select,
body.nicedash-body textarea {
    background-color: var(--mat-sys-surface) !important;
    background-clip: padding-box !important;
}
body.nicedash-body select,
body.nicedash-body .field select,
body.nicedash-body .datatable-length select {
    appearance: none !important;
    -webkit-appearance: none !important;
    padding-right: 42px !important;
    background-color: var(--mat-sys-surface) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%23166354' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px 18px !important;
}
body.nicedash-body .datatable-length select {
    background-color: #fff !important;
    background-position: right 14px center !important;
}
body.nicedash-body .profile-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
}
body.nicedash-body .profile-actions .profile-logout,
body.nicedash-body .profile-logout {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 150px !important;
    white-space: nowrap !important;
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    background: #166354 !important;
    color: #fff !important;
}
@media (max-width: 680px) {
    body.nicedash-body .topbar-right.userbox .topbar-icon-btn:first-child,
    body.nicedash-body .topbar-mobile-search-toggle,
    body.nicedash-body .alerts-widget,
    body.nicedash-body .alerts-widget .alert-bell,
    body.nicedash-body .profile-dropdown {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    body.nicedash-body .topbar-right.userbox {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 8px !important;
        margin-left: auto !important;
    }
    body.nicedash-body .topbar-left {
        display: flex !important;
        justify-content: flex-start !important;
        margin-right: auto !important;
    }
    body.nicedash-body .topbar-mobile-search-toggle { order: 1 !important; }
    body.nicedash-body .alerts-widget { order: 2 !important; }
    body.nicedash-body .profile-dropdown { order: 3 !important; }
}
body.nicedash-body .contact-chat-app .chat-left-profile {
    border-bottom: 0 !important;
    padding: 20px 18px 12px !important;
}
body.nicedash-body .contact-chat-app .chat-search.nicedash-search-field {
    margin: 12px 16px 18px !important;
    border: 1px solid #dfe8e3 !important;
    border-radius: 12px !important;
    background: #fff !important;
    min-height: 44px !important;
    display: block !important;
    position: relative !important;
    overflow: hidden !important;
}
body.nicedash-body .contact-chat-app .chat-search.nicedash-search-field .datatable-search-icon {
    left: 14px !important;
    color: #030e09 !important;
}
body.nicedash-body .contact-chat-app .chat-search.nicedash-search-field input {
    width: 100% !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding-left: 44px !important;
    padding-right: 12px !important;
    min-height: 44px !important;
}
body.nicedash-body .chat-section {
    padding: 0 12px 12px !important;
}
body.nicedash-body .chat-section summary {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    cursor: pointer !important;
    padding: 10px 4px 8px !important;
    color: #030e09 !important;
    font-weight: 800 !important;
    list-style: none !important;
}
body.nicedash-body .chat-section summary::-webkit-details-marker { display: none !important; }
body.nicedash-body .chat-section summary::after {
    content: "";
    width: 18px;
    height: 18px;
    margin-left: auto;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%23166354' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px 18px no-repeat;
    transition: transform .15s ease;
}
body.nicedash-body .chat-section[open] summary::after { transform: rotate(180deg); }
body.nicedash-body .chat-section .badge { margin-left: auto; margin-right: 8px; }
body.nicedash-body .chat-empty-list { padding: 8px 10px 14px; margin: 0; }
body.nicedash-body .contact-chat-app .chat-conversation-list {
    max-height: 260px !important;
}
body.nicedash-body .chat-bubble,
body.nicedash-body .chat-bubble p,
body.nicedash-body .chat-bubble strong,
body.nicedash-body .chat-bubble small {
    color: #030e09 !important;
}
body.nicedash-body .chat-bubble-row.mine .chat-bubble,
body.nicedash-body .chat-bubble-row.mine .chat-bubble p,
body.nicedash-body .chat-bubble-row.mine .chat-bubble strong,
body.nicedash-body .chat-bubble-row.mine .chat-bubble small {
    color: #fff !important;
}


/* Update 69: notificaciones mobile, chat contacts, cancelados acreditación. */
@media (max-width: 680px) {
    body.nicedash-body .alerts-panel.nice-popover {
        position: fixed !important;
        top: 74px !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: calc(100vw - 24px) !important;
        transform: none !important;
        margin: 0 !important;
        z-index: 1200 !important;
    }
}
body.nicedash-body .chat-left-profile { border-bottom: 0 !important; }
body.nicedash-body .chat-profile-avatar-wrap,
body.nicedash-body .chat-avatar-status { position: relative; display: inline-flex; flex: 0 0 auto; }
body.nicedash-body .online-dot {
    position: absolute;
    width: 11px;
    height: 11px;
    right: 1px;
    bottom: 2px;
    border-radius: 999px;
    background: #22c55e;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, .18);
}
body.nicedash-body .chat-section .badge { margin-left: 0 !important; margin-right: 0 !important; }
body.nicedash-body .chat-section summary::after { margin-left: 4px !important; }
body.nicedash-body .contact-chat-app .chat-conversation-list { max-height: 280px !important; }
body.nicedash-body .text-danger { color: #d93025 !important; font-weight: 700; }
body.nicedash-body .row-actions .inline-form { display: inline-flex; margin: 0; padding: 0; }
body.nicedash-body .row-actions .action-icon.danger { color: #d93025 !important; }

/* Update 69 refuerzo final: el shorthand background no debe pisar la flecha SVG de selects. */
body.nicedash-body select,
body.nicedash-body .field select,
body.nicedash-body .datatable-length select {
    background-color: var(--mat-sys-surface) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%23166354' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px 18px !important;
}
body.nicedash-body .datatable-length select {
    background-color: #fff !important;
}

/* Update 70: ajustes chat, two factor móvil y flechas select. */
body.nicedash-body .chat-section .badge {
    margin-left: auto !important;
    margin-right: 0 !important;
}
body.nicedash-body .datatable-length select {
    background-position: right 14px center !important;
}
@media (max-width: 520px) {
    .two-step-inputs {
        grid-template-columns: repeat(6, minmax(38px, 1fr)) !important;
        gap: 8px !important;
    }
    .two-step-inputs input {
        min-width: 38px !important;
        height: 48px !important;
        font-size: 20px !important;
        padding: 0 !important;
    }
}
@media (max-width: 380px) {
    .two-step-inputs {
        grid-template-columns: repeat(6, minmax(34px, 1fr)) !important;
        gap: 6px !important;
    }
    .two-step-inputs input {
        min-width: 34px !important;
        height: 46px !important;
        font-size: 18px !important;
    }
}

/* Update 73 - Submenú de Adjudicaciones y ajustes de rondas/preferencias. */
body.nicedash-body .nav-submenu { display: block; }
body.nicedash-body .nav-submenu > summary { list-style: none; cursor: pointer; }
body.nicedash-body .nav-submenu > summary::-webkit-details-marker { display: none; }
body.nicedash-body .nav-submenu .nav-chevron { margin-left: auto; transition: transform .18s ease; color: currentColor; }
body.nicedash-body .nav-submenu[open] .nav-chevron { transform: rotate(180deg); }
body.nicedash-body .nav-submenu-list { display: grid; gap: 4px; margin: 4px 0 8px 12px; padding-left: 14px; border-left: 1px solid #dfe8e3; }
body.nicedash-body .nav-subitem { min-height: 38px !important; padding-top: 8px !important; padding-bottom: 8px !important; font-size: 13px !important; }
body.nicedash-body .nav-subitem .routeIcon { width: 18px !important; height: 18px !important; }
body.nicedash-body.sidebar-collapsed .nav-submenu-list { margin-left: 0; padding-left: 0; border-left: 0; }
body.nicedash-body.sidebar-collapsed .nav-submenu:not([open]) .nav-submenu-list { display: none; }
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:hover .nav-submenu-list { margin-left: 12px; padding-left: 14px; border-left: 1px solid #dfe8e3; }
body.nicedash-body.sidebar-collapsed .sidebar.sidebarNav:not(:hover) .nav-chevron { display: none; }
body.nicedash-body .adjudicacion-phase-box { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:16px; }
body.nicedash-body .adjudicacion-phase-box .phase-card { border:1px solid #dfe8e3; border-radius:16px; padding:18px; background:#fff; }
body.nicedash-body .adjudicacion-phase-box .phase-card h3 { margin:0 0 8px; font-size:16px; color:#030e09; }

/* Update 74 - Ajustes de Adjudicaciones, sorteo y formulario de asignación. */
body.nicedash-body .checkbox-inline-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
    padding: 10px 0;
}
body.nicedash-body .checkbox-inline-group .checkbox-inline {
    margin: 0 !important;
    min-height: 28px;
    white-space: nowrap;
}
body.nicedash-body .adjudicacion-dictantes-inline {
    border: 1px solid #dfe8e3;
    border-radius: 12px;
    padding: 10px 14px;
    background: #fff;
    max-height: 190px;
    overflow: auto;
}
body.nicedash-body .sorteo-mapping-form .nice-form-grid {
    margin-bottom: 18px;
}
body.nicedash-body .sorteo-map-table {
    width: 100%;
}
body.nicedash-body .sorteo-map-table table {
    width: 100% !important;
}
body.nicedash-body .sorteo-mapping-form .form-action-row {
    justify-content: flex-end;
    margin-top: 18px;
}

/* Update 76 - Ajustes de adjudicaciones y formularios */
body.nicedash-body .nice-form-grid .field.full {
    grid-column: 1 / -1 !important;
}
body.nicedash-body .adjudicacion-dictantes-inline {
    width: 100%;
}
body.nicedash-body .adjudicacion-form .adjudicacion-dictantes-inline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 18px;
}
body.nicedash-body .adjudicacion-form .field.full > textarea {
    width: 100%;
}
@media (max-width: 991px) {
    body.nicedash-body .adjudicacion-form .adjudicacion-dictantes-inline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    body.nicedash-body .adjudicacion-form .adjudicacion-dictantes-inline {
        grid-template-columns: 1fr;
    }
}

/* Update 77 - Adjudicaciones: label flotante en select de cabecera. */
body.nicedash-body .datatable-controls .field.floating-select {
    position: relative;
    min-width: 190px;
}
body.nicedash-body .datatable-controls .field.floating-select label {
    position: absolute;
    left: 14px;
    top: 7px;
    z-index: 2;
    margin: 0 !important;
    padding: 0 4px;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    color: #166354;
    background: var(--mat-sys-surface, #fff);
    pointer-events: none;
}
body.nicedash-body .datatable-controls .field.floating-select select {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
body.nicedash-body .datatable-controls .field.floating-select select:focus + label,
body.nicedash-body .datatable-controls .field.floating-select:focus-within label {
    color: #166354;
}
@media (max-width: 680px) {
    body.nicedash-body .datatable-controls .field.floating-select,
    body.nicedash-body .datatable-controls .field.floating-select select {
        width: 100% !important;
        min-width: 0;
    }
}

/* Update 79 - login FDE, perfil, usuarios y dictantes */
.auth-side,
body.nicedash-body .auth-side {
    background-image: url('img/nicedash/login-bg-fde-v2.png') !important;
    background-size: cover !important;
    background-position: center center !important;
}
.auth-footer { font-size: 13px; }
.auth-footer nav a + a::before { content: ''; }
.auth-help-block { margin-top: 18px; text-align: center; color: #6f7b76; }
.auth-secondary-btn { margin-top: 12px; width: 100%; justify-content: center; }

body.nicedash-body .app-footer-centered { flex-direction: column; justify-content: center; gap: 8px; text-align: center; }
body.nicedash-body .app-footer-links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 13px; }
body.nicedash-body .app-footer-links a { color: #166354; font-weight: 600; }

.inline-form { display: inline-flex; margin: 0; }
body.nicedash-body .badge.red { background: #fde3e3; color: #b42318; }

body.nicedash-body .avatar-btn img,
body.nicedash-body .profile-avatar-xl img { object-fit: cover; }

body.nicedash-body .account-setting-card { padding: 0 !important; overflow: hidden; }
body.nicedash-body .account-tabs { display: flex; gap: 0; border-bottom: 1px solid #dfe8e3; overflow-x: auto; }
body.nicedash-body .account-tabs a { min-height: 48px; display: inline-flex; align-items: center; gap: 7px; padding: 0 20px; color: #030e09; font-weight: 600; border-bottom: 2px solid transparent; }
body.nicedash-body .account-tabs a.active { border-color: #166354; color: #166354; }
body.nicedash-body .account-grid-top { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 18px; }
body.nicedash-body .account-inner-card { border: 1px solid #dfe8e3; border-radius: 16px; padding: 20px; background: #fff; }
body.nicedash-body .account-avatar-box { text-align: center; padding: 24px; }
body.nicedash-body .account-avatar-box img { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; margin: 16px auto; display: block; }
body.nicedash-body .account-reset-avatar { display: flex; flex-direction: column; justify-content: center; align-items: center; }
body.nicedash-body .account-personal,
body.nicedash-body .account-panel-block { margin: 18px; border: 1px solid #dfe8e3; border-radius: 16px; padding: 20px; background:#fff; }
body.nicedash-body .account-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
body.nicedash-body .account-form-grid .full { grid-column: 1 / -1; }
body.nicedash-body .account-actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 18px; }
body.nicedash-body .notification-preferences { display: flex; flex-direction: column; gap: 14px; max-width: 980px; }
body.nicedash-body .notify-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf2ef; cursor: pointer; }
body.nicedash-body .notify-row:last-child { border-bottom: 0; }
body.nicedash-body .notify-icon { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #dfecEA; color: #166354; }
body.nicedash-body .notify-row small { display:block; color:#6f7b76; margin-top: 4px; }
body.nicedash-body .notify-row input[type="checkbox"] { width: 36px; height: 20px; accent-color: #166354; }
body.nicedash-body .account-security-layout { display: grid; grid-template-columns: 1fr 360px; gap: 18px; padding: 18px; }
body.nicedash-body .security-inline-form { margin-bottom: 20px; }
body.nicedash-body .devices-card { align-self: start; }
body.nicedash-body .device-list { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
body.nicedash-body .device-row { display:flex; align-items:flex-start; gap:12px; padding:12px 0; border-bottom:1px solid #edf2ef; }
body.nicedash-body .device-row small { display:block; color:#6f7b76; margin-top:4px; }

body.nicedash-body .person-cell { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
body.nicedash-body .table-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid #dfe8e3; background:#fff; }
body.nicedash-body .profile-avatar { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; border: 1px solid #dfe8e3; }
body.nicedash-body .person-cell-large { gap: 16px; }
body.nicedash-body .person-cell-large h2 { margin: 0; }
body.nicedash-body .dictante-form-head { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: start; margin-bottom: 18px; }
body.nicedash-body .dictante-photo-box { border: 1px solid #dfe8e3; border-radius: 16px; padding: 18px; text-align: center; background:#fff; }
body.nicedash-body .dictante-photo-box img { width: 116px; height: 116px; border-radius: 50%; object-fit: cover; margin-bottom: 14px; border: 1px solid #dfe8e3; }
body.nicedash-body .dictante-main-fields { width: 100%; }

@media (max-width: 900px) {
    body.nicedash-body .account-grid-top,
    body.nicedash-body .account-form-grid,
    body.nicedash-body .account-security-layout,
    body.nicedash-body .dictante-form-head { grid-template-columns: 1fr; }
    .auth-footer { position: static; padding: 20px; flex-direction: column; text-align: center; }
}

/* Update 80 - SMTP robusto, perfil y foto compacta de dictantes */
body.nicedash-body .hidden-form { display: none !important; }
body.nicedash-body .sr-only-file {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
body.nicedash-body .file-btn { cursor: pointer; user-select: none; }
body.nicedash-body .account-grid-top.account-grid-top-single {
    display: block !important;
    padding: 18px !important;
}
body.nicedash-body .account-avatar-box-nicedash {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    padding: 26px 24px !important;
}
body.nicedash-body .account-avatar-box-nicedash img {
    width: 118px !important;
    height: 118px !important;
    border-radius: 50%;
    object-fit: cover;
    margin: 20px auto 18px !important;
}
body.nicedash-body .profile-upload-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}
body.nicedash-body .dictante-main-fields { margin-bottom: 14px; }
body.nicedash-body .dictante-photo-inline {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #dfe8e3;
    border-radius: 16px;
    padding: 12px 14px;
    background: #fff;
    margin: 0 0 18px;
}
body.nicedash-body .dictante-photo-inline img {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #dfe8e3;
    background: #fff;
    flex: 0 0 auto;
}
body.nicedash-body .dictante-photo-inline-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}
body.nicedash-body .dictante-photo-inline-text strong { color: #030e09; }
body.nicedash-body .dictante-photo-inline-text span { color: #6f7b76; font-size: 13px; }
body.nicedash-body .reset-photo-check {
    gap: 7px;
    white-space: nowrap;
}
body.nicedash-body .reset-photo-check input {
    width: 16px;
    height: 16px;
    accent-color: #166354;
}
@media (max-width: 720px) {
    body.nicedash-body .dictante-photo-inline {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    body.nicedash-body .dictante-photo-inline-text {
        flex-basis: calc(100% - 88px);
    }
    body.nicedash-body .profile-upload-actions {
        display: flex;
        width: 100%;
        flex-wrap: wrap;
    }
}

/* Update 82 - Perfil, avatar por defecto y etiquetas tipo boton */
body.nicedash-body .account-grid-top {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
    padding: 18px !important;
    align-items: stretch !important;
}
body.nicedash-body .account-avatar-box-nicedash,
body.nicedash-body .account-password-box {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    min-height: 100% !important;
}
body.nicedash-body .account-avatar-box-nicedash {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 28px 24px !important;
}
body.nicedash-body .account-password-box {
    padding: 28px 24px !important;
}
body.nicedash-body .account-password-box .actions.right {
    display: flex !important;
    justify-content: flex-end !important;
    margin-top: 8px !important;
}
body.nicedash-body label.btn,
body.nicedash-body label.file-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 40px !important;
    margin-bottom: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    color: #ffffff !important;
}
body.nicedash-body label.btn.ghost {
    color: #166354 !important;
}
body.nicedash-body .dictante-photo-inline label.btn,
body.nicedash-body .profile-upload-actions label.btn {
    margin-bottom: 0 !important;
}
body.nicedash-body .dictante-photo-inline-text strong {
    color: #030e09 !important;
}
body.nicedash-body .dictante-photo-inline-text span {
    color: #6f7b76 !important;
}
body.nicedash-body .account-tabs a[href*="billing"],
body.nicedash-body .account-tabs a[href*="security"] {
    white-space: nowrap !important;
}
@media (max-width: 900px) {
    body.nicedash-body .account-grid-top {
        grid-template-columns: 1fr !important;
    }
}

/* Update 85 - matriz de permisos y solicitudes de celebración */
.permissions-matrix-wrap { overflow-x: auto; border: 1px solid var(--mat-sys-outline-variant); border-radius: 18px; }
.permissions-matrix { width: 100%; min-width: 980px; border-collapse: collapse; }
.permissions-matrix th, .permissions-matrix td { padding: 12px 14px; border-bottom: 1px solid var(--mat-sys-outline-variant); vertical-align: middle; }
.permissions-matrix th { text-align: left; color: var(--mat-sys-on-surface); font-weight: 700; background: rgba(22,99,84,.06); }
.permissions-matrix td small { display: block; color: var(--mat-sys-on-surface-variant); font-size: 12px; margin-top: 2px; }
.permission-group-row td { background: rgba(22,99,84,.12); color: #166354; font-weight: 800; letter-spacing: .01em; }
.permission-check-cell { text-align: center; }
.switch-mini { display: inline-flex !important; align-items: center; justify-content: center; margin: 0 !important; color: inherit !important; }
.switch-mini input { position: absolute; opacity: 0; pointer-events: none; }
.switch-mini span { width: 38px; height: 22px; border-radius: 999px; background: #d9e2df; position: relative; display: inline-block; transition: .2s; }
.switch-mini span:before { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: .2s; }
.switch-mini input:checked + span { background: #166354; }
.switch-mini input:checked + span:before { transform: translateX(16px); }
.switch-mini input:disabled + span { opacity: .65; cursor: not-allowed; }
.role-dashboard-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; align-items: center; }
.role-dashboard-card .role-kicker { color: #166354; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }
.role-dashboard-card h2 { margin: 6px 0 8px; font-size: 26px; }
.role-quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 18px; }
.role-quick-card { border: 1px solid var(--mat-sys-outline-variant); border-radius: 18px; padding: 16px; background: var(--mat-sys-surface); display: flex; flex-direction: column; gap: 8px; }
.role-quick-card .iconify { font-size: 26px; color: #166354; }
.request-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.request-actions .btn.small { padding: 7px 10px; font-size: 12px; min-height: auto; }
.readonly-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(22,99,84,.08); color: #166354; font-weight: 700; font-size: 12px; }

/* Update 86 - Expediente académico */
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px;margin-top:12px}.stat-card{border:1px solid var(--stroke,#e5e7eb);border-radius:16px;padding:16px;background:var(--mat-sys-surface,#fff)}.stat-card span{display:block;font-size:12px;color:#64748b;text-transform:uppercase;letter-spacing:.04em}.stat-card strong{display:block;font-size:28px;line-height:1.1;color:#166354;margin:4px 0}.stat-card small{color:#64748b}.expediente-attendance-table input,.expediente-attendance-table select{min-width:92px}.expediente-attendance-table td:first-child input{min-width:160px}.w-80{max-width:80px}.max-320{max-width:320px}.qr-preview{width:220px;height:220px;object-fit:contain;border:1px solid #e5e7eb;border-radius:18px;padding:12px;background:#fff}.text-center{text-align:center}.align-end{display:flex;align-items:flex-end}.mb-16{margin-bottom:16px}.mt-16{margin-top:16px}.mt-8{margin-top:8px}.hidden{display:none!important}.alert.success{background:#e8f7ef;color:#116149;border-color:#b7e4ca}

/* update87 - expediente academico */
body.nicedash-body .actions.left,
body.nicedash-body .model-download-actions.left{justify-content:flex-start;text-align:left}
body.nicedash-body .model-download-actions .btn{display:inline-flex;align-items:center;gap:8px}
body.nicedash-body .expediente-status-line{display:flex;align-items:center;gap:10px;margin:0 0 16px;color:#64748b;font-weight:600}
body.nicedash-body .expediente-attendance-table.compact-readonly input,
body.nicedash-body .expediente-attendance-table.compact-readonly select{min-width:0}
body.nicedash-body .row-muted{opacity:.62;background:#fafafa}
body.nicedash-body .app-dialog{border:none;border-radius:22px;padding:0;max-width:760px;width:calc(100vw - 32px);box-shadow:0 30px 100px rgba(15,23,42,.28)}
body.nicedash-body .app-dialog::backdrop{background:rgba(15,23,42,.42);backdrop-filter:blur(4px)}
body.nicedash-body .dialog-card{padding:22px;background:#fff;border-radius:22px}
body.nicedash-body .dialog-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px;border-bottom:1px solid #e5e7eb;padding-bottom:12px}
body.nicedash-body .dialog-header h3{margin:0;font-size:20px}
body.nicedash-body .dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
body.nicedash-body .inline-checkbox-grid{display:flex;flex-wrap:wrap;gap:14px}
body.nicedash-body .eval-admin-grid .alert.info{margin-top:16px}
body.nicedash-body .qr-card{border:1px solid #e5e7eb;border-radius:20px;padding:20px;background:#fbfdfc}
body.nicedash-body .danger-soft{color:#b42318!important;border-color:#f4c7c3!important;background:#fff7f6!important}
body.nicedash-body .grid.cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:1200px){body.nicedash-body .grid.cols-5{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:680px){body.nicedash-body .grid.cols-5{grid-template-columns:1fr}}

/* Update 88 - Expediente academico: evaluaciones y certificados */
body.nicedash-body .inline-form{display:inline-flex;margin:0;padding:0}
body.nicedash-body .eval-results-panel{border-top:1px solid var(--mat-sys-outline-variant,#dbe8e4);padding-top:18px}
body.nicedash-body .compact-stats{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));margin-top:12px}
body.nicedash-body .table-summary td{background:#f5faf8!important}
body.nicedash-body .row-actions form.inline-form .action-icon{border:0;background:transparent;cursor:pointer}

/* update89: expediente academico */
body.nicedash-body .eval-results-panel{
  border:1px solid var(--mat-sys-outline-variant,#dbe8e4);
  border-radius:18px;
  background:#fff;
  padding:0;
  overflow:hidden;
}
body.nicedash-body .eval-results-panel summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
  padding:16px 18px;
  font-weight:700;
  color:#10231f;
}
body.nicedash-body .eval-results-panel summary::-webkit-details-marker{display:none;}
body.nicedash-body .eval-results-panel summary:after{
  content:'+';
  width:28px;
  height:28px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#e7f3ef;
  color:#166354;
  font-weight:800;
  flex:0 0 28px;
}
body.nicedash-body .eval-results-panel[open] summary:after{content:'-';}
body.nicedash-body .eval-results-panel summary small{font-weight:600;color:#64748b;margin-left:auto;}
body.nicedash-body .eval-results-body{border-top:1px solid var(--mat-sys-outline-variant,#dbe8e4);padding:18px;}
@media(max-width:680px){
  body.nicedash-body .eval-results-panel summary{align-items:flex-start;flex-direction:column;}
  body.nicedash-body .eval-results-panel summary small{margin-left:0;}
}

/* update90: expediente academico */
body.nicedash-body .eval-results-panel{margin-top:28px;}
body.nicedash-body .attendance-import-form{display:inline-flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0;}
body.nicedash-body .attendance-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:10px 0 18px;}
body.nicedash-body .certificates-auto-note{margin-top:10px;}

/* update92 - ajustes expediente, evaluacion, botones y correo */
body.nicedash-body .attendance-tools.bottom-right{
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:10px;
    margin:16px 0 0;
}
body.nicedash-body .attendance-import-form{display:none!important;}
body.nicedash-body .certificates-auto-note{margin-top:12px;}
body.nicedash-body .eval-results-panel{margin-top:34px;}
body.nicedash-body .btn,
body.nicedash-body button.btn,
body.nicedash-body a.btn{
    min-height:40px!important;
    padding:9px 18px!important;
    border-radius:12px!important;
    border:1px solid transparent;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:8px!important;
    background:var(--nde-primary)!important;
    color:#fff!important;
    font:inherit!important;
    font-size:14px!important;
    font-weight:600!important;
    line-height:1.2!important;
    cursor:pointer;
    box-shadow:none!important;
    transition:background-color .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease;
}
body.nicedash-body .btn:hover{background:#11483f!important;color:#fff!important;}
body.nicedash-body .btn.ghost,
body.nicedash-body a.btn.ghost{
    background:#fff!important;
    color:var(--nde-primary)!important;
    border-color:var(--nde-border)!important;
}
body.nicedash-body .btn.ghost:hover{background:var(--nde-primary-soft)!important;color:var(--nde-primary)!important;}
body.nicedash-body .btn.secondary{background:var(--nde-secondary)!important;color:var(--nde-text)!important;}
body.nicedash-body .btn.danger{background:var(--mat-sys-error)!important;color:#fff!important;}
body.nicedash-body .btn.small{min-height:34px!important;padding:7px 12px!important;border-radius:10px!important;font-size:13px!important;}
body.nicedash-body .danger-soft{background:#fff7f6!important;color:#b42318!important;border-color:#f4c7c3!important;}

/* pagina publica de evaluacion: logo blanco sobre cabecera oscura */
.eval-hero img{
    background:transparent!important;
    border-radius:0!important;
    padding:0!important;
    box-shadow:none!important;
    max-width:250px!important;
    margin-bottom:24px!important;
}

/* Update 93: botones NiceDash sin degradados en certificados/evaluaciones */
body.nicedash-body .btn,
body.nicedash-body button.btn,
body.nicedash-body a.btn,
.btn {
    min-height: 40px;
    padding: 9px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--nde-primary, #166354);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: none;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
body.nicedash-body .btn:hover,
body.nicedash-body button.btn:hover,
body.nicedash-body a.btn:hover,
.btn:hover {
    background: var(--green-dark, #0f4d43);
    color: #fff;
    transform: none;
}

/* Update 96: adjudicaciones y evaluacion */
.adjudicacion-mini-row{display:flex;align-items:center;gap:8px;justify-content:space-between;margin:3px 0;}
.adjudicacion-mini-row .action-icon.compact{width:28px;height:28px;min-width:28px;}
.adjudicacion-mini-row .action-icon.compact .iconify{width:16px;height:16px;}
.cursos-disponibles-filter{justify-content:flex-end;margin-bottom:12px;}
.public-eval .nif-help-under-label{display:block;margin:4px 0 10px;color:#64748b;font-size:13px;line-height:1.35;}

/* Update 97: resumen adjudicacion y evaluación pública responsive */
.summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px;align-items:start}
.summary-box{border:1px solid var(--stroke,#e5e7eb);border-radius:16px;background:#fff;padding:16px;min-width:0}
.summary-box h3{margin:0 0 12px;font-size:18px;color:#10231f}
.kv-list{display:grid;grid-template-columns:minmax(120px,180px) minmax(0,1fr);gap:8px 14px;margin:0}
.kv-list dt{font-weight:700;color:#475569}
.kv-list dd{margin:0;min-width:0;overflow-wrap:anywhere}
.public-eval .nif-help-under-label{display:block;margin:4px 0 14px;color:#64748b;font-size:13px;line-height:1.35;}
.public-eval,.public-eval *{box-sizing:border-box;}
.public-eval .eval-layout{max-width:100%;}
.public-eval .eval-layout>*{min-width:0;}
.public-eval .eval-summary,.public-eval .eval-card{max-width:100%;min-width:0;}
.public-eval .eval-summary dd{overflow-wrap:anywhere;}
.public-eval .score-row{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}
@media(max-width:640px){.kv-list{grid-template-columns:1fr}.public-eval{padding:14px 10px 34px}.public-eval .eval-hero{border-radius:22px;padding:24px 18px}.public-eval .eval-hero img{width:190px;max-width:82%;margin-bottom:18px}.public-eval .eval-hero h1{font-size:25px;line-height:1.12}.public-eval .eval-hero p{font-size:14px;line-height:1.45}.public-eval .eval-layout{gap:14px;margin-top:14px}.public-eval .eval-summary,.public-eval .eval-card{border-radius:18px;padding:18px}.public-eval .eval-card h2{font-size:22px}.public-eval .eval-question{padding:16px 0}.public-eval .score-row{gap:6px;overflow-x:auto;max-width:100%}.public-eval .score-row label{min-width:50px;padding:8px 15px}.public-eval .eval-submit .btn{width:100%;min-width:0}}
@media(max-width:380px){.public-eval{padding-left:8px;padding-right:8px}.public-eval .eval-summary,.public-eval .eval-card{padding:15px}.public-eval .score-row label{min-width:50px;padding:8px 15px}}

.public-eval .score-row label{gap:2px;min-width:50px;justify-content:center;}
.score-row label{color:#263238!important;background:#f9fbfb;border:1px solid #d9e1e8;border-radius:12px;padding:8px 15px;display:inline-flex;gap:2px;align-items:center;justify-content:center;cursor:pointer;flex:0 0 auto;min-width:42px;white-space:nowrap;}


/* Update 99 */
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px;margin-top:12px;margin-bottom:20px;}
.certificate-dialog{width:min(96vw,1120px);max-width:1120px;}
.certificate-dialog .certificate-dialog-card{width:100%;max-width:1120px;padding:0;overflow:hidden;}
.certificate-dialog .dialog-header{padding:16px 18px;border-bottom:1px solid #e5e7eb;}
.certificate-dialog iframe{display:block;width:100%;height:min(82vh,980px);border:0;background:#eef3f1;}
.certificate-courses-list{display:block;line-height:1.45;}
.certificate-courses-list span{display:block;}
.public-eval .eval-comment-field{margin-top:18px;}
@media(max-width:640px){.certificate-dialog{width:98vw;}.certificate-dialog iframe{height:82vh;}.public-eval .eval-comment-field{margin-top:16px;}}

/* Update 100 - certificados: descarga en ventana individual y responsive */
body.nicedash-body .certificate-dialog{
    width:min(96vw,1180px);
    max-width:1180px;
    max-height:94vh;
    padding:0;
    border-radius:20px;
    overflow:hidden;
}
body.nicedash-body .certificate-dialog .certificate-dialog-card{
    width:100%;
    max-width:none;
    max-height:94vh;
    display:flex;
    flex-direction:column;
    padding:0;
    overflow:hidden;
}
body.nicedash-body .certificate-dialog .dialog-header{
    flex:0 0 auto;
    padding:14px 18px;
    border-bottom:1px solid #e5e7eb;
}
body.nicedash-body .certificate-dialog .dialog-header h3{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
body.nicedash-body .certificate-dialog iframe{
    flex:1 1 auto;
    width:100%;
    height:min(82vh,980px);
    min-height:520px;
    border:0;
    background:#eef3f1;
}
@media(max-width:760px){
    body.nicedash-body .certificate-dialog{
        width:calc(100vw - 12px);
        max-height:96vh;
        border-radius:16px;
    }
    body.nicedash-body .certificate-dialog .certificate-dialog-card{max-height:96vh;}
    body.nicedash-body .certificate-dialog .dialog-header{padding:12px 14px;gap:10px;}
    body.nicedash-body .certificate-dialog .dialog-header h3{font-size:15px;}
    body.nicedash-body .certificate-dialog iframe{height:calc(96vh - 58px);min-height:0;}
}


/* Update 103 - ajustes de configuración y permisos */
.config-reglas-head{align-items:flex-start;gap:18px}
.config-reglas-head>div{min-width:0;flex:1}
.config-reglas-filter{margin-left:auto;align-items:center;justify-content:flex-end;flex-wrap:nowrap}
.config-reglas-filter select{min-width:190px}
.role-quick-grid-spaced{margin-bottom:22px}
.role-quick-card .nice-form-grid .form-action-row.compact{grid-column:1/-1;justify-content:flex-start;margin-top:2px}
.role-quick-card .nice-form-grid .form-action-row.compact .btn{width:auto;min-width:0;align-self:flex-start;padding-left:16px;padding-right:16px}
.roles-permissions-main{margin-top:22px}
@media(max-width:720px){.config-reglas-head{flex-direction:column}.config-reglas-filter{width:100%;margin-left:0;justify-content:flex-start;flex-wrap:wrap}.config-reglas-filter select{min-width:0;flex:1 1 180px}.role-quick-grid-spaced{margin-bottom:16px}.roles-permissions-main{margin-top:16px}}

/* update104: ajustes de configuración */
body.nicedash-body .config-reglas-head{display:grid;grid-template-columns:minmax(260px,1fr) auto;align-items:start;gap:18px;margin-bottom:0}
body.nicedash-body .config-reglas-head>div{min-width:0;max-width:560px}
body.nicedash-body .config-reglas-head h2{margin:0 0 8px;line-height:1.18;white-space:normal}
body.nicedash-body .config-reglas-head .muted{max-width:520px;line-height:1.45}
body.nicedash-body .config-reglas-filter{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin:0;min-width:280px;width:auto;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;min-height:0!important}
body.nicedash-body .config-reglas-filter select{width:220px;min-width:220px;max-width:260px}
body.nicedash-body .config-reglas-filter .btn{flex:0 0 auto}
body.nicedash-body .roles-permissions-main{margin-top:0}
@media(max-width:760px){body.nicedash-body .config-reglas-head{grid-template-columns:1fr}body.nicedash-body .config-reglas-filter{width:100%;justify-content:flex-start}body.nicedash-body .config-reglas-filter select{width:100%;min-width:0;max-width:none;flex:1 1 auto}}

/* Update 108 - Usuarios: vinculaciones y datos para liquidaciones */
body.nicedash-body .wrap-cell {
    white-space: normal !important;
    min-width: 220px;
    max-width: 420px;
    line-height: 1.35;
}
body.nicedash-body .table-compact .person-cell {
    min-width: 180px;
}
@media (max-width: 991px) {
    body.nicedash-body .wrap-cell {
        min-width: 180px;
        max-width: none;
    }
}

/* Update 109 - Usuarios, perfil de liquidación e impersonación */
body.nicedash-body .impersonation-banner {
    margin: 16px 24px 0;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid rgba(22, 99, 84, .28);
    background: #e8f5ef;
    color: #163b33;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 10px 30px rgba(22, 99, 84, .08);
}
body.nicedash-body .impersonation-banner strong { color:#166354; }
body.nicedash-body .impersonation-banner small { color:#54706a; }
body.nicedash-body .liquidation-profile-form { margin-top: 16px; }
body.nicedash-body .compact-title-row { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; }
body.nicedash-body .compact-title-row h3 { margin:0; }
body.nicedash-body .compact-title-row p { margin:4px 0 0; }
@media (max-width: 760px) {
    body.nicedash-body .impersonation-banner { margin: 12px 14px 0; align-items:flex-start; flex-direction:column; }
}

/* Update 110 - Intranet Formación, multi-sede y preliquidaciones */
body.nicedash-body .role-dashboard-card .role-dashboard-white,
body.nicedash-body .dashboard-hero .role-dashboard-white { color:#ffffff !important; }
body.nicedash-body .impersonation-banner { margin-bottom:18px; }
body.nicedash-body .multi-sede-editor {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:8px 12px;
    max-height:310px;
    overflow:auto;
    padding:12px;
    border:1px solid #d9e1e8;
    border-radius:14px;
    background:#f9fbfb;
}
body.nicedash-body .user-form-wide .form-action-row { grid-column:1/-1; }
body.nicedash-body .request-actions.row-actions { margin-top:8px; justify-content:flex-start; gap:6px; }
body.nicedash-body .request-actions .action-icon { width:34px; height:34px; }
body.nicedash-body .certificate-dialog-card iframe { min-height:min(74vh, 780px); }
body.nicedash-body .liquidation-profile-form .checkbox-inline { margin:0; }
@media (max-width:760px){
  body.nicedash-body .multi-sede-editor { grid-template-columns:1fr; max-height:260px; }
  body.nicedash-body .request-actions.row-actions { justify-content:flex-start; }
}

/* Update 111 - convocatoria por fechas, calendario responsive y perfil liquidaciones */
body.nicedash-body .role-dashboard-card .muted.role-dashboard-white,
body.nicedash-body .dashboard-hero .muted.role-dashboard-white,
body.nicedash-body .role-dashboard-white { color:#fff !important; }
body.nicedash-body .impersonation-banner { margin-bottom:24px !important; }
body.nicedash-body .calendar-grid-scroll { width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; padding-bottom:4px; }
@media (max-width: 760px) {
    body.nicedash-body .calendar-grid-scroll .calendar-grid,
    body.nicedash-body .calendar-grid-responsive {
        display:grid !important;
        grid-template-columns:repeat(7, minmax(92px, 1fr)) !important;
        min-width:760px;
        border-radius:14px;
    }
    body.nicedash-body .calendar-grid-scroll .calendar-head,
    body.nicedash-body .calendar-grid-responsive .calendar-head { display:block !important; }
    body.nicedash-body .calendar-grid-scroll .calendar-day,
    body.nicedash-body .calendar-grid-responsive .calendar-day {
        min-height:116px !important;
        border-right:1px solid var(--nde-border, #e5e7eb) !important;
    }
    body.nicedash-body .calendar-grid-scroll .calendar-day.outside:empty,
    body.nicedash-body .calendar-grid-responsive .calendar-day.outside:empty { display:block !important; }
}
body.nicedash-body .liquidation-profile-form .profile-copy-readonly input[readonly],
body.nicedash-body .liquidation-profile-form input[data-profile-copy-field][readonly] {
    background:#f3f7f6;
    color:#52635f;
    cursor:not-allowed;
}
body.nicedash-body .adjudicaciones-controls .datatable-filter-form { flex:1 1 auto; }

/* Update 112 - filtros compactos, responsive y certificados */
body.nicedash-body .nice-filter-controls {
    align-items: center !important;
    gap: 16px !important;
    padding: 20px 24px !important;
}
body.nicedash-body .nice-filter-controls .nice-filter-bar {
    display:flex !important;
    align-items:center !important;
    gap:14px !important;
    flex-wrap:wrap !important;
    width:100% !important;
}
body.nicedash-body .nice-filter-controls .field { margin:0 !important; }
body.nicedash-body .nice-filter-controls .field label:not(.checkbox-inline) {
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    overflow:hidden !important;
    clip:rect(0 0 0 0) !important;
    white-space:nowrap !important;
}
body.nicedash-body .nice-filter-controls .field select,
body.nicedash-body .nice-filter-controls .field input[type="search"],
body.nicedash-body .nice-filter-controls .field input[type="text"] {
    min-height:52px !important;
    border-radius:14px !important;
    padding-top:0 !important;
    padding-bottom:0 !important;
}
body.nicedash-body .nice-filter-controls .search-field input[type="search"] {
    min-width:260px !important;
    padding-left:44px !important;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M10.5 18a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15Zm5.3-2.2L21 21' stroke='%235c6f6a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") !important;
    background-repeat:no-repeat !important;
    background-position:left 15px center !important;
    background-size:21px 21px !important;
}
body.nicedash-body .nice-filter-controls .floating-select label,
body.nicedash-body .nice-filter-controls .floating-select:focus-within label { display:none !important; }
body.nicedash-body .nice-filter-controls .floating-select select { padding-top:0 !important; min-height:52px !important; }
@media (max-width:760px){
    body.nicedash-body .nice-filter-controls { padding:16px !important; }
    body.nicedash-body .nice-filter-controls .nice-filter-bar,
    body.nicedash-body .nice-filter-controls .datatable-actions-slot { width:100%; }
    body.nicedash-body .nice-filter-controls .field,
    body.nicedash-body .nice-filter-controls .field select,
    body.nicedash-body .nice-filter-controls .field input { width:100% !important; min-width:0 !important; }
}
@media (max-width:760px){
  body.nicedash-body .calendar-form .acreditaciones-historial,
  body.nicedash-body .acreditaciones-historial,
  body.nicedash-body .acreditacion-history-card,
  body.nicedash-body [data-acreditaciones-anteriores],
  body.nicedash-body .table-responsive:has(table.acreditaciones-anteriores-table) {
      max-width:100% !important;
      overflow-x:auto !important;
      -webkit-overflow-scrolling:touch !important;
  }
  body.nicedash-body .calendario-dictantes-card,
  body.nicedash-body [data-dictantes-asignados],
  body.nicedash-body .dictantes-asignados,
  body.nicedash-body .kv:has(.dictantes-asignados) {
      max-width:100% !important;
      overflow-x:auto !important;
      overflow-wrap:anywhere !important;
  }
  body.nicedash-body .calendar-grid-scroll .calendar-grid,
  body.nicedash-body .calendar-grid-responsive {
      grid-template-columns:repeat(7, minmax(82px, 1fr)) !important;
      min-width:650px !important;
  }
}
@media screen and (max-width:760px){
  body.certificate-body .cert-footer-img img,
  body.certificate-body .certificate-page.cert-dictante .cert-footer-img img { max-height:9.5% !important; width:84% !important; }
  body.certificate-body .cert-footer-img,
  body.certificate-body .certificate-page.cert-dictante .cert-footer-img { bottom:12.2% !important; }
  body.certificate-body .cert-body,
  body.certificate-body .certificate-page.cert-inscrito .cert-body,
  body.certificate-body .certificate-page.cert-dictante .cert-body { font-size:clamp(7.1px,1.92vw,10px) !important; line-height:1.24 !important; }
  body.certificate-body .certificate-page { aspect-ratio:210/315 !important; }
}
@media print{
  body.certificate-body .certificate-page{ height:297mm !important; aspect-ratio:auto !important; }
}


/* Update 113 - filtros compactos en una sola línea y sin select flotante alto. */
body.nicedash-body .datatable-controls.nice-filter-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px 16px !important;
    flex-wrap: wrap !important;
    padding: 20px 24px !important;
}
body.nicedash-body .datatable-controls.nice-filter-controls .nice-filter-bar {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    width: auto !important;
    flex: 0 1 auto !important;
}
body.nicedash-body .datatable-controls.nice-filter-controls .datatable-actions-slot {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}
body.nicedash-body .datatable-controls.nice-filter-controls .field {
    flex: 0 0 auto !important;
    margin: 0 !important;
}
body.nicedash-body .datatable-controls.nice-filter-controls .field select,
body.nicedash-body .datatable-controls.nice-filter-controls .field input[type="search"],
body.nicedash-body .datatable-controls.nice-filter-controls .field input[type="text"] {
    min-height: 46px !important;
    height: 46px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-radius: 14px !important;
}
body.nicedash-body .datatable-controls.nice-filter-controls .field.floating-select select {
    min-height: 46px !important;
    height: 46px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
body.nicedash-body .datatable-controls.nice-filter-controls .floating-select label,
body.nicedash-body .datatable-controls.nice-filter-controls .floating-select:focus-within label {
    display: none !important;
}
body.nicedash-body .datatable-controls.nice-filter-controls .search-field input[type="search"] {
    min-width: 260px !important;
}
@media (max-width: 760px) {
    body.nicedash-body .datatable-controls.nice-filter-controls {
        align-items: stretch !important;
        padding: 16px !important;
    }
    body.nicedash-body .datatable-controls.nice-filter-controls .nice-filter-bar,
    body.nicedash-body .datatable-controls.nice-filter-controls .datatable-actions-slot {
        width: 100% !important;
        margin-left: 0 !important;
        justify-content: flex-start !important;
    }
    body.nicedash-body .datatable-controls.nice-filter-controls .field,
    body.nicedash-body .datatable-controls.nice-filter-controls .field select,
    body.nicedash-body .datatable-controls.nice-filter-controls .field input {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* Update 114 - labels de convocatoria, separación de filtros e IBAN protegido. */
body.nicedash-body .datatable-controls.nice-filter-controls .field.labeled-select {
    position: relative !important;
    min-width: 190px !important;
}
body.nicedash-body .datatable-controls.nice-filter-controls .field.labeled-select label {
    display: block !important;
    position: absolute !important;
    left: 14px !important;
    top: 7px !important;
    z-index: 2 !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    overflow: visible !important;
    padding: 0 4px !important;
    margin: 0 !important;
    background: var(--mat-sys-surface, #fff) !important;
    color: #166354 !important;
    font-size: 11px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    pointer-events: none !important;
}
body.nicedash-body .datatable-controls.nice-filter-controls .field.labeled-select select {
    height: 54px !important;
    min-height: 54px !important;
    padding-top: 17px !important;
    padding-bottom: 4px !important;
}
body.nicedash-body .datatable-controls .users-type-filter {
    margin-right: 16px !important;
}
body.nicedash-body .datatable-controls .users-type-filter .field {
    margin: 0 !important;
}
body.nicedash-body .iban-mask-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
body.nicedash-body .iban-mask-row input { flex: 1 1 auto; }
body.nicedash-body .iban-editor { margin-top: 8px; }
body.nicedash-body .iban-editor[hidden] { display: none !important; }
body.nicedash-body .bank-certificate-card {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #dbe6e2;
    border-radius: 14px;
    background: #f8fbfa;
}
body.nicedash-body .bank-certificate-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
@media (max-width: 760px) {
    body.nicedash-body .datatable-controls .users-type-filter {
        margin-right: 0 !important;
        margin-bottom: 12px !important;
        width: 100% !important;
    }
    body.nicedash-body .datatable-controls.nice-filter-controls .field.labeled-select,
    body.nicedash-body .datatable-controls.nice-filter-controls .field.labeled-select select {
        width: 100% !important;
        min-width: 0 !important;
    }
}
body.nicedash-body .datatable-controls .users-type-filter .field.labeled-select {
    position: relative !important;
    min-width: 190px !important;
}
body.nicedash-body .datatable-controls .users-type-filter .field.labeled-select label {
    display: block !important;
    position: absolute !important;
    left: 14px !important;
    top: 7px !important;
    z-index: 2 !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    overflow: visible !important;
    padding: 0 4px !important;
    background: var(--mat-sys-surface, #fff) !important;
    color: #166354 !important;
    font-size: 11px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
}
body.nicedash-body .datatable-controls .users-type-filter .field.labeled-select select {
    height: 54px !important;
    min-height: 54px !important;
    padding-top: 17px !important;
    padding-bottom: 4px !important;
}

/* Update 118: control de asistencia por jornadas/sesiones */
body.nicedash-body .attendance-sessions-panel {
    margin: 14px 0 18px;
    border: 1px solid #dbe6e2;
    border-radius: 14px;
    background: #f8fbfa;
    overflow: hidden;
}
body.nicedash-body .attendance-sessions-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    font-weight: 700;
    color: #166354;
}
body.nicedash-body .attendance-sessions-panel > summary small { color: #60706b; font-weight: 500; }
body.nicedash-body .attendance-sessions-body { padding: 0 16px 16px; }
body.nicedash-body .session-chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
body.nicedash-body .attendance-dialog-card { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
body.nicedash-body .attendance-session-editor { margin-top: 18px; }
body.nicedash-body .attendance-session-editor h4 { margin: 0 0 10px; color: #166354; }
body.nicedash-body .attendance-session-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(180px, .8fr) minmax(130px, .55fr);
    gap: 12px;
    align-items: end;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid #dbe6e2;
    border-radius: 12px;
    background: #fff;
}
body.nicedash-body .attendance-session-heading { align-self: center; }
body.nicedash-body .attendance-session-heading strong,
body.nicedash-body .attendance-session-heading span,
body.nicedash-body .attendance-session-heading small { display: block; }
body.nicedash-body .attendance-session-heading span { color: #60706b; margin-top: 3px; }
body.nicedash-body .attendance-session-heading small { color: #7d8985; margin-top: 5px; }
body.nicedash-body .attendance-session-row .field.full { grid-column: 1 / -1; }
@media (max-width: 760px) {
    body.nicedash-body .attendance-sessions-panel > summary { align-items: flex-start; flex-direction: column; gap: 4px; }
    body.nicedash-body .attendance-session-row { grid-template-columns: 1fr; }
    body.nicedash-body .attendance-session-row .field.full { grid-column: auto; }
    body.nicedash-body .attendance-dialog-card { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
}

/* Update 119: modal de asistencia sin desplazamiento horizontal */
body.nicedash-body .attendance-dialog {
    width: min(1040px, calc(100vw - 24px));
    max-width: 1040px;
    max-height: calc(100dvh - 24px);
    overflow: hidden;
    box-sizing: border-box;
}
body.nicedash-body .attendance-dialog-card {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    overscroll-behavior: contain;
}
body.nicedash-body .attendance-dialog-card .grid,
body.nicedash-body .attendance-dialog-card .field,
body.nicedash-body .attendance-session-row,
body.nicedash-body .attendance-session-heading {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
body.nicedash-body .attendance-dialog-card input,
body.nicedash-body .attendance-dialog-card select,
body.nicedash-body .attendance-dialog-card textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
body.nicedash-body .attendance-session-heading strong,
body.nicedash-body .attendance-session-heading span,
body.nicedash-body .attendance-session-heading small {
    overflow-wrap: anywhere;
}
body.nicedash-body .revoked-certificates-panel {
    border: 1px solid #efd7a1;
    border-radius: 14px;
    padding: 0 16px 16px;
    background: #fffaf0;
}
body.nicedash-body .revoked-certificates-panel > summary {
    cursor: pointer;
    padding: 14px 0;
    color: #8a5a00;
    font-weight: 700;
}
@media (max-width: 920px) {
    body.nicedash-body .attendance-session-row {
        grid-template-columns: minmax(0, 1fr) minmax(160px, .75fr);
    }
    body.nicedash-body .attendance-session-heading,
    body.nicedash-body .attendance-session-row .field.full {
        grid-column: 1 / -1;
    }
}
@media (max-width: 680px) {
    body.nicedash-body .attendance-dialog {
        width: calc(100vw - 12px);
        max-height: calc(100dvh - 12px);
        margin: 6px;
    }
    body.nicedash-body .attendance-dialog-card {
        max-height: calc(100dvh - 12px);
        padding: 16px;
    }
    body.nicedash-body .attendance-dialog-card > .grid.cols-2,
    body.nicedash-body .attendance-session-row {
        grid-template-columns: minmax(0, 1fr);
    }
    body.nicedash-body .attendance-session-heading,
    body.nicedash-body .attendance-session-row .field.full {
        grid-column: auto;
    }
    body.nicedash-body .attendance-dialog-card .dialog-actions {
        position: sticky;
        bottom: -16px;
        z-index: 2;
        margin: 18px -16px -16px;
        padding: 12px 16px 16px;
        background: #fff;
        border-top: 1px solid #e7eeeb;
    }
}

/* update121 - liquidaciones y desplazamientos */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.check-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border, #dfe7e3);
  border-radius: 12px;
  background: #fbfdfc;
  cursor: pointer;
}
.check-card input { width: 18px; height: 18px; margin: 0; }
.check-row { display: inline-flex; align-items: center; gap: 8px; }
.document-list { display: grid; gap: 10px; }
.document-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border, #dfe7e3);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  background: #fff;
}
.document-item:hover { border-color: #166354; background: #f6fbf9; }
.document-item .iconify { color: #166354; font-size: 22px; }
.timeline { display: grid; gap: 12px; }
.timeline-item { border-left: 3px solid #166354; padding: 4px 0 4px 14px; }
.timeline-item > span { display: block; color: #6b7772; font-size: 12px; margin-top: 3px; }
.timeline-item p { margin: 6px 0 0; }
.text-danger { color: #b42318; font-weight: 700; }
.actions-title { gap: 16px; }
.actions-title > form.inline-form { margin-left: auto; }

@media (max-width: 760px) {
  .option-grid { grid-template-columns: 1fr 1fr; }
  .actions-title { align-items: stretch; }
  .actions-title > form.inline-form { margin-left: 0; width: 100%; }
  .actions-title > form.inline-form .field { width: 100%; }
}
@media (max-width: 480px) {
  .option-grid { grid-template-columns: 1fr; }
}

/* Update 122: asistentes por pasos de liquidaciones y desplazamientos */
.liquidation-wizard {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--border, #dfe7e3);
  border-radius: 16px;
  background: #fff;
}
.liquidation-wizard.travel-wizard { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: #52625c;
  text-decoration: none;
  background: #f7faf9;
  border: 1px solid transparent;
}
.wizard-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e5efeb;
  color: #166354;
  font-weight: 800;
}
.wizard-step strong { min-width: 0; font-size: 13px; line-height: 1.25; }
.wizard-step.active { color: #fff; background: #166354; border-color: #166354; }
.wizard-step.active span { color: #166354; background: #fff; }
.wizard-step.done { border-color: #b9d6cc; }
.wizard-step.done span { color: #fff; background: #2f7d6b; }
.wizard-panel { overflow: visible; }
.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}
.wizard-actions form { margin: 0; }
.wizard-actions .disabled { opacity: .45; pointer-events: none; }
.choice-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid #dbe6e2;
  border-radius: 14px;
  background: #fbfdfc;
  cursor: pointer;
}
.choice-card:has(input:checked) { border-color: #166354; box-shadow: 0 0 0 2px rgba(22,99,84,.10); background: #f1f8f5; }
.choice-card input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; }
.choice-card span { display: grid; gap: 4px; }
.choice-card strong { color: #163f35; }
.choice-card small { color: #66746f; line-height: 1.4; }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.summary-grid article {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid #dfe8e4;
  border-radius: 13px;
  background: #f8fbfa;
}
.summary-grid article span { color: #66746f; font-size: 12px; }
.summary-grid article strong { color: #102e27; font-size: 17px; overflow-wrap: anywhere; }
.joint-billing-box {
  padding: 16px;
  border: 1px solid #cfe1da;
  border-radius: 14px;
  background: #f5faf8;
}
.expense-form {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(110px, .5fr) minmax(150px, .7fr) minmax(150px, .7fr);
  gap: 14px;
  align-items: end;
}
.expense-cards { display: grid; gap: 10px; }
.expense-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #dfe8e4;
  border-radius: 13px;
  background: #fff;
}
.expense-card > div:first-child { display: grid; gap: 3px; min-width: 0; }
.expense-card > div:first-child span { color: #6a7772; font-size: 12px; }
.expense-admin-edit {
  display: grid;
  grid-template-columns: 74px 105px auto;
  gap: 7px;
  align-items: center;
}
.expense-admin-edit input { min-width: 0; height: 38px; padding: 7px 9px; }
.small-btn { min-height: 38px !important; padding: 7px 11px !important; }
.invoice-upload {
  display: flex;
  align-items: end;
  gap: 12px;
}
.invoice-upload .field { flex: 1 1 420px; }
.liquidation-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #dfe8e4;
  border-radius: 14px;
  overflow: hidden;
}
.liquidation-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5ece9;
  background: #fff;
}
.liquidation-summary > div:nth-child(odd) { border-right: 1px solid #e5ece9; }
.liquidation-summary > div.total { grid-column: 1 / -1; border: 0; background: #eef7f4; color: #124f42; font-size: 18px; }
.admin-review-card { border-color: #c7ddd5; background: #fbfdfc; }
.admin-review-actions { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; align-items: end; }
.empty-state.compact { padding: 22px; border: 1px dashed #ccd9d4; border-radius: 12px; text-align: center; color: #67756f; }
#carTravelFields[hidden], #manualKmReason[hidden], #companionName[hidden], #companionDoc[hidden] { display: none !important; }

@media (max-width: 980px) {
  .liquidation-wizard { grid-template-columns: repeat(5, minmax(115px, 1fr)); overflow-x: auto; }
  .liquidation-wizard.travel-wizard { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .expense-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .expense-card { grid-template-columns: minmax(0,1fr) auto; }
  .expense-card .expense-admin-edit { grid-column: 1 / -1; }
  .admin-review-actions { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .liquidation-wizard { margin-left: -4px; margin-right: -4px; padding: 9px; gap: 7px; }
  .wizard-step { padding: 9px; min-width: 130px; }
  .wizard-step strong { font-size: 12px; }
  .choice-cards, .expense-form, .summary-grid, .liquidation-summary { grid-template-columns: 1fr; }
  .liquidation-summary > div:nth-child(odd) { border-right: 0; }
  .liquidation-summary > div.total { grid-column: auto; }
  .expense-card { grid-template-columns: minmax(0,1fr) auto; align-items: start; }
  .expense-admin-edit { grid-template-columns: 1fr 1fr; }
  .expense-admin-edit .btn { grid-column: 1 / -1; }
  .invoice-upload { flex-direction: column; align-items: stretch; }
  .invoice-upload .field { flex-basis: auto; width: 100%; }
  .wizard-actions { flex-wrap: wrap; }
  .wizard-actions > * { flex: 1 1 auto; }
}
.expense-document-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.expense-document-status.ok { color: #14634f; background: #e8f6f0; }
.expense-document-status.pending { color: #9a5a00; background: #fff3d7; }
/* Update 122: estado de justificantes en las tarjetas de gasto */
.expense-card { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.expense-card .expense-admin-edit { grid-column: 1 / -1; }
@media (max-width: 680px) {
  .expense-card { grid-template-columns: minmax(0, 1fr) auto; }
  .expense-card .expense-document-status { grid-column: 1 / -1; justify-self: start; }
}

/* Update 123 - Liquidaciones: wizard, factura y gastos */
.wizard-actions-end { justify-content: flex-end; }
.wizard-action-group { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.company-fields { margin-top: 4px; padding: 18px; border:1px solid #dbe7e4; border-radius:16px; background:#f8fbfa; }
.route-status { display:flex; align-items:center; gap:10px; min-height:48px; padding:12px 14px; border:1px solid #d6e4e0; border-radius:12px; background:#f6faf9; }
.route-status .iconify { width:22px; height:22px; color:#166354; flex:0 0 auto; }
.spinner-mini { width:18px; height:18px; border:2px solid #cfe0dc; border-top-color:#166354; border-radius:50%; animation:spin123 .8s linear infinite; }
@keyframes spin123 { to { transform:rotate(360deg); } }
.expense-workspace { display:grid; grid-template-columns:minmax(280px,.9fr) minmax(320px,1.1fr); gap:24px; align-items:start; }
.expense-form-simple { grid-template-columns:repeat(2,minmax(0,1fr)); padding:18px; border:1px solid #dbe7e4; border-radius:16px; background:#f8fbfa; margin:0; }
.expense-list-column { min-width:0; }
.expense-card-editable { position:relative; display:block; padding:16px 52px 16px 16px; }
.expense-card-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; }
.expense-card-head > div { display:flex; flex-direction:column; gap:6px; min-width:0; }
.expense-card-editable details { margin-top:12px; border-top:1px solid #e4ecea; padding-top:10px; }
.expense-card-editable summary { cursor:pointer; color:#166354; font-weight:700; }
.expense-edit-form { margin-top:12px; }
.expense-delete-form { position:absolute; right:12px; top:12px; }
.invoice-view { border:1px solid #dce5e3; border-radius:18px; padding:28px; background:#fff; box-shadow:0 10px 30px rgba(26,63,57,.06); }
.invoice-top { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; padding-bottom:24px; border-bottom:1px solid #dce5e3; }
.invoice-top > div:first-child { display:grid; grid-template-columns:auto 1fr; gap:4px 16px; align-items:center; }
.invoice-top img { width:76px; max-height:70px; object-fit:contain; grid-row:1/4; }
.invoice-top h3 { margin:0; font-size:22px; }
.invoice-top span { color:#61736f; }
.invoice-company { display:flex; flex-direction:column; text-align:right; gap:4px; }
.invoice-meta { display:grid; grid-template-columns:1fr 1fr; gap:30px; padding:24px 0; }
.invoice-meta > div { display:flex; flex-direction:column; gap:5px; }
.invoice-table { width:100%; border-collapse:collapse; }
.invoice-table th,.invoice-table td { padding:14px 12px; border-bottom:1px solid #e5ecea; }
.invoice-table th { background:#f6faf9; text-align:left; }
.text-right { text-align:right !important; }
.invoice-totals { max-width:470px; margin:24px 0 0 auto; display:grid; gap:10px; }
.invoice-totals > div { display:flex; justify-content:space-between; gap:20px; padding:8px 0; }
.invoice-totals .grand { border-top:2px solid #166354; padding-top:14px; font-size:18px; }
.college-result-grid { margin-top:22px; display:grid; gap:12px; }
.college-result-grid > div { display:flex; justify-content:space-between; gap:20px; padding:13px 16px; border:1px solid #dce5e3; border-radius:10px; }
.college-result-grid .highlight { border:2px solid #166354; font-size:17px; }
.signature-callout { margin-top:24px; display:flex; justify-content:space-between; align-items:center; gap:20px; padding:18px; border:1px solid #cfe0dc; border-radius:14px; background:#f0f8f6; }
.signature-callout > div { display:flex; flex-direction:column; gap:4px; }
.signature-pad-wrap { border:2px dashed #aac7c0; border-radius:16px; background:#fff; overflow:hidden; }
.signature-pad-wrap canvas { display:block; width:100%; height:260px; touch-action:none; }
.college-wizard { grid-template-columns:repeat(4,minmax(0,1fr)); }

@media (max-width: 980px) {
  .expense-workspace { grid-template-columns:1fr; }
  .invoice-meta { grid-template-columns:1fr; }
  .invoice-top { flex-direction:column; }
  .invoice-company { text-align:left; }
}
@media (max-width: 680px) {
  .expense-form-simple { grid-template-columns:1fr; }
  .expense-card-head { flex-direction:column; gap:8px; }
  .invoice-view { padding:18px 14px; border-radius:14px; }
  .invoice-top > div:first-child { grid-template-columns:58px 1fr; }
  .invoice-top img { width:58px; }
  .invoice-top h3 { font-size:18px; }
  .invoice-company { font-size:13px; }
  .invoice-table th,.invoice-table td { padding:10px 8px; font-size:13px; }
  .college-result-grid > div { flex-direction:column; gap:5px; }
  .signature-callout { flex-direction:column; align-items:stretch; }
  .signature-pad-wrap canvas { height:220px; }
  .wizard-action-group { width:100%; }
  .wizard-action-group form,.wizard-action-group .btn { width:100%; }
}

/* Update 124 - Ajustes finales de los asistentes de liquidaciones y viajes */
.wizard-step.warning {
  border-color: #f2bd4b;
  background: #fff7df;
  color: #8a5800;
}
.wizard-step.warning span { background: #ffe4a3; color: #8a5800; }
.wizard-step.warning.active { background: #8a5800; color: #fff; }
.wizard-step.warning.active span { background: #fff; color: #8a5800; }
.bank-certificate-alert { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.bank-certificate-alert a { color:inherit; font-weight:800; text-decoration:underline; }
.wizard-actions-separated {
  width:100%;
  margin-top:24px;
  padding-top:20px;
  border-top:1px solid #e2e9e7;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  grid-column:1 / -1;
}
.wizard-actions-separated > span:empty { display:block; }
.travel-choice-cards { grid-template-columns:repeat(3,minmax(0,1fr)); }
.choice-card-title { display:flex; align-items:center; gap:10px; min-height:28px; }
.choice-card-title input[type="radio"] { margin:0; flex:0 0 auto; }
.choice-card-title strong { line-height:1.25; }
.choice-card > p { margin:8px 0 0; padding-left:0; line-height:1.45; }
.travel-choice-cards .choice-card { min-height:126px; display:block; }
.car-route-panel {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  padding:20px;
  border:1px solid #d9e5e1;
  border-radius:16px;
  background:#f8fbfa;
}
.car-route-panel > .full,
.car-route-panel > .route-status,
.car-route-panel > .route-values-row,
.car-route-panel > .manual-distance-row { grid-column:1 / -1; }
.route-values-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.manual-distance-row {
  display:grid;
  grid-template-columns:minmax(260px,.75fr) minmax(300px,1.25fr);
  gap:16px;
  align-items:end;
}
.manual-distance-row .check-line { min-height:48px; display:flex; align-items:center; gap:9px; margin:0; }
.manual-distance-row .check-line input { margin:0; }
.dictante-expense-form,
.college-expense-form {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  padding:20px;
  border:1px solid #dbe7e4;
  border-radius:16px;
  background:#f8fbfa;
}
.dictante-expense-form .full,
.college-expense-form .full,
.college-expense-form .rule-help,
.expense-add-actions { grid-column:1 / -1; }
.expense-add-actions,
.form-actions-right { display:flex; justify-content:flex-start; align-items:center; gap:12px; }
.form-actions-right { justify-content:flex-end; }
.expense-card.changed,
.changed-row,
.changed-field { border-color:#e9b43e !important; background:#fff8e7 !important; }
.expense-card.changed::before,
.changed-row::before {
  content:"Modificado";
  display:inline-flex;
  margin-bottom:8px;
  padding:3px 8px;
  border-radius:999px;
  background:#ffe7a8;
  color:#805000;
  font-size:11px;
  font-weight:800;
}
.invoice-edit-view {
  display:grid;
  gap:20px;
  padding:22px;
  border:1px solid #d5e3df;
  border-radius:16px;
  background:#fbfdfc;
}
.invoice-edit-title h3 { margin:0 0 4px; }
.invoice-edit-title p { margin:0; color:#657570; }
.invoice-edit-lines { display:grid; gap:10px; }
.invoice-edit-line {
  display:grid;
  grid-template-columns:minmax(220px,1fr) minmax(150px,220px);
  align-items:center;
  gap:16px;
  padding:12px 14px;
  border:1px solid #e1e9e7;
  border-radius:12px;
  background:#fff;
}
.invoice-edit-line input { width:100%; }
.admin-invoice-actions { display:flex; justify-content:flex-end; gap:12px; flex-wrap:wrap; margin-top:20px; }
.college-expense-values { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; grid-column:1 / -1; }
.rule-help {
  margin:0;
  padding:10px 12px;
  border-left:4px solid #e5a61a;
  border-radius:8px;
  background:#fff7df;
  color:#815500;
  line-height:1.4;
}
.fde-bank-transfer {
  margin-top:18px;
  padding:15px 18px;
  border:2px solid #166354;
  border-radius:12px;
  background:#edf8f5;
  color:#104c40;
  font-weight:800;
  text-align:center;
}
.travel-type-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
.linked-travel-option {
  margin-top:16px;
  padding:14px 16px;
  border:1px solid #d8e5e1;
  border-radius:12px;
  background:#f8fbfa;
}
.travel-means-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  grid-column:1 / -1;
}
.travel-means-grid .check-card {
  width:100%;
  min-height:54px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border:1px solid #d7e4e0;
  border-radius:12px;
  background:#fff;
}
.travel-means-grid .check-card input { margin:0; flex:0 0 auto; }
.travel-means-grid .check-card span { line-height:1.25; }
.companion-block { width:100%; grid-column:1 / -1; }
.travel-status-form {
  display:flex;
  align-items:flex-end;
  gap:12px;
  flex-wrap:wrap;
}
.travel-status-form .field { margin:0; min-width:220px; }
.btn.btn-compact { min-height:42px; padding:10px 18px; width:auto; }
.travel-add-segment-action { margin-top:4px; display:flex; justify-content:flex-start; }
.table-compact td.actions,
.table-compact td:last-child { vertical-align:middle; }
.table-compact .action-icon { vertical-align:middle; }

@media (max-width: 980px) {
  .travel-choice-cards { grid-template-columns:repeat(3,minmax(190px,1fr)); overflow-x:auto; }
  .travel-means-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .manual-distance-row { grid-template-columns:1fr; }
}
@media (max-width: 680px) {
  .bank-certificate-alert { flex-direction:column; }
  .travel-choice-cards,
  .travel-type-cards,
  .route-values-row,
  .dictante-expense-form,
  .college-expense-form,
  .college-expense-values,
  .travel-means-grid { grid-template-columns:1fr; overflow:visible; }
  .car-route-panel { grid-template-columns:1fr; padding:15px; }
  .manual-distance-row { grid-template-columns:1fr; }
  .wizard-actions-separated { flex-wrap:wrap; }
  .wizard-actions-separated > * { flex:1 1 auto; }
  .wizard-actions-separated > span:empty { display:none; }
  .invoice-edit-line { grid-template-columns:1fr; gap:8px; }
  .admin-invoice-actions { flex-direction:column; align-items:stretch; }
  .admin-invoice-actions .btn,
  .admin-invoice-actions form { width:100%; }
  .travel-status-form { align-items:stretch; }
  .travel-status-form .field,
  .travel-status-form .btn { width:100%; }
}

/* Update 125 - Homogeneización visual de Liquidaciones */
.liquidation-list-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.liquidation-list-controls .datatable-search { flex: 1 1 320px; max-width: 520px; }
.liquidation-list-controls .datatable-filter-form { margin-left: auto; }
.liquidation-list-controls .labeled-select { min-width: 210px; }

.wizard-actions-only-next {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e2e9e7;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}
.wizard-actions-separated { grid-column: 1 / -1; }

.dictante-travel-layout {
  display: grid;
  grid-template-columns: minmax(250px, .72fr) minmax(430px, 1.28fr);
  gap: 24px;
  align-items: start;
}
.travel-options-column,
.travel-detail-column { min-width: 0; }
.dictante-travel-layout .travel-choice-cards { grid-template-columns: 1fr; overflow: visible; }
.dictante-travel-layout .choice-card { width: 100%; }
.travel-detail-column > .alert,
.travel-detail-column > .car-route-panel { margin: 0; }
.car-route-panel > .route-status { margin-bottom: 6px; }
.route-status + .field { margin-top: 4px; }

.travel-step-one-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.travel-course-column,
.travel-type-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.travel-type-column .travel-type-cards { grid-template-columns: 1fr; }
.travel-step-full {
  width: 100%;
  display: grid;
  gap: 18px;
  margin-top: 18px;
}
.travel-step-full > * { width: 100%; }
.travel-summary-stack {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.travel-summary-stack > * { width: 100%; }
.travel-summary-stack .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

body.nicedash-body .checkbox-list label {
  min-height: 34px !important;
  padding: 4px 0 !important;
  gap: 10px !important;
  line-height: 1.25 !important;
}
.travel-step-full .travel-means-grid {
  width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.travel-step-full .travel-means-grid .check-card {
  border: 1px solid #d7e4e0;
  border-radius: 12px;
  background: #fff;
}

.admin-edit-dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 43, 36, .24);
  overflow: hidden;
}
.admin-edit-dialog::backdrop { background: rgba(17, 37, 32, .56); }
.admin-edit-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid #dfe8e5;
  background: #fff;
}
.admin-edit-dialog-head h3 { margin: 0 0 4px; }
.admin-edit-dialog-head p { margin: 0; color: #657570; }
.admin-edit-dialog-form {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  padding: 22px;
}
.admin-edit-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
  margin-top: 8px;
}

.college-expense-form #collegeRuleMessage {
  margin-top: -2px;
  margin-bottom: 4px;
}
.fde-bank-transfer {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.travel-management-stats {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 16px;
}
.travel-management-stats .stat-card {
  min-height: 92px;
  padding: 12px 14px;
  border-radius: 13px;
}
.travel-management-stats .stat-card strong {
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.25;
}

@media (max-width: 980px) {
  .dictante-travel-layout,
  .travel-step-one-grid { grid-template-columns: 1fr; }
  .travel-step-full .travel-means-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .travel-management-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .liquidation-list-controls { align-items: stretch; }
  .liquidation-list-controls .datatable-search,
  .liquidation-list-controls .datatable-filter-form,
  .liquidation-list-controls .labeled-select { width: 100%; max-width: none; margin-left: 0; }
  .liquidation-wizard.responsive-wizard,
  .liquidation-wizard.travel-wizard {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 10px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .liquidation-wizard.responsive-wizard .wizard-step,
  .liquidation-wizard.travel-wizard .wizard-step {
    flex: 0 0 min(190px, 76vw);
    min-width: 0;
    scroll-snap-align: start;
  }
  .travel-summary-stack .summary-grid,
  .travel-step-full .travel-means-grid,
  .travel-management-stats { grid-template-columns: 1fr; }
  .admin-edit-dialog { width: calc(100vw - 18px); max-height: calc(100vh - 18px); }
  .admin-edit-dialog-form { max-height: calc(100vh - 120px); padding: 16px; }
  .admin-edit-form-actions { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  .admin-edit-form-actions .btn { width: 100%; }
  .fde-bank-transfer { align-items: flex-start; text-align: left; }
}

/* Update 126 - Ajustes de liquidaciones, justificantes y desplazamientos */
#noTravelMessage[hidden],
.travel-detail-column [hidden],
.company-fields[hidden],
#manualKmReason[hidden],
#companionName[hidden],
#companionDoc[hidden] {
  display: none !important;
}

.company-fields {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 20px;
  padding: 20px;
  box-sizing: border-box;
}

.manual-distance-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
  margin-top: 8px;
}
.manual-distance-row .check-row,
.manual-distance-row .field {
  width: 100%;
  box-sizing: border-box;
}
.manual-distance-row textarea { width: 100%; }

.invoice-upload-aligned {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
}
.invoice-upload-aligned .field { margin: 0; min-width: 0; }
.invoice-upload-aligned input[type="file"] {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}
.invoice-upload-aligned .invoice-upload-button {
  align-self: end;
  min-height: 44px;
  white-space: nowrap;
}

.travel-status-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.travel-status-form .field {
  margin: 0;
  min-width: 230px;
}
.travel-status-form .btn,
.travel-status-form .btn-compact {
  width: auto !important;
  min-height: 44px !important;
  padding: 9px 16px !important;
  align-self: flex-end;
  white-space: nowrap;
}
.travel-add-segment-action {
  justify-content: flex-start;
  align-items: center;
}
.travel-add-segment-action .btn {
  width: auto !important;
  min-width: 0 !important;
  min-height: 42px;
  padding: 9px 16px;
}

.travel-means-grid {
  width: 100%;
  gap: 12px;
}
.travel-means-grid .check-card {
  min-height: 50px !important;
  padding: 10px 14px !important;
  border: 1px solid #d7e4e0;
  border-radius: 12px;
  background: #f4f9f7;
  color: #184f43;
  box-sizing: border-box;
}
.travel-means-grid .check-card:has(input:checked) {
  border-color: #166354;
  background: #e7f3ef;
}
.travel-means-grid .check-card input {
  margin-right: 2px !important;
}

.companion-block > .grid {
  margin-top: 18px !important;
}
.companion-block .field { margin-top: 0; }

@media (max-width: 680px) {
  .company-fields { padding: 16px; margin-top: 16px; }
  .invoice-upload-aligned { grid-template-columns: 1fr; }
  .invoice-upload-aligned .invoice-upload-button { width: 100%; }
  .travel-status-form { align-items: stretch; }
  .travel-status-form .field,
  .travel-status-form .btn,
  .travel-status-form .btn-compact { width: 100% !important; }
  .travel-means-grid { grid-template-columns: 1fr; }
}


/* Update 127 - Justificantes independientes y ajustes finos de formularios */
body.nicedash-body form.invoice-upload-aligned .field,
body.nicedash-body form.travel-status-form .field {
  margin-bottom: 0 !important;
}

body.nicedash-body form.travel-status-form {
  display: grid;
  grid-template-columns: minmax(230px, 320px) auto;
  align-items: end;
  gap: 12px;
}
body.nicedash-body form.travel-status-form .travel-state-field {
  position: relative;
  min-width: 0;
  padding-top: 0;
}
body.nicedash-body form.travel-status-form .travel-state-field label {
  display: block;
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--nde-muted);
}
body.nicedash-body form.travel-status-form .travel-state-field select,
body.nicedash-body form.travel-status-form .btn {
  min-height: 44px !important;
}
body.nicedash-body form.travel-status-form .btn {
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  align-self: end;
}

body.nicedash-body .travel-add-segment-action {
  display: flex !important;
  justify-content: flex-start !important;
}
body.nicedash-body .travel-add-segment-action .btn {
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  padding: 9px 16px !important;
}

body.nicedash-body .checkbox-list.travel-means-grid {
  padding: 0 !important;
  gap: 12px !important;
  max-height: none !important;
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
}
body.nicedash-body .checkbox-list.travel-means-grid label.check-card {
  min-height: 50px !important;
  padding: 12px 14px !important;
  gap: 10px !important;
  line-height: 1.25 !important;
  border: 1px solid #d7e4e0 !important;
  border-radius: 12px !important;
  background: #f4f9f7 !important;
}
body.nicedash-body .checkbox-list.travel-means-grid label.check-card:has(input:checked) {
  border-color: #166354 !important;
  background: #e7f3ef !important;
}
body.nicedash-body .companion-block > .grid {
  margin-top: 20px !important;
}

@media (max-width: 680px) {
  body.nicedash-body form.travel-status-form { grid-template-columns: 1fr; }
  body.nicedash-body form.travel-status-form .btn { width: 100% !important; }
}


/* Update 128 - Acompanante en el paso inicial, estados de gastos y ajustes de viaje */
.travel-companion-step-one {
  margin-top: 4px;
  padding: 16px;
  border: 1px solid #d8e5e1;
  border-radius: 14px;
  background: #f8fbfa;
}
.travel-companion-step-one > .grid { margin-top: 16px !important; }
.travel-companion-step-one .alert { margin-bottom: 0; }
#travelCompanionBlock[hidden],
#companionCostNotice[hidden] { display: none !important; }

body.nicedash-body form.travel-status-form .travel-state-submit {
  display: inline-flex !important;
  width: auto !important;
  max-width: max-content !important;
  min-width: 0 !important;
  justify-self: start !important;
  align-self: end !important;
  flex: 0 0 auto !important;
}

.expense-card.has-document {
  border-color: #9fd3bd !important;
  background: #f0faf6 !important;
}
.expense-card.missing-document {
  border-color: #efc46a !important;
  background: #fff8e7 !important;
}
.expense-card.has-document.changed {
  border-color: #79bea3 !important;
  background: #edf9f4 !important;
}
.expense-card.changed::before {
  content: "Modificado";
  display: inline-flex;
  width: max-content;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ffe7a8;
  color: #805000;
  font-size: 11px;
  font-weight: 800;
}
.changed-row {
  border-color: inherit !important;
  background: transparent !important;
}
.changed-row::before { content: none !important; display: none !important; }
.changed-row .changed-badge {
  display: inline-flex;
  margin: 0 8px 3px 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ffe7a8;
  color: #805000;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}

@media (max-width: 680px) {
  .travel-companion-step-one .grid { grid-template-columns: 1fr; }
  body.nicedash-body form.travel-status-form .travel-state-submit {
    width: auto !important;
    max-width: max-content !important;
  }
}


/* Update 131 */
.payment-actions{display:flex;align-items:center;gap:10px;justify-content:flex-end;position:relative}.payment-register-details{position:relative}.payment-register-details>summary{list-style:none;cursor:pointer}.payment-register-details>summary::-webkit-details-marker{display:none}.payment-register-form{position:absolute;z-index:30;right:0;top:calc(100% + 8px);width:min(520px,80vw);padding:18px;background:#fff;border:1px solid #dbe6e3;border-radius:16px;box-shadow:0 18px 45px rgba(15,45,40,.16);display:grid;grid-template-columns:1fr 1fr;gap:14px}.signed-download-callout{margin-top:24px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px;border:1px solid #b8ddce;border-radius:14px;background:#eff9f4}.signed-download-callout>div{display:flex;flex-direction:column;gap:4px}.dictante-expense-form .meal-quantity-field[hidden],.expense-edit-form .meal-quantity-field[hidden]{display:none!important}.meal-rule-alert{margin-top:0}.liquidation-print-actions{position:sticky;top:0;z-index:10;display:flex;justify-content:center;gap:12px;padding:12px;background:rgba(255,255,255,.94);border-bottom:1px solid #dbe6e3}.liquidation-print-page{max-width:210mm;margin:18px auto;padding:18mm;background:#fff;box-shadow:0 10px 35px rgba(15,45,40,.12);font-family:Onest,Inter,Arial,sans-serif;color:#263238}.liquidation-print-head{display:flex;justify-content:space-between;gap:30px;align-items:flex-start;border-bottom:2px solid #166354;padding-bottom:18px}.liquidation-print-head img{max-width:190px;max-height:70px}.liquidation-print-company{display:flex;flex-direction:column;align-items:flex-end;gap:3px;font-size:12px}.liquidation-print-title{margin:26px 0 10px}.liquidation-print-meta{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:20px 0}.liquidation-print-box{padding:14px;border:1px solid #dbe6e3;border-radius:12px;display:flex;flex-direction:column;gap:4px}.liquidation-print-table{width:100%;border-collapse:collapse;margin-top:18px}.liquidation-print-table th,.liquidation-print-table td{padding:10px;border-bottom:1px solid #e6ecea;text-align:left}.liquidation-print-table th:last-child,.liquidation-print-table td:last-child{text-align:right}.liquidation-print-total{margin-left:auto;margin-top:18px;width:min(360px,100%);display:grid;gap:8px}.liquidation-print-total>div{display:flex;justify-content:space-between;gap:20px}.liquidation-print-total .grand{font-size:18px;font-weight:800;padding-top:10px;border-top:2px solid #166354}.liquidation-print-signature{margin-top:34px;padding-top:20px;border-top:1px solid #dbe6e3;display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:end}.liquidation-print-signature img{max-width:260px;max-height:90px;object-fit:contain}.liquidation-delete-form{display:inline-flex}.meal-quantity-help{font-size:12px;color:#64748b;margin-top:5px}
@media(max-width:700px){.payment-register-form{position:fixed;left:12px;right:12px;top:90px;width:auto;max-height:calc(100vh - 110px);overflow:auto;grid-template-columns:1fr}.signed-download-callout{align-items:stretch;flex-direction:column}.liquidation-print-page{margin:0;padding:18px;box-shadow:none}.liquidation-print-head,.liquidation-print-signature{grid-template-columns:1fr;display:grid}.liquidation-print-company{align-items:flex-start}.liquidation-print-meta{grid-template-columns:1fr}}
@media print{.liquidation-print-actions{display:none!important}.liquidation-print-page{box-shadow:none;margin:0;max-width:none;padding:12mm}.liquidation-print-body{background:#fff}}

/* Update 132 - Viajes, avisos, justificantes y pagos */
body.nicedash-body,
body.nicedash-body button,
body.nicedash-body input,
body.nicedash-body select,
body.nicedash-body textarea {
  font-family: Onest, Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

.expense-upload-field > label:first-child {
  display: block;
  margin-bottom: 8px;
}
.fde-upload-control {
  width: 100%;
  min-width: 0;
}
.fde-upload-input {
  position: static !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 7px 10px !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
  border: 1px solid #d8e3df !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #334b46 !important;
  box-sizing: border-box !important;
  cursor: pointer;
}
.fde-upload-input::file-selector-button {
  min-height: 34px;
  margin-right: 12px;
  padding: 7px 12px;
  border: 0;
  border-radius: 9px;
  background: #166354;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.fde-upload-input::-webkit-file-upload-button {
  min-height: 34px;
  margin-right: 12px;
  padding: 7px 12px;
  border: 0;
  border-radius: 9px;
  background: #166354;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.fde-upload-mobile-card { display: none; }
.fde-upload-desktop-status {
  display: block;
  margin-top: 7px;
  color: #6b7e79;
  font-size: 12px;
  line-height: 1.45;
}
.fde-upload-control.is-processing { opacity: .72; pointer-events: none; }
.fde-upload-control.has-files .fde-upload-input {
  border-color: #7ebaa9 !important;
  background: #f1faf6 !important;
}
.fde-upload-control.has-error .fde-upload-input {
  border-color: #d66a6a !important;
  background: #fff7f7 !important;
}
.fde-upload-control.has-error [data-file-status] { color: #a33434 !important; }


.dictante-expense-form.is-meal-selected .expense-amount-field { grid-column: span 2; }
.expense-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.expense-document-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.expense-document-links a { display: inline-flex; align-items: center; gap: 6px; color: #166354; font-size: 13px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.expense-document-links a:hover { text-decoration: underline; }
.document-list-title { margin: 0 0 9px; color: #263a36; font-size: 15px; font-weight: 800; }
.document-group + .document-group { padding-top: 14px; border-top: 1px solid #e1e9e6; }

.travel-request-details,
.travel-confirmed-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.travel-request-details article,
.travel-confirmed-summary article {
  min-width: 0;
  padding: 15px;
  border: 1px solid #dce7e3;
  border-radius: 14px;
  background: #f8fbfa;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.travel-request-details article > span,
.travel-confirmed-summary article > span { color: #6c7d78; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; }
.travel-request-details article strong,
.travel-confirmed-summary article strong { color: #243a35; overflow-wrap: anywhere; }
.travel-request-details article small,
.travel-confirmed-summary article small { color: #687a75; line-height: 1.45; overflow-wrap: anywhere; }

.agency-booking-form { display: grid; gap: 16px; }
.agency-form-row { display: grid; gap: 16px; }
.agency-form-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.agency-form-row.cols-1 { grid-template-columns: minmax(0, 1fr); }
.agency-add-segment-footer,
.agency-confirm-form {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid #dfe8e5;
  display: flex;
  justify-content: flex-end;
}
.agency-confirm-form { margin-top: 22px; }
.segment-ticket-links,
.ticket-download-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.segment-ticket-links a { display: inline-flex; align-items: center; gap: 5px; color: #166354; font-size: 12px; font-weight: 750; text-decoration: none; }
.travel-ticket-pending { display: flex; align-items: flex-start; gap: 16px; padding: 20px; border: 1px solid #cfe2dc; border-radius: 15px; background: #f3f9f7; }
.travel-ticket-pending > .iconify { flex: 0 0 auto; width: 30px; height: 30px; color: #166354; }
.travel-ticket-pending strong { display: block; margin-bottom: 5px; color: #243a35; }
.travel-ticket-pending p { margin: 0; color: #536a64; line-height: 1.55; }

.travel-actions-column { text-align: center !important; vertical-align: middle !important; }
.travel-actions-column .row-actions { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }

.payment-filter-controls { align-items: end; }
.payment-type-filter { min-width: 190px; margin-left: auto; }
.payment-type-filter label { display: block; margin-bottom: 6px; }
.payment-operation-icon.is-payment { color: #166354; background: #edf8f4; border-color: #a9d3c6; }
.payment-operation-icon.is-collection { color: #2461a8; background: #eff6ff; border-color: #b8d3f1; }
.payment-operation-icon.is-accounting { color: #87631d; background: #fff8e8; border-color: #ecd39b; }
.payment-register-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(23, 48, 43, .24);
  overflow: hidden;
}
.payment-register-dialog::backdrop { background: rgba(18, 36, 32, .48); backdrop-filter: blur(2px); }
.payment-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid #e1e9e6; }
.payment-dialog-head h3 { margin: 0 0 4px; }
.payment-dialog-head p { margin: 0; }
.payment-dialog-form { display: grid; gap: 16px; padding: 22px; }
.payment-dialog-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.payment-dialog-footer { display: flex; justify-content: flex-end; margin-top: 2px; padding-top: 18px; border-top: 1px solid #dfe8e5; }

@media (max-width: 820px) {
  .travel-request-details,
  .travel-confirmed-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .liquidation-wizard.responsive-wizard,
  .liquidation-wizard.travel-wizard { scroll-behavior: smooth; scroll-padding-inline: 10px; }
  .liquidation-wizard.responsive-wizard .wizard-step,
  .liquidation-wizard.travel-wizard .wizard-step { scroll-snap-align: center; }
  .dictante-expense-form.is-meal-selected .expense-amount-field { grid-column: auto; }
  .expense-card-head { flex-direction: column; }
  .expense-document-links { justify-content: flex-start; }
  .travel-request-details,
  .travel-confirmed-summary,
  .agency-form-row.cols-2,
  .payment-dialog-row { grid-template-columns: 1fr; }
  .payment-filter-controls { align-items: stretch; }
  .payment-type-filter { width: 100%; margin-left: 0; }
  .payment-register-dialog { width: calc(100vw - 18px); max-height: calc(100vh - 18px); }
  .payment-dialog-form { padding: 17px; }
}
.dictante-expense-form .meal-rule-alert[hidden] { display: none !important; }

/* Update 133 - subida responsive, tablas y formularios */
.payment-operation-svg {
  width: 21px;
  height: 21px;
  display: block;
  flex: 0 0 auto;
}
.payment-operation-svg path,
.payment-operation-svg rect,
.payment-operation-svg circle,
.payment-operation-svg polyline,
.payment-operation-svg line {
  vector-effect: non-scaling-stroke;
}

.travel-list-table th,
.travel-list-table td {
  border-bottom: 1px solid #e2e9e7 !important;
}
.travel-list-table tbody tr:last-child td {
  border-bottom: 1px solid #e2e9e7 !important;
}
.travel-list-table .travel-actions-column {
  width: 132px;
  min-width: 132px;
  padding-left: 12px !important;
  padding-right: 12px !important;
  text-align: center !important;
  vertical-align: middle !important;
}
.travel-action-buttons {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.travel-action-buttons .inline-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
}
.travel-action-buttons .action-icon {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  flex: 0 0 38px !important;
}
.travel-action-buttons .action-icon .iconify {
  width: 20px !important;
  height: 20px !important;
  display: block !important;
}

.convocatorias-layout {
  align-items: start;
}
.convocatorias-form-dates {
  margin-top: 0;
}
.convocatorias-active-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 8px;
  line-height: 1.45;
}
.convocatorias-active-check input {
  flex: 0 0 auto;
  margin-top: 3px;
}
.convocatorias-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.convocatorias-table {
  min-width: 650px;
}
.convocatorias-table .convocatoria-actions {
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 991.98px) {
  .fde-upload-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  .fde-upload-mobile-card {
    min-height: 190px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;
    padding: 24px 20px;
    border: 2px dashed rgba(22, 99, 84, .42);
    border-radius: 18px;
    background: linear-gradient(180deg, #f6fbf9 0%, #fbfdfc 100%);
    color: #334b46;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
  }
  .fde-upload-control.compact .fde-upload-mobile-card {
    min-height: 170px;
    padding: 20px 16px;
  }
  .fde-upload-control.is-dragging .fde-upload-mobile-card {
    border-color: #166354;
    background: #eef7f4;
    transform: translateY(-1px);
  }
  .fde-upload-control.has-files .fde-upload-mobile-card {
    border-style: solid;
    border-color: #7ebaa9;
    background: #edf8f4;
  }
  .fde-upload-control.has-error .fde-upload-mobile-card {
    border-style: solid;
    border-color: #d66a6a;
    background: #fff7f7;
  }
  .fde-upload-icon {
    width: 72px !important;
    height: 72px !important;
    color: #166354;
    flex: 0 0 auto;
  }
  .fde-upload-mobile-title {
    display: block;
    max-width: 560px;
    color: #166354;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 800;
  }
  .fde-upload-mobile-formats {
    display: block;
    color: #4e625d;
    font-size: 13px;
    line-height: 1.4;
  }
  .fde-upload-mobile-status {
    display: block;
    color: #6b7e79;
    font-size: 12px;
    line-height: 1.45;
  }
  .fde-upload-desktop-status { display: none; }

  body.nicedash-body .liquidation-list-controls .datatable-search {
    flex: 0 1 320px !important;
    width: min(100%, 320px) !important;
    max-width: 320px !important;
    min-width: 0 !important;
  }
  body.nicedash-body .liquidation-list-controls .datatable-search input[type="search"] {
    width: 100% !important;
    min-width: 0 !important;
  }

  .convocatorias-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .convocatorias-layout > .card {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  body.nicedash-body .liquidation-list-controls .datatable-search {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .convocatorias-form-dates {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .convocatorias-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .convocatorias-form-actions .btn {
    flex: 1 1 150px;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .convocatorias-table-wrap { overflow: visible; }
  .convocatorias-table {
    min-width: 0;
    width: 100%;
  }
  .convocatorias-table thead { display: none; }
  .convocatorias-table tbody {
    display: grid;
    gap: 12px;
  }
  .convocatorias-table tbody tr {
    display: grid;
    gap: 0;
    padding: 8px 14px;
    border: 1px solid #dfe8e5;
    border-radius: 14px;
    background: #fff;
  }
  .convocatorias-table tbody td {
    display: grid;
    grid-template-columns: minmax(112px, .72fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px 0 !important;
    border-bottom: 1px solid #edf1f0 !important;
    text-align: left !important;
    white-space: normal !important;
  }
  .convocatorias-table tbody td:last-child { border-bottom: 0 !important; }
  .convocatorias-table tbody td::before {
    content: attr(data-label);
    color: #5f716c;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
  }
  .convocatorias-table .convocatoria-actions .btn {
    width: max-content;
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .fde-upload-mobile-card {
    min-height: 175px;
    padding: 20px 14px;
    gap: 11px;
  }
  .fde-upload-icon {
    width: 64px !important;
    height: 64px !important;
  }
  .convocatorias-table {
    min-width: 590px;
  }
}

/* Update 134 - campos de archivo y acreditaciones compartidas */
.fde-upload-field-label {
  display: block;
  margin-bottom: 8px;
  color: #263a36;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

/* La clase es común a todos los input file. Solo los justificantes con
   .has-mobile-card sustituyen el control por la tarjeta táctil en móvil. */
.fde-upload-mobile-card {
  display: none !important;
}

body.nicedash-body .fde-upload-input.sr-only-file {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 991.98px) {
  /* Corrige la regla de update133 que ocultaba cualquier input con esta clase. */
  body.nicedash-body .fde-upload-input:not(.sr-only-file) {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 7px 10px !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    border: 1px solid #d8e3df !important;
  }

  body.nicedash-body .fde-upload-control.has-mobile-card .fde-upload-input:not(.sr-only-file) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  body.nicedash-body .fde-upload-control.has-mobile-card .fde-upload-mobile-card {
    display: flex !important;
  }

  body.nicedash-body .fde-upload-control.has-mobile-card .fde-upload-desktop-status {
    display: none !important;
  }
}

/* Update 135: acreditaciones compartidas, histórico, datos bancarios y PWA */
.profile-link-button{
  appearance:none;border:0;background:transparent;width:100%;display:flex;align-items:center;gap:10px;
  padding:10px 12px;color:inherit;font:inherit;text-align:left;cursor:pointer;border-radius:10px;
}
.profile-link-button:hover{background:rgba(22,99,84,.08);color:#166354}
.profile-link-button .iconify{font-size:1.2rem}

.accreditation-link-mode{border-color:rgba(22,99,84,.24);background:linear-gradient(180deg,rgba(22,99,84,.035),#fff)}
.accreditation-mode-options{display:grid;gap:12px}
.accreditation-mode-options .choice-card{display:flex;align-items:flex-start;gap:12px;padding:14px 16px;border:1px solid #dce6e3;border-radius:14px;background:#fff;cursor:pointer}
.accreditation-mode-options .choice-card:has(input:checked){border-color:#166354;box-shadow:0 0 0 3px rgba(22,99,84,.1)}
.accreditation-mode-options .choice-card input{width:auto;margin-top:3px;accent-color:#166354}
.accreditation-mode-options .choice-card span{display:grid;gap:4px}
.accreditation-mode-options .choice-card small{color:#667773;line-height:1.45}
.accreditation-share-target{margin:0 0 0 34px;max-width:680px}
.selected-reference{padding:12px 14px;border:1px solid #dce6e3;border-radius:12px;background:#f8fbfa}

.accounting-bank-block{border:1px solid rgba(22,99,84,.22);border-radius:14px;padding:16px;background:#fbfdfc}
.accounting-bank-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px}
.accounting-bank-grid article{display:grid;gap:7px;padding:14px;border:1px solid #e1e9e7;border-radius:12px;background:#fff;min-width:0}
.accounting-bank-grid article>span{font-size:.8rem;text-transform:uppercase;letter-spacing:.04em;color:#667773;font-weight:700}
.accounting-bank-grid article>strong{overflow-wrap:anywhere}
.accounting-bank-grid article>small{color:#667773}
.accounting-bank-grid .document-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}

.liquidation-history-card{margin-top:24px;border-top:4px solid rgba(22,99,84,.18)}
.liquidation-history-controls{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.liquidation-history-controls .datatable-search{flex:0 1 320px}
.liquidation-history-controls .field{margin:0;min-width:220px}

@media (max-width: 767.98px){
  .accounting-bank-grid{grid-template-columns:1fr}
  .accreditation-share-target{margin-left:0;max-width:none}
  .liquidation-history-controls>*{width:100%;max-width:none!important}
  .liquidation-history-controls .btn{width:auto;margin-left:auto}
}
.pwa-install-help-card{width:min(520px,100%)}
.pwa-install-help-card .modal-body p{margin:0 0 12px;line-height:1.6}
.pwa-install-help-card .actions{padding-top:14px;border-top:1px solid #e1e9e6}

/* Update 136: comunicaciones, FAQ, informes, cursos externos y filtros históricos */
.communication-form textarea[name="cuerpo_html"] {
  min-height: 220px;
  resize: vertical;
  line-height: 1.62;
}
.communication-form select[multiple] {
  min-height: 210px;
  padding: 8px;
}
.communication-preview {
  margin: 16px 0 22px;
  padding: 20px 22px;
  border: 1px solid #dfe8e5;
  border-radius: 14px;
  background: #fbfdfc;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.communication-preview > :first-child { margin-top: 0; }
.communication-preview > :last-child { margin-bottom: 0; }
.communication-preview a { color: #166354; font-weight: 700; }

.faq-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
}
.faq-hero > .iconify {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  color: #166354;
}
.faq-hero > div { min-width: 0; flex: 1 1 auto; }
.faq-hero h2 { margin: 0 0 5px; }
.faq-hero p { margin: 0; }
.faq-layout {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.faq-categories {
  display: grid;
  gap: 7px;
  position: sticky;
  top: 96px;
}
.faq-categories h3 { margin: 0 0 7px; }
.faq-categories button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #52635f;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.faq-categories button:hover,
.faq-categories button.active {
  color: #166354;
  background: rgba(22, 99, 84, .09);
}
.faq-accordion { padding: 6px 22px; }
.faq-accordion details { border-bottom: 1px solid #e5ecea; }
.faq-accordion details:last-child { border-bottom: 0; }
.faq-accordion summary {
  display: grid;
  grid-template-columns: minmax(100px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  color: #1f312d;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.faq-accordion summary::-webkit-details-marker { display: none; }
.faq-accordion summary > span:first-child {
  color: #166354;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.faq-accordion summary > .iconify { transition: transform .18s ease; }
.faq-accordion details[open] summary > .iconify { transform: rotate(180deg); }
.faq-accordion details p {
  margin: -2px 0 18px;
  padding: 0 0 0 114px;
  color: #52635f;
  line-height: 1.68;
}

.report-filter-card { padding-bottom: 18px; }
.report-filter-grid {
  display: grid !important;
  grid-template-columns: minmax(180px, 1.2fr) minmax(170px, 1fr) minmax(150px, .8fr) minmax(150px, .8fr) auto;
  gap: 12px;
  align-items: end;
  width: 100%;
}
.report-filter-grid .field { margin: 0; min-width: 0; }
.report-filter-grid .align-end { align-self: end; }
.report-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}
.stat-card {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 18px;
  border: 1px solid #dfe8e5;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 50, 43, .045);
}
.stat-card > span {
  color: #5f716c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.stat-card > strong {
  color: #166354;
  font-size: clamp(26px, 2.5vw, 38px);
  line-height: 1;
}
.stat-card > small { color: #6b7c78; line-height: 1.4; }
.asset-tile small {
  display: block;
  margin-top: 3px;
  color: #6a7a76;
  font-size: 11px;
  font-weight: 650;
}

/* El buscador queda a la izquierda y la convocatoria del histórico a la derecha. */
.liquidation-history-controls { width: 100%; }
.liquidation-history-controls .field { margin-left: auto; }
.liquidation-history-controls .datatable-search { min-width: min(100%, 260px); }

/* Estado administrativo de acreditación no presentada. */
[data-no-presented-fields], .accreditation-not-presented-fields {
  margin-top: 4px;
  padding: 15px;
  border: 1px solid rgba(181, 58, 58, .2);
  border-radius: 13px;
  background: #fffafa;
}

@media (max-width: 1199.98px) {
  .report-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .report-filter-grid .align-end { grid-column: span 4; justify-self: end; }
}

@media (max-width: 991.98px) {
  .faq-layout { grid-template-columns: 1fr; }
  .faq-categories {
    position: static;
    display: flex;
    overflow-x: auto;
    padding-bottom: 12px;
  }
  .faq-categories h3 { display: none; }
  .faq-categories button { width: auto; flex: 0 0 auto; white-space: nowrap; }
  .report-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-filter-grid .align-end { grid-column: span 2; }
  .report-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .faq-hero { align-items: flex-start; flex-wrap: wrap; padding: 18px; }
  .faq-hero > .iconify { width: 40px; height: 40px; }
  .faq-hero .btn { margin-left: 58px; }
  .faq-accordion { padding: 3px 16px; }
  .faq-accordion summary { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .faq-accordion summary > span:first-child { grid-column: 1 / -1; }
  .faq-accordion details p { padding-left: 0; }
  .report-filter-grid { grid-template-columns: 1fr; }
  .report-filter-grid .align-end { grid-column: auto; justify-self: stretch; }
  .report-filter-grid .align-end .btn { width: 100%; justify-content: center; }
  .report-stat-grid { grid-template-columns: 1fr; }
  .liquidation-history-controls { align-items: stretch; }
  .liquidation-history-controls .datatable-search,
  .liquidation-history-controls .field { width: 100%; max-width: none; margin-left: 0; }
}

@media print {
  body:has(.report-stat-grid) .sidebar,
  body:has(.report-stat-grid) .topbar,
  body:has(.report-stat-grid) .footer,
  body:has(.report-stat-grid) .report-filter-card,
  body:has(.report-stat-grid) .section-title .actions,
  body:has(.report-stat-grid) .datatable-controls,
  body:has(.report-stat-grid) .datatable-pagination { display: none !important; }
  body:has(.report-stat-grid) .main-content { margin: 0 !important; padding: 0 !important; }
  body:has(.report-stat-grid) .card,
  body:has(.report-stat-grid) .stat-card { box-shadow: none !important; break-inside: avoid; }
  body:has(.report-stat-grid) .table-responsive { overflow: visible !important; }
  body:has(.report-stat-grid) table { font-size: 9pt; }
}

.communication-reader-card { max-width: 980px; margin-inline: auto; }
.communication-reader-card .role-kicker {
  margin-bottom: 6px;
  color: #166354;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.communication-reader-card .section-title { align-items: flex-start; }
.communication-attachments { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e2eae7; }
.communication-attachments h3 { margin: 0 0 12px; }
@media (max-width: 767.98px) {
  .communication-reader-card .section-title { display: grid; gap: 12px; }
  .communication-reader-card .section-title .btn { width: max-content; }
}

/* Update 137: inbox de comunicaciones, analíticas, FAQ y asistentes secuenciales */
.mail-app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 680px;
  padding: 0;
  overflow: hidden;
}
.mail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px;
  border-right: 1px solid #e2eae7;
  background: #fbfcfc;
}
.mail-compose-btn { width: 100%; justify-content: center; min-height: 46px; }
.mail-folders { display: grid; gap: 5px; }
.mail-folders a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #52635f;
  font-weight: 700;
}
.mail-folders a .iconify { width: 21px; height: 21px; flex: 0 0 auto; }
.mail-folders a b { margin-left: auto; font-size: 12px; }
.mail-folders a:hover,
.mail-folders a.active { color: #fff; background: #166354; }
.mail-help { margin-top: auto; display: grid; gap: 5px; padding: 13px; border-radius: 12px; background: rgba(22,99,84,.08); }
.mail-help small { color: #62736f; line-height: 1.45; }
.mail-main { min-width: 0; background: #fff; }
.mail-toolbar {
  min-height: 77px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 22px;
  border-bottom: 1px solid #e2eae7;
}
.mail-toolbar > div:first-child { min-width: 0; }
.mail-toolbar h2 { margin: 0 0 3px; font-size: 20px; }
.mail-toolbar p { margin: 0; color: #6a7a76; font-size: 13px; }
.mail-toolbar-spacer { flex: 1 1 auto; }
.mail-search { margin-left: auto; width: min(300px, 100%); display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #d8e3df; border-radius: 10px; background: #f8faf9; }
.mail-search input { width: 100%; padding: 0; border: 0; background: transparent; box-shadow: none; }
.mail-list { display: grid; }
.mail-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 70px;
  padding: 12px 22px;
  border-bottom: 1px solid #e8eeec;
  color: #263a35;
}
.mail-row:hover { background: #f3f8f6; }
.mail-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(22,99,84,.1); color: #166354; }
.mail-avatar .iconify { width: 21px; height: 21px; }
.mail-row-main { min-width: 0; display: grid; gap: 3px; }
.mail-row-main strong,
.mail-row-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-main small { color: #6a7a76; }
.mail-row-meta { display: grid; justify-items: end; gap: 5px; }
.mail-row-meta time { color: #788783; font-size: 12px; white-space: nowrap; }
.mail-compose-form,
.template-editor { display: grid; gap: 15px; padding: 22px; }
.mail-compose-row { display: grid; grid-template-columns: 110px minmax(0,1fr); align-items: center; gap: 12px; }
.mail-compose-row label { margin: 0; font-weight: 750; }
.mail-subject input { border-width: 0 0 1px; border-radius: 0; padding-inline: 0; font-size: 17px; }
.mail-compose-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.mail-compose-actions { display: flex; justify-content: space-between; gap: 12px; padding-top: 17px; border-top: 1px solid #e2eae7; }
.mail-compose-actions > div { display: flex; gap: 9px; }
.mail-message { padding: 24px; }
.mail-message header { position: relative; padding-right: 160px; border-bottom: 1px solid #e4ebe8; padding-bottom: 18px; }
.mail-message header h2 { margin: 0 0 8px; }
.mail-message header p { margin: 0; color: #52635f; }
.mail-message header > small { position: absolute; top: 4px; right: 0; color: #74837f; }
.mail-message-body { padding: 24px 0; line-height: 1.7; overflow-wrap: anywhere; }
.mail-attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0; border-top: 1px solid #e4ebe8; }
.mail-attachments a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 9px; background: rgba(22,99,84,.08); color: #166354; font-weight: 700; }
.mail-message footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid #e4ebe8; color: #64746f; }
.mail-main .empty-state { min-height: 300px; display: grid; place-content: center; justify-items: center; gap: 8px; color: #6b7b77; }
.mail-main .empty-state .iconify { width: 52px; height: 52px; color: #166354; opacity: .7; }

.faq-categories button { border: 1px solid #dde7e3; background: #fff; color: #415550; }
.faq-categories button:hover { border-color: rgba(22,99,84,.35); color: #166354; background: rgba(22,99,84,.06); }
.faq-categories button.active { border-color: #166354; color: #fff; background: #166354; box-shadow: 0 6px 16px rgba(22,99,84,.18); }
.faq-accordion details p { white-space: pre-line; }

.report-stat-grid-spaced { gap: 20px !important; margin-bottom: 30px !important; }
.report-block { margin-top: 24px; }
.report-executive-summary { margin-top: 8px; margin-bottom: 28px; }

.wizard-step.locked {
  cursor: not-allowed;
  opacity: .48;
  filter: grayscale(.25);
  pointer-events: none;
}
.wizard-step.locked > span { background: #dfe6e4 !important; color: #697873 !important; }

body.nicedash-body .dashboard-chart-fake { width: 100%; min-width: 0; }
body.nicedash-body .asset-tile small { display: block; margin-top: 5px; }
.dashboard-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0,1.35fr) minmax(300px,.9fr) minmax(280px,.8fr);
  gap: 22px;
  margin: 0 0 24px;
}
.dashboard-analytics-card { min-width: 0; margin: 0; }
.dashboard-analytics-card .section-title { margin-bottom: 16px; }
.analytics-total { color: #166354; font-size: 26px; }
.analytics-bars { min-height: 240px; display: grid; grid-template-columns: repeat(12,minmax(16px,1fr)); gap: 8px; align-items: end; padding: 18px 3px 0; border-bottom: 1px solid #e1e9e6; }
.analytics-bar-item { height: 220px; min-width: 0; display: grid; grid-template-rows: 22px minmax(0,1fr) 24px; gap: 4px; align-items: end; text-align: center; }
.analytics-bar-value { font-size: 10px; color: #62736f; opacity: 0; transition: opacity .15s ease; }
.analytics-bar-item:hover .analytics-bar-value { opacity: 1; }
.analytics-bar-track { height: 100%; display: flex; align-items: end; justify-content: center; border-radius: 8px 8px 0 0; background: linear-gradient(to top,rgba(22,99,84,.05),transparent); overflow: hidden; }
.analytics-bar-track i { display: block; width: min(22px,70%); min-height: 3px; border-radius: 7px 7px 0 0; background: #166354; }
.analytics-bar-item small { color: #6d7d79; font-size: 11px; }
.dashboard-ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dashboard-ranking li { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #e7eeeb; }
.dashboard-ranking li:last-child { border-bottom: 0; }
.ranking-position { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: rgba(22,99,84,.1); color: #166354; font-weight: 800; font-size: 12px; }
.dashboard-ranking li > div { min-width: 0; display: grid; gap: 3px; }
.dashboard-ranking li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.dashboard-ranking li small { color: #6e7e7a; }
.dashboard-ranking li b { color: #166354; font-size: 16px; }
.dashboard-ranking .empty-ranking { display: block; color: #6e7e7a; border: 0; }

@media (max-width: 1299.98px) {
  .dashboard-analytics-grid { grid-template-columns: minmax(0,1.2fr) minmax(300px,.8fr); }
  .dashboard-sede-ranking { grid-column: 1 / -1; }
}
@media (max-width: 991.98px) {
  .mail-app { grid-template-columns: 1fr; }
  .mail-sidebar { border-right: 0; border-bottom: 1px solid #e2eae7; padding: 14px; }
  .mail-folders { display: flex; overflow-x: auto; padding-bottom: 3px; }
  .mail-folders a { flex: 0 0 auto; }
  .mail-help { display: none; }
  .dashboard-analytics-grid { grid-template-columns: 1fr; }
  .dashboard-sede-ranking { grid-column: auto; }
}
@media (max-width: 767.98px) {
  .mail-toolbar { align-items: flex-start; flex-wrap: wrap; padding: 15px; }
  .mail-search { width: 100%; margin-left: 0; }
  .mail-row { grid-template-columns: 36px minmax(0,1fr); padding: 11px 15px; }
  .mail-row-meta { grid-column: 2; justify-items: start; grid-auto-flow: column; align-items: center; }
  .mail-compose-form,.template-editor { padding: 16px; }
  .mail-compose-row,.mail-compose-grid { grid-template-columns: 1fr; }
  .mail-compose-actions { align-items: stretch; flex-direction: column; }
  .mail-compose-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  .mail-compose-actions .btn { justify-content: center; }
  .mail-message { padding: 17px; }
  .mail-message header { padding-right: 0; }
  .mail-message header > small { position: static; display: block; margin-top: 8px; }
  .mail-message footer { flex-direction: column; }
  .analytics-bars { gap: 3px; }
  .analytics-bar-track i { width: 70%; }
}

/* Update 137: equilibrio final de tarjetas analíticas */
@media (min-width: 1400px) {
  body.nicedash-body .dashboard-mini-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1181px) and (max-width: 1399px) {
  body.nicedash-body .dashboard-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
body.nicedash-body .dashboard-chart-fake { width: 100%; min-width: 0; }
body.nicedash-body .asset-tile small { display: inline-block; margin-top: 5px; color: #60716b; }


/* Update 138: configuración, comunicaciones, búsqueda, visor, convocatorias y gráficos */
.configuration-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.configuration-card-grid .placeholder-card {
  min-width: 0;
  align-content: start;
  gap: 10px;
  padding: 22px;
}
.configuration-card-grid .placeholder-card .btn { margin-top: auto; width: max-content; }
.config-card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #166354;
  background: rgba(22,99,84,.1);
}
.config-card-icon .iconify { width: 27px; height: 27px; }

/* Comunicaciones: enviados como vista principal y selección de destinatarios escalable. */
.mail-app { min-width: 0; }
.mail-list-search.nicedash-search-field {
  flex: 0 1 330px;
  width: min(330px,100%);
  margin-left: auto;
}
.mail-list-search input { min-width: 0; }
.recipient-picker-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.recipient-picker-summary > span { color: #63736f; font-size: 13px; font-weight: 700; }
.recipient-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(22,99,84,.2);
  border-radius: 999px;
  background: rgba(22,99,84,.08);
  color: #166354;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.recipient-chip b { font-size: 16px; line-height: 1; }
.recipient-picker-dialog {
  width: min(760px, calc(100vw - 30px));
  max-height: min(780px, calc(100vh - 30px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(18,45,39,.28);
  background: #fff;
}
.recipient-picker-dialog::backdrop { background: rgba(15,35,31,.52); backdrop-filter: blur(2px); }
.recipient-picker-card { display: grid; grid-template-rows: auto auto minmax(220px,1fr) auto; max-height: inherit; }
.recipient-picker-card > header,
.recipient-picker-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px;
}
.recipient-picker-card > header { border-bottom: 1px solid #e3ebe8; }
.recipient-picker-card > footer { border-top: 1px solid #e3ebe8; }
.recipient-picker-card > header h2 { margin: 0; font-size: 20px; }
.recipient-picker-filters { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 12px; padding: 15px 20px; border-bottom: 1px solid #edf2f0; }
.recipient-picker-results { overflow: auto; padding: 8px 20px 16px; }
.recipient-result {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  border-bottom: 1px solid #edf2f0;
  cursor: pointer;
}
.recipient-result:hover { background: #f5f9f7; }
.recipient-result > span { min-width: 0; display: grid; gap: 2px; }
.recipient-result strong,.recipient-result small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipient-result small { color: #697a75; }
.recipient-result em { padding: 4px 8px; border-radius: 999px; background: rgba(22,99,84,.08); color: #166354; font-size: 11px; font-style: normal; font-weight: 750; }

/* Buscador global con sugerencias filtradas en servidor. */
.global-search-form { position: relative; }
.global-search-suggestions {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  width: min(560px, calc(100vw - 28px));
  max-height: min(520px, 70vh);
  overflow: auto;
  border: 1px solid #dfe9e5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(19,52,44,.2);
}
.global-search-suggestion,
.global-search-result {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  color: #253a35;
  border-bottom: 1px solid #edf2f0;
}
.global-search-suggestion:hover,.global-search-result:hover { background: #f3f8f6; }
.global-search-suggestion-icon,.global-search-result-icon {
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 11px;
  color: #166354;
  background: rgba(22,99,84,.09);
}
.global-search-suggestion > span:nth-child(2),.global-search-result > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.global-search-suggestion small,.global-search-result small { color: #166354; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.global-search-suggestion strong,.global-search-result strong,.global-search-suggestion em,.global-search-result em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-search-suggestion em,.global-search-result em { color: #6b7b77; font-size: 12px; font-style: normal; }
.global-search-all { display: block; padding: 12px 14px; color: #166354; text-align: center; font-weight: 800; background: #f7faf9; }
.global-search-empty { padding: 20px; color: #6a7a76; text-align: center; }
.global-search-result-list { display: grid; }
.global-search-results-card .empty-state { min-height: 220px; display: grid; place-content: center; justify-items: center; gap: 10px; color: #64746f; }
.global-search-results-card .empty-state .iconify { width: 46px; height: 46px; color: #166354; }

/* Visor interno para no perder la navegación de la PWA. */
.document-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(10,28,24,.68);
  backdrop-filter: blur(2px);
}
.document-viewer-modal.open { display: grid; }
.document-viewer-card { width: min(1180px, 100%); height: min(860px, calc(100vh - 36px)); display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; border-radius: 18px; background: #fff; box-shadow: 0 28px 85px rgba(0,0,0,.35); }
.document-viewer-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; border-bottom: 1px solid #e1e9e6; }
.document-viewer-card > header h2 { margin: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-viewer-body { min-height: 0; background: #edf2f0; }
.document-viewer-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.document-viewer-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 13px 17px; border-top: 1px solid #e1e9e6; }
body.modal-open { overflow: hidden; }

/* Convocatorias: alta y operativa arriba, listado debajo. */
.convocatorias-stack { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; align-items: start; }
.convocatorias-list-card { grid-column: 1 / -1; }
.operativa-current { display: flex; align-items: center; gap: 13px; padding: 14px; margin-bottom: 16px; border-radius: 13px; background: rgba(22,99,84,.08); }
.operativa-current > .iconify { width: 31px; height: 31px; color: #166354; }
.operativa-current > div { display: grid; gap: 2px; }
.operativa-current small,.operativa-current span { color: #64746f; }
.operativa-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
.convocatorias-table-wrap { overflow-x: auto; }

/* Auditoría. */
.audit-filter-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; align-items: end; }
.audit-search-field { grid-column: span 2; }
.audit-filter-actions { display: flex; justify-content: flex-end; gap: 9px; align-self: end; }

/* FAQ: icono principal encima del título. */
.faq-hero { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-height: 190px; text-align: center; }
.faq-hero > .iconify { width: 54px; height: 54px; color: #166354; }
.faq-hero h2 { margin: 0 0 5px; }
.faq-hero p { margin: 0; }
.faq-hero > .btn { position: absolute; top: 18px; right: 18px; }
.faq-accordion details { scroll-margin-top: 110px; }

/* Gráficos dinámicos del panel. */
.dashboard-overview-chart { min-width: 0; }
.dashboard-overview-chart svg { display: block; width: 100%; min-height: 245px; overflow: visible; }
.chart-axis { stroke: #dbe5e1; stroke-width: 1; }
.dashboard-chart-bar { fill: rgba(22,99,84,.18); transition: fill .16s ease, transform .16s ease; transform-origin: center bottom; }
.dashboard-chart-dot { fill: #166354; stroke: #fff; stroke-width: 2; }
.dashboard-chart-line { fill: none; stroke: #166354; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.dashboard-chart-point { cursor: help; outline: none; }
.dashboard-chart-point:hover .dashboard-chart-bar,.dashboard-chart-point:focus .dashboard-chart-bar { fill: rgba(22,99,84,.55); transform: scaleX(1.08); }
.dashboard-chart-point text { fill: #6b7b77; font-size: 11px; }
.dashboard-chart-help { display: flex; align-items: center; gap: 7px; margin-top: 8px; color: #6a7a76; font-size: 12px; }
.dashboard-chart-help .iconify { color: #166354; }
.dashboard-analytics-grid { grid-template-columns: minmax(0,1.4fr) minmax(300px,.9fr); }
.dashboard-category-card { min-width: 0; }
.category-donut-layout { display: grid; grid-template-columns: minmax(190px,.8fr) minmax(220px,1.2fr); gap: 20px; align-items: center; }
.category-donut-chart svg { width: 100%; max-width: 260px; display: block; margin: auto; }
.donut-bg { fill: none; stroke: #edf2f0; stroke-width: 7; }
.donut-segment { fill: none; stroke-width: 7; stroke-linecap: butt; transform: rotate(-90deg); transform-origin: 21px 21px; cursor: help; transition: stroke-width .15s ease, opacity .15s ease; }
.donut-segment:hover { stroke-width: 8.5; opacity: .86; }
.donut-segment-0,.donut-segment-bg-0{stroke:#166354;background:#166354}.donut-segment-1,.donut-segment-bg-1{stroke:#e28d4f;background:#e28d4f}.donut-segment-2,.donut-segment-bg-2{stroke:#6f88a8;background:#6f88a8}.donut-segment-3,.donut-segment-bg-3{stroke:#9b77a9;background:#9b77a9}.donut-segment-4,.donut-segment-bg-4{stroke:#c4a647;background:#c4a647}.donut-segment-5,.donut-segment-bg-5{stroke:#4d9d93;background:#4d9d93}.donut-segment-6,.donut-segment-bg-6{stroke:#b66c73;background:#b66c73}
.donut-total { fill: #193a32; font-size: 4px; font-weight: 800; }
.donut-caption { fill: #6c7c78; font-size: 2.2px; }
.donut-legend { display: grid; gap: 8px; }
.donut-legend > div { display: grid; grid-template-columns: 12px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid #edf2f0; }
.donut-legend-color { width: 10px; height: 10px; border-radius: 50%; }
.donut-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #52645f; }
.donut-legend strong { color: #166354; }

@media (max-width: 1199.98px) {
  .configuration-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-analytics-grid { grid-template-columns: 1fr; }
  .category-donut-layout { grid-template-columns: minmax(180px,.7fr) minmax(220px,1.3fr); }
}
@media (max-width: 991.98px) {
  .convocatorias-stack { grid-template-columns: 1fr; }
  .convocatorias-list-card { grid-column: auto; }
  .audit-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mail-toolbar .mail-list-search { order: 3; flex-basis: 100%; width: 100%; margin-left: 0; }
}
@media (max-width: 767.98px) {
  .configuration-card-grid { grid-template-columns: 1fr; }
  .recipient-picker-filters { grid-template-columns: 1fr; }
  .recipient-picker-card > header,.recipient-picker-card > footer { padding: 14px; }
  .recipient-picker-filters,.recipient-picker-results { padding-inline: 14px; }
  .recipient-result { grid-template-columns: auto minmax(0,1fr); }
  .recipient-result em { grid-column: 2; justify-self: start; }
  .document-viewer-modal { padding: 0; }
  .document-viewer-card { width: 100%; height: 100%; border-radius: 0; }
  .document-viewer-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .document-viewer-actions .btn { justify-content: center; }
  .audit-filter-grid,.operativa-form { grid-template-columns: 1fr; }
  .audit-search-field { grid-column: auto; }
  .audit-filter-actions { justify-content: stretch; }
  .audit-filter-actions .btn { flex: 1; justify-content: center; }
  .faq-hero { padding-top: 70px; }
  .faq-hero > .btn { left: 18px; right: 18px; justify-content: center; }
  .category-donut-layout { grid-template-columns: 1fr; }
  .global-search-suggestions { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; max-height: calc(100vh - 82px); }
}
