:root {
    --navy-950: #050505;
    --navy-900: #0d0d0d;
    --navy-800: #171717;
    --navy-700: #242424;
    --accent: #f7931e;
    --white: #ffffff;
    --slate-50: #121212;
    --slate-100: #1a1a1a;
    --slate-200: #2c2c2c;
    --slate-400: #a3a3a3;
    --slate-500: #cfcfcf;
    --slate-700: #f5f5f5;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-lg: 0 30px 60px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.3);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Open Sans", sans-serif;
    background: #080808;
    color: var(--white);
}

body {
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
strong,
.eyebrow,
.btn,
.sidebar-nav a,
.status {
    font-family: "Montserrat", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-body {
    background:
        radial-gradient(circle at top right, rgba(247, 147, 30, 0.2), transparent 22%),
        linear-gradient(135deg, #020202, #0a0a0a 52%, #151515 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 32px;
    padding: 40px;
    align-items: center;
}

.login-brand {
    color: var(--white);
    padding: 32px;
}

.brand-logo {
    display: block;
    width: 156px;
    max-width: 100%;
    margin: 18px 0 4px;
    filter: drop-shadow(0 14px 28px rgba(247, 147, 30, 0.15));
}

.brand-badge,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
}

.login-brand h1,
.sidebar-brand h1 {
    margin: 18px 0 10px;
    font-size: clamp(46px, 6vw, 72px);
    line-height: 0.95;
    font-weight: 800;
}

.login-brand h1 span,
.sidebar-brand h1 span {
    color: var(--accent);
}

.login-brand p {
    max-width: 560px;
    font-size: 18px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.82);
}

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

.brand-grid article {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(247, 147, 30, 0.18);
    border-radius: var(--radius-md);
    padding: 18px;
    backdrop-filter: blur(12px);
}

.brand-grid strong {
    display: block;
    margin-bottom: 10px;
    color: var(--white);
    font-size: 14px;
}

.brand-grid span {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.6;
}


.login-card {
    position: relative;
    background: rgba(12, 12, 12, 0.96);
    border: 1px solid rgba(247, 147, 30, 0.16);
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-top-line {
    height: 6px;
    background: linear-gradient(90deg, var(--accent), #ff8a3d);
}

.login-card-inner {
    padding: 40px;
}

.login-card h2 {
    margin: 12px 0 8px;
    font-size: 34px;
    font-weight: 800;
    color: var(--white);
}

.muted {
    margin: 0 0 28px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.7;
}

.form-stack {
    display: grid;
    gap: 18px;
}

.form-stack label span {
    display: block;
    margin-bottom: 8px;
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(247, 147, 30, 0.18);
    background: #171717;
    color: var(--white);
    border-radius: 14px;
    padding: 15px 16px;
    font-size: 15px;
    outline: none;
    transition: 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(247, 147, 30, 0.14);
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: #ffffff;
    caret-color: #ffffff;
    box-shadow: 0 0 0 1000px #5b5b5b inset;
    transition: background-color 9999s ease-in-out 0s;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #000000, #111111);
    color: #ffffff;
    border: 1px solid rgba(247, 147, 30, 0.28);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.btn-outline,
.btn-outline-dark {
    border: 1px solid rgba(247, 147, 30, 0.22);
    background: #121212;
    color: var(--white);
}

.btn-primary:hover,
.btn-outline:hover,
.btn-outline-dark:hover {
    transform: translateY(-1px);
}

.btn-outline-light {
    border: 1px solid rgba(247, 147, 30, 0.22);
    background: rgba(255, 255, 255, 0.04);
    color: var(--white);
}

.btn-soft {
    background: #000000;
    color: #ffffff;
    border: 1px solid rgba(247, 147, 30, 0.22);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
}

.btn-success {
    background: #15803d;
    color: var(--white);
}

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.18);
}

.alert-success {
    background: rgba(22, 163, 74, 0.12);
    color: #bbf7d0;
    border: 1px solid rgba(22, 163, 74, 0.18);
}

.login-divider {
    position: relative;
    margin: 10px 0;
    text-align: center;
}

.login-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid var(--slate-200);
}

.login-divider span {
    position: relative;
    display: inline-block;
    padding: 0 12px;
    background: #0c0c0c;
    color: var(--slate-400);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.app-body {
    background:
        radial-gradient(circle at top left, rgba(247, 147, 30, 0.08), transparent 18%),
        linear-gradient(180deg, #f7f7f5 0%, #eceae6 100%);
}

.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    width: 100%;
}

.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px;
    min-width: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(247, 147, 30, 0.18), transparent 22%),
        linear-gradient(180deg, #000000, #0b0b0b);
    color: var(--white);
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 24px;
}

.sidebar-brand-logo {
    display: block;
    width: calc(100% + 10px);
    max-width: 380px;
    height: auto;
    margin-left: -10px;
    filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.24));
}

.user-avatar,
.directory-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.sidebar-nav a {
    padding: 13px 16px;
    border-radius: 16px;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ffffff;
    border: 1px solid rgba(247, 147, 30, 0.12);
    background: rgba(255, 255, 255, 0.02);
    overflow-wrap: anywhere;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #f7931e, #de7e10);
    border-color: #f7931e;
    transform: translateX(2px);
    box-shadow: 0 12px 24px rgba(247, 147, 30, 0.22);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(247, 147, 30, 0.22);
}

.user-avatar,
.directory-avatar {
    background: linear-gradient(135deg, var(--accent), #ffb35d);
    color: #111111;
}

.sidebar-user strong,
.directory-card strong {
    display: block;
}

.sidebar-user span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.main-content {
    padding: 32px;
    min-width: 0;
    max-width: 100%;
}

.page-copy {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.72);
    max-width: 780px;
    line-height: 1.7;
}

.panel .page-copy,
.panel-description,
.directory-card p,
.directory-card span,
.stat-card span {
    color: #6b7280;
}

.page-alert {
    margin-top: 22px;
    padding: 16px 18px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 700;
}

.page-alert.success {
    background: rgba(22, 163, 74, 0.12);
    color: #dcfce7;
    border: 1px solid rgba(22, 163, 74, 0.22);
}

.page-alert.error {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.22);
}

.page-alert.info {
    background: rgba(247, 147, 30, 0.08);
    color: #fed7aa;
    border: 1px solid rgba(247, 147, 30, 0.16);
}

.topbar,
.hero-panel,
.panel,
.stat-card,
.mini-panel,
.directory-card {
    min-width: 0;
    background: #ffffff;
    border: 1px solid rgba(15, 15, 15, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    background:
        linear-gradient(135deg, rgba(0, 0, 0, 1), rgba(12, 12, 12, 0.98)),
        radial-gradient(circle at top right, rgba(247, 147, 30, 0.18), transparent 22%);
    border-color: rgba(247, 147, 30, 0.16);
}

.topbar-main {
    min-width: 0;
    flex: 1 1 680px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.topbar-copy {
    flex: 1 1 360px;
    min-width: 0;
}

.topbar-user-card {
    flex: 0 1 420px;
    min-width: min(280px, 100%);
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 20px;
    border: 1px solid rgba(247, 147, 30, 0.24);
    background: linear-gradient(135deg, #0b0b0b, #141414);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.topbar-user-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: linear-gradient(135deg, #000000, #111111);
    color: #ffffff;
    border: 1px solid rgba(247, 147, 30, 0.22);
    font-family: "Montserrat", sans-serif;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.topbar-user-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.topbar-user-copy small {
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.topbar-user-copy strong {
    font-size: 16px;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-badge,
.topbar-page-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-family: "Montserrat", sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.role-badge {
    border: 1px solid transparent;
}

.role-admin {
    background: #f7931e;
    border-color: #f7931e;
    color: #ffffff;
}

.role-admin_contrato {
    background: rgba(247, 147, 30, 0.18);
    border-color: rgba(247, 147, 30, 0.34);
    color: #ffffff;
}

.role-hsec {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(247, 147, 30, 0.14);
    color: #ffffff;
}

.role-supervisor {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(247, 147, 30, 0.14);
    color: #ffffff;
}

.topbar-page-badge {
    background: #f7931e;
    color: #ffffff;
    border: 1px solid #f7931e;
}

.topbar h2,
.hero-panel h3,
.panel h3 {
    margin: 10px 0 0;
    font-size: 28px;
    font-weight: 800;
}

.topbar h2,
.hero-panel h3 {
    color: #ffffff;
}

.panel h3,
.stat-card strong,
.directory-card strong {
    color: #111111;
}

.hero-panel {
    margin-top: 24px;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background:
        radial-gradient(circle at right top, rgba(247, 147, 30, 0.14), transparent 24%),
        linear-gradient(135deg, rgba(0, 0, 0, 1), rgba(14, 14, 14, 0.98));
    color: var(--white);
}

.hero-panel.compact {
    margin-top: 24px;
    padding: 22px 28px;
}

.analytics-hero {
    position: relative;
    overflow: hidden;
}

.analytics-hero::after {
    content: "";
    position: absolute;
    inset: auto -80px -120px auto;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 68%);
    pointer-events: none;
}

.hero-panel p {
    color: rgba(255, 255, 255, 0.82);
    max-width: 760px;
    line-height: 1.7;
}

.hero-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-chip-list span {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stats-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

.payment-stats-overview {
    margin-top: 24px;
    display: grid;
    grid-template-columns: minmax(180px, 0.55fr) minmax(420px, 1.55fr) minmax(340px, 1.1fr);
    gap: 16px;
    align-items: stretch;
}

.payment-stat-block,
.payment-stat-group {
    min-width: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(216, 225, 237, 0.95);
    border-radius: 18px;
    box-shadow: var(--shadow-md);
}

.payment-stat-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 24px;
}

.payment-stat-label,
.payment-stat-group-header span,
.payment-stat-card span {
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.payment-stat-block strong {
    color: var(--navy-900);
    font-size: 42px;
    line-height: 1;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.payment-stat-group {
    padding: 18px;
}

.payment-stat-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(216, 225, 237, 0.85);
}

.payment-stat-values {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.payment-stat-values.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payment-stat-card {
    min-width: 0;
    overflow: hidden;
    padding: 18px;
    border: 1px solid rgba(216, 225, 237, 0.75);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #f7fafc);
}

.payment-stat-card strong {
    display: block;
    margin-top: 12px;
    color: var(--navy-900);
    font-size: 30px;
    line-height: 1.08;
    font-weight: 850;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-variant-numeric: tabular-nums;
}

.payment-stat-card.highlight {
    border-color: rgba(37, 99, 235, 0.18);
    background: linear-gradient(180deg, #f8fbff, #eef5ff);
}

.payment-stat-card.cost {
    border-color: rgba(234, 88, 12, 0.18);
    background: linear-gradient(180deg, #fffaf5, #fff4ea);
}

.payment-stat-card.utility {
    border-color: rgba(22, 163, 74, 0.18);
    background: linear-gradient(180deg, #f8fffb, #eefbf3);
}

.payment-dashboard-stats {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.payment-summary-card {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    border-radius: 18px;
    border-color: rgba(216, 225, 237, 0.86);
    padding: 22px 24px;
}

.payment-summary-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: #111111;
}

.payment-summary-card span {
    color: var(--navy-800);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.payment-summary-card small {
    display: block;
    margin-top: 7px;
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 700;
}

.payment-summary-card strong {
    max-width: 100%;
    margin-top: 18px;
    font-size: clamp(18px, 1.25vw, 22px);
    line-height: 1.08;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    font-variant-numeric: tabular-nums;
}

.payment-summary-card-count::before {
    background: #111111;
}

.payment-summary-card-edp::before,
.payment-summary-card-total::before {
    background: #f7931e;
}

.payment-summary-card-cost::before {
    background: #ea580c;
}

.payment-summary-card-utility::before {
    background: #16a34a;
}

.payment-summary-card-total {
    background: linear-gradient(180deg, #ffffff, #fff5e9);
}

.payment-summary-card-cost {
    background: linear-gradient(180deg, #ffffff, #fff4ea);
}

.payment-summary-card-utility {
    background: linear-gradient(180deg, #ffffff, #eefbf3);
}

.kpi-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
}

.kpi-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff, #f6f9fd);
    border: 1px solid rgba(216, 225, 237, 0.92);
    box-shadow: var(--shadow-md);
}

.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    border-radius: 24px 0 0 24px;
    background: #111111;
}

.kpi-label {
    display: block;
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.kpi-card strong {
    display: block;
    margin-top: 14px;
    font-size: 34px;
    color: var(--navy-900);
}

.kpi-card p {
    margin: 10px 0 0;
    color: var(--slate-500);
    line-height: 1.6;
    font-size: 14px;
}

.accent-primary::before { background: linear-gradient(180deg, #111111, #000000); }
.accent-success::before { background: linear-gradient(180deg, #15803d, #16a34a); }
.accent-warning::before { background: linear-gradient(180deg, #d97706, #f59e0b); }
.accent-danger::before { background: linear-gradient(180deg, #b91c1c, #dc2626); }
.accent-dark::before { background: linear-gradient(180deg, var(--navy-900), var(--navy-700)); }
.accent-soft::before { background: linear-gradient(180deg, #f7931e, #de7e10); }

.stat-card {
    padding: 24px;
}

.stat-card span {
    display: block;
    color: #6b7280;
    font-size: clamp(11px, 0.95vw, 13px);
    font-weight: 700;
}

.stat-card strong {
    display: block;
    margin-top: 14px;
    color: #111111;
    font-size: clamp(24px, 2.4vw, 34px);
    line-height: 1.12;
    font-weight: 800;
    overflow-wrap: break-word;
    word-break: normal;
    font-variant-numeric: tabular-nums;
}

.payment-cost-kpis {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.payment-cost-kpis .stat-card {
    min-width: 0;
    overflow: hidden;
}

.payment-cost-kpis .stat-card strong {
    max-width: 100%;
    font-size: clamp(21px, 1.7vw, 27px);
    line-height: 1.12;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-variant-numeric: tabular-nums;
}

.content-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: 1.5fr 0.9fr;
    gap: 18px;
}

.analytics-content-grid {
    grid-template-columns: 1.35fr 0.95fr;
}

.panel,
.mini-panel {
    padding: 24px;
}

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

.section-helper {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
    line-height: 1.6;
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.analytics-filter-panel {
    margin-top: 24px;
}

.dashboard-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    align-items: end;
}

.dashboard-filters label {
    display: grid;
    gap: 8px;
}

.dashboard-filters label span {
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
}

.dashboard-filter-actions {
    display: flex;
    justify-content: flex-end;
    align-items: end;
}

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

.analytics-dual-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: 1.35fr 0.85fr;
    gap: 18px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 18px;
}

.analytics-card {
    border: 1px solid rgba(247, 147, 30, 0.12);
    border-radius: 22px;
    padding: 22px;
    background: linear-gradient(180deg, #141414, #0d0d0d);
}

.analytics-card-chart {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    align-items: center;
}

.report-donut {
    width: 220px;
    height: 220px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 0 1px rgba(216, 225, 237, 0.6);
}

.report-donut-center {
    width: 132px;
    height: 132px;
    border-radius: 999px;
    background: #111111;
    display: grid;
    place-items: center;
    text-align: center;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.report-donut-center strong {
    display: block;
    font-size: 34px;
    color: var(--navy-900);
}

.report-donut-center span {
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chart-legend {
    display: grid;
    gap: 12px;
}

.chart-legend-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(247, 147, 30, 0.12);
    border-radius: 16px;
    background: #121212;
}

.chart-legend-item span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    font-weight: 700;
}

.chart-legend-item strong {
    font-size: 13px;
    color: var(--navy-900);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
}

.legend-dot.approved,
.chart-bar-fill.approved {
    background: #16a34a;
}

.legend-dot.pending,
.chart-bar-fill.pending {
    background: #f59e0b;
}

.legend-dot.rejected,
.chart-bar-fill.rejected {
    background: #dc2626;
}

.chart-bars {
    display: grid;
    gap: 16px;
}

.chart-bar-row {
    display: grid;
    gap: 8px;
}

.chart-bar-copy {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.chart-bar-copy span {
    color: var(--slate-700);
    font-size: 14px;
    font-weight: 700;
}

.chart-bar-copy strong {
    color: var(--navy-900);
    font-size: 15px;
}

.chart-bar-track {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    background: #e7edf5;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 999px;
    min-width: 10px;
}

.analytics-summary {
    margin-top: 22px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(18, 64, 122, 0.05);
    border: 1px solid rgba(18, 64, 122, 0.08);
}

.analytics-summary span {
    display: block;
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.analytics-summary strong {
    display: block;
    margin-top: 6px;
    font-size: 18px;
}

.analytics-summary p {
    margin: 10px 0 0;
    color: var(--slate-500);
    line-height: 1.7;
}

.alert-stack {
    display: grid;
    gap: 14px;
}

.insight-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--slate-200);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.insight-card strong {
    display: block;
    font-size: 16px;
}

.insight-card p {
    margin: 8px 0 0;
    color: var(--slate-500);
    line-height: 1.65;
}

.insight-success {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, #f0fdf4, #f7fff9);
}

.insight-warning {
    border-color: #fde68a;
    background: linear-gradient(180deg, #fffbeb, #fffdf4);
}

.insight-danger {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fef2f2, #fff8f8);
}

.insight-neutral {
    border-color: var(--slate-200);
}

.admin-executive-panel {
    border: 1px solid rgba(18, 64, 122, 0.14);
    background:
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

.admin-executive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.admin-executive-card {
    display: grid;
    gap: 9px;
    padding: 18px;
    border: 1px solid var(--slate-200);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 16px 36px rgba(8, 26, 55, 0.08);
}

.admin-executive-card span {
    color: var(--slate-500);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-executive-card strong {
    color: var(--navy-900);
    font-size: 42px;
    line-height: 1;
}

.admin-executive-card p,
.admin-executive-card small {
    margin: 0;
    color: var(--slate-600);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.admin-executive-analysis {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
    gap: 16px;
    margin-top: 18px;
}

.admin-health-meter {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--slate-200);
    background: #ffffff;
}

.admin-health-meter h4 {
    margin: 0 0 8px;
    color: var(--navy-900);
}

.admin-health-meter p {
    margin: 0;
    color: var(--slate-600);
    line-height: 1.55;
}

.admin-health-ring {
    --score: 0;
    width: 116px;
    height: 116px;
    flex: 0 0 116px;
    position: relative;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #ffffff 0 56%, transparent 57%),
        conic-gradient(var(--success) calc(var(--score) * 1%), #e2e8f0 0);
}

.admin-health-ring strong {
    color: var(--navy-900);
    font-size: 24px;
    line-height: 1;
}

.admin-health-ring span {
    position: absolute;
    bottom: 25px;
    color: var(--slate-500);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-executive-alerts {
    display: grid;
    gap: 12px;
}

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

.criticality-card {
    padding: 18px 16px;
    border-radius: 18px;
    border: 1px solid var(--slate-200);
    text-align: center;
}

.criticality-card span {
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.criticality-card strong {
    display: block;
    margin-top: 12px;
    font-size: 30px;
}

.criticality-red {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.criticality-yellow {
    background: #fffbeb;
    border-color: #fde68a;
    color: #a16207;
}

.criticality-green {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.monthly-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.monthly-chart-col {
    display: grid;
    gap: 10px;
    justify-items: center;
}

.monthly-chart-meta {
    text-align: center;
}

.monthly-chart-meta strong {
    display: block;
    font-size: 22px;
    color: var(--navy-900);
}

.monthly-chart-meta span {
    color: var(--slate-500);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.monthly-chart-bar {
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.monthly-chart-stack {
    width: min(72px, 100%);
    min-height: 180px;
    border-radius: 18px 18px 10px 10px;
    background: linear-gradient(180deg, #f8fbff, #edf3fa);
    border: 1px solid var(--slate-200);
    padding: 6px;
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
    justify-content: flex-start;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.monthly-segment {
    display: block;
    width: 100%;
    border-radius: 10px;
    min-height: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.monthly-chart-label {
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
    font-weight: 800;
    color: var(--navy-900);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.monthly-chart-detail {
    display: grid;
    gap: 4px;
    text-align: center;
}

.monthly-chart-detail small {
    color: var(--slate-500);
    font-size: 11px;
    font-weight: 700;
}

.monthly-legend {
    margin-top: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.file-trigger {
    position: relative;
    overflow: hidden;
}

.file-trigger input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.inline-note {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #f7f9fc;
    border: 1px solid var(--slate-200);
    color: var(--slate-500);
    font-size: 14px;
    line-height: 1.6;
}

.inline-file-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 12px;
}

.btn-small {
    padding: 10px 12px;
    font-size: 11px;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(247, 147, 30, 0.08);
    font-size: 14px;
    color: #111111;
}

.data-table th {
    background: #101010;
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table-filter-row th {
    padding-top: 10px;
    padding-bottom: 12px;
    background: #fff8f1;
    border-bottom: 1px solid rgba(247, 147, 30, 0.16);
}

.table-filter-form {
    margin: 0;
}

.table-filter-row input,
.table-filter-row select {
    min-width: 100%;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid rgba(15, 15, 15, 0.14);
    color: #111111;
    border-radius: 12px;
    font-size: 13px;
    text-transform: none;
    letter-spacing: normal;
}

.table-filter-static {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
}

.actions-cell {
    white-space: nowrap;
}

.payment-states-table {
    min-width: 1180px;
    table-layout: fixed;
}

.payment-states-table th,
.payment-states-table td {
    padding: 12px 9px;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: normal;
}

.payment-states-table th {
    font-size: 10px;
    letter-spacing: 0.09em;
    line-height: 1.25;
}

.payment-states-table th:nth-child(1),
.payment-states-table td:nth-child(1) {
    width: 76px;
}

.payment-states-table th:nth-child(2),
.payment-states-table td:nth-child(2) {
    width: 86px;
}

.payment-states-table th:nth-child(3),
.payment-states-table td:nth-child(3) {
    width: 112px;
}

.payment-states-table th:nth-child(4),
.payment-states-table td:nth-child(4),
.payment-states-table th:nth-child(5),
.payment-states-table td:nth-child(5),
.payment-states-table th:nth-child(6),
.payment-states-table td:nth-child(6) {
    width: 118px;
}

.payment-states-table th:nth-child(7),
.payment-states-table td:nth-child(7),
.payment-states-table th:nth-child(8),
.payment-states-table td:nth-child(8),
.payment-states-table th:nth-child(9),
.payment-states-table td:nth-child(9),
.payment-states-table th:nth-child(10),
.payment-states-table td:nth-child(10),
.payment-states-table th:nth-child(11),
.payment-states-table td:nth-child(11) {
    width: 92px;
    white-space: nowrap;
}

.payment-states-table th:nth-child(12),
.payment-states-table td:nth-child(12) {
    width: 74px;
}

.payment-states-table th:nth-child(13),
.payment-states-table td:nth-child(13) {
    width: 185px;
}

.payment-states-table .actions-cell {
    white-space: normal;
    line-height: 1.8;
}

.payment-states-table .status {
    max-width: 100%;
    padding: 6px 8px;
    font-size: 10px;
    letter-spacing: 0.05em;
}

.inline-action-form {
    display: inline;
}

.checkbox-card {
    align-content: center;
    grid-template-columns: auto 1fr;
    align-items: center;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
}

.checkbox-card input {
    width: auto;
}

.table-link {
    color: #fdba74;
    font-weight: 800;
}

.table-link-button {
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.danger-link {
    color: #fca5a5;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.inline-filter select,
select,
textarea {
    width: 100%;
    border: 1px solid var(--slate-200);
    background: var(--white);
    color: var(--navy-900);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 15px;
    outline: none;
}

select:focus,
textarea:focus {
    border-color: var(--navy-800);
    box-shadow: 0 0 0 4px rgba(18, 64, 122, 0.12);
}

.criticality-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.criticality-pill,
.doc-criticality-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 12px;
    font-family: "Montserrat", sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.criticality-pill i,
.doc-criticality-badge i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.criticality-verde {
    background: #ecfdf3 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}

.criticality-verde i {
    background: #16a34a;
}

.criticality-amarillo {
    background: #fffbeb !important;
    border-color: #fcd34d !important;
    color: #b45309 !important;
}

.criticality-amarillo i {
    background: #f59e0b;
}

.criticality-rojo {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #b91c1c !important;
}

.criticality-rojo i {
    background: #dc2626;
}

.criticality-field {
    position: relative;
}

.criticality-select {
    border-width: 2px;
    font-weight: 700;
}

.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.status-pendiente {
    background: #fff7ed;
    color: var(--warning);
}

.status-aprobado {
    background: #f0fdf4;
    color: var(--success);
}

.status-rechazado {
    background: #fef2f2;
    color: var(--danger);
}

.panel-stack {
    display: grid;
    gap: 18px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.plain-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.plain-list li {
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--slate-50);
    color: var(--navy-900);
    font-weight: 700;
}

.plain-list small {
    display: block;
    color: var(--slate-500);
    margin-top: 4px;
}

.plain-list-compact li {
    padding: 10px 12px;
}

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

.rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.rank-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    background: var(--slate-50);
    border: 1px solid var(--slate-100);
}

.rank-list strong {
    display: block;
}

.rank-list small {
    display: block;
    margin-top: 4px;
    color: var(--slate-500);
    line-height: 1.5;
}

.rank-list span {
    min-width: 44px;
    text-align: center;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--white);
    color: var(--navy-900);
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
}

.rank-list .is-empty {
    justify-content: center;
    color: var(--slate-500);
}

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

.directory-card {
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.directory-card p,
.directory-card span {
    margin: 4px 0 0;
    color: var(--slate-500);
}

.directory-main {
    flex: 1;
}

.directory-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

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

.users-grid {
    grid-template-columns: 1.1fr 1fr;
}

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

.audit-path {
    min-width: 220px;
    word-break: break-word;
}

.audit-detail {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 360px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    color: var(--slate-700);
}

.single-column {
    grid-template-columns: 1fr;
}

.approval-grid,
.repeat-stack,
.finding-list,
.timeline {
    display: grid;
    gap: 16px;
}

.approval-grid-three {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.approval-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.approval-module-panel {
    margin-top: 18px;
}

.approval-action-form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.approval-action-form textarea {
    min-height: 74px;
    resize: vertical;
}

.approval-action-inline {
    margin-top: 12px;
}

.approval-card,
.repeat-card,
.timeline-item,
.finding-card {
    border: 1px solid var(--slate-100);
    border-radius: 18px;
    padding: 18px;
    background: var(--white);
}

.approval-card h4,
.finding-card h4 {
    margin: 12px 0 8px;
    font-size: 20px;
}

.approval-card p,
.timeline-item p,
.finding-card p {
    color: var(--slate-700);
    line-height: 1.7;
}

.approval-card small,
.timeline-item small,
.finding-card small {
    display: block;
    color: var(--slate-500);
    margin-bottom: 12px;
}

.report-form-shell {
    display: grid;
    gap: 20px;
    margin-top: 24px;
}

.form-grid {
    display: grid;
    gap: 18px;
}

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

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

.form-grid.five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.form-grid .full {
    grid-column: 1 / -1;
}

.form-grid label,
.review-form label {
    display: grid;
    gap: 8px;
}

.form-grid label span,
.review-form label span {
    color: var(--slate-700);
    font-size: 13px;
    font-weight: 700;
}

.repeat-card {
    position: relative;
}

.remove-row {
    margin-top: 12px;
    border: none;
    background: transparent;
    color: var(--danger);
    font-weight: 700;
    cursor: pointer;
}

.page-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.topbar-actions {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
}

.topbar-brand-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(247, 147, 30, 0.28);
    background: #000000;
}

.topbar-brand-logo {
    display: block;
    width: 170px;
    max-width: 100%;
    height: auto;
}

.topbar-actions .btn {
    max-width: 100%;
    white-space: nowrap;
}

.review-form {
    display: grid;
    gap: 14px;
}

.button-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

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

.detail-grid div {
    background: var(--slate-50);
    border-radius: 16px;
    padding: 14px 16px;
}

.detail-grid strong {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.detail-grid span {
    color: var(--navy-900);
    font-weight: 700;
}

.detail-section {
    margin-top: 22px;
}

.detail-section h4 {
    margin-bottom: 12px;
    font-size: 18px;
}

.finding-head {
    display: flex;
    justify-content: flex-end;
}

.evidence-thumb {
    display: block;
    margin-top: 14px;
    width: 100%;
    max-width: 420px;
    min-height: 180px;
    max-height: 320px;
    border-radius: 14px;
    border: 1px solid var(--slate-200);
    object-fit: contain;
    background: var(--slate-50);
}

.evidence-thumb.large {
    max-width: 100%;
}

.evidence-thumb.is-hidden {
    display: none;
}

.material-reference-preview {
    max-width: 280px;
    min-height: 160px;
    max-height: 240px;
}

.inline-create {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.inline-create.stacked {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
}

.settings-form-stack {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.client-logo-editor {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-start;
}

.client-logo-preview-card {
    display: grid;
    gap: 12px;
    min-width: 220px;
    padding: 14px;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 16px;
}

.client-logo-preview {
    width: 100%;
    max-width: 180px;
    height: 90px;
    object-fit: contain;
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    padding: 10px;
}

.list-with-action {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.list-client-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-client-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: contain;
    background: var(--white);
    border: 1px solid var(--slate-200);
    padding: 6px;
    flex: 0 0 auto;
}

.list-client-logo-fallback {
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, #edf4ff, #dbeafe);
    color: var(--navy-800);
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    padding: 0;
}

.checkbox-line {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.checkbox-line input {
    width: auto;
}

.password-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.password-field input {
    flex: 1;
}

.password-toggle {
    border: 1px solid var(--slate-200);
    background: var(--white);
    color: var(--navy-800);
    border-radius: 12px;
    padding: 12px 14px;
    font-family: "Montserrat", sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s ease;
}

.password-toggle:hover {
    background: var(--slate-50);
}

.field-hint {
    color: var(--slate-500);
    font-size: 12px;
    line-height: 1.5;
}

.empty-row {
    text-align: center;
    color: var(--slate-500);
}

.status-comentario,
.status-verde {
    background: #eff6ff;
    color: var(--navy-800);
}

.status-amarillo {
    background: #fef3c7;
    color: #b45309;
}

.status-rojo {
    background: #fee2e2;
    color: var(--danger);
}

.document-body {
    background: #dfe7f0;
}

.document-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 18px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--slate-200);
    position: sticky;
    top: 0;
    z-index: 10;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.status-chip.approved {
    background: #dcfce7;
    color: var(--success);
}

.status-chip.invalid {
    background: #fee2e2;
    color: var(--danger);
}

.view-switcher-shell {
    margin-top: 24px;
}

.view-switcher {
    display: inline-flex;
    gap: 6px;
    background: #d7e1ee;
    padding: 6px;
    border-radius: 18px;
    box-shadow: inset 0 1px 2px rgba(8, 26, 55, 0.08);
}

.view-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 170px;
    padding: 12px 18px;
    border-radius: 14px;
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-500);
}

.view-tab.active {
    background: var(--white);
    color: var(--navy-900);
    box-shadow: 0 10px 24px rgba(8, 26, 55, 0.1);
}

.document-preview-panel {
    margin-top: 20px;
}

.document-preview-inline {
    margin-top: 8px;
    border-radius: 24px;
    background: linear-gradient(180deg, #dfe7f0, #e8eef6);
    border: 1px solid #cad6e6;
    padding: 18px;
}

.document-stage {
    padding: 28px 20px 60px;
}

.document-standalone {
    max-width: 100%;
}

.doc-preview-container {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    overflow-y: visible;
    padding: 4px 0 20px;
}

.doc-page-wrap {
    position: relative;
    flex: 0 0 auto;
}

.a4-document {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background: var(--white);
    color: var(--navy-900);
    box-shadow: 0 36px 90px rgba(8, 26, 55, 0.2);
    position: relative;
    overflow: hidden;
    padding: 15mm 14mm 16mm;
    transform-origin: top left;
    border: 1px solid #d7e1ee;
}

.a4-document::before {
    content: "";
    position: absolute;
    inset: 0;
    border-top: 12px solid var(--navy-800);
    pointer-events: none;
}

.doc-top-band {
    height: 7mm;
    margin: -15mm -14mm 8mm;
    background: linear-gradient(90deg, var(--navy-950), var(--navy-800) 72%, var(--accent));
}

.doc-header {
    display: grid;
    grid-template-columns: 150px 1fr 190px;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    padding-bottom: 14px;
    border-bottom: 1px solid #dbe4ef;
}

.doc-header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.doc-header-logo img {
    width: auto;
    max-width: 128px;
    max-height: 128px;
    height: auto;
    object-fit: contain;
}

.doc-header-title p {
    margin: 0;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    font-weight: 800;
}

.doc-header-title h1 {
    margin: 10px 0 8px;
    font-size: 25px;
    line-height: 1.18;
}

.doc-header-title span {
    display: inline-block;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.doc-header-status {
    padding: 14px;
    border-radius: 14px;
    border: 2px solid var(--slate-200);
    text-align: center;
}

.doc-header-status strong {
    display: block;
    font-size: 18px;
    margin-bottom: 8px;
}

.doc-header-status small {
    color: var(--slate-500);
    line-height: 1.5;
}

.doc-header-status.approved {
    border-color: #86efac;
    background: #f0fdf4;
    color: var(--success);
}

.doc-header-status.invalid {
    border-color: #fca5a5;
    background: #fef2f2;
    color: var(--danger);
}

.doc-block {
    position: relative;
    z-index: 1;
    margin-top: 14px;
}

.doc-section-head {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: linear-gradient(90deg, var(--navy-900), var(--navy-800));
    color: var(--white);
    border-radius: 10px;
}

.doc-section-head h2 {
    margin: 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.doc-grid-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.doc-grid-meta div,
.doc-stat {
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    padding: 11px 12px;
    background: #fcfdff;
}

.doc-grid-meta strong,
.doc-footer-sgi strong {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--slate-500);
    margin-bottom: 8px;
}

.doc-grid-meta span,
.doc-footer-sgi span {
    font-size: 13px;
    font-weight: 700;
}

.doc-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.doc-stat {
    text-align: center;
}

.doc-stat strong {
    display: block;
    font-size: 30px;
    margin-bottom: 6px;
}

.doc-stat.green strong { color: var(--success); }
.doc-stat.yellow strong { color: var(--warning); }
.doc-stat.red strong { color: var(--danger); }
.doc-stat.blue strong { color: var(--navy-800); }

.payment-a4-document .doc-stat strong {
    font-size: 23px;
    line-height: 1.12;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-variant-numeric: tabular-nums;
}

.payment-doc-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payment-doc-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
}

.payment-doc-table th:nth-child(2),
.payment-doc-table td:nth-child(2),
.money-cell {
    text-align: right;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

.doc-table th,
.doc-table td {
    border: 1px solid var(--slate-200);
    padding: 8px 9px;
    vertical-align: top;
}

.doc-table th {
    background: var(--slate-50);
    color: var(--navy-900);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 11px;
}

.doc-reference-cell {
    text-align: center;
}

.doc-material-reference {
    width: 100%;
    max-width: 110px;
    min-height: 78px;
    max-height: 110px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    object-fit: contain;
    background: #f8fbff;
}

.doc-reference-empty {
    font-size: 11px;
    color: var(--slate-500);
}

.doc-finding {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.85fr);
    gap: 14px;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    background: #ffffff;
    break-inside: avoid;
}

.doc-finding-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.doc-finding-box {
    border: 1px solid #dbe4ef;
    background: #f8fbff;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.doc-finding-box span {
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--slate-500);
}

.doc-finding-copy p {
    margin: 0;
    line-height: 1.55;
}

.doc-finding-copy small,
.doc-no-image {
    color: var(--slate-500);
}

.doc-finding-media img,
.doc-no-image {
    width: 100%;
    min-height: 210px;
    max-height: 235px;
    border-radius: 10px;
    border: 1px solid #dbe4ef;
    object-fit: contain;
    background: #f8fbff;
}

.doc-no-image {
    display: grid;
    place-items: center;
    padding: 20px;
    text-align: center;
}

.doc-project-support {
    margin-top: 10px;
    color: var(--slate-600);
    white-space: pre-wrap;
    line-height: 1.5;
}

.doc-footer-sgi {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--slate-200);
    padding-top: 14px;
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

/* Compact dashboard overrides */
.main-content {
    padding: 26px;
}

.topbar {
    padding: 18px 20px;
}

.topbar h2,
.hero-panel h3,
.panel h3 {
    font-size: 24px;
}

.hero-panel {
    padding: 20px 22px;
}

.hero-panel p {
    max-width: 680px;
    line-height: 1.55;
    margin-bottom: 0;
}

.hero-chip-list {
    gap: 8px;
}

.content-grid,
.analytics-dual-grid,
.kpi-grid {
    margin-top: 18px;
    gap: 14px;
}

.analytics-filter-panel {
    margin-top: 14px;
}

.analytics-filter-panel-compact {
    padding-top: 14px;
    padding-bottom: 14px;
}

.panel,
.mini-panel {
    padding: 18px;
}

.panel-header {
    margin-bottom: 14px;
}

.compact-header {
    margin-bottom: 12px;
}

.section-helper {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.5;
}

.dashboard-filters {
    gap: 12px;
}

.kpi-grid {
    gap: 14px;
}

.kpi-card {
    padding: 16px 18px;
    border-radius: 20px;
}

.kpi-card strong {
    margin-top: 10px;
    font-size: 28px;
}

.kpi-card p {
    margin-top: 6px;
    line-height: 1.45;
    font-size: 13px;
}

.analytics-secondary-grid {
    grid-template-columns: 0.95fr 0.75fr;
}

.analytics-panel-tight {
    margin-top: 0;
}

.analytics-grid {
    gap: 14px;
}

.analytics-card {
    border-radius: 18px;
    padding: 16px;
}

.analytics-card-tight {
    padding: 14px;
}

.analytics-card-chart {
    grid-template-columns: 180px 1fr;
    gap: 14px;
}

.report-donut-compact {
    width: 180px;
    height: 180px;
}

.report-donut-center-compact {
    width: 104px;
    height: 104px;
}

.report-donut-center-compact strong {
    font-size: 28px;
}

.chart-legend,
.chart-bars,
.alert-stack,
.plain-list,
.rank-list,
.panel-stack {
    gap: 10px;
}

.chart-legend-item {
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
}

.chart-legend-item span,
.chart-bar-copy span {
    font-size: 13px;
}

.chart-legend-item strong,
.chart-bar-copy strong {
    font-size: 12px;
}

.analytics-summary {
    margin-top: 14px;
    padding: 14px;
    border-radius: 16px;
}

.analytics-summary strong {
    font-size: 16px;
}

.analytics-summary-tight p {
    display: none;
}

.insight-card {
    padding: 14px;
    border-radius: 16px;
}

.insight-card p {
    margin-top: 6px;
    line-height: 1.5;
    font-size: 13px;
}

.criticality-grid {
    margin-top: 12px;
}

.criticality-card {
    padding: 14px 12px;
    border-radius: 16px;
}

.criticality-card strong {
    margin-top: 8px;
    font-size: 24px;
}

.monthly-chart {
    gap: 10px;
}

.monthly-chart-compact {
    gap: 8px;
}

.monthly-chart-meta strong {
    font-size: 18px;
}

.monthly-chart-bar-compact {
    min-height: 152px;
}

.monthly-chart-stack-compact {
    width: min(56px, 100%);
    min-height: 140px;
    padding: 4px;
    gap: 3px;
}

.monthly-chart-label {
    font-size: 11px;
}

.monthly-chart-detail-inline {
    gap: 2px;
}

.monthly-chart-detail-inline small {
    font-size: 10px;
}

.plain-list li {
    padding: 10px 12px;
    border-radius: 12px;
}

.ranking-grid,
.directory-grid {
    gap: 14px;
}

.rank-list li,
.directory-card {
    padding: 12px;
}


@media print {
    @page {
        size: A4 portrait;
        margin: 8mm;
    }

    .no-print {
        display: none !important;
    }

    .document-body {
        background: var(--white);
    }

    .document-stage {
        padding: 0;
    }

    .doc-preview-container,
    .doc-page-wrap {
        display: block;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .a4-document {
        width: auto;
        min-height: auto;
        margin: 0;
        padding: 10mm 10mm 11mm;
        box-shadow: none;
        transform: none !important;
        border: none;
    }

    .doc-finding,
    .doc-block,
    .doc-table tr,
    .doc-header,
    .doc-footer-sgi {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

@media (max-width: 1240px) {
    .app-layout {
        grid-template-columns: minmax(230px, 260px) minmax(0, 1fr);
    }

    .sidebar {
        padding: 22px;
    }

    .sidebar-brand {
        gap: 12px;
    }

    .sidebar-brand h1 {
        font-size: 28px;
    }

    .sidebar-nav a {
        padding: 12px 14px;
        font-size: 12px;
        letter-spacing: 0.06em;
    }

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

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

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

    .analytics-dual-grid,
    .analytics-grid,
    .analytics-card-chart,
    .admin-executive-grid,
    .admin-executive-analysis,
    .ranking-grid,
    .dashboard-filters {
        grid-template-columns: 1fr;
    }

    .analytics-card-chart {
        justify-items: center;
    }

    .payment-stats-overview {
        grid-template-columns: 1fr;
    }

    .payment-stat-values,
    .payment-stat-values.two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-secondary-grid {
        grid-template-columns: 1fr;
    }

    .monthly-chart,
    .monthly-legend {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

}

@media (max-width: 980px) {
    .login-shell,
    .app-layout,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .brand-grid,
    .stats-grid,
    .directory-grid,
    .kpi-grid,
    .criticality-grid {
        grid-template-columns: 1fr;
    }

    .monthly-chart,
    .monthly-legend {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
        gap: 24px;
    }

    .main-content {
        padding: 20px;
    }

    .hero-panel,
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .payment-stat-values,
    .payment-stat-values.two {
        grid-template-columns: 1fr;
    }

    .topbar-main {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-user-card {
        width: 100%;
        min-width: 0;
    }

    .topbar-actions {
        width: 100%;
    }

    .topbar-actions .btn {
        width: 100%;
    }

    .form-grid.two,
    .form-grid.three,
    .form-grid.five,
    .detail-grid,
    .inline-create.stacked,
    .admin-executive-grid,
    .admin-executive-analysis,
    .analytics-content-grid {
        grid-template-columns: 1fr;
    }

    .document-stage {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* El documento A4 debe conservar siempre su composicion tipo PDF.
   No dejamos que las reglas responsive de la app colapsen el layout interno. */
.doc-preview-container .doc-header {
    grid-template-columns: 150px 1fr 190px !important;
}

.doc-preview-container .doc-grid-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.doc-preview-container .doc-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.doc-preview-container .doc-finding {
    grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.85fr) !important;
}

.doc-preview-container .doc-header-logo {
    min-height: 110px !important;
}

.doc-preview-container .doc-header-logo img {
    max-width: 118px !important;
    max-height: 118px !important;
}

.status-borrador {
    background: rgba(107, 114, 128, 0.18);
    color: #374151;
}

.status-emitido {
    background: rgba(247, 147, 30, 0.18);
    color: #c2410c;
}

.status-aprobado {
    background: rgba(34, 197, 94, 0.16);
    color: #166534;
}

.status-anulado {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}

.status-normal,
.status-presente,
.status-completado,
.status-baja,
.status-a {
    background: #f0fdf4;
    color: var(--success);
}

.status-alerta,
.status-relevo,
.status-apoyo,
.status-en_proceso,
.status-media,
.status-alta,
.status-b {
    background: #fef3c7;
    color: #b45309;
}

.status-critico,
.status-ausente,
.status-detenido,
.status-critica,
.status-art22 {
    background: #fee2e2;
    color: var(--danger);
}

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

.detail-paragraph {
    margin: 0;
    color: var(--slate-700);
    line-height: 1.65;
    white-space: pre-line;
}

.presupuesto-form-shell {
    gap: 24px;
}

.presupuesto-paste-panel {
    border: 1px solid var(--slate-200);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.03), rgba(14, 165, 233, 0.08));
}

.presupuesto-paste-copy strong {
    display: block;
    margin-bottom: 6px;
    color: var(--navy-900);
}

.presupuesto-paste-copy p {
    margin: 0 0 14px;
    color: var(--slate-600);
}

.presupuesto-paste-template {
    display: grid;
    gap: 8px;
    margin: 0 0 16px;
}

.presupuesto-paste-template-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.presupuesto-paste-template-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.presupuesto-template-upload {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(247, 147, 30, 0.28);
    background: #ffffff;
    color: #243447;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    overflow: hidden;
}

.presupuesto-template-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.presupuesto-template-upload span {
    color: #243447 !important;
}

.presupuesto-paste-template-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--navy-800);
}

.presupuesto-paste-template-box {
    border: 1px solid rgba(247, 147, 30, 0.28);
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.presupuesto-paste-template-head {
    padding: 10px 14px;
    background: linear-gradient(135deg, #4f4f4f 0%, #666666 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.presupuesto-paste-template-body {
    margin: 0;
    padding: 12px 14px;
    background: #f8fafc;
    color: #243447;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.presupuesto-paste-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 16px;
    align-items: stretch;
}

.presupuesto-paste-grid textarea {
    min-height: 140px;
    width: 100%;
    resize: vertical;
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    padding: 14px 16px;
    font: inherit;
    color: var(--navy-900);
    background: #fff;
}

.presupuesto-paste-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: flex-start;
}

.presupuesto-paste-actions small {
    color: var(--navy-700);
    line-height: 1.5;
}

.presupuesto-paste-actions small.is-error {
    color: #b42318 !important;
    font-weight: 700;
}

.presupuesto-paste-actions small.is-success {
    color: #1d4f91 !important;
    font-weight: 700;
}

.app-body .presupuesto-paste-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(234, 244, 252, 0.96)) !important;
    border-color: rgba(247, 147, 30, 0.24) !important;
}

.app-body .presupuesto-paste-copy strong,
.app-body .presupuesto-paste-template-label {
    color: #243447 !important;
}

.app-body .presupuesto-paste-template-tools,
.app-body .presupuesto-template-upload,
.app-body .presupuesto-template-upload span {
    color: #243447 !important;
}

.app-body .presupuesto-paste-copy p {
    color: #516273 !important;
}

.app-body .presupuesto-paste-panel,
.app-body .presupuesto-paste-panel * {
    -webkit-text-fill-color: initial;
}

.app-body .presupuesto-paste-copy,
.app-body .presupuesto-paste-copy p,
.app-body .presupuesto-paste-template,
.app-body .presupuesto-paste-template-label,
.app-body .presupuesto-paste-template-body {
    color: #243447 !important;
}

.app-body .presupuesto-paste-template-body {
    color: #314355 !important;
}

.app-body .presupuesto-paste-panel .presupuesto-paste-copy strong,
.app-body .presupuesto-paste-panel .presupuesto-paste-copy p,
.app-body .presupuesto-paste-panel .presupuesto-paste-template-label,
.app-body .presupuesto-paste-panel .presupuesto-paste-template-body,
.app-body .presupuesto-paste-panel .presupuesto-paste-template-box,
.app-body .presupuesto-paste-panel .presupuesto-paste-template-box *:not(.presupuesto-paste-template-head) {
    color: #2b3c4f !important;
}

.app-body .presupuesto-paste-panel .presupuesto-paste-template-head,
.app-body .presupuesto-paste-panel .presupuesto-paste-template-head * {
    color: #ffffff !important;
}

.app-body .presupuesto-paste-template-head {
    color: #ffffff !important;
}

.app-body .presupuesto-paste-template-body {
    color: #2b3c4f !important;
}

.app-body .presupuesto-paste-actions small {
    color: #516273 !important;
}

.app-body .presupuesto-paste-grid textarea {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.presupuesto-annex-shell {
    margin-top: 18px;
}

.presupuesto-annex-form-table td {
    vertical-align: top;
}

.presupuesto-annex-form-table th:nth-child(1) {
    width: 8%;
}

.presupuesto-annex-form-table th:nth-child(2) {
    width: 32%;
}

.presupuesto-annex-form-table th:nth-child(3) {
    width: 48%;
}

.presupuesto-annex-form-table th:nth-child(4) {
    width: 12%;
}

.presupuesto-annex-row-number {
    text-align: center;
    font-weight: 800;
    color: var(--navy-900);
}

.presupuesto-annex-editor {
    display: grid;
    gap: 12px;
}

.presupuesto-annex-paste-field {
    display: grid;
    gap: 6px;
}

.presupuesto-annex-paste-field > span {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--navy-800);
}

.presupuesto-annex-paste-field > small {
    color: var(--slate-500);
    font-size: 13px;
}

.presupuesto-annex-paste-zone {
    width: 100%;
    min-height: 92px;
    padding: 14px 16px;
    border: 1px dashed rgba(18, 64, 122, 0.34);
    border-radius: 14px;
    background: rgba(18, 64, 122, 0.04);
    color: var(--navy-800);
    cursor: text;
    resize: vertical;
    font: inherit;
    line-height: 1.5;
}

.presupuesto-annex-paste-zone::placeholder {
    color: var(--slate-500);
}

.presupuesto-annex-paste-zone:focus {
    outline: none;
    border-color: rgba(14, 165, 233, 0.52);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.presupuesto-annex-paste-zone.is-active {
    border-color: rgba(18, 64, 122, 0.56);
    background: rgba(18, 64, 122, 0.08);
}

.presupuesto-annex-paste-zone.has-image {
    border-style: solid;
    border-color: rgba(11, 122, 61, 0.42);
    background: rgba(11, 122, 61, 0.07);
}

.presupuesto-annex-textarea {
    width: 100%;
    min-height: 110px;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    padding: 12px 14px;
    resize: vertical;
    font: inherit;
    color: var(--navy-900);
    background: #fff;
}

.presupuesto-annex-file-input {
    width: 100%;
}

.presupuesto-annex-preview {
    max-width: 280px;
    min-height: 160px;
    max-height: 240px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
}

.presupuesto-items-table td {
    vertical-align: middle;
}

.presupuesto-items-table {
    min-width: 0 !important;
    table-layout: fixed;
}

.presupuesto-items-table th,
.presupuesto-items-table td {
    padding: 10px 8px;
    font-size: 13px;
}

.presupuesto-items-table th:nth-child(1),
.presupuesto-items-table td:nth-child(1) {
    width: 5%;
    text-align: center;
}

.presupuesto-items-table th:nth-child(2),
.presupuesto-items-table td:nth-child(2) {
    width: 10%;
}

.presupuesto-items-table th:nth-child(3),
.presupuesto-items-table td:nth-child(3) {
    width: 10%;
}

.presupuesto-items-table th:nth-child(4),
.presupuesto-items-table td:nth-child(4) {
    width: 37%;
}

.presupuesto-items-table th:nth-child(5),
.presupuesto-items-table td:nth-child(5) {
    width: 15%;
}

.presupuesto-items-table th:nth-child(6),
.presupuesto-items-table td:nth-child(6) {
    width: 15%;
}

.presupuesto-items-table th:nth-child(7),
.presupuesto-items-table td:nth-child(7) {
    width: 8%;
}

.shift-hero {
    align-items: stretch;
    flex-wrap: wrap;
    background:
        radial-gradient(circle at 88% 10%, rgba(14, 165, 233, 0.28), transparent 32%),
        linear-gradient(135deg, #082f49 0%, #0f172a 54%, #111827 100%);
}

.shift-hero > div:first-child {
    flex: 1 1 420px;
    min-width: 0;
}

.shift-hero .hero-chip-list {
    flex: 0 1 360px;
    justify-content: flex-end;
    align-content: center;
    min-width: 0;
}

.shift-hero .hero-chip-list .btn {
    flex: 1 1 160px;
    max-width: 100%;
    white-space: nowrap;
}

.shift-hero + .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.shift-hero + .stats-grid .stat-card {
    overflow: hidden;
}

.shift-hero + .stats-grid .stat-card strong {
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.1;
    overflow-wrap: break-word;
    word-break: normal;
}

.shift-command-panel {
    border-top: 4px solid #0ea5e9;
}

.shift-edit-table input,
.shift-edit-table select {
    min-width: 150px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    background: var(--white);
    font: inherit;
}

.shift-summary-grid,
.shift-readiness {
    display: grid;
    gap: 14px;
}

.shift-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 22px;
}

.shift-summary-grid article,
.shift-readiness article {
    padding: 18px;
    border: 1px solid var(--slate-100);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.shift-summary-grid span,
.shift-readiness span {
    display: block;
    margin-bottom: 8px;
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.shift-summary-grid p,
.shift-readiness p {
    margin: 0;
    color: var(--slate-700);
    line-height: 1.65;
    white-space: pre-line;
}

.shift-focus-card {
    grid-column: 1 / -1;
    border-color: rgba(14, 165, 233, 0.32) !important;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%) !important;
}

.shift-readiness {
    margin-bottom: 18px;
}

.shift-readiness strong {
    display: block;
    color: var(--navy-900);
    font-size: 34px;
    line-height: 1;
}

.shift-risk-card {
    border-left: 4px solid #f59e0b;
}

.shift-side-panel {
    align-self: start;
}

.shift-personnel-helper {
    margin: -6px 0 16px;
    padding: 12px 14px;
    border: 1px dashed rgba(14, 165, 233, 0.38);
    border-radius: 14px;
    background: #f8fbff;
}

.shift-task-image-block {
    display: grid;
    gap: 12px;
    margin-top: 4px;
}

.shift-doc-status.normal {
    border-color: #86efac;
    background: #f0fdf4;
    color: var(--success);
}

.shift-doc-status.alerta {
    border-color: #fde68a;
    background: #fffbeb;
    color: var(--warning);
}

.shift-doc-status.critico {
    border-color: #fca5a5;
    background: #fef2f2;
    color: var(--danger);
}

.shift-doc-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.shift-doc-summary-grid div {
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    padding: 11px 12px;
    background: #fcfdff;
}

.shift-doc-summary-grid strong {
    display: block;
    margin-bottom: 8px;
    color: var(--slate-500);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.shift-doc-summary-grid p {
    margin: 0;
    line-height: 1.55;
    font-size: 12px;
}

.shift-doc-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shift-doc-staff-table th:nth-child(1) {
    width: 7%;
}

.shift-doc-staff-table th:nth-child(5),
.shift-doc-staff-table th:nth-child(6) {
    width: 12%;
}

.shift-doc-activity {
    grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
}

.shift-doc-badge {
    border: 1px solid var(--slate-200);
    border-radius: 999px;
    padding: 7px 10px;
    background: var(--slate-50);
    color: var(--navy-800);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.presupuesto-cell-input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    color: var(--navy-900);
    background: #fff;
}

.presupuesto-cell-input:focus,
.presupuesto-annex-textarea:focus,
.presupuesto-paste-grid textarea:focus {
    outline: none;
    border-color: rgba(14, 165, 233, 0.45);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.presupuesto-money-input {
    text-align: right;
}

.presupuesto-line-total {
    min-width: 0;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 800;
    color: var(--navy-900);
}

.presupuesto-items-table .actions-cell {
    white-space: normal !important;
    text-align: center;
}

.presupuesto-items-table .table-link {
    display: inline-block;
    font-size: 12px;
    line-height: 1.2;
}

.presupuesto-bottom-grid {
    align-items: start;
}

.presupuesto-totals-panel {
    align-self: start;
}

.presupuesto-totals-stack {
    display: grid;
    gap: 14px;
}

.presupuesto-totals-stack > div {
    border-radius: 18px;
    padding: 18px;
    background: var(--slate-50);
}

.presupuesto-totals-stack span {
    display: block;
    font-size: 12px;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.presupuesto-totals-stack strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    color: var(--navy-900);
}

.presupuesto-totals-stack .grand-total {
    background: linear-gradient(135deg, var(--navy-900), #1d4f91);
}

.presupuesto-totals-stack .grand-total span,
.presupuesto-totals-stack .grand-total strong {
    color: #fff;
}

.presupuesto-inline-rate-field {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.presupuesto-inline-rate-field small {
    color: var(--slate-500);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.presupuesto-inline-rate-field input {
    width: 100%;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    color: var(--navy-900);
    background: #fff;
}

@media print {
    .doc-header {
        grid-template-columns: 150px 1fr 190px !important;
    }

    .doc-grid-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .doc-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .doc-finding {
        grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.85fr) !important;
    }

    .doc-header-logo {
        min-height: 100px !important;
    }

    .doc-header-logo img {
        max-width: 105px !important;
        max-height: 105px !important;
    }
}

@media (max-width: 640px) {
    .login-shell,
    .main-content,
    .sidebar {
        padding: 18px;
    }

    .login-card-inner,
    .panel,
    .mini-panel,
    .topbar,
    .hero-panel,
    .stat-card {
        padding: 16px;
    }

    .login-brand {
        padding: 6px;
    }

    .brand-grid article {
        padding: 16px;
    }

    .login-card h2,
    .topbar h2 {
        font-size: 26px;
    }

    .topbar {
        padding: 18px;
    }

    .topbar-user-card {
        padding: 12px;
    }

    .topbar-user-avatar {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    .client-logo-editor,
    .list-client-item {
        align-items: flex-start;
    }

    .detail-grid-three,
    .presupuesto-paste-grid {
        grid-template-columns: 1fr;
    }
}

/* Codex override: graphite steel palette */
.login-body,
.app-body {
    background-color: #575757 !important;
    background-image:
        radial-gradient(circle at top right, rgba(247, 147, 30, 0.12), transparent 22%),
        radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.12), transparent 28%),
        radial-gradient(circle at 82% 78%, rgba(255, 255, 255, 0.08), transparent 24%),
        repeating-radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.06) 0 1px, rgba(0, 0, 0, 0.06) 1px 2px, transparent 2px 4px),
        linear-gradient(135deg, #3d3d3d 0%, #565656 52%, #6d6d6d 100%) !important;
    background-blend-mode: screen, screen, soft-light, overlay, normal !important;
}

.sidebar,
.topbar,
.hero-panel,
.topbar-user-card,
.topbar-brand-pill,
.sidebar-user {
    background-color: #4f4f4f !important;
    background-image:
        radial-gradient(circle at top right, rgba(247, 147, 30, 0.12), transparent 24%),
        radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.1), transparent 26%),
        radial-gradient(circle at 78% 84%, rgba(255, 255, 255, 0.06), transparent 22%),
        repeating-radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.05) 0 1px, rgba(0, 0, 0, 0.06) 1px 2px, transparent 2px 4px),
        linear-gradient(135deg, #3a3a3a 0%, #505050 56%, #656565 100%) !important;
    background-blend-mode: screen, screen, soft-light, overlay, normal !important;
}

.sidebar-nav a {
    background-color: #494949 !important;
    background-image:
        radial-gradient(circle at 22% 22%, rgba(255, 255, 255, 0.08), transparent 28%),
        repeating-radial-gradient(circle at 35% 40%, rgba(255, 255, 255, 0.04) 0 1px, rgba(0, 0, 0, 0.05) 1px 2px, transparent 2px 4px),
        linear-gradient(135deg, #414141 0%, #535353 100%) !important;
    background-blend-mode: screen, overlay, normal !important;
}

.sidebar-nav a.active,
.sidebar-nav a:hover,
.presupuesto-totals-stack .grand-total,
.btn-primary,
.btn-soft {
    background-color: #505050 !important;
    background-image:
        radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.14), transparent 24%),
        repeating-radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.05) 0 1px, rgba(0, 0, 0, 0.05) 1px 2px, transparent 2px 4px),
        linear-gradient(135deg, #434343 0%, #5b5b5b 100%) !important;
    background-blend-mode: screen, overlay, normal !important;
    color: #ffffff !important;
}

.payment-stat-card.highlight,
.kpi-card,
.shift-summary-grid article,
.shift-readiness article {
    background: linear-gradient(180deg, #ffffff 0%, #f4f4f4 100%) !important;
}

.shift-hero {
    background-color: #4b4b4b !important;
    background-image:
        radial-gradient(circle at 88% 10%, rgba(247, 147, 30, 0.14), transparent 32%),
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.12), transparent 24%),
        repeating-radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.05) 0 1px, rgba(0, 0, 0, 0.06) 1px 2px, transparent 2px 4px),
        linear-gradient(135deg, #3d3d3d 0%, #555555 54%, #696969 100%) !important;
    background-blend-mode: screen, soft-light, overlay, normal !important;
}

.shift-command-panel {
    border-top: 4px solid #f7931e !important;
}

/* Codex override: settings module gray inputs */
.settings-form-stack input,
.settings-form-stack select,
.settings-form-stack textarea,
.inline-create input,
.inline-create select,
.inline-create textarea,
.client-logo-editor input[type="file"] {
    background: linear-gradient(135deg, #4a4a4a 0%, #626262 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.settings-form-stack input::placeholder,
.settings-form-stack textarea::placeholder,
.inline-create input::placeholder,
.inline-create textarea::placeholder {
    color: rgba(255, 255, 255, 0.72) !important;
}

.settings-form-stack input:focus,
.settings-form-stack select:focus,
.settings-form-stack textarea:focus,
.inline-create input:focus,
.inline-create select:focus,
.inline-create textarea:focus,
.client-logo-editor input[type="file"]:focus {
    border-color: rgba(247, 147, 30, 0.62) !important;
    box-shadow: 0 0 0 4px rgba(247, 147, 30, 0.14) !important;
}

.page-actions .btn-outline-dark,
.inline-create.stacked .btn-outline-dark {
    background: linear-gradient(135deg, #4a4a4a 0%, #5f5f5f 100%) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
}

.plain-list li,
.list-with-action {
    background: linear-gradient(135deg, #3f3f3f 0%, #585858 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.plain-list small,
.list-with-action small {
    color: rgba(255, 255, 255, 0.84) !important;
}

.list-client-logo-fallback {
    background: linear-gradient(135deg, #e7e7e7 0%, #ffffff 100%) !important;
    color: #1f1f1f !important;
}

/* Codex override: force gray UI across settings, quotes and users */
.app-body input:not([type="checkbox"]):not([type="radio"]),
.app-body select,
.app-body textarea,
.app-body .password-field input,
.app-body .table-filter-row input,
.app-body .table-filter-row select,
.app-body .dashboard-filters input,
.app-body .dashboard-filters select,
.app-body .inline-create input,
.app-body .inline-create select,
.app-body .inline-create textarea,
.app-body .settings-form-stack input,
.app-body .settings-form-stack select,
.app-body .settings-form-stack textarea,
.app-body .review-form textarea,
.app-body .review-form select,
.app-body .client-logo-editor input[type="file"] {
    background: linear-gradient(135deg, #4b4b4b 0%, #626262 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    -webkit-text-fill-color: #ffffff !important;
}

.app-body input:not([type="checkbox"]):not([type="radio"])::placeholder,
.app-body textarea::placeholder {
    color: rgba(255, 255, 255, 0.74) !important;
}

.app-body .btn-primary,
.app-body .btn-soft,
.app-body .btn-outline-dark,
.app-body .topbar-actions .btn,
.app-body .dashboard-filter-actions .btn,
.app-body .hero-chip-list .btn,
.app-body .page-actions .btn {
    background: linear-gradient(135deg, #4a4a4a 0%, #626262 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16) !important;
}

.app-body .plain-list li,
.app-body .list-with-action,
.app-body .directory-card,
.app-body .approval-card,
.app-body .analytics-card,
.app-body .chart-legend-item {
    background: linear-gradient(135deg, #3f3f3f 0%, #585858 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

.app-body .plain-list small,
.app-body .list-with-action small,
.app-body .directory-card p,
.app-body .directory-card span,
.app-body .approval-card p,
.app-body .approval-card small,
.app-body .chart-legend-item span,
.app-body .chart-legend-item strong {
    color: rgba(255, 255, 255, 0.86) !important;
}

/* Codex override: final global gray theme */
:root {
    --rvt-graphite: #5b5b5b !important;
    --rvt-graphite-dark: #515151 !important;
    --rvt-graphite-light: #666666 !important;
    --navy-950: #3f3f3f !important;
    --navy-900: #4a4a4a !important;
    --navy-800: #575757 !important;
    --navy-700: #666666 !important;
    --slate-50: #4a4a4a !important;
    --slate-100: #555555 !important;
    --slate-200: #666666 !important;
}

.login-card,
.brand-grid article,
.analytics-card,
.report-donut-center,
.chart-legend-item,
.analytics-summary,
.approval-card,
.directory-card,
.sidebar-nav a,
.sidebar-user,
.topbar-user-avatar,
.topbar-brand-pill,
.hero-panel,
.topbar,
.sidebar,
.btn-primary,
.btn-soft,
.btn-outline,
.btn-outline-dark,
.btn-outline-light,
.status,
.presupuesto-totals-stack > div,
.presupuesto-totals-stack .grand-total,
.plain-list li,
.list-with-action,
.directory-avatar,
.user-avatar {
    background-color: var(--rvt-graphite) !important;
    background-image:
        radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.1), transparent 24%),
        linear-gradient(135deg, var(--rvt-graphite-dark) 0%, var(--rvt-graphite-light) 100%) !important;
    color: #ffffff !important;
}

.login-card,
.brand-grid article,
.analytics-card,
.approval-card,
.directory-card,
.plain-list li,
.list-with-action,
.btn-primary,
.btn-soft,
.btn-outline,
.btn-outline-dark,
.btn-outline-light,
.sidebar-nav a,
.sidebar-user,
.topbar-user-card,
.topbar-brand-pill,
.hero-panel,
.topbar,
.sidebar {
    border-color: rgba(255, 255, 255, 0.16) !important;
}

.app-body input:not([type="checkbox"]):not([type="radio"]),
.app-body select,
.app-body textarea,
.login-body input:not([type="checkbox"]):not([type="radio"]),
.login-body select,
.login-body textarea,
.client-logo-editor input[type="file"] {
    background-color: var(--rvt-graphite) !important;
    background-image: linear-gradient(135deg, var(--rvt-graphite-dark) 0%, var(--rvt-graphite-light) 100%) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    -webkit-text-fill-color: #ffffff !important;
}

.app-body input:not([type="checkbox"]):not([type="radio"])::placeholder,
.app-body textarea::placeholder,
.login-body input:not([type="checkbox"]):not([type="radio"])::placeholder,
.login-body textarea::placeholder {
    color: rgba(255, 255, 255, 0.78) !important;
}

.app-body .panel h3,
.app-body .stat-card strong,
.app-body .directory-card strong,
.app-body .chart-bar-copy strong,
.app-body .report-donut-center strong,
.login-body h1,
.login-body h2,
.app-body h2,
.app-body h3,
.app-body h4,
.app-body label span,
.app-body .section-helper,
.app-body .page-copy,
.app-body .muted,
.app-body .dashboard-filters label span {
    color: #ffffff !important;
}

.app-body .table-link,
.app-body .danger-link,
.app-body .plain-list small,
.app-body .list-with-action small,
.app-body .directory-card p,
.app-body .directory-card span,
.app-body .approval-card p,
.app-body .approval-card small,
.app-body .chart-legend-item span,
.app-body .chart-legend-item strong,
.app-body .hero-panel p,
.app-body .sidebar-brand p,
.app-body .sidebar-user span {
    color: rgba(255, 255, 255, 0.88) !important;
}

/* Codex override: presupuesto list readability */
.app-body .data-table tbody td,
.app-body .data-table tbody td span:not(.status),
.app-body .data-table tbody td strong,
.app-body .empty-row {
    color: #1f1f1f !important;
}

.app-body .data-table .actions-cell,
.app-body .data-table .actions-cell span,
.app-body .data-table .inline-action-form,
.app-body .data-table .table-link-button {
    color: #1f1f1f !important;
}

.app-body .data-table .table-link {
    color: #c96d06 !important;
}

.app-body .data-table .danger-link {
    color: #c24141 !important;
}

.app-body .data-table .status {
    background: #6a6a6a !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

/* Codex override: uniform readable surfaces */
.app-body .panel,
.app-body .mini-panel,
.app-body .stat-card,
.app-body .table-wrap,
.app-body .content-grid > .panel,
.app-body .approval-grid > .approval-card:only-child {
    background: #ffffff !important;
    border: 1px solid rgba(247, 147, 30, 0.24) !important;
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.94) !important;
}

.app-body .panel h3,
.app-body .panel .panel-description,
.app-body .panel .section-helper,
.app-body .panel .page-copy,
.app-body .panel label span,
.app-body .panel .field-hint,
.app-body .panel .checkbox-line span,
.app-body .stat-card span,
.app-body .stat-card strong {
    color: #313131 !important;
}

.app-body .stat-card {
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(247, 147, 30, 0.12) inset !important;
}

.app-body .approval-card,
.app-body .directory-card,
.app-body .plain-list li,
.app-body .list-with-action {
    background: linear-gradient(135deg, #565656 0%, #686868 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(247, 147, 30, 0.34) !important;
    box-shadow:
        0 18px 36px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.app-body .approval-card h4,
.app-body .approval-card strong,
.app-body .directory-card strong,
.app-body .plain-list li > span,
.app-body .list-with-action > span {
    color: #ffffff !important;
}

.app-body .approval-card p,
.app-body .approval-card small,
.app-body .directory-card p,
.app-body .directory-card span,
.app-body .directory-card small,
.app-body .plain-list small,
.app-body .list-with-action small {
    color: rgba(255, 255, 255, 0.9) !important;
}

.report-detail-grid {
    grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr) !important;
    align-items: start;
}

.report-detail-grid .panel:first-child {
    min-width: 0;
}

.report-detail-grid .panel-stack {
    position: sticky;
    top: 18px;
    align-self: start;
}

.report-detail-grid .detail-grid {
    gap: 14px;
}

.report-detail-grid .detail-grid div {
    min-width: 0;
}

.report-detail-grid .detail-grid strong {
    line-height: 1.35;
}

.report-detail-grid .detail-grid span {
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.report-detail-grid .detail-section + .detail-section {
    margin-top: 18px;
}

.report-detail-grid .table-wrap {
    overflow-x: visible;
}

.report-detail-grid .data-table {
    min-width: 0 !important;
    table-layout: fixed;
}

.report-detail-grid .data-table th,
.report-detail-grid .data-table td {
    padding: 10px 8px;
    font-size: 12px;
}

.report-detail-grid .data-table th:nth-child(1),
.report-detail-grid .data-table td:nth-child(1) {
    width: 6%;
}

.report-detail-grid .data-table th:nth-child(2),
.report-detail-grid .data-table td:nth-child(2) {
    width: 11%;
}

.report-detail-grid .data-table th:nth-child(3),
.report-detail-grid .data-table td:nth-child(3) {
    width: 12%;
}

.report-detail-grid .data-table th:nth-child(4),
.report-detail-grid .data-table td:nth-child(4) {
    width: 35%;
}

.report-detail-grid .data-table th:nth-child(5),
.report-detail-grid .data-table td:nth-child(5) {
    width: 18%;
}

.report-detail-grid .data-table th:nth-child(6),
.report-detail-grid .data-table td:nth-child(6) {
    width: 18%;
}

.report-detail-grid .data-table td {
    overflow-wrap: anywhere;
}

.report-detail-grid .presupuesto-detail-items-table th:nth-child(1),
.report-detail-grid .presupuesto-detail-items-table td:nth-child(1) {
    width: 6%;
}

.report-detail-grid .presupuesto-detail-items-table th:nth-child(2),
.report-detail-grid .presupuesto-detail-items-table td:nth-child(2) {
    width: 10%;
}

.report-detail-grid .presupuesto-detail-items-table th:nth-child(3),
.report-detail-grid .presupuesto-detail-items-table td:nth-child(3) {
    width: 12%;
}

.report-detail-grid .presupuesto-detail-items-table th:nth-child(4),
.report-detail-grid .presupuesto-detail-items-table td:nth-child(4) {
    width: 31%;
}

.report-detail-grid .presupuesto-detail-items-table th:nth-child(5),
.report-detail-grid .presupuesto-detail-items-table td:nth-child(5) {
    width: 20%;
}

.report-detail-grid .presupuesto-detail-items-table th:nth-child(6),
.report-detail-grid .presupuesto-detail-items-table td:nth-child(6) {
    width: 21%;
}

.report-detail-grid .presupuesto-detail-annex-table th:nth-child(1),
.report-detail-grid .presupuesto-detail-annex-table td:nth-child(1) {
    width: 8%;
}

.report-detail-grid .presupuesto-detail-annex-table th:nth-child(2),
.report-detail-grid .presupuesto-detail-annex-table td:nth-child(2) {
    width: 38%;
}

.report-detail-grid .presupuesto-detail-annex-table th:nth-child(3),
.report-detail-grid .presupuesto-detail-annex-table td:nth-child(3) {
    width: 54%;
}

.report-detail-grid .plain-list {
    gap: 10px;
}

.report-detail-grid .plain-list li {
    padding: 12px 14px !important;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.report-detail-grid .plain-list li small {
    margin-top: 6px;
}

.report-detail-grid .plain-list-multiline {
    white-space: normal;
}

.report-detail-grid .plain-list-multiline br + br {
    display: none;
}

.report-detail-grid .plain-list-multiline small {
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    padding-top: 8px;
}

.report-detail-grid .page-actions {
    margin-top: 18px;
    gap: 14px;
    justify-content: flex-start;
}

.report-detail-grid .page-actions .btn,
.report-detail-grid .page-actions .inline-action-form .btn {
    min-height: 56px;
    min-width: 132px;
    padding: 14px 18px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    white-space: normal;
}

.report-detail-grid .page-actions .inline-action-form {
    display: inline-flex;
}

.report-detail-grid .page-actions .btn-outline-dark {
    min-width: 108px;
}

.report-detail-grid .page-actions .btn-soft,
.report-detail-grid .page-actions .btn-success,
.report-detail-grid .page-actions .btn-primary,
.report-detail-grid .page-actions .btn-danger {
    min-width: 156px;
}

@media (max-width: 1480px) {
    .report-detail-grid {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 0.76fr) !important;
    }

    .report-detail-grid .detail-grid-three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .presupuesto-items-table th,
    .presupuesto-items-table td {
        padding: 9px 6px;
        font-size: 12px;
    }

    .presupuesto-cell-input {
        padding: 9px 10px;
    }

    .presupuesto-line-total {
        font-size: 11px;
    }
}

@media (max-width: 1180px) {
    .report-detail-grid .panel-stack {
        position: static;
    }

    .report-detail-grid .detail-grid-three {
        grid-template-columns: 1fr;
    }
}

.app-body .directory-actions .table-link,
.app-body .approval-card .table-link,
.app-body .list-with-action .table-link {
    color: #ffd199 !important;
}

.app-body .directory-actions .danger-link,
.app-body .approval-card .danger-link,
.app-body .list-with-action .danger-link {
    color: #ffd0d0 !important;
}

.app-body .password-toggle {
    background: #f3f3f3 !important;
    color: #3a3a3a !important;
    border: 1px solid rgba(247, 147, 30, 0.3) !important;
}

.app-body .checkbox-line input[type="checkbox"] {
    accent-color: #f7931e;
}

.app-body .data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.app-body .data-table th {
    background: linear-gradient(135deg, #565656 0%, #686868 100%) !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(247, 147, 30, 0.28) !important;
    box-shadow: inset 0 -1px 0 rgba(247, 147, 30, 0.14) !important;
}

.app-body .data-table th:first-child {
    border-top-left-radius: 14px;
}

.app-body .data-table th:last-child {
    border-top-right-radius: 14px;
}

.app-body .data-table tbody tr:nth-child(even) {
    background: rgba(91, 91, 91, 0.04) !important;
}

.app-body .data-table tbody td {
    color: #2d2d2d !important;
    border-bottom: 1px solid rgba(91, 91, 91, 0.12) !important;
}

.app-body .data-table .actions-cell {
    white-space: normal;
    line-height: 1.8;
}

.app-body .data-table .status,
.app-body .directory-card .status,
.app-body .approval-card .status {
    background: #727272 !important;
    color: #ffffff !important;
    border: 1px solid rgba(247, 147, 30, 0.34) !important;
}

.app-body .status.status-borrador {
    background: rgba(107, 114, 128, 0.18) !important;
    color: #374151 !important;
    border: 1px solid rgba(107, 114, 128, 0.34) !important;
}

.app-body .data-table .status.status-borrador,
.app-body span.status.status-borrador {
    background: rgba(107, 114, 128, 0.18) !important;
    color: #374151 !important;
    border: 1px solid rgba(107, 114, 128, 0.34) !important;
}

.app-body .status.status-emitido {
    background: rgba(247, 147, 30, 0.18) !important;
    color: #c2410c !important;
    border: 1px solid rgba(247, 147, 30, 0.34) !important;
}

.app-body .data-table .status.status-emitido,
.app-body span.status.status-emitido {
    background: rgba(247, 147, 30, 0.18) !important;
    color: #c2410c !important;
    border: 1px solid rgba(247, 147, 30, 0.34) !important;
}

.app-body .status.status-aprobado {
    background: rgba(34, 197, 94, 0.16) !important;
    color: #166534 !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
}

.app-body .data-table .status.status-aprobado,
.app-body span.status.status-aprobado {
    background: rgba(34, 197, 94, 0.16) !important;
    color: #166534 !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
}

.app-body .status.status-anulado {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #b91c1c !important;
    border: 1px solid rgba(239, 68, 68, 0.28) !important;
}

.app-body .data-table .status.status-anulado,
.app-body span.status.status-anulado {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #b91c1c !important;
    border: 1px solid rgba(239, 68, 68, 0.28) !important;
}

/* Codex override: economic summary contrast */
.app-body .presupuesto-totals-stack > div {
    border: 1px solid rgba(247, 147, 30, 0.32) !important;
    box-shadow:
        0 16px 28px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.app-body .presupuesto-totals-stack > div span {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 700 !important;
}

.app-body .presupuesto-totals-stack > div strong {
    color: #ffffff !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.22);
}

.app-body .presupuesto-totals-stack .grand-total {
    background: linear-gradient(135deg, #4c4c4c 0%, #5c5c5c 100%) !important;
    border: 1px solid rgba(247, 147, 30, 0.42) !important;
    box-shadow:
        0 18px 30px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.app-body .presupuesto-totals-stack .grand-total span {
    color: #ffffff !important;
}

.app-body .presupuesto-totals-stack .grand-total strong {
    color: #ffffff !important;
    font-size: 34px !important;
}

.app-body .presupuesto-summary-note {
    color: #505050 !important;
    border: 1px solid rgba(247, 147, 30, 0.2) !important;
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%) !important;
}

.app-body .dashboard-filters input,
.app-body .dashboard-filters select,
.app-body .settings-form-stack input,
.app-body .settings-form-stack select,
.app-body .settings-form-stack textarea,
.app-body .inline-create input,
.app-body .inline-create select,
.app-body .inline-create textarea,
.app-body .review-form textarea,
.app-body .review-form select,
.app-body .password-field input,
.app-body .client-logo-editor input[type="file"] {
    border: 1px solid rgba(247, 147, 30, 0.34) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 8px 18px rgba(0, 0, 0, 0.08) !important;
}

.app-body .dashboard-filters input:focus,
.app-body .dashboard-filters select:focus,
.app-body .settings-form-stack input:focus,
.app-body .settings-form-stack select:focus,
.app-body .settings-form-stack textarea:focus,
.app-body .inline-create input:focus,
.app-body .inline-create select:focus,
.app-body .inline-create textarea:focus,
.app-body .review-form textarea:focus,
.app-body .review-form select:focus,
.app-body .password-field input:focus,
.app-body .client-logo-editor input[type="file"]:focus {
    border-color: rgba(247, 147, 30, 0.62) !important;
    box-shadow:
        0 0 0 3px rgba(247, 147, 30, 0.12),
        0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.app-body .btn-primary,
.app-body .btn-soft,
.app-body .btn-outline-dark,
.app-body .hero-chip-list .btn,
.app-body .page-actions .btn,
.app-body .dashboard-filter-actions .btn,
.app-body .topbar-actions .btn {
    border: 1px solid rgba(247, 147, 30, 0.38) !important;
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.app-body .topbar,
.app-body .hero-panel,
.app-body .topbar-user-card,
.app-body .topbar-brand-pill,
.app-body .sidebar-user,
.app-body .sidebar-nav a {
    border: 1px solid rgba(247, 147, 30, 0.26) !important;
}

/* Codex override: final contrast fix for Section 3 quick paste */
.app-body .presupuesto-paste-panel .presupuesto-paste-copy,
.app-body .presupuesto-paste-panel .presupuesto-paste-copy p,
.app-body .presupuesto-paste-panel .presupuesto-paste-copy strong,
.app-body .presupuesto-paste-panel .presupuesto-paste-template,
.app-body .presupuesto-paste-panel .presupuesto-paste-template-topbar,
.app-body .presupuesto-paste-panel .presupuesto-paste-template-label,
.app-body .presupuesto-paste-panel .presupuesto-paste-template-tools,
.app-body .presupuesto-paste-panel .presupuesto-template-upload,
.app-body .presupuesto-paste-panel .presupuesto-template-upload span,
.app-body .presupuesto-paste-panel .presupuesto-paste-template-body,
.app-body .presupuesto-paste-panel .presupuesto-paste-actions small {
    color: #304254 !important;
    -webkit-text-fill-color: #304254 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

.app-body .presupuesto-paste-panel .presupuesto-paste-copy strong,
.app-body .presupuesto-paste-panel .presupuesto-paste-template-label {
    color: #243447 !important;
    -webkit-text-fill-color: #243447 !important;
}

.app-body .presupuesto-paste-panel .presupuesto-paste-copy p {
    color: #4f6275 !important;
    -webkit-text-fill-color: #4f6275 !important;
}

.app-body .presupuesto-paste-panel .presupuesto-paste-template-body,
.app-body .presupuesto-paste-panel .presupuesto-paste-template-body * {
    color: #5d6e7e !important;
    -webkit-text-fill-color: #5d6e7e !important;
    opacity: 1 !important;
}

.app-body .presupuesto-paste-panel .presupuesto-paste-template-head,
.app-body .presupuesto-paste-panel .presupuesto-paste-template-head * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.app-body .presupuesto-paste-panel .presupuesto-paste-grid textarea,
.app-body .presupuesto-paste-panel .presupuesto-paste-grid textarea::placeholder {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}

.app-body .presupuesto-paste-panel .presupuesto-template-upload {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #243447 !important;
    -webkit-text-fill-color: #243447 !important;
}

.app-body .presupuesto-paste-panel .presupuesto-template-upload input[type="file"] {
    color: #243447 !important;
    -webkit-text-fill-color: #243447 !important;
}

.app-body .presupuesto-paste-panel .presupuesto-template-upload input[type="file"]::file-selector-button {
    background: #f3f4f6;
    color: #243447;
    border: 1px solid rgba(247, 147, 30, 0.26);
    border-radius: 10px;
    padding: 8px 14px;
    margin-right: 12px;
    font-weight: 700;
    cursor: pointer;
}

.app-body .presupuesto-paste-panel .presupuesto-paste-actions small.is-error {
    color: #b42318 !important;
    -webkit-text-fill-color: #b42318 !important;
}

.app-body .presupuesto-paste-panel .presupuesto-paste-actions small.is-success {
    color: #1d4f91 !important;
    -webkit-text-fill-color: #1d4f91 !important;
}

.app-body .section-panel p,
.app-body .section-panel small,
.app-body .presupuesto-form-grid p,
.app-body .presupuesto-form-grid small {
    color: #4f6275;
    -webkit-text-fill-color: #4f6275;
}

/* Codex override: users/settings readability pass */
.app-body .page-alert.success {
    background: #ecfdf3 !important;
    color: #166534 !important;
    border: 1px solid rgba(34, 197, 94, 0.26) !important;
}

.app-body .page-alert.error {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid rgba(239, 68, 68, 0.24) !important;
}

.app-body .page-alert.info {
    background: #fff7ed !important;
    color: #c2410c !important;
    border: 1px solid rgba(247, 147, 30, 0.24) !important;
}

.app-body .directory-actions .table-link,
.app-body .approval-card .table-link,
.app-body .list-with-action .table-link {
    color: #ffd39c !important;
    -webkit-text-fill-color: #ffd39c !important;
    font-weight: 700;
}

.app-body .directory-actions .danger-link,
.app-body .approval-card .danger-link,
.app-body .list-with-action .danger-link {
    color: #ffc1c1 !important;
    -webkit-text-fill-color: #ffc1c1 !important;
    font-weight: 700;
}

.app-body .approval-card .review-form label span,
.app-body .approval-card h4,
.app-body .approval-card strong,
.app-body .directory-card strong,
.app-body .plain-list li > span,
.app-body .list-with-action > span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.app-body .approval-card .review-form .btn-success {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
}

.app-body .approval-card .review-form .btn-danger {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
}

.app-body .panel .field-hint,
.app-body .panel .section-helper,
.app-body .panel .checkbox-line span,
.app-body .panel .page-copy {
    color: #556677 !important;
    -webkit-text-fill-color: #556677 !important;
}
