:root {
    --bg: #f6f0e4;
    --bg-strong: #efe1bf;
    --ink: #16120c;
    --muted: #6e6453;
    --line: rgba(22, 18, 12, 0.1);
    --panel: rgba(255, 250, 240, 0.72);
    --panel-strong: rgba(255, 248, 232, 0.94);
    --accent: #111111;
    --gold: #f0b429;
    --gold-deep: #bc7f00;
    --success: #245d3d;
    --danger: #9a2e1f;
    --warning: #9a6a00;
    --shadow: 0 30px 80px rgba(35, 23, 3, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 220, 125, 0.55), transparent 28%),
        radial-gradient(circle at 85% 15%, rgba(184, 124, 0, 0.18), transparent 22%),
        linear-gradient(180deg, #fff9ee 0%, var(--bg) 38%, #efe5d2 100%);
    color: var(--ink);
    font-family: "Space Grotesk", sans-serif;
}

.page-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 60px;
}

.app-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    padding: 10px;
    border: 1px solid rgba(22, 18, 12, 0.08);
    border-radius: 999px;
    background: rgba(255, 249, 238, 0.72);
    backdrop-filter: blur(14px);
    width: fit-content;
}

.app-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.app-nav-link:hover {
    transform: translateY(-1px);
    color: var(--ink);
}

.app-nav-link.is-active {
    background: var(--accent);
    color: #fff8e9;
}

.hero {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 28px;
    align-items: end;
    min-height: 50vh;
    padding: 24px 0 12px;
}

.hero-copy h1,
.surface-heading h2,
.status-band h2 {
    font-family: "Fraunces", serif;
    letter-spacing: -0.04em;
    line-height: 0.98;
}

.hero-copy h1 {
    margin: 0;
    max-width: 10ch;
    font-size: clamp(3.4rem, 6vw, 6.8rem);
}

.hero-text {
    max-width: 56ch;
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.84rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--warning);
}

.hero-chips,
.issue-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.hero-chips span,
.issue-flags span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(22, 18, 12, 0.08);
    border-radius: 999px;
    background: rgba(255, 250, 240, 0.72);
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--muted);
}

.hero-panel,
.upload-surface,
.sheet-card,
.issues-ledger,
.status-band {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(22, 18, 12, 0.08);
    border-radius: 28px;
    background: var(--panel);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.hero-panel {
    padding: 24px;
    min-height: 320px;
    background:
        linear-gradient(160deg, rgba(255, 223, 141, 0.92), rgba(255, 246, 225, 0.78)),
        var(--panel);
}

.hero-panel::after,
.upload-surface::after,
.status-band::after {
    content: "";
    position: absolute;
    inset: auto -30px -50px auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.7), transparent 70%);
    pointer-events: none;
}

.hero-panel-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 30px;
}

.hero-panel-top span {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(22, 18, 12, 0.56);
}

.hero-panel-top strong {
    font-size: 1.1rem;
}

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

.hero-list li {
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(22, 18, 12, 0.08);
    font-size: 1rem;
    line-height: 1.55;
}

.workspace {
    display: grid;
    gap: 22px;
}

.upload-surface,
.issues-ledger,
.sheet-overview {
    padding: 28px;
}

.form-surface {
    overflow: visible;
}

.surface-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 22px;
}

.surface-heading h2,
.status-band h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3.1rem);
}

.surface-note,
.status-text {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.upload-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
}

.dropzone {
    display: grid;
    gap: 8px;
    min-height: 168px;
    padding: 28px;
    border-radius: 24px;
    border: 1.5px dashed rgba(22, 18, 12, 0.18);
    background:
        linear-gradient(140deg, rgba(255, 247, 228, 0.95), rgba(255, 252, 245, 0.72));
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
    transform: translateY(-2px);
    border-color: rgba(188, 127, 0, 0.55);
    box-shadow: 0 22px 50px rgba(188, 127, 0, 0.12);
}

.dropzone input {
    display: none;
}

.dropzone-label {
    font-size: 1.18rem;
    font-weight: 600;
}

.dropzone-hint {
    color: var(--muted);
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0 22px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
    border: 0;
    background: var(--accent);
    color: #fff8e9;
    box-shadow: 0 20px 40px rgba(17, 17, 17, 0.16);
    cursor: pointer;
}

.secondary-button {
    border: 1px solid rgba(17, 17, 17, 0.08);
    color: var(--ink);
    background: rgba(255, 251, 245, 0.82);
}

.compact-button {
    min-height: 46px;
    padding: 0 18px;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(22, 18, 12, 0.1);
    background: rgba(255, 252, 245, 0.85);
    color: var(--ink);
    cursor: pointer;
    font-weight: 600;
}

.danger-button {
    color: var(--danger);
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-2px);
}

.alert {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    line-height: 1.5;
}

.alert-error {
    background: rgba(154, 46, 31, 0.1);
    color: var(--danger);
    border: 1px solid rgba(154, 46, 31, 0.14);
}

.status-band {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
}

.status-attention {
    background: linear-gradient(135deg, rgba(255, 226, 176, 0.88), rgba(255, 250, 239, 0.92));
}

.status-progress {
    background: linear-gradient(135deg, rgba(227, 236, 212, 0.9), rgba(255, 250, 239, 0.92));
}

.status-success {
    background: linear-gradient(135deg, rgba(219, 242, 229, 0.88), rgba(255, 250, 239, 0.92));
}

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

.metrics-grid article {
    padding: 20px 22px;
    border-radius: 22px;
    background: rgba(255, 251, 244, 0.72);
    border: 1px solid rgba(22, 18, 12, 0.08);
}

.metrics-grid span {
    display: block;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.metrics-grid strong {
    display: block;
    margin-top: 14px;
    font-size: clamp(2.1rem, 3vw, 3rem);
    line-height: 1;
}

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

.sheet-card {
    padding: 24px;
    background: var(--panel-strong);
}

.sheet-card h3 {
    margin: 0 0 20px;
    font-size: 1.08rem;
}

.sheet-card dl {
    margin: 0;
    display: grid;
    gap: 14px;
}

.sheet-card dl div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(22, 18, 12, 0.08);
}

.sheet-card dt {
    color: var(--muted);
}

.sheet-card dd {
    margin: 0;
    font-weight: 700;
}

.issues-table-wrap {
    overflow: auto;
    border-radius: 22px;
    border: 1px solid rgba(22, 18, 12, 0.08);
}

.issues-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
    background: rgba(255, 252, 245, 0.9);
}

.issues-table th,
.issues-table td {
    padding: 16px 18px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(22, 18, 12, 0.08);
}

.issues-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(255, 246, 226, 0.98);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.issues-table tbody tr {
    transition: background 160ms ease;
}

.issues-table tbody tr:hover {
    background: rgba(255, 246, 219, 0.52);
}

.severity-error td:first-child,
.severity-critical td:first-child {
    box-shadow: inset 4px 0 0 var(--danger);
}

.severity-warning td:first-child {
    box-shadow: inset 4px 0 0 var(--warning);
}

.severity-correction td:first-child {
    box-shadow: inset 4px 0 0 var(--success);
}

.empty-state {
    padding: 22px;
    border-radius: 22px;
    background: rgba(255, 251, 244, 0.72);
    border: 1px solid rgba(22, 18, 12, 0.08);
    color: var(--muted);
    line-height: 1.7;
}

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

.entry-section {
    display: grid;
    gap: 18px;
    padding: 22px;
    border-radius: 26px;
    border: 1px solid rgba(22, 18, 12, 0.08);
    background: rgba(255, 252, 245, 0.78);
}

.entry-section-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
}

.entry-section-header h3 {
    margin: 0 0 8px;
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-family: "Fraunces", serif;
}

.entry-section-header p:last-child {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

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

.entry-row {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 248, 232, 0.82);
    border: 1px solid rgba(22, 18, 12, 0.08);
}

.entry-grid {
    display: grid;
    gap: 12px;
}

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

.entry-grid-4 {
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
}

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

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.field input,
.field select {
    min-height: 48px;
    width: 100%;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(22, 18, 12, 0.12);
    background: rgba(255, 255, 255, 0.74);
    color: var(--ink);
    font: inherit;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: rgba(188, 127, 0, 0.48);
    box-shadow: 0 0 0 4px rgba(240, 180, 41, 0.12);
}

.field-wide {
    grid-column: span 2;
}

.field-note {
    display: block;
    min-height: 20px;
    font-size: 0.85rem;
    color: var(--muted);
}

.field-note.is-loading {
    color: var(--warning);
}

.field-note.is-valid {
    color: var(--success);
}

.field-note.is-invalid {
    color: var(--danger);
}

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

.form-footer {
    display: flex;
    justify-content: flex-end;
}

.client-page {
    background:
        radial-gradient(circle at 0% 0%, rgba(244, 205, 111, 0.18), transparent 28%),
        radial-gradient(circle at 100% 100%, rgba(196, 149, 52, 0.1), transparent 24%),
        linear-gradient(180deg, #f7f2e9 0%, #f3ebdc 100%);
}

.client-page .page-shell {
    width: min(1180px, calc(100% - 32px));
    padding-top: 26px;
}

.client-topbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 18px;
}

.client-topbar h1 {
    margin: 0;
    font-family: "Fraunces", serif;
    font-size: clamp(2.1rem, 4vw, 3.6rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.back-link {
    flex-shrink: 0;
}

.client-page .workspace {
    gap: 16px;
}

.client-page .form-surface {
    padding: 28px;
    border-radius: 32px;
    background:
        linear-gradient(180deg, rgba(255, 251, 244, 0.92), rgba(250, 245, 235, 0.88));
}

.client-page .upload-surface::after {
    display: none;
}

.client-page .surface-heading {
    align-items: end;
    margin-bottom: 22px;
}

.client-page .surface-heading h2 {
    font-size: clamp(1.6rem, 2.4vw, 2.3rem);
}

.section-switcher {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}

.switch-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 66px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(22, 18, 12, 0.06);
    background: rgba(255, 254, 250, 0.78);
    color: var(--muted);
    cursor: pointer;
    text-align: left;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.switch-pill:hover {
    transform: translateY(-1px);
}

.switch-pill span {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.switch-pill strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(22, 18, 12, 0.06);
    font-size: 0.95rem;
    color: var(--ink);
}

.switch-pill.is-active {
    background: #151515;
    color: #fff8e9;
    border-color: rgba(21, 21, 21, 0.9);
    box-shadow: 0 18px 34px rgba(21, 21, 21, 0.16);
}

.switch-pill.is-active strong {
    color: #fff8e9;
    background: rgba(255, 248, 233, 0.14);
}

.payment-panel {
    display: none;
}

.payment-panel.is-active {
    display: grid;
}

.client-page .entry-section {
    padding: 22px;
    gap: 18px;
    background: rgba(255, 252, 246, 0.78);
    border-color: rgba(22, 18, 12, 0.06);
}

.client-page .entry-section-header {
    align-items: center;
}

.client-page .entry-section-header h3 {
    margin: 0 0 4px;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.client-page .entry-section-header p {
    margin: 0;
    font-size: 0.95rem;
}

.client-page .entry-row {
    padding: 18px;
    border-radius: 22px;
    gap: 16px;
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(22, 18, 12, 0.06);
}

.client-page .field span {
    font-size: 0.74rem;
}

.client-page .field input,
.client-page .field select {
    min-height: 50px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.94);
}

.client-page .field input[readonly] {
    background: rgba(245, 240, 231, 0.98);
    color: rgba(22, 18, 12, 0.82);
    font-weight: 500;
    cursor: default;
}

.entry-grid-key {
    display: grid;
    grid-template-columns: 1.05fr 1.55fr 0.8fr 0.9fr;
    grid-template-areas:
        "recipient key amount date"
        "description key amount date";
    gap: 14px;
}

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

.entry-grid-boleto {
    display: grid;
    grid-template-columns: 1.8fr 0.8fr 0.9fr 1.1fr;
    gap: 14px;
}

.entry-row-key .field-recipient {
    grid-area: recipient;
}

.entry-row-key .field-key {
    grid-area: key;
}

.entry-row-key .field-amount {
    grid-area: amount;
}

.entry-row-key .field-date {
    grid-area: date;
}

.entry-row-key .field-description {
    grid-area: description;
}

.entry-row-account .field-description {
    grid-column: span 2;
}

@media (min-width: 1180px) {
    .entry-grid-key {
        grid-template-columns: 0.95fr 1.5fr 0.62fr 0.78fr 0.95fr;
        grid-template-areas: "recipient key amount date description";
        align-items: start;
    }

    .entry-row-key {
        gap: 12px;
    }

    .entry-row-key .field input {
        min-height: 46px;
    }

    .entry-row-key .field-note {
        min-height: 0;
        margin-top: 2px;
        line-height: 1.35;
    }
}

.form-submit-bar {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid rgba(22, 18, 12, 0.06);
    background: rgba(255, 252, 246, 0.94);
    box-shadow: 0 18px 40px rgba(22, 18, 12, 0.07);
    backdrop-filter: blur(16px);
}

.submit-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    font-size: 0.94rem;
}

.compact-status-band {
    padding: 20px 22px;
}

.result-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.result-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 251, 244, 0.82);
    border: 1px solid rgba(22, 18, 12, 0.08);
    color: var(--muted);
    font-size: 0.88rem;
}

.result-stat strong {
    color: var(--ink);
}

.result-fold {
    border: 1px solid rgba(22, 18, 12, 0.06);
    border-radius: 24px;
    background: rgba(255, 252, 246, 0.82);
    box-shadow: 0 20px 42px rgba(22, 18, 12, 0.07);
    overflow: hidden;
}

.result-fold summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.result-fold summary::-webkit-details-marker {
    display: none;
}

.result-fold summary span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 246, 226, 0.92);
    border: 1px solid rgba(22, 18, 12, 0.08);
    color: var(--muted);
    font-size: 0.88rem;
}

.result-fold[open] summary {
    border-bottom: 1px solid rgba(22, 18, 12, 0.08);
}

.issue-card-list,
.compact-sheet-grid {
    display: grid;
    gap: 14px;
    padding: 14px;
}

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

.issue-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(22, 18, 12, 0.06);
}

.issue-card-top {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.issue-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 246, 226, 0.92);
    border: 1px solid rgba(22, 18, 12, 0.08);
    font-size: 0.78rem;
    color: var(--muted);
}

.issue-card-message {
    margin: 0 0 12px;
    line-height: 1.6;
}

.issue-card-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.issue-card-values div {
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 248, 232, 0.82);
}

.issue-card-values span {
    display: block;
    margin-bottom: 6px;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.issue-card-values strong {
    word-break: break-word;
}

.mini-sheet-card {
    padding: 16px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 249, 238, 0.82));
    border: 1px solid rgba(22, 18, 12, 0.08);
    box-shadow: 0 14px 28px rgba(32, 24, 8, 0.06);
}

.mini-sheet-card.tone-danger {
    border-color: rgba(154, 46, 31, 0.14);
}

.mini-sheet-card.tone-warning {
    border-color: rgba(154, 106, 0, 0.14);
}

.mini-sheet-card.tone-progress {
    border-color: rgba(36, 93, 61, 0.14);
}

.mini-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.mini-sheet-card h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.25;
}

.mini-sheet-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 246, 226, 0.96);
    border: 1px solid rgba(22, 18, 12, 0.08);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.mini-sheet-card.tone-danger .mini-sheet-state {
    background: rgba(154, 46, 31, 0.08);
    color: var(--danger);
}

.mini-sheet-card.tone-warning .mini-sheet-state {
    background: rgba(154, 106, 0, 0.08);
    color: var(--warning);
}

.mini-sheet-card.tone-progress .mini-sheet-state {
    background: rgba(36, 93, 61, 0.08);
    color: var(--success);
}

.mini-sheet-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.mini-sheet-card dl div {
    display: grid;
    gap: 6px;
    padding: 11px 12px 12px;
    border-radius: 16px;
    background: rgba(255, 250, 242, 0.84);
    border: 1px solid rgba(22, 18, 12, 0.06);
}

.mini-sheet-card dt {
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.mini-sheet-card dd {
    margin: 0;
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1;
}

.mini-sheet-card dl div:nth-child(2) dd,
.mini-sheet-card dl div:nth-child(4) dd {
    color: var(--ink);
}

.mini-sheet-card.tone-danger dl div:nth-child(4) dd {
    color: var(--danger);
}

.mini-sheet-card.tone-warning dl div:nth-child(2) dd {
    color: var(--warning);
}

.mini-sheet-card.tone-progress dl div:nth-child(3) dd {
    color: var(--success);
}

@media (max-width: 980px) {
    .hero,
    .upload-form,
    .status-band,
    .surface-heading {
        grid-template-columns: 1fr;
        display: grid;
    }

    .status-band {
        align-items: start;
    }

    .metrics-grid,
    .sheet-grid,
    .compact-sheet-grid,
    .entry-grid-account,
    .entry-grid-boleto {
        grid-template-columns: 1fr 1fr;
    }

    .entry-section-header,
    .client-topbar {
        flex-direction: column;
        align-items: start;
    }

    .form-submit-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .entry-grid-key {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "recipient recipient"
            "key key"
            "amount date"
            "description description";
    }

    .entry-row-account .field-description {
        grid-column: span 2;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 20px, 1240px);
        padding-top: 18px;
    }

    .hero-copy h1 {
        max-width: 100%;
        font-size: clamp(2.6rem, 14vw, 4.2rem);
    }

    .hero,
    .metrics-grid,
    .sheet-grid,
    .upload-form,
    .section-switcher,
    .compact-sheet-grid,
    .issue-card-values,
    .entry-grid-account,
    .entry-grid-boleto {
        grid-template-columns: 1fr;
    }

    .entry-grid-key {
        grid-template-columns: 1fr;
        grid-template-areas: none;
    }

    .upload-surface,
    .issues-ledger,
    .sheet-overview,
    .entry-section {
        padding: 20px;
    }

    .primary-button,
    .secondary-button,
    .ghost-button {
        width: 100%;
    }

    .app-nav,
    .hero-actions,
    .entry-row-actions,
    .form-footer,
    .result-strip {
        width: 100%;
    }

    .app-nav,
    .hero-actions,
    .entry-row-actions,
    .result-strip {
        flex-direction: column;
    }

    .field-wide {
        grid-column: span 1;
    }

    .client-page .surface-heading {
        display: grid;
        gap: 10px;
    }

    .client-topbar h1 {
        max-width: 100%;
        font-size: clamp(1.8rem, 10vw, 2.8rem);
    }

    .entry-row-key .field-recipient,
    .entry-row-key .field-key,
    .entry-row-key .field-amount,
    .entry-row-key .field-date,
    .entry-row-key .field-description {
        grid-area: auto;
    }

    .entry-row-account .field-description {
        grid-column: span 1;
    }
}

body.client-page {
    background: #f3f4f6;
    color: #0f1115;
    font-family: "Manrope", "Space Grotesk", sans-serif;
}

.client-page .eyebrow {
    color: #7a7f89;
    letter-spacing: 0.14em;
}

.client-page .client-app-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: 100vh;
}

.client-page .client-sidebar {
    display: grid;
    align-content: start;
    gap: 24px;
    padding: 26px 22px;
    background: #232323;
    color: #f5f7fb;
}

.client-page .sidebar-brand h1 {
    margin: 0 0 10px;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.client-page .sidebar-copy,
.client-page .sidebar-foot {
    margin: 0;
    color: rgba(245, 247, 251, 0.68);
    line-height: 1.6;
    font-size: 0.96rem;
}

.client-page .sidebar-balance,
.client-page .compose-surface,
.client-page .entry-section,
.client-page .result-fold,
.client-page .status-band {
    border-radius: 28px;
    border: 1px solid rgba(15, 17, 21, 0.08);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 48px rgba(15, 17, 21, 0.06);
}

.client-page .sidebar-balance {
    padding: 18px;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
}

.client-page .sidebar-balance span,
.client-page .sidebar-balance small {
    display: block;
    color: rgba(245, 247, 251, 0.72);
}

.client-page .sidebar-balance strong {
    display: block;
    margin: 8px 0 6px;
    font-size: 1.24rem;
    color: #ffffff;
}

.client-page .sidebar-nav {
    display: grid;
    gap: 10px;
}

.client-page .sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 58px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    color: #f5f7fb;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.client-page .sidebar-link strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 0.92rem;
}

.client-page .sidebar-link:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
}

.client-page .sidebar-link.is-active,
.client-page .sidebar-link-primary {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.14);
}

.client-page .sidebar-link-primary {
    justify-content: center;
}

.client-page .client-main {
    padding: 34px 34px 48px;
}

.client-page .client-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.client-page .client-header h2 {
    margin: 0 0 10px;
    font-size: clamp(2.4rem, 4vw, 4rem);
    line-height: 0.96;
    letter-spacing: -0.05em;
}

.client-page .client-header-copy {
    max-width: 58ch;
    margin: 0;
    color: #616672;
    line-height: 1.65;
    font-size: 1.02rem;
}

.client-page .back-link {
    background: #ffffff;
    border-color: rgba(15, 17, 21, 0.1);
}

.client-page .customer-form {
    display: grid;
    gap: 24px;
}

.client-page .compose-surface {
    padding: 22px;
}

.client-page .mode-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 8px;
    border-radius: 999px;
    border: 1px solid rgba(15, 17, 21, 0.08);
    background: #f7f8fb;
}

.client-page .mode-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #4c5058;
    font: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.client-page .mode-button span {
    font-size: 0.84rem;
    font-weight: 700;
    color: #8a909b;
}

.client-page .mode-button.is-active {
    background: #232323;
    color: #ffffff;
}

.client-page .mode-button.is-active span {
    color: rgba(255, 255, 255, 0.72);
}

.client-page .compose-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 188px;
    gap: 14px;
    margin-top: 18px;
}

.client-page .compose-field {
    display: grid;
    gap: 10px;
}

.client-page .compose-field span {
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7d828d;
}

.client-page .compose-field input {
    min-height: 78px;
    padding: 0 24px;
    border-radius: 22px;
    border: 1px solid rgba(15, 17, 21, 0.12);
    background: #ffffff;
    color: #111319;
    font: inherit;
    font-size: 1.1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.client-page .compose-field input:focus {
    outline: none;
    border-color: rgba(27, 31, 38, 0.24);
    box-shadow: 0 0 0 4px rgba(255, 209, 71, 0.22);
}

.client-page .compose-field input:disabled {
    background: #f0f2f5;
    color: #9aa0aa;
    cursor: not-allowed;
}

.client-page .composer-continue {
    align-self: end;
    min-height: 78px;
    border: 0;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffdd67 0%, #ffca33 100%);
    color: #111319;
    font: inherit;
    font-size: 1.08rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 18px 34px rgba(255, 202, 51, 0.28);
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.client-page .composer-continue:hover {
    transform: translateY(-1px);
}

.client-page .composer-continue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.client-page .compose-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.client-page .soft-action {
    min-height: 54px;
    padding: 0 22px;
    border: 1px solid rgba(30, 107, 255, 0.1);
    border-radius: 18px;
    background: #eef4ff;
    color: #1b63dd;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.client-page .compose-status {
    margin: 18px 2px 0;
    color: #636978;
    line-height: 1.6;
}

.client-page .compose-status.is-warning {
    color: #8b5b00;
}

.client-page .compose-status.is-success {
    color: #245d3d;
}

.client-page .studio-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.client-page .builder-stage {
    display: grid;
    gap: 16px;
}

.client-page .operation-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.client-page .switch-pill {
    min-height: 72px;
    padding: 18px 20px;
    border-radius: 22px;
    border-color: rgba(15, 17, 21, 0.08);
    background: rgba(255, 255, 255, 0.88);
    color: #5e6471;
    box-shadow: 0 12px 30px rgba(15, 17, 21, 0.04);
}

.client-page .switch-pill span {
    font-size: 0.9rem;
}

.client-page .switch-pill strong {
    min-width: 38px;
    min-height: 38px;
    background: #f0f2f5;
    color: #111319;
}

.client-page .switch-pill.is-active {
    background: #232323;
    color: #ffffff;
    border-color: rgba(35, 35, 35, 0.92);
    box-shadow: 0 18px 40px rgba(15, 17, 21, 0.12);
}

.client-page .switch-pill.is-active strong {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.client-page .entry-section {
    padding: 24px;
    background: #ffffff;
    border-color: rgba(15, 17, 21, 0.08);
    box-shadow: 0 18px 48px rgba(15, 17, 21, 0.05);
}

.client-page .entry-section-header {
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.client-page .entry-section-header h3 {
    margin: 0 0 6px;
    font-size: 2rem;
    letter-spacing: -0.05em;
}

.client-page .entry-section-header p {
    color: #666c78;
    line-height: 1.6;
}

.client-page .entry-row {
    gap: 16px;
    padding: 18px;
    border-radius: 26px;
    background: #fafbfc;
    border: 1px solid rgba(15, 17, 21, 0.08);
    box-shadow: none;
}

.client-page .field span {
    font-size: 0.78rem;
    color: #7b818e;
}

.client-page .field input,
.client-page .field select {
    min-height: 64px;
    padding: 0 18px;
    border-radius: 20px;
    border: 1px solid rgba(15, 17, 21, 0.12);
    background: #ffffff;
    font-size: 1.02rem;
    font-family: inherit;
}

.client-page .field input:focus,
.client-page .field select:focus {
    outline: none;
    border-color: rgba(18, 26, 41, 0.18);
    box-shadow: 0 0 0 4px rgba(255, 209, 71, 0.18);
}

.client-page .field input[readonly] {
    background: #f4efe3;
    color: #242833;
    font-weight: 700;
}

.client-page .field-note {
    min-height: 24px;
    padding-left: 2px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.client-page .entry-row-actions {
    justify-content: flex-end;
}

.client-page .ghost-button,
.client-page .secondary-button,
.client-page .primary-button {
    font-family: inherit;
}

.client-page .ghost-button,
.client-page .secondary-button {
    border-radius: 18px;
    min-height: 48px;
    background: #ffffff;
    border-color: rgba(15, 17, 21, 0.1);
    box-shadow: none;
}

.client-page .danger-button {
    color: #9a2e1f;
}

.client-page .whatsapp-share {
    color: #1f6f43;
    border-color: rgba(31, 111, 67, 0.14);
    background: rgba(31, 111, 67, 0.05);
}

.client-page .success-button {
    color: #1f6f43;
    border-color: rgba(31, 111, 67, 0.16);
    background: rgba(31, 111, 67, 0.06);
}

.client-page .form-submit-bar {
    position: sticky;
    bottom: 18px;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-radius: 24px;
    border: 1px solid rgba(15, 17, 21, 0.08);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 48px rgba(15, 17, 21, 0.08);
    backdrop-filter: blur(18px);
}

.client-page .submit-summary {
    display: grid;
    gap: 3px;
}

.client-page .submit-summary strong {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: #17191d;
}

.client-page .submit-summary span {
    color: #5f6672;
    font-size: 0.94rem;
}

.client-page .primary-button {
    min-height: 56px;
    border-radius: 20px;
    background: #17191d;
    color: #ffffff;
    box-shadow: 0 18px 36px rgba(23, 25, 29, 0.16);
}

.client-page .client-results {
    display: grid;
    gap: 16px;
    margin-top: 26px;
}

.client-page .status-band {
    background: rgba(255, 255, 255, 0.92);
}

.client-page .result-fold {
    background: rgba(255, 255, 255, 0.92);
}

.alert-success,
.alert-token {
    background: rgba(36, 93, 61, 0.1);
    color: var(--success);
    border: 1px solid rgba(36, 93, 61, 0.14);
}

.auth-surface,
.history-surface,
.admin-card {
    background: rgba(255, 255, 255, 0.92);
}

.auth-form,
.admin-inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 16px;
    align-items: end;
}

.filters-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 220px 140px;
    gap: 16px;
    align-items: end;
}

.stacked-auth-form {
    display: grid;
    gap: 16px;
    max-width: 520px;
}

.token-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.token-banner span {
    font-weight: 600;
}

.token-banner code {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(36, 93, 61, 0.14);
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.history-list,
.admin-list {
    display: grid;
    gap: 14px;
}

.history-item,
.admin-list-item {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 251, 244, 0.86);
    border: 1px solid rgba(22, 18, 12, 0.08);
}

.admin-list-item.is-processed {
    background:
        linear-gradient(135deg, rgba(236, 248, 241, 0.96), rgba(248, 252, 249, 0.96));
    border-color: rgba(31, 111, 67, 0.16);
    box-shadow: inset 0 0 0 1px rgba(31, 111, 67, 0.04);
}

.admin-list-item.is-processed::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: linear-gradient(180deg, rgba(31, 111, 67, 0.9), rgba(79, 153, 108, 0.72));
}

.admin-list-item.is-processed .admin-meta-grid div {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(31, 111, 67, 0.09);
}

.admin-list-item.is-processed .admin-list-actions {
    padding-left: 8px;
    border-left: 1px solid rgba(31, 111, 67, 0.1);
}

.history-item-top,
.admin-list-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.history-item-top h3,
.admin-list-top h3 {
    margin: 0;
    font-size: 1.02rem;
}

.history-meta,
.admin-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.history-meta div,
.admin-meta-grid div {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(22, 18, 12, 0.06);
}

.history-meta dt,
.admin-meta-grid dt {
    margin-bottom: 6px;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.history-meta dd,
.admin-meta-grid dd {
    margin: 0;
    font-weight: 700;
}

.admin-list-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.history-actions,
.admin-list-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.history-actions a,
.admin-list-actions form {
    width: 100%;
}

.list-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(22, 18, 12, 0.08);
    background: rgba(255, 246, 226, 0.92);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.list-badge.is-success,
.list-badge.status-success {
    background: rgba(36, 93, 61, 0.08);
    color: var(--success);
}

.list-badge.status-progress {
    background: rgba(154, 106, 0, 0.08);
    color: var(--warning);
}

.list-badge.status-attention {
    background: rgba(154, 46, 31, 0.08);
    color: var(--danger);
}

.list-badge.processing-success {
    background: rgba(36, 93, 61, 0.08);
    color: var(--success);
}

.list-badge.processing-warning {
    background: rgba(154, 106, 0, 0.08);
    color: var(--warning);
}

@media (max-width: 1280px) {
    .client-page .client-app-shell {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .client-page .client-main {
        padding: 26px;
    }
}

@media (max-width: 1120px) {
    .client-page .client-app-shell {
        grid-template-columns: 1fr;
    }

    .client-page .client-sidebar {
        gap: 18px;
        padding: 20px;
    }

    .client-page .sidebar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 820px) {
    .client-page .client-header {
        grid-template-columns: 1fr;
        display: grid;
        align-items: start;
    }

    .client-page .client-header h2 {
        font-size: clamp(2.1rem, 11vw, 3rem);
    }

    .client-page .compose-grid,
    .client-page .operation-tabs,
    .client-page .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .auth-form,
    .admin-inline-form,
    .filters-form,
    .history-item,
    .admin-list-item,
    .history-meta,
    .admin-meta-grid {
        grid-template-columns: 1fr;
    }

    .history-actions,
    .admin-list-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .client-page .compose-shortcuts {
        display: grid;
        grid-template-columns: 1fr;
    }

    .client-page .composer-continue,
    .client-page .soft-action,
    .client-page .sidebar-link,
    .client-page .mode-button,
    .client-page .secondary-button,
    .client-page .ghost-button,
    .client-page .primary-button {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .client-page .client-main {
        padding: 18px;
    }

    .client-page .client-sidebar {
        padding: 18px;
    }

    .client-page .form-submit-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .client-page .entry-section,
    .client-page .compose-surface {
        padding: 18px;
        border-radius: 22px;
    }

    .client-page .entry-section-header h3 {
        font-size: 1.6rem;
    }

    .client-page .field input,
    .client-page .field select,
    .client-page .compose-field input {
        min-height: 58px;
    }
}

.validator-page .sidebar-nav {
    grid-template-columns: 1fr;
}

.validator-page .sidebar-link {
    text-decoration: none;
}

.validator-page .validator-upload-surface {
    padding: 24px;
}

.validator-page .validator-upload-form {
    grid-template-columns: minmax(0, 1fr) 240px;
    align-items: stretch;
}

.validator-page .validator-dropzone {
    min-height: 190px;
    border-style: solid;
    border-width: 1px;
    border-color: rgba(15, 17, 21, 0.12);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.validator-page .validator-dropzone:hover,
.validator-page .validator-dropzone.is-dragging {
    border-color: rgba(23, 25, 29, 0.18);
    box-shadow: 0 18px 36px rgba(23, 25, 29, 0.06);
}

.validator-page .metrics-grid article {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 22px;
    border-color: rgba(15, 17, 21, 0.08);
    box-shadow: 0 18px 40px rgba(15, 17, 21, 0.05);
}

@media (max-width: 820px) {
    .validator-page .validator-upload-form {
        grid-template-columns: 1fr;
    }
}
