:root {
    --bg: #f4efe6;
    --panel: #fffdf8;
    --panel-strong: #fffaf1;
    --ink: #192533;
    --muted: #617181;
    --line: #d5c6ae;
    --accent: #0f766e;
    --accent-strong: #0b4f4a;
    --accent-soft: rgba(15, 118, 110, 0.08);
    --warn: #c2410c;
    --shadow: 0 18px 40px rgba(25, 37, 51, 0.08);
    --shadow-soft: 0 8px 20px rgba(25, 37, 51, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
    color: var(--ink);
    line-height: 1.45;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.14), transparent 28%),
        linear-gradient(180deg, #f8f3ea 0%, #f0ebe2 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    align-items: start;
}

.sidebar {
    background: linear-gradient(180deg, #17334a 0%, #102838 100%);
    color: #eff7f5;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(127, 200, 189, 0.34);
    border-radius: 999px;
}

.sidebar h1,
.topbar h2,
.hero h3,
.section-head h3,
.card h4 {
    margin: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 18px;
}

.sidebar-logo {
    width: 100%;
    max-width: 220px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.18));
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #7fc8bd;
}

.muted {
    color: var(--muted);
}

.nav {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.nav a {
    padding: 13px 15px;
    border-radius: 14px;
    color: #eff7f5;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 600;
    transition: background-color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.nav a:hover {
    background: rgba(127, 200, 189, 0.12);
    transform: translateX(2px);
}

.nav a.is-active {
    background: rgba(127, 200, 189, 0.18);
    border-color: rgba(127, 200, 189, 0.28);
}

.content {
    padding: 28px 32px 40px;
    max-width: 1600px;
    width: 100%;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 22px;
}

.userbox {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--panel);
    box-shadow: var(--shadow);
    border: 1px solid rgba(213, 198, 174, 0.7);
}

.button {
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    min-height: 44px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.button.ghost {
    background: transparent;
    color: var(--accent-strong);
    border: 1px solid var(--line);
}

.button:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

button.button {
    font: inherit;
}

.expense-doc-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 150px;
}

.expense-doc-actions .button,
.expense-doc-actions a.button {
    display: block;
    width: 100%;
    min-height: auto;
    padding: 8px 10px;
    line-height: 1.35;
    white-space: normal;
    text-align: center;
}

.report-cell-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
}

.report-cell-actions .compact-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 10px;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
}

.audit-user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.audit-user-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-strong);
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.audit-user-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.audit-user-head h4,
.audit-user-head p {
    margin: 0;
}

.audit-user-head strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    min-height: 46px;
    border-radius: 12px;
    color: #fff;
    background: var(--accent);
    font-size: 1.15rem;
}

.audit-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.audit-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid rgba(15, 118, 110, 0.2);
    color: var(--accent-strong);
    background: var(--accent-soft);
    font-size: 0.84rem;
    font-weight: 600;
}

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

.audit-doc-grid div {
    display: grid;
    align-content: start;
    gap: 4px;
    min-height: 72px;
    padding: 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid rgba(213, 198, 174, 0.55);
    font-size: 0.86rem;
}

.audit-doc-grid div > span:first-child {
    color: var(--muted);
    font-weight: 700;
}

.audit-last-list {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.audit-last-list p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.hero {
    background: linear-gradient(135deg, #fffdf8 0%, #efe4d3 100%);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.hero-grid,
.card-grid,
.stats-grid,
.module-grid,
.summary-strip {
    display: grid;
    gap: 18px;
}

.hero-grid {
    grid-template-columns: 1.5fr 1fr;
    align-items: start;
}

.stats-grid,
.card-grid,
.module-grid,
.summary-strip {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat,
.card,
.module-card,
.login-card,
.notice,
.table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.stat,
.card,
.module-card,
.notice,
.table-wrap {
    padding: 20px;
}

.stat strong {
    display: block;
    font-size: 2rem;
    margin-top: 8px;
    letter-spacing: -0.03em;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin: 26px 0 14px;
}

.report-section-head {
    align-items: flex-start;
    flex-wrap: wrap;
}

.report-section-head > div:first-child {
    min-width: 280px;
    flex: 1 1 420px;
}

.report-head-actions {
    display: flex;
    flex: 0 1 520px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.report-head-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    min-height: 38px;
    padding: 8px 12px;
    line-height: 1.15;
    white-space: nowrap;
    text-align: center;
}

@media (max-width: 900px) {
    .report-head-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .report-head-actions .button {
        flex: 1 1 140px;
    }
}

.module-card p,
.card p,
.hero p,
.notice p {
    line-height: 1.6;
}

.module-card {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-strong) 100%);
}

.module-card h4 {
    margin-bottom: 10px;
}

.login-wrapper {
    min-height: calc(100vh - 120px);
    display: grid;
    place-items: center;
}

.login-card {
    width: min(520px, 100%);
    padding: 28px;
}

.pwa-shell {
    min-height: 100vh;
}

.pwa-page {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 18px;
}

.pwa-hero {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.35fr);
}

.pwa-detail-row {
    box-shadow: var(--shadow-soft);
}

.pwa-signature .signature-pad {
    touch-action: none;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.field label {
    font-weight: 600;
    font-size: 0.96rem;
}

.field input {
    width: 100%;
    min-height: 48px;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.field select,
.field textarea,
td input,
td select {
    width: 100%;
    min-height: 46px;
    padding: 12px 13px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.field textarea {
    min-height: 110px;
    resize: vertical;
}

.client-picker {
    display: grid;
    gap: 10px;
}

.client-search {
    width: 100%;
    min-height: 46px;
    padding: 12px 13px;
    border-radius: 14px;
    border: 1px solid rgba(15, 118, 110, 0.22);
    background: #f8fbfa;
    color: var(--ink);
    font: inherit;
}

.client-summary {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel-strong);
    margin-bottom: 16px;
}

.summary-line {
    font-size: 0.95rem;
    color: var(--ink);
}

.signature-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.signature-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #fffdf8 0%, #f8f1e5 100%);
    box-shadow: var(--shadow-soft);
    padding: 14px;
}

.signature-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.signature-head strong {
    font-size: 0.96rem;
}

.signature-head span {
    color: var(--muted);
    font-size: 0.85rem;
}

.signature-pad {
    width: 100%;
    height: 180px;
    border-radius: 16px;
    border: 1px dashed rgba(15, 118, 110, 0.35);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 245, 237, 0.98)),
        repeating-linear-gradient(
            180deg,
            transparent 0,
            transparent 33px,
            rgba(15, 118, 110, 0.08) 33px,
            rgba(15, 118, 110, 0.08) 34px
        );
    touch-action: none;
    cursor: crosshair;
    display: block;
}

.signature-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.signature-note {
    color: var(--muted);
    font-size: 0.82rem;
}

.field input:focus,
.client-search:focus,
.field select:focus,
.field textarea:focus,
td input:focus,
td select:focus {
    outline: none;
    border-color: rgba(15, 118, 110, 0.55);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.filter-actions {
    display: flex;
    align-items: end;
}

.stack {
    display: grid;
    gap: 18px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid.five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.alert.error {
    background: #fff0eb;
    color: var(--warn);
    border: 1px solid #f7c9b9;
}

.alert.info {
    background: #ecfdf9;
    color: var(--accent-strong);
    border: 1px solid #b8eadf;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #ece2d2;
    vertical-align: top;
}

th {
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: rgba(15, 118, 110, 0.03);
}

.bitacora-merged {
    vertical-align: top;
    min-width: 140px;
}

.bitacora-merged textarea {
    min-height: 220px;
}

.table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table-wrap.compact {
    padding: 10px;
}

.pwa-receipt-detail-table {
    min-width: 1080px;
    table-layout: fixed;
}

.pwa-receipt-detail-table .pwa-col-desecho {
    width: 21%;
}

.pwa-receipt-detail-table .pwa-col-codigo {
    width: 10%;
}

.pwa-receipt-detail-table .pwa-col-unidad {
    width: 8%;
}

.pwa-receipt-detail-table .pwa-col-calculo {
    width: 18%;
}

.pwa-receipt-detail-table .pwa-col-peso {
    width: 10%;
}

.pwa-receipt-detail-table .pwa-col-envase {
    width: 14%;
}

.pwa-receipt-detail-table .pwa-col-fundas {
    width: 9%;
}

.pwa-receipt-detail-table .pwa-col-accion {
    width: 10%;
}

.pwa-receipt-detail-table .detail-cantidad {
    min-width: 0;
}

.pwa-receipt-detail-table .detail-fundas {
    min-width: 0;
}

.pwa-receipt-detail-table td input,
.pwa-receipt-detail-table td select,
.pwa-receipt-detail-table td textarea {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px 7px;
    border-radius: 10px;
    box-sizing: border-box;
}

.pwa-receipt-detail-table td {
    padding: 8px 5px;
}

.pwa-receipt-detail-table .detail-calculo {
    display: block;
    resize: vertical;
}

.pwa-receipt-detail-table th {
    white-space: normal;
    padding-left: 5px;
    padding-right: 5px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 18px;
    margin-bottom: 20px;
    padding: 26px 28px;
    border: 1px solid rgba(213, 198, 174, 0.9);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 28%),
        linear-gradient(135deg, #fffdf8 0%, #f3eadb 100%);
    box-shadow: var(--shadow);
}

.dashboard-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.10);
    color: var(--accent-strong);
    font-size: 0.86rem;
    font-weight: 700;
}

.dashboard-hero-copy h3 {
    margin: 14px 0 10px;
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.dashboard-hero-copy p {
    max-width: 720px;
    margin: 0;
    color: #46586b;
    font-size: 1.02rem;
}

.dashboard-highlight {
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 22px 24px;
    border-radius: 24px;
    background: linear-gradient(180deg, #163549 0%, #0f2a39 100%);
    color: #f6fbfa;
    box-shadow: 0 20px 36px rgba(16, 40, 56, 0.22);
}

.dashboard-highlight-value {
    font-size: clamp(2.6rem, 4vw, 4rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.05em;
}

.dashboard-highlight-copy {
    display: grid;
    gap: 6px;
}

.dashboard-highlight-copy strong {
    font-size: 1.06rem;
}

.dashboard-highlight-copy span {
    color: rgba(239, 247, 245, 0.78);
}

.dashboard-stat-grid,
.dashboard-metric-strip {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.dashboard-stat-grid,
.dashboard-metric-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-stat-card,
.dashboard-metric-card {
    display: grid;
    gap: 8px;
    padding: 18px 20px;
    border-radius: 22px;
    border: 1px solid rgba(213, 198, 174, 0.85);
    background: rgba(255, 253, 248, 0.92);
    box-shadow: var(--shadow-soft);
}

.dashboard-stat-card strong,
.dashboard-metric-card strong {
    font-size: clamp(2rem, 3vw, 2.7rem);
    line-height: 1;
    letter-spacing: -0.05em;
    color: #0f2a39;
}

.dashboard-stat-label,
.dashboard-metric-label {
    color: #536b82;
    font-size: 0.9rem;
    font-weight: 700;
}

.dashboard-stat-note,
.dashboard-metric-note {
    color: var(--muted);
    font-size: 0.92rem;
}

.dashboard-card {
    border-radius: 18px;
    background: #fffdf8;
    border: 1px solid rgba(213, 198, 174, 0.82);
    box-shadow: 0 16px 32px rgba(27, 45, 61, 0.08);
    min-height: 360px;
}

.dashboard-chart {
    margin: 16px 0 18px;
}

.dashboard-empty-chart {
    display: grid;
    place-items: center;
    min-height: 150px;
    margin: 14px 0 18px;
    border: 1px dashed rgba(97, 113, 129, 0.35);
    border-radius: 18px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.42);
}

.bar-chart {
    display: grid;
    gap: 14px;
}

.bar-chart-row {
    display: grid;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(213, 198, 174, 0.28);
}

.bar-chart-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    color: #33475a;
    font-size: 0.92rem;
}

.bar-chart-meta span {
    min-width: 0;
    white-space: normal;
    line-height: 1.25;
}

.bar-chart-meta strong {
    flex: 0 0 auto;
    font-size: 1rem;
    color: #0f2a39;
    font-variant-numeric: tabular-nums;
}

.bar-track {
    height: 16px;
    border-radius: 999px;
    background: rgba(213, 198, 174, 0.34);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    min-width: 6px;
    border-radius: inherit;
}

.grouped-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(72px, 1fr));
    gap: 14px;
    align-items: end;
    min-height: 250px;
    padding: 14px 4px 8px;
    border-bottom: 1px solid rgba(213, 198, 174, 0.78);
}

.grouped-chart-month {
    display: grid;
    gap: 8px;
    align-items: end;
    min-width: 0;
}

.grouped-bars {
    height: 188px;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 8px;
}

.grouped-bar-wrap {
    height: 188px;
    display: grid;
    grid-template-rows: auto 1fr;
    align-items: end;
    justify-items: center;
    gap: 6px;
    min-width: 26px;
}

.grouped-bar-wrap strong {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: #0f2a39;
    font-size: 0.72rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    max-height: 72px;
    overflow: hidden;
}

.grouped-bar {
    width: 20px;
    min-height: 0;
    border-radius: 10px 10px 3px 3px;
}

.grouped-chart-month span {
    min-height: 38px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.15;
    text-align: center;
    font-weight: 700;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: 8px 0 18px;
    color: #536b82;
    font-size: 0.86rem;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.tone-1 {
    background: #0f766e;
}

.tone-2 {
    background: #2563eb;
}

.tone-3 {
    background: #b45309;
}

.tone-4 {
    background: #7c3aed;
}

.tone-5 {
    background: #be123c;
}

.dashboard-head {
    margin-top: 0;
}

.dashboard-head h3 {
    margin: 0 0 6px;
    font-size: 1.08rem;
    letter-spacing: 0;
}

.dashboard-head .muted {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.35;
}

.dashboard-modules {
    margin-top: 8px;
}

.dashboard-module-card {
    border-radius: 24px;
    min-height: 220px;
    display: grid;
    align-content: space-between;
    gap: 18px;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(247, 239, 226, 0.92)),
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 36%);
}

.dashboard-module-card h4 {
    font-size: 1.2rem;
    margin: 0;
}

.dashboard-module-card p {
    margin: 0;
    color: #46586b;
}

.client-admin-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
    gap: 18px;
    margin-bottom: 18px;
    padding: 22px 24px;
    border: 1px solid rgba(197, 168, 119, 0.26);
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(255, 251, 244, 0.98), rgba(244, 236, 223, 0.94)),
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.10), transparent 34%);
    box-shadow: 0 18px 42px rgba(76, 58, 31, 0.08);
}

.client-admin-hero-copy {
    display: grid;
    align-content: center;
    gap: 10px;
}

.client-admin-hero-copy h3 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.client-admin-hero-copy .muted {
    margin: 0;
    max-width: 760px;
}

.client-admin-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.client-summary-card {
    display: grid;
    gap: 8px;
    align-content: space-between;
    min-height: 138px;
    padding: 18px;
    border: 1px solid rgba(197, 168, 119, 0.24);
    border-radius: 22px;
    background: rgba(255, 253, 248, 0.78);
    backdrop-filter: blur(6px);
}

.client-summary-card span,
.client-list-badge {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #0f766e;
}

.client-summary-card strong {
    font-size: 2rem;
    line-height: 1;
    color: #16324f;
}

.client-summary-card small {
    color: #526679;
}

.client-admin-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 18px;
    align-items: start;
}

.client-admin-card {
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(245, 238, 226, 0.94)),
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 34%);
}

.client-admin-head {
    margin-top: 0;
}

.client-admin-head h3 {
    margin: 0 0 6px;
    font-size: 1.7rem;
    letter-spacing: -0.03em;
}

.client-admin-head .muted {
    margin: 0;
    max-width: 760px;
}

.client-form-layout {
    padding: 6px 0 2px;
}

.client-form-card,
.client-list-card {
    box-shadow: 0 20px 44px rgba(76, 58, 31, 0.08);
}

.client-form-layout textarea {
    min-height: 118px;
}

.client-form-block {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(197, 168, 119, 0.2);
    border-radius: 22px;
    background: rgba(255, 252, 247, 0.76);
}

.client-form-block-accent {
    background:
        linear-gradient(180deg, rgba(250, 247, 239, 0.98), rgba(245, 238, 226, 0.92)),
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 34%);
}

.client-form-block-head {
    display: grid;
    gap: 4px;
}

.client-form-block-head h4 {
    margin: 0;
    font-size: 1.08rem;
    color: #16324f;
}

.client-form-block-head .eyebrow {
    margin: 0;
}

.client-form-actions {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.client-form-hint {
    padding: 0 4px;
    font-size: 0.94rem;
    color: #526679;
}

.client-list-card {
    min-height: 100%;
}

.client-list-head {
    justify-content: space-between;
    gap: 16px;
}

.client-list-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 999px;
    background: rgba(255, 251, 244, 0.88);
    white-space: nowrap;
}

.client-list-section .table-wrap {
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.97), rgba(247, 239, 226, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

@media (max-width: 1280px) {
    .shell {
        grid-template-columns: 236px minmax(0, 1fr);
    }

    .sidebar {
        padding: 26px 18px;
    }

    .sidebar-logo {
        max-width: 190px;
    }

    .nav {
        gap: 8px;
    }

    .nav a {
        padding: 11px 12px;
        font-size: 0.94rem;
    }

    .content {
        padding: 24px 22px 34px;
    }

    .hero,
    .stat,
    .card,
    .module-card,
    .notice,
    .table-wrap {
        padding: 16px;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    }

    .dashboard-hero {
        grid-template-columns: 1fr 320px;
    }

    .dashboard-stat-grid,
    .dashboard-metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-admin-hero {
        grid-template-columns: 1fr;
        padding: 20px 22px;
    }

    .client-admin-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .client-admin-shell {
        grid-template-columns: 1fr;
    }

    .client-admin-head h3 {
        font-size: 1.5rem;
    }

    .stats-grid,
    .card-grid,
    .module-grid,
    .summary-strip {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .form-grid.four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .signature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    table {
        min-width: 700px;
    }
}

@media (max-width: 1100px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .dashboard-highlight {
        min-height: 180px;
    }

    .client-admin-card {
        border-radius: 22px;
    }

    .client-admin-hero-copy h3 {
        font-size: 1.75rem;
    }

    .client-admin-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .client-form-actions {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stat-grid,
    .dashboard-metric-strip,
    .stats-grid,
    .card-grid,
    .module-grid,
    .summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid.three,
    .form-grid.four,
    .form-grid.five {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .userbox {
        flex-wrap: wrap;
    }

    .signature-grid {
        grid-template-columns: 1fr;
    }

    .table-wrap.compact {
        padding: 8px;
    }

    table {
        min-width: 820px;
    }
}

@media (max-width: 980px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        min-height: auto;
        overflow: visible;
        padding: 20px;
    }

    .sidebar-brand {
        justify-content: center;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 18px 14px 28px;
    }

    .form-grid.two,
    .form-grid.three,
    .form-grid.four,
    .form-grid.five {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .userbox {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .nav {
        grid-auto-flow: column;
        grid-auto-columns: minmax(150px, 1fr);
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .nav a:hover {
        transform: none;
    }

    .hero,
    .stat,
    .card,
    .module-card,
    .notice,
    .table-wrap,
    .login-card {
        border-radius: 18px;
    }

    .client-admin-hero {
        padding: 18px;
        border-radius: 22px;
    }

    .client-admin-summary {
        grid-template-columns: 1fr;
    }

    .client-summary-card {
        min-height: auto;
    }

    .client-form-block {
        padding: 16px;
        border-radius: 18px;
    }

    table {
        min-width: 920px;
    }

    .bitacora-merged,
    .bitacora-merged textarea {
        min-width: 180px;
    }
}

@media (max-width: 640px) {
    .dashboard-hero {
        padding: 18px;
        border-radius: 22px;
    }

    .dashboard-highlight {
        padding: 18px;
        border-radius: 20px;
    }

    .dashboard-stat-card,
    .dashboard-metric-card,
    .dashboard-module-card {
        border-radius: 20px;
    }

    .client-admin-card,
    .client-list-section .table-wrap {
        border-radius: 20px;
    }

    .client-admin-hero-copy h3 {
        font-size: 1.45rem;
    }

    .client-admin-head h3 {
        font-size: 1.4rem;
    }

    .client-list-badge {
        width: 100%;
    }

    .sidebar h1 {
        font-size: 1.5rem;
    }

    .sidebar-logo {
        max-width: 180px;
    }

    .topbar h2 {
        font-size: 1.35rem;
    }

    .hero {
        padding: 20px;
    }

    .stat strong {
        font-size: 1.7rem;
    }

    .button,
    .button.ghost {
        width: 100%;
    }

    .stats-grid,
    .card-grid,
    .module-grid,
    .summary-strip {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        align-items: stretch;
    }
}
