/* =========================================================
   Respaldo global para dashboard y procesos
   Se carga aparte para evitar problemas con css aislado o cache
========================================================= */

.dashboard {
    padding: 24px 18px 48px;
    min-height: calc(100vh - 56px);
    background:
        radial-gradient(1200px 540px at 10% 8%, rgba(29, 78, 216, 0.10), transparent 56%),
        radial-gradient(900px 520px at 88% 18%, rgba(14, 165, 233, 0.08), transparent 52%),
        #f7f9fc;
}

.dashboard__hero {
    display: grid;
    grid-template-columns: 1.6fr 0.9fr;
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard__hero-copy,
.dashboard__hero-card,
.dashboard-panel,
.dashboard-stat,
.dashboard__loading,
.dashboard__empty,
.proc__toolbar,
.proc__card,
.kpi {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.dashboard__hero-copy {
    padding: 28px;
}

.dashboard__eyebrow,
.process-modal__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 11px;
    font-weight: 900;
    color: rgba(11, 42, 90, 0.58);
}

.dashboard__hero-copy h1,
.proc__title h1 {
    margin: 0;
    color: #0b2a5a;
    font-weight: 950;
}

.dashboard__hero-copy h1 {
    margin-top: 10px;
    font-size: 34px;
}

.dashboard__hero-copy p,
.proc__title p,
.dashboard-panel__head p,
.muted,
.kpi__hint {
    color: rgba(11, 42, 90, 0.62);
    font-weight: 600;
}

.dashboard__hero-copy p {
    margin: 0;
    max-width: 720px;
    font-size: 16px;
    line-height: 1.65;
}

.dashboard__user-pill {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #0b2a5a;
    font-weight: 800;
}

.dashboard__hero-card {
    padding: 24px;
    background: linear-gradient(160deg, #0f2d62, #1d4ed8 58%, #0ea5e9);
    color: #fff;
}

.dashboard__hero-label {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 11px;
    font-weight: 900;
    opacity: 0.82;
}

.dashboard__hero-value {
    margin-top: 14px;
    font-size: 52px;
    font-weight: 950;
    line-height: 1;
}

.dashboard__hero-title {
    margin-top: 8px;
    font-size: 18px;
    font-weight: 900;
}

.dashboard__hero-card p {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.86);
    font-weight: 600;
    line-height: 1.6;
}

.dashboard__hero-actions,
.proc__top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.dashboard-btn,
.pbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    padding: 11px 16px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

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

.dashboard-btn--primary,
.pbtn--primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #1f3b82, #2563eb);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}

.dashboard-btn--ghost,
.pbtn--ghost {
    color: #0b2a5a;
    background: rgba(255, 255, 255, 0.94);
}

.pbtn--sm {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
}

.pbtn__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 14px;
    line-height: 1;
}

.dashboard__alert,
.proc__feedback {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 800;
    border: 1px solid transparent;
}

.dashboard__alert--success,
.proc__feedback--success {
    background: rgba(34, 197, 94, 0.10);
    border-color: rgba(34, 197, 94, 0.18);
    color: #166534;
}

.dashboard__alert--error,
.proc__feedback--error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.18);
    color: #b42318;
}

.dashboard__loading,
.dashboard__empty {
    padding: 28px;
    color: #0b2a5a;
}

.dashboard__stats,
.proc__kpis {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

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

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

.dashboard-stat,
.kpi {
    padding: 18px;
}

.dashboard-stat span,
.dashboard-mini-stats span,
.kpi__label {
    display: block;
    color: rgba(11, 42, 90, 0.60);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dashboard-stat strong,
.dashboard-mini-stats strong,
.kpi__value {
    display: block;
    margin-top: 10px;
    color: #0b2a5a;
    font-size: 30px;
    font-weight: 950;
}

.dashboard-stat small {
    display: block;
    margin-top: 8px;
    color: rgba(11, 42, 90, 0.56);
    font-weight: 700;
}

.dashboard-stat--blue {
    border-top: 4px solid #2563eb;
}

.dashboard-stat--green {
    border-top: 4px solid #16a34a;
}

.dashboard-stat--amber {
    border-top: 4px solid #d97706;
}

.dashboard-stat--slate {
    border-top: 4px solid #475569;
}

.dashboard__highlights,
.dashboard__content-grid {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard__highlights {
    grid-template-columns: 1.35fr 0.85fr;
}

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

.dashboard-panel {
    padding: 20px;
}

.dashboard-panel__head,
.proc__card-head,
.proc__card-foot,
.process-modal__head,
.dashboard-agenda-item__top,
.dashboard-process-item__header,
.dashboard-activity-item__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.dashboard-panel__head h2,
.process-modal__head h2,
.proc__card-title {
    margin: 0;
    color: #0b2a5a;
    font-weight: 950;
}

.dashboard-panel__head h2 {
    font-size: 22px;
}

.proc__card-title {
    display: inline-flex;
    align-items: center;
    font-size: 20px;
    gap: 10px;
}

.dashboard-panel__empty,
.proc__no-data {
    padding: 18px;
    border-radius: 18px;
    border: 1px dashed rgba(15, 23, 42, 0.14);
    background: rgba(247, 249, 252, 0.92);
    color: rgba(11, 42, 90, 0.60);
    font-weight: 700;
    text-align: center;
}

.dashboard-agenda-list,
.dashboard-process-list,
.dashboard-activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-agenda-item,
.dashboard-process-item,
.dashboard-activity-item {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 20px;
    background: rgba(247, 249, 252, 0.95);
    text-align: left;
    cursor: pointer;
}

.dashboard-agenda-item {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 14px;
    padding: 14px;
}

.dashboard-agenda-item__date {
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    font-weight: 900;
}

.dashboard-tone--danger {
    background: rgba(239, 68, 68, 0.10);
    color: #b42318;
}

.dashboard-tone--today {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.dashboard-tone--soon {
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
}

.dashboard-tone--normal {
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
}

.dashboard-tag,
.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tag--info {
    background: rgba(37, 99, 235, 0.10);
    border-color: rgba(37, 99, 235, 0.18);
    color: #1d4ed8;
}

.tag--success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.22);
    color: #166534;
}

.tag--neutral {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.14);
    color: #334155;
}

.proc {
    padding: 26px 18px 48px;
    min-height: calc(100vh - 56px);
}

.proc__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.proc__title p {
    margin: 10px 0 0;
    font-size: 16px;
    line-height: 1.6;
}

.proc__toolbar {
    padding: 16px;
    margin-bottom: 18px;
}

.proc__search {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
}

.proc__search-ico,
.proc__card-ico,
.kpi__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 950;
}

.proc__search-ico {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.proc__search input,
.proc__filters select,
.proc__page-size,
.process-modal__close {
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.94);
    color: rgba(11, 42, 90, 0.92);
}

.proc__search input,
.proc__filters select {
    width: 100%;
    border-radius: 14px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 700;
    outline: none;
}

.proc__filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

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

.kpi__ico {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    font-size: 14px;
}

.kpi--ok .kpi__ico {
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
}

.kpi--info .kpi__ico {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.kpi--warn .kpi__ico {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.kpi--danger .kpi__ico {
    background: rgba(239, 68, 68, 0.12);
    color: #b42318;
}

.proc__card {
    padding: 18px;
}

.proc__card-head {
    margin-bottom: 14px;
}

.proc__card-foot {
    margin-top: 16px;
    align-items: center;
}

.proc__card-ico {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.proc__table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.92);
}

.proc__table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.proc__table thead th {
    padding: 15px 12px;
    text-align: left;
    background: rgba(11, 42, 90, 0.03);
    color: #0b2a5a;
    font-size: 13px;
    font-weight: 900;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.proc__table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    color: rgba(11, 42, 90, 0.88);
    font-weight: 700;
    vertical-align: middle;
}

.t-right {
    text-align: right;
}

.row-actions,
.proc__pagination {
    display: inline-flex;
    gap: 10px;
    align-items: center;
}

.proc__page-size {
    min-width: 72px;
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 800;
}

.pager__num {
    color: #0b2a5a;
    font-weight: 900;
}

.process-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(10, 14, 25, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.process-modal-backdrop .process-modal {
    width: min(80vw, 1600px);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(180deg, #f7f9fc, #eef3fb);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
    padding: 22px 22px 16px;
}

.process-modal__head h2 {
    font-size: 28px;
}

.process-modal__head {
    flex: 0 0 auto;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.process-modal__close {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
}

.process-modal .editor-shell {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.process-modal .editor-content {
    min-height: 0;
    overflow: auto;
    padding-right: 10px;
    padding-bottom: 18px;
}

.process-modal .editor-field__select-wrap {
    position: relative;
    display: block;
}

.process-modal .editor-field__select-wrap::after {
    content: "";
    position: absolute;
    top: 9px;
    right: 72px;
    width: 1px;
    height: calc(100% - 18px);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.04), rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.04));
    pointer-events: none;
}

.process-modal .editor-field__select-wrap select {
    width: 100%;
    padding-right: 118px;
}

.process-modal .editor-field__add-btn {
    border: none;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0.11));
    color: #1d4ed8;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.process-modal .editor-field__add-btn--inside {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.process-modal .editor-field__add-btn--inside:hover {
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.18));
    color: #123fb8;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18), 0 8px 18px rgba(37, 99, 235, 0.12);
}

.process-modal .editor-content::-webkit-scrollbar {
    width: 10px;
}

.process-modal .editor-content::-webkit-scrollbar-thumb {
    background: rgba(11, 42, 90, 0.18);
    border-radius: 999px;
}

.process-modal .editor-actions {
    flex: 0 0 auto;
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #eef3fb;
}

.process-modal .editor-obligation-list {
    display: grid;
    gap: 14px;
}

.process-modal .editor-obligation-list__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    color: #5e759c;
    font-size: 14px;
}

.process-modal .editor-obligation-list__head span {
    font-weight: 700;
    color: #334a72;
}

.process-modal .editor-obligation-list__add,
.editor-obligation-list__add {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: linear-gradient(180deg, #f8fbff 0%, #e5efff 100%);
    color: #1d4ed8;
    font-size: 32px;
    font-weight: 500;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65), 0 10px 22px rgba(37, 99, 235, 0.10);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.process-modal .editor-obligation-list__add:hover:not(:disabled),
.editor-obligation-list__add:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #eef5ff 0%, #dbeafe 100%);
    color: #1e40af;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75), 0 14px 28px rgba(37, 99, 235, 0.16);
}

.process-modal .editor-obligation-list__add:active:not(:disabled),
.editor-obligation-list__add:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 6px 14px rgba(37, 99, 235, 0.12);
}

.process-modal .editor-obligation-list__add:disabled,
.editor-obligation-list__add:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.process-modal .editor-obligation-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.7);
}

.process-modal .editor-obligation-row__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 48px;
}

.process-modal .editor-obligation-row__remove,
.editor-obligation-row__remove {
    min-width: 108px;
    height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(220, 38, 38, 0.14);
    background: linear-gradient(180deg, #fff7f7 0%, #ffe8e8 100%);
    color: #b42318;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.process-modal .editor-obligation-row__remove:hover:not(:disabled),
.editor-obligation-row__remove:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #fff1f1 0%, #ffdede 100%);
    border-color: rgba(220, 38, 38, 0.24);
    color: #912018;
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.10);
}

.process-modal .editor-obligation-row__remove:active:not(:disabled),
.editor-obligation-row__remove:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.process-modal .editor-obligation-row__remove:disabled,
.editor-obligation-row__remove:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.process-modal .editor-obligation-list__errors {
    display: grid;
    gap: 6px;
}

@media (max-width: 1100px) {
    .dashboard__hero,
    .dashboard__highlights,
    .dashboard__content-grid,
    .proc__filters,
    .proc__kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .process-modal-backdrop {
        padding: 10px;
    }

    .process-modal-backdrop .process-modal {
        width: min(96vw, 100%);
        max-height: calc(100vh - 20px);
        border-radius: 22px;
    }
}

@media (max-width: 640px) {
    .process-modal-backdrop {
        padding: 0;
    }

    .process-modal-backdrop .process-modal {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        padding: 18px 16px 12px;
    }

    .process-modal .editor-content {
        padding-right: 2px;
    }

    .process-modal .editor-obligation-row {
        grid-template-columns: 1fr;
    }

    .process-modal .editor-obligation-row__actions {
        min-height: 0;
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .dashboard,
    .proc {
        padding-inline: 14px;
    }

    .dashboard__stats,
    .dashboard-mini-stats,
    .dashboard-agenda-item,
    .dashboard-activity-item,
    .proc__filters,
    .proc__kpis {
        grid-template-columns: 1fr;
    }

    .dashboard-panel__head,
    .dashboard__hero-actions,
    .dashboard-agenda-item__top,
    .dashboard-process-item__header,
    .dashboard-activity-item__top,
    .proc__top,
    .proc__card-head,
    .proc__card-foot {
        flex-direction: column;
    }

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

    .t-right {
        text-align: left;
    }

    .row-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}
