/* Paleta corporativa inspirada únicamente en los tonos de la referencia:
   grafito #151E2F, petróleo #12435C, marfil y acento cobre. */
:root {
    --corporate-graphite: #151e2f;
    --corporate-petrol: #12435c;
    --corporate-petrol-soft: #286278;
    --corporate-copper: #b96532;
    --corporate-copper-dark: #8f4826;
    --corporate-ivory: #f5f3ef;
    --corporate-stone: #dedbd4;
    --corporate-sage: #507565;
}

/* Portal público */
body:not(:has(.dashboard)):not(:has(.login-layout)) {
    --ink: var(--corporate-graphite);
    --muted: #687276;
    --blue: var(--corporate-copper);
    --blue-dark: var(--corporate-copper-dark);
    --line: #d9d7d0;
    --bg: var(--corporate-ivory);
    --success: var(--corporate-sage);
    background:
        radial-gradient(circle at 12% 10%, #ebe5dc 0, transparent 32%),
        linear-gradient(145deg, #faf9f6, #efeee9);
}

body:not(:has(.dashboard)):not(:has(.login-layout)) .page-glow--one { background: #ded5c8; }
body:not(:has(.dashboard)):not(:has(.login-layout)) .page-glow--two { background: #e5dfd7; }
body:not(:has(.dashboard)):not(:has(.login-layout)) .site-header { background: rgba(250, 249, 246, .86); }
body:not(:has(.dashboard)):not(:has(.login-layout)) .brand__icon {
    background: linear-gradient(145deg, var(--corporate-petrol), var(--corporate-graphite));
    box-shadow: 0 10px 25px rgba(21, 30, 47, .2);
}
body:not(:has(.dashboard)):not(:has(.login-layout)) .step { background: #eee6dc; color: var(--corporate-copper-dark); }
body:not(:has(.dashboard)):not(:has(.login-layout)) .form-card { border-color: #ddd8cf; box-shadow: 0 30px 70px rgba(21, 30, 47, .11); }
body:not(:has(.dashboard)):not(:has(.login-layout)) textarea:focus { border-color: #a96a46; box-shadow: 0 0 0 4px rgba(185, 101, 50, .1); }
body:not(:has(.dashboard)):not(:has(.login-layout)) .submit-button {
    background: linear-gradient(135deg, var(--corporate-petrol-soft), var(--corporate-petrol));
    box-shadow: 0 11px 23px rgba(18, 67, 92, .22);
}
body:not(:has(.dashboard)):not(:has(.login-layout)) .submit-button:hover:not(:disabled) { box-shadow: 0 14px 28px rgba(18, 67, 92, .3); }
body:not(:has(.dashboard)):not(:has(.login-layout)) .category-result {
    margin-top: 18px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--corporate-petrol);
    background: #edf1ef;
    border: 1px solid #d3dfda;
}
body:not(:has(.dashboard)):not(:has(.login-layout)) .reference { margin-top: 10px; }

/* Login */
.login-layout .login-aside {
    background:
        radial-gradient(circle at 20% 20%, rgba(185, 101, 50, .2), transparent 36%),
        radial-gradient(circle at 85% 80%, rgba(40, 98, 120, .2), transparent 35%),
        var(--corporate-graphite);
}
.login-layout .brand-mark { background: var(--corporate-copper); box-shadow: 0 9px 24px rgba(143, 72, 38, .3); }
.login-layout .eyebrow { color: #d39a76; }
.login-layout .lock { background: #eee7de; color: var(--corporate-copper-dark); }
.login-layout .login-panel { background: radial-gradient(circle at 90% 10%, #e7e1d8, transparent 32%), #f6f4f0; }
.login-layout .login-card input:focus { border-color: #a96a46; box-shadow: 0 0 0 4px rgba(185, 101, 50, .1); }
.login-layout .login-card button { background: var(--corporate-petrol); box-shadow: 0 11px 23px rgba(18, 67, 92, .22); }
.login-layout .login-card button:hover { background: #0d354a; }
.login-layout .back-link:hover { color: var(--corporate-copper-dark); }

/* Dashboard */
body:has(.dashboard) {
    --navy: #111821;
    --sidebar: var(--corporate-graphite);
    --panel: #1b2530;
    --panel-2: #202d39;
    --line: #33414b;
    --text: #edf0ef;
    --muted: #8d989b;
    --blue: var(--corporate-copper);
    --green: #5f8f78;
    --amber: #c99a58;
    --red: #b85f5d;
    background: radial-gradient(circle at 72% -20%, #283941 0, transparent 37%), #111820;
}
body:has(.dashboard) .sidebar { background: linear-gradient(180deg, #172330, #121c27); border-color: #2a3944; }
body:has(.dashboard) .sidebar__brand > span { background: linear-gradient(145deg, var(--corporate-copper), var(--corporate-copper-dark)); }
body:has(.dashboard) .sidebar__brand em { color: #d3946f; }
body:has(.dashboard) .sidebar nav a:hover,
body:has(.dashboard) .sidebar nav a.active { background: #263640; }
body:has(.dashboard) .sidebar nav a.active { box-shadow: inset 3px 0 var(--corporate-copper); }
body:has(.dashboard) .stat-card,
body:has(.dashboard) .panel { background: linear-gradient(145deg, rgba(31, 43, 53, .98), rgba(23, 33, 43, .98)); }
body:has(.dashboard) .stat-card--blue .stat-icon { background: rgba(185, 101, 50, .14); color: #d4946e; }
body:has(.dashboard) .user-chip > span { background: #334852; color: #d9e2df; }
body:has(.dashboard) .live-pill { color: #9bc8b3; background: #213d35; border-color: #365d4f; }
body:has(.dashboard) .chart-track { background: #31404a; }
body:has(.dashboard) .chart-bar--0 { background: var(--corporate-copper); }
body:has(.dashboard) .chart-bar--1 { background: #4d7b70; }
body:has(.dashboard) .chart-bar--2 { background: #88766a; }
body:has(.dashboard) .chart-bar--3 { background: #b8945e; }
body:has(.dashboard) .chart-bar--4 { background: #8b5d58; }
body:has(.dashboard) .status-ring { background: conic-gradient(var(--corporate-copper) var(--progress), #33414b 0); }
body:has(.dashboard) .status-ring::before { background: #1b2530; }
body:has(.dashboard) .filters select,
body:has(.dashboard) .filters input,
body:has(.dashboard) .filters button { background: #18232d; border-color: #3a4a55; }
body:has(.dashboard) .filters input:focus,
body:has(.dashboard) .filters select:focus { border-color: #986344; }
body:has(.dashboard) .badge--procesando { color: #acc3c0; background: #29413f; }
body:has(.dashboard) .id-cell { color: #cb9778; }
body:has(.dashboard) .row-action--edit { border-color: #8f5d40; color: #e0ad8e; }
body:has(.dashboard) .row-action--edit:hover { border-color: #c27a4e; color: #f4d1bd; }
body:has(.dashboard) .row-action--delete { border-color: #95525a; color: #ef9aa5; }
body:has(.dashboard) .row-action--delete:hover { border-color: #c76873; color: #ffd4da; }
body:has(.dashboard) .result-count { background: #293b44; color: #a9b9b8; }
body:has(.dashboard) .detail-dialog { background: #19242e; border-color: #3c4b55; }
body:has(.dashboard) .detail-message { background: #222f39; }

.row-actions { display: flex; gap: 5px; }
.edit-fields { padding: 20px 23px 6px; }
.edit-fields > label:not(.check-field), .edit-grid label { display: grid; gap: 7px; color: #9ca7a8; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.edit-fields textarea, .edit-fields select {
    width: 100%; border: 1px solid #3a4a55; border-radius: 9px; background: #141f28;
    color: #e7ebea; font: inherit; font-size: 12px; outline: none;
}
.edit-fields textarea { margin: 7px 0 15px; padding: 12px; resize: vertical; line-height: 1.6; }
.edit-fields select { height: 39px; padding: 0 10px; margin-top: 7px; }
.edit-fields textarea:focus, .edit-fields select:focus { border-color: #a76946; box-shadow: 0 0 0 3px rgba(185, 101, 50, .1); }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-field { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: #bdc6c5; font-size: 11px; }
.check-field input { accent-color: var(--corporate-copper); }
.edit-error { min-height: 18px; color: #dc8581; font-size: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 23px 20px; }
.dialog-actions button { border: 1px solid #3a4a55; border-radius: 8px; padding: 9px 14px; background: #222f39; color: #c7cfce; font: inherit; font-size: 10px; cursor: pointer; }
.dialog-actions button[type="submit"] { border-color: var(--corporate-copper-dark); background: var(--corporate-copper-dark); color: #fff; }
.dialog-actions button:disabled { opacity: .55; cursor: wait; }
.delete-dialog { width: min(450px, calc(100% - 28px)); max-height: min(88vh, 620px); max-height: min(88dvh, 620px); overflow: auto; overscroll-behavior: contain; border-radius: 18px; }
.delete-dialog__heading { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 42px 1fr 38px; align-items: center; gap: 12px; padding: 17px 18px; background: #fbfaf8; border-bottom: 1px solid #dde3ea; }
.delete-dialog__trash { width: 42px; height: 42px; display: grid; place-items: center; color: #c5141b; background: #fdebed; border-radius: 12px; }
.delete-dialog__trash svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.delete-dialog__heading small { display: block; margin-bottom: 2px; color: #53677e; font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.delete-dialog__heading h2 { margin: 0; color: #132b4a; font-size: 22px; line-height: 1.15; letter-spacing: -.02em; }
.delete-dialog__close { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; color: #33465c; background: #f1f4f7; border: 1px solid #d9e0e7; border-radius: 10px; cursor: pointer; }
.delete-dialog__close:hover { color: #132b4a; background: #e7ecf1; }
.delete-dialog__close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; }
.delete-dialog__body { padding: 20px 18px 4px; }
.delete-dialog__question { margin: 0; color: #142b49; font-size: 17px; line-height: 1.4; }
.delete-dialog__question strong { display: inline-block; padding: 0 7px 1px; color: #0754b6; background: #e3efff; border-radius: 999px; font-weight: 800; }
.delete-dialog__description { margin: 6px 0 16px; color: #52657c; font-size: 13px; line-height: 1.45; }
.delete-dialog__warning { min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 10px 13px; color: #bd1017; background: #fff0f1; border: 1px solid #f3c9cc; border-radius: 11px; }
.delete-dialog__warning span { width: 22px; height: 22px; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; font-size: 13px; font-family: Georgia, serif; font-weight: 800; }
.delete-dialog__warning strong { font-size: 13px; }
.delete-error { min-height: 16px; margin: 7px 0 0; }
.delete-dialog__actions { padding: 12px 18px 18px; border: 0; }
.delete-dialog__actions > button { min-height: 42px; padding: 0 17px; border-radius: 10px; font-size: 12px; font-weight: 750; }
.delete-dialog__actions #cancel-delete { color: #233a56; background: #fff; border-color: #b9c5d2; }
.delete-dialog__actions #cancel-delete:hover { background: #f3f6f8; border-color: #94a5b7; }
.dialog-actions .delete-confirm-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 220px; color: #fff; background: linear-gradient(180deg, #dd1b22, #c4070e); border-color: #ad070d; box-shadow: inset 0 1px rgba(255,255,255,.28), 0 8px 18px rgba(190, 10, 17, .17); }
.dialog-actions .delete-confirm-button:hover:not(:disabled) { background: linear-gradient(180deg, #c9151b, #ab050b); border-color: #92060b; }
.delete-confirm-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 600px) {
    .delete-dialog { width: min(450px, calc(100% - 20px)); }
    .delete-dialog__heading { grid-template-columns: 38px 1fr 36px; gap: 10px; padding: 14px; }
    .delete-dialog__trash { width: 38px; height: 38px; border-radius: 11px; }
    .delete-dialog__heading h2 { font-size: 19px; }
    .delete-dialog__body { padding: 17px 14px 3px; }
    .delete-dialog__question { font-size: 16px; }
    .delete-dialog__description { font-size: 12px; }
    .delete-dialog__actions { flex-direction: column-reverse; padding: 10px 14px 14px; }
    .delete-dialog__actions > button, .dialog-actions .delete-confirm-button { width: 100%; min-width: 0; }
}
@media (max-height: 520px) {
    .delete-dialog__heading { padding-block: 10px; }
    .delete-dialog__body { padding-top: 12px; }
    .delete-dialog__description { margin-bottom: 10px; }
    .delete-dialog__actions { padding-bottom: 10px; }
}

@media (max-width: 500px) {
    .edit-grid { grid-template-columns: 1fr; }
    .row-actions { flex-direction: column; }
}

