:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #eef4f0;
    --ink: #172033;
    --muted: #64748b;
    --line: #dbe3ee;
    --primary: #16a66a;
    --primary-strong: #0d7c55;
    --secondary: #2563eb;
    --danger: #dc2626;
    --warning: #b7791f;
    --radius: 8px;
    --shadow: 0 18px 44px rgba(23, 32, 51, .08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    max-width: 100%;
}

body {
    min-height: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    letter-spacing: 0;
}

body.modal-open {
    overflow: hidden;
}

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

button,
input,
select,
textarea {
    font: inherit;
    letter-spacing: 0;
}

button {
    cursor: pointer;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
    max-width: 100%;
    overflow-x: clip;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 24px 18px;
    border-right: 1px solid var(--line);
    background: #ffffff;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-close {
    display: none;
}

.sidebar-overlay {
    display: none;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 18px;
    line-height: 1.1;
}

.brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.brand-large .brand-mark {
    width: 50px;
    height: 50px;
}

.brand-large strong {
    font-size: 21px;
}

.nav-list {
    display: grid;
    gap: 6px;
}

.nav-list a,
.button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-list a {
    min-height: 42px;
    justify-content: flex-start;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: #334155;
    font-weight: 650;
}

.nav-list a:hover,
.nav-list a.is-active {
    background: var(--surface-soft);
    color: var(--primary-strong);
}

.nav-list svg,
.button svg,
.icon-button svg,
.category-icon svg,
.empty-state svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.1;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.user-chip {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.user-chip > span {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: var(--radius);
    background: #e8eefc;
    color: #1d4ed8;
    font-weight: 800;
}

.user-chip strong,
.user-chip small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chip small {
    color: var(--muted);
    font-size: 12px;
}

.main-content {
    width: 100%;
    min-width: 0;
    max-width: 1440px;
    padding: 28px;
    overflow-x: clip;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.topbar h1,
.panel h2,
.form-heading h2,
.empty-state h2,
.auth-copy h1,
.section-title-row h2,
.category-card h3 {
    margin: 0;
    letter-spacing: 0;
}

.topbar h1 {
    font-size: 28px;
    line-height: 1.15;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 4px;
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.icon-button {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: #334155;
}

.icon-button:hover {
    border-color: #b8c6d8;
    background: #f8fafc;
}

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

[data-sidebar-toggle] {
    display: none;
}

.button {
    min-height: 40px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 750;
    white-space: nowrap;
}

.button-primary {
    background: var(--primary);
    color: #fff;
}

.button-primary:hover {
    background: var(--primary-strong);
}

.button-secondary {
    background: #e8eefc;
    color: #1d4ed8;
}

.button-ghost {
    border-color: var(--line);
    background: #fff;
    color: #334155;
}

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

.full {
    width: 100%;
}

.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(13, 27, 20, .72);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
}

.checkbox-line input {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font-weight: 650;
}

.alert-success {
    border-color: #9fd8bd;
    background: #eefaf4;
    color: #0f6b49;
}

.alert-error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #b91c1c;
}

.alert-warning {
    border-color: #f7d38a;
    background: #fff8e6;
    color: #8a5b12;
}

.alert span {
    white-space: pre-line;
}

.toolbar-panel,
.panel,
.stat-card,
.category-card,
.auth-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.toolbar-panel,
.panel {
    margin-bottom: 18px;
    padding: 18px;
    max-width: 100%;
    min-width: 0;
}

.panel-header,
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.panel h2,
.section-title-row h2 {
    font-size: 20px;
}

.narrow-panel {
    max-width: 820px;
}

.filter-grid,
.form-grid {
    display: grid;
    gap: 12px;
}

.filter-grid {
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    align-items: end;
}

.filter-grid .field:nth-child(3) {
    grid-column: span 2;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

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

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

.field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.field > span {
    color: #334155;
    font-size: 13px;
    font-weight: 750;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    padding: 10px 12px;
    outline: none;
}

.field input[type="color"] {
    padding: 4px;
}

.field textarea {
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 166, 106, .14);
}

.field-error {
    color: var(--danger);
    font-weight: 650;
}

.check-field {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgba(10, 163, 110, .14);
    border-radius: var(--radius);
    background: rgba(232, 255, 245, .48);
    color: rgba(13, 27, 20, .72);
    font-size: 13px;
    line-height: 1.5;
    font-weight: 650;
}

.check-field input {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--primary);
}

.check-field a {
    color: var(--primary-strong);
    font-weight: 900;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

.stats-grid-finance {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.stat-card {
    padding: 18px;
    min-width: 0;
}

.stat-card span,
.stat-card small {
    color: var(--muted);
}

.stat-card span {
    display: block;
    font-weight: 750;
}

.stat-card strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 27px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.stat-income strong,
.stat-balance.is-positive strong,
.money-cell.type-income {
    color: var(--primary-strong);
}

.stat-expense strong,
.stat-balance.is-negative strong,
.money-cell.type-expense {
    color: var(--danger);
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card-head {
    min-width: 0;
}

.stat-icon {
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.stat-icon svg {
    display: block;
    margin: auto;
}

.stat-card span.stat-label {
    min-width: 0;
    line-height: 1.15;
}

.stat-card strong {
    white-space: nowrap;
    font-size: clamp(21px, 1.45vw, 29px);
    line-height: 1;
}

.stat-card small {
    line-height: 1.25;
}

.sidebar-close {
    display: none;
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card-head {
    min-width: 0;
}

.stat-icon {
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.stat-icon svg {
    display: block;
    margin: auto;
}

.stat-card span.stat-label {
    min-width: 0;
    line-height: 1.15;
}

.stat-card strong {
    white-space: nowrap;
    font-size: clamp(21px, 1.45vw, 29px);
    line-height: 1;
}

.stat-card small {
    line-height: 1.25;
}

.phone-security-panel {
    display: grid;
    gap: 16px;
}

.phone-status-card,
.phone-pending-box,
.security-note {
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(244, 255, 249, .82));
}

.phone-status-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.phone-status-icon {
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 16px;
}

.phone-status-icon.is-verified {
    background: #e8fff5;
    color: var(--green-2);
}

.phone-status-icon.is-warning {
    background: #fff8e6;
    color: #8a5b12;
}

.phone-status-card strong,
.phone-status-card small {
    display: block;
}

.phone-status-card small,
.phone-pending-box p,
.security-note {
    color: rgba(13, 27, 20, .62);
}

.phone-pending-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
}

.phone-pending-box p {
    margin: 6px 0 0;
    line-height: 1.45;
}

.security-note {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.stat-balance.is-neutral strong {
    color: var(--muted);
}

.progress {
    width: 100%;
    height: 8px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.progress span {
    display: block;
    height: 100%;
    background: var(--primary);
}

.dashboard-grid,
.bot-layout,
.category-layout {
    display: grid;
    gap: 18px;
    min-width: 0;
}

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

.bot-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
}

.category-layout {
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    align-items: start;
}

.chart-box {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 310px;
    min-width: 0;
}

.chart-box canvas {
    max-width: 100%;
}

.chart-box-wide {
    height: 340px;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: min(820px, 1000px);
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.align-right {
    text-align: right !important;
}

.table-actions {
    width: 112px;
    text-align: right !important;
    white-space: nowrap;
}

.table-actions form {
    display: inline-flex;
}

.category-pill,
.type-pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.type-pill.type-income {
    background: #eefaf4;
    color: #0f6b49;
}

.type-pill.type-expense {
    background: #fff1f2;
    color: #b91c1c;
}

.category-pill {
    background: color-mix(in srgb, var(--pill-color) 16%, white);
    color: color-mix(in srgb, var(--pill-color) 72%, #111827);
}

.status-pill {
    background: #e8eefc;
    color: #1d4ed8;
}

.status-needs_review {
    background: #fff8e6;
    color: #8a5b12;
}

.status-saved {
    background: #eefaf4;
    color: #0f6b49;
}

.muted-line {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.empty-state,
.empty-inline {
    color: var(--muted);
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 54px 20px;
    text-align: center;
}

.empty-state.compact {
    padding: 28px 16px;
}

.empty-state svg {
    width: 36px;
    height: 36px;
    color: var(--primary);
}

.empty-state p {
    max-width: 460px;
    margin: 0;
}

.empty-inline {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius);
    background: #f8fafc;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}

.category-list > .empty-inline {
    grid-column: 1 / -1;
}

.category-filter-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(245, 188, 22, .16), transparent 12rem),
        linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(248, 255, 251, .86));
    box-shadow: 0 18px 46px rgba(13, 27, 20, .07);
}

.category-filter-panel h2,
.category-filter-panel p {
    margin: 0;
}

.category-filter-panel h2 {
    font-size: clamp(22px, 2.4vw, 30px);
    line-height: 1;
    letter-spacing: -.055em;
    font-weight: 900;
}

.category-filter-panel p {
    max-width: 620px;
    margin-top: 6px;
    color: rgba(13, 27, 20, .64);
    line-height: 1.55;
    font-weight: 650;
}

.category-type-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 6px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
}

.category-type-filter a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 999px;
    color: rgba(13, 27, 20, .7);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.category-type-filter a:hover,
.category-type-filter a.is-active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-green);
}

.category-type-filter svg {
    width: 17px;
    height: 17px;
}

.category-card {
    padding: 16px;
}

.category-card-top {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.category-icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--category-color) 18%, white);
    color: color-mix(in srgb, var(--category-color) 75%, #111827);
}

.category-card h3 {
    font-size: 17px;
}

.category-card small,
.category-card p {
    color: var(--muted);
}

.category-card p {
    min-height: 42px;
    margin: 0 0 14px;
    line-height: 1.45;
}

.payables-hero {
    display: grid;
    gap: 18px;
}

.dashboard-payables-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 18px;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(245, 188, 22, .18), transparent 13rem),
        linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(238, 250, 243, .78));
    box-shadow: 0 18px 46px rgba(13, 27, 20, .07);
}

.dashboard-payables-panel h2,
.dashboard-payables-panel p {
    margin: 0;
}

.dashboard-payables-panel h2 {
    font-size: clamp(24px, 2.7vw, 34px);
    line-height: 1;
    letter-spacing: -.06em;
    font-weight: 900;
}

.dashboard-payables-panel p {
    max-width: 560px;
    margin-top: 8px;
    color: rgba(13, 27, 20, .64);
    line-height: 1.55;
    font-weight: 650;
}

.dashboard-payables-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: 10px;
}

.dashboard-payables-metrics span {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 18px;
    background: rgba(255, 255, 255, .76);
}

.dashboard-payables-metrics strong {
    color: var(--ink);
    font-size: clamp(18px, 1.7vw, 24px);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -.05em;
    overflow-wrap: anywhere;
}

.dashboard-payables-metrics small {
    color: rgba(13, 27, 20, .58);
    font-size: 12px;
    font-weight: 850;
}

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

.payables-filter {
    grid-template-columns: minmax(160px, .6fr) minmax(240px, 1fr) auto;
}

.payables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.payable-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.payable-card.is-overdue {
    border-color: rgba(220, 38, 38, .26);
    background:
        radial-gradient(circle at top right, rgba(239, 68, 68, .08), transparent 12rem),
        rgba(255, 255, 255, .94);
}

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

.payable-card-head h3 {
    margin: 0;
    font-size: clamp(22px, 2vw, 28px);
    line-height: 1;
    letter-spacing: -.055em;
    font-weight: 900;
}

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

.payable-values div {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 18px;
    background: rgba(248, 255, 251, .82);
}

.payable-values dt {
    color: rgba(13, 27, 20, .58);
    font-size: 12px;
    font-weight: 900;
}

.payable-values dd {
    margin: 6px 0 0;
    color: var(--ink);
    font-size: clamp(18px, 2.1vw, 24px);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -.05em;
    overflow-wrap: anywhere;
}

.payable-progress {
    margin-top: -4px;
}

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

.payable-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(13, 27, 20, .05);
    color: rgba(13, 27, 20, .66);
    font-size: 12px;
    font-weight: 850;
}

.payable-meta svg {
    width: 15px;
    height: 15px;
}

.payable-notes {
    margin: 0;
    color: rgba(13, 27, 20, .64);
    line-height: 1.55;
    font-weight: 650;
}

.payable-naming-guide {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    padding: 13px;
    border: 1px solid rgba(10, 163, 110, .18);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(232, 255, 245, .86), rgba(255, 248, 219, .52));
    color: rgba(13, 27, 20, .72);
    font-size: 13px;
    line-height: 1.45;
}

.payable-naming-guide svg {
    width: 19px;
    height: 19px;
    color: var(--primary);
}

.payable-naming-guide strong,
.payable-naming-guide span {
    display: block;
}

.payable-naming-guide strong {
    color: var(--ink);
    font-weight: 900;
}

.payable-naming-guide span {
    margin-top: 3px;
    font-weight: 700;
}

.payable-form .form-grid.two {
    align-items: start;
    gap: 14px;
}

.payable-form .field {
    min-width: 0;
}

.payable-form input,
.payable-form select {
    min-height: 54px;
}

.payable-form textarea {
    min-height: 98px;
}

.payable-recurrence-grid.is-single {
    grid-template-columns: 1fr;
}

[data-payable-installments-field][hidden] {
    display: none !important;
}

.payable-form input.is-invalid {
    border-color: rgba(220, 38, 38, .72);
    background: #fff7f7;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .1);
}

.field-error[hidden] {
    display: none !important;
}

.payable-payment-form {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 20px;
    background: rgba(255, 255, 255, .78);
}

.payable-payment-form .field input {
    min-height: 44px;
}

.payable-actions {
    margin-top: auto;
}

.status-pending {
    background: #fff8e6;
    color: #8a5b12;
}

.status-partial {
    background: #e8eefc;
    color: #1d4ed8;
}

.status-paid {
    background: #eefaf4;
    color: #0f6b49;
}

.status-archived {
    background: #f1f5f9;
    color: #475569;
}

.category-builder-layout {
    grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
}

.category-builder-panel {
    position: sticky;
    top: 18px;
}

.panel-lead {
    max-width: 360px;
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.choice-trigger {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    text-align: left;
}

.choice-trigger:hover,
.choice-trigger:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 166, 106, .12);
    outline: none;
}

.choice-trigger > span:nth-child(2) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 750;
}

.color-swatch,
.color-option span {
    display: inline-block;
    width: 26px;
    height: 26px;
    border: 3px solid #fff;
    border-radius: 999px;
    background: var(--swatch-color);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .14);
}

.icon-choice-preview {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 14%, white);
    color: var(--primary-strong);
}

.category-preview {
    display: grid;
    gap: 12px;
    padding-top: 4px;
}

.category-preview-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-preview-head strong,
.category-preview-head small {
    display: block;
}

.category-preview-head small {
    color: var(--muted);
    font-size: 12px;
}

.category-preview-icon {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--category-color) 18%, white);
    color: color-mix(in srgb, var(--category-color) 75%, #111827);
}

.category-preview-chat {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(22, 166, 106, .08), transparent 34%),
        #f8fafc;
}

.preview-bubble {
    max-width: 92%;
    margin: 0;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 12px;
    line-height: 1.35;
}

.preview-bubble-user {
    justify-self: end;
    padding: 8px 10px;
    background: #dcf8c6;
}

.preview-bubble-bot {
    display: grid;
    gap: 7px;
    justify-self: start;
    padding: 10px;
    background: #fff;
}

.preview-bubble-bot strong {
    font-size: 14px;
}

.preview-bubble-bot span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: #334155;
    font-size: 13px;
}

.preview-bubble-bot b {
    min-width: 0;
    overflow-wrap: anywhere;
}

.preview-bubble-bot small {
    color: var(--muted);
}

.zg-modal[hidden] {
    display: none !important;
}

.zg-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 20px;
}

.zg-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .52);
}

.zg-modal-card {
    position: relative;
    width: min(680px, 100%);
    max-height: min(720px, calc(100vh - 40px));
    overflow: auto;
    padding: 18px;
    border: 1px solid rgba(219, 227, 238, .9);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 28px 90px rgba(15, 23, 42, .28);
}

.zg-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.zg-modal-head h2 {
    font-size: 20px;
}

.color-palette,
.icon-palette {
    display: grid;
    gap: 10px;
}

.color-palette {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.icon-palette {
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.color-option,
.icon-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 12px;
    border: 1px solid #dbe3ee;
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    text-align: left;
}

.color-option:hover,
.icon-option:hover,
.color-option:focus-visible,
.icon-option:focus-visible,
.color-option.is-selected,
.icon-option.is-selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 166, 106, .12);
    outline: none;
}

.icon-option span {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #eefaf4;
    color: var(--primary-strong);
}

.card-actions,
.example-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.tabs a {
    min-height: 34px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.tabs a.is-active,
.tabs a:hover {
    border-color: #9fd8bd;
    background: #eefaf4;
    color: var(--primary-strong);
}

.example-chip {
    min-height: 32px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 750;
}

.example-chip:hover {
    border-color: var(--primary);
    color: var(--primary-strong);
}

.parsed-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.parsed-list div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.parsed-list dt {
    color: var(--muted);
    font-weight: 750;
}

.parsed-list dd {
    margin: 0;
    font-weight: 800;
}

.warning-list {
    margin: 16px 0 0;
    padding-left: 18px;
    color: var(--warning);
    font-weight: 650;
}

.billing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}

.billing-hero,
.billing-plan,
.billing-note {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.billing-hero {
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(245, 188, 22, .18), transparent 16rem),
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 255, 251, .9));
}

.billing-hero h2 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(30px, 4vw, 52px);
    line-height: .98;
    font-weight: 900;
}

.billing-hero p {
    max-width: 720px;
    margin: 16px 0 0;
    color: rgba(13, 27, 20, .68);
    font-size: 16px;
    line-height: 1.65;
}

.billing-status-card {
    display: grid;
    gap: 7px;
    align-content: center;
    padding: 18px;
    border: 1px solid rgba(10, 163, 110, .14);
    border-radius: 22px;
    background: rgba(232, 255, 245, .62);
}

.billing-status-card span,
.billing-status-card small {
    color: rgba(13, 27, 20, .62);
    font-weight: 800;
}

.billing-status-card strong {
    color: var(--green-2);
    font-size: 28px;
    line-height: 1;
    font-weight: 950;
}

.billing-status-card em {
    width: fit-content;
    padding: 7px 10px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font-style: normal;
    font-size: 12px;
    font-weight: 900;
}

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

.billing-plan {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    overflow: hidden;
}

.billing-plan .button {
    margin-top: auto;
}

.billing-plan h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1;
}

.billing-plan p {
    margin: 10px 0 0;
    color: rgba(13, 27, 20, .64);
    line-height: 1.55;
}

.billing-plan-featured {
    border-color: rgba(10, 163, 110, .28);
    background:
        radial-gradient(circle at top right, rgba(245, 188, 22, .2), transparent 13rem),
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(232, 255, 245, .7));
}

.billing-plan-current {
    border-color: rgba(10, 163, 110, .18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 255, 251, .86));
}

.billing-plan-badge {
    width: fit-content;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--green);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.billing-plan-badge-muted {
    background: #eef4f0;
    color: var(--green-2);
}

.billing-disabled-button,
.billing-disabled-button:hover {
    cursor: not-allowed;
    opacity: .72;
    transform: none;
    box-shadow: none;
}

.billing-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.billing-price strong {
    color: var(--ink);
    font-size: clamp(34px, 4vw, 48px);
    line-height: 1;
    font-weight: 950;
}

.billing-price span {
    color: rgba(13, 27, 20, .58);
    font-weight: 800;
}

.billing-benefits {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.billing-benefits li,
.billing-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.billing-benefits svg,
.billing-note svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--green);
}

.billing-benefits span,
.billing-note p {
    color: rgba(13, 27, 20, .72);
    line-height: 1.5;
    font-weight: 700;
}

.billing-note {
    margin-top: 18px;
    padding: 16px;
    background: rgba(255, 248, 219, .62);
}

.billing-note p {
    margin: 0;
}

.billing-note a {
    color: var(--green-2);
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-body {
    min-height: 100vh;
    background: #eef3f8;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(280px, .9fr) minmax(320px, 520px);
    gap: 26px;
    min-height: 100vh;
    padding: 28px;
}

.auth-panel {
    display: flex;
    min-height: calc(100vh - 56px);
    flex-direction: column;
    justify-content: space-between;
    padding: 32px;
    border-radius: var(--radius);
    background: #132238;
    color: #fff;
}

.auth-panel .brand small,
.auth-copy p {
    color: #cbd5e1;
}

.auth-copy {
    max-width: 560px;
}

.auth-copy h1 {
    font-size: 42px;
    line-height: 1.05;
}

.auth-copy p {
    font-size: 17px;
    line-height: 1.6;
}

.auth-card {
    align-self: center;
    width: 100%;
    padding: 28px;
}

.form-heading {
    margin-bottom: 18px;
}

.form-heading h2 {
    font-size: 26px;
}

.auth-switch {
    margin: 16px 0 0;
    color: var(--muted);
    text-align: center;
}

.auth-switch a {
    color: var(--primary-strong);
    font-weight: 800;
}

@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .dashboard-grid,
    .bot-layout,
    .category-layout {
        grid-template-columns: 1fr;
    }

    .category-builder-panel {
        position: static;
    }
}

@media (max-width: 840px) {
    .sidebar-close {
        display: inline-flex;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        max-width: calc(100vw - 32px);
        z-index: 40;
        transform: translateX(-100%);
        transition: transform .18s ease;
        overflow-y: auto;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar-close {
        display: inline-flex;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 35;
        display: block;
        pointer-events: none;
        background: rgba(15, 23, 42, .48);
        opacity: 0;
        transition: opacity .18s ease;
    }

    body.sidebar-open .sidebar-overlay {
        pointer-events: auto;
        opacity: 1;
    }

    [data-sidebar-toggle] {
        display: inline-flex;
    }

    .main-content {
        padding: 18px;
    }

    .topbar h1 {
        font-size: 23px;
    }

    .whatsapp-start-panel {
        grid-template-columns: 1fr;
    }

    .whatsapp-qr-card {
        grid-template-columns: auto minmax(0, 1fr);
        justify-items: start;
        text-align: left;
    }

    .whatsapp-qr-card img {
        width: 112px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .auth-panel {
        min-height: auto;
        gap: 34px;
    }

    .auth-copy h1 {
        font-size: 32px;
    }

    .billing-hero,
    .billing-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .stats-grid,
    .stats-grid-finance,
    .filter-grid,
    .form-grid.two {
        grid-template-columns: 1fr;
    }

    .filter-grid .field:nth-child(3) {
        grid-column: auto;
    }

    .category-list {
        grid-template-columns: 1fr;
    }

    .color-palette,
    .icon-palette {
        grid-template-columns: 1fr;
    }

    .zg-modal {
        padding: 12px;
    }

    .zg-modal-card {
        max-height: calc(100vh - 24px);
    }

    .filter-actions,
    .panel-header,
    .section-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .button {
        width: 100%;
    }

    .whatsapp-start-panel {
        padding: 18px;
        border-radius: 22px;
    }

    .whatsapp-start-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .whatsapp-number {
        justify-content: center;
        width: 100%;
        white-space: normal;
        text-align: center;
    }

    .icon-button {
        width: 38px;
    }

    .chart-box {
        height: 260px;
    }

    .auth-card,
    .auth-panel,
    .toolbar-panel,
    .panel {
        padding: 16px;
    }

    .parsed-list div {
        grid-template-columns: 1fr;
    }
}

/* ZapeiGastei premium visual refresh */
:root {
    --green: #0aa36e;
    --green-2: #0d7f59;
    --green-3: #e8fff5;
    --gold: #f5bc16;
    --gold-2: #ffd866;
    --ink: #0d1b14;
    --muted: #617065;
    --bg: #f7fbf8;
    --surface: rgba(255, 255, 255, .88);
    --surface-solid: #ffffff;
    --surface-soft: #eefaf3;
    --line: rgba(13, 27, 20, .1);
    --primary: #0aa36e;
    --primary-strong: #0d7f59;
    --secondary: #f5bc16;
    --danger: #dc2626;
    --warning: #b7791f;
    --radius: 24px;
    --radius-lg: 32px;
    --radius-sm: 16px;
    --shadow: 0 22px 58px rgba(13, 27, 20, .09);
    --shadow-soft: 0 14px 34px rgba(13, 27, 20, .07);
    --shadow-green: 0 22px 55px rgba(10, 163, 110, .24);
}

html {
    background: #ffffff;
}

body {
    background:
        radial-gradient(circle at top left, rgba(245, 188, 22, .2), transparent 32rem),
        radial-gradient(circle at top right, rgba(10, 163, 110, .14), transparent 34rem),
        linear-gradient(180deg, #ffffff 0%, #f4faf6 48%, #ffffff 100%);
    color: var(--ink);
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(13, 27, 20, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13, 27, 20, .035) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .9), transparent 88%);
}

.app-shell {
    position: relative;
    grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    z-index: 1;
    gap: 24px;
    padding: 26px 18px;
    border-right: 1px solid rgba(13, 27, 20, .08);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(18px);
    box-shadow: 18px 0 60px rgba(13, 27, 20, .05);
}

.main-content {
    position: relative;
    z-index: 1;
}

.brand {
    gap: 13px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--green), #19c989 52%, var(--gold));
    box-shadow: 0 14px 30px rgba(10, 163, 110, .24);
    font-weight: 900;
    position: relative;
    overflow: hidden;
}

.brand-mark::after {
    content: "";
    position: absolute;
    width: 68%;
    height: 68%;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 13px;
    transform: rotate(12deg);
}

.brand strong {
    color: var(--ink);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -.04em;
}

.brand small {
    color: rgba(13, 27, 20, .58);
    font-weight: 600;
}

.nav-list {
    gap: 8px;
}

.nav-list a {
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 18px;
    color: rgba(13, 27, 20, .74);
    font-weight: 800;
    transition:
        transform .2s ease,
        border-color .2s ease,
        background .2s ease,
        color .2s ease,
        box-shadow .2s ease;
}

.nav-list a:hover,
.nav-list a.is-active {
    background: linear-gradient(135deg, rgba(232, 255, 245, .92), rgba(255, 248, 219, .66));
    border-color: rgba(10, 163, 110, .16);
    color: var(--green-2);
    box-shadow: 0 12px 28px rgba(13, 27, 20, .05);
}

.nav-list a:hover {
    transform: translateX(2px);
}

.sidebar-footer {
    gap: 12px;
}

.user-chip {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 11px;
    border: 1px solid rgba(13, 27, 20, .09);
    border-radius: 20px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 12px 32px rgba(13, 27, 20, .05);
}

.user-chip > span {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    background: linear-gradient(135deg, #e8fff5, #fff4cc);
    color: var(--green-2);
}

.main-content {
    max-width: 1540px;
    margin: 0 auto;
    padding: 32px clamp(20px, 3vw, 38px) 44px;
}

.topbar {
    justify-content: flex-start;
    margin-bottom: 22px;
}

.topbar-dashboard {
    position: relative;
    justify-content: space-between;
    gap: 18px;
    min-height: 148px;
    padding: 28px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 92% 18%, rgba(245, 188, 22, .26), transparent 15rem),
        linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(244, 255, 249, .88));
    box-shadow: var(--shadow);
    overflow: hidden;
}

.topbar-dashboard::after {
    content: "";
    position: absolute;
    right: -34px;
    bottom: -54px;
    width: 170px;
    height: 170px;
    border: 1px solid rgba(10, 163, 110, .12);
    border-radius: 48px;
    transform: rotate(18deg);
}

.topbar-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.topbar h1 {
    font-size: clamp(30px, 3vw, 44px);
    line-height: .98;
    letter-spacing: -.06em;
    font-weight: 900;
}

.whatsapp-start-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
    gap: 20px;
    align-items: center;
    margin-bottom: 22px;
    padding: 22px;
    border: 1px solid rgba(10, 163, 110, .16);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(232, 255, 245, .92), rgba(255, 251, 235, .68)),
        #ffffff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.whatsapp-start-copy {
    min-width: 0;
}

.whatsapp-start-copy h2,
.whatsapp-start-copy p {
    margin: 0;
}

.whatsapp-start-copy h2 {
    max-width: 760px;
    font-size: clamp(24px, 2.2vw, 34px);
    line-height: 1.02;
    font-weight: 900;
}

.whatsapp-start-copy p {
    max-width: 760px;
    margin-top: 10px;
    color: rgba(13, 27, 20, .68);
    font-size: 15px;
    line-height: 1.55;
}

.whatsapp-start-copy strong {
    color: rgba(13, 27, 20, .88);
}

.whatsapp-start-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
}

.whatsapp-number {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid rgba(10, 163, 110, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: rgba(13, 27, 20, .72);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.whatsapp-number svg {
    width: 16px;
    height: 16px;
}

.whatsapp-qr-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 20px;
    background: rgba(255, 255, 255, .82);
    text-align: center;
}

.whatsapp-qr-card img {
    display: block;
    width: min(150px, 100%);
    height: auto;
    border-radius: 12px;
}

.whatsapp-qr-card strong,
.whatsapp-qr-card small {
    display: block;
}

.whatsapp-qr-card strong {
    color: rgba(13, 27, 20, .9);
    font-weight: 900;
}

.whatsapp-qr-card small {
    margin-top: 2px;
    color: rgba(13, 27, 20, .58);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

@media (max-width: 840px) {
    .whatsapp-start-panel {
        grid-template-columns: 1fr;
    }

    .whatsapp-qr-card {
        grid-template-columns: auto minmax(0, 1fr);
        justify-items: start;
        text-align: left;
    }

    .whatsapp-qr-card img {
        width: 112px;
    }
}

@media (max-width: 640px) {
    .whatsapp-start-panel {
        padding: 18px;
        border-radius: 22px;
    }

    .whatsapp-start-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .whatsapp-number {
        justify-content: center;
        width: 100%;
        white-space: normal;
        text-align: center;
    }
}

.topbar-copy p {
    max-width: 560px;
    margin: 12px 0 0;
    color: rgba(13, 27, 20, .66);
    font-size: 16px;
    line-height: 1.55;
}

.topbar-action {
    position: relative;
    z-index: 1;
}

.eyebrow {
    color: var(--green);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.button,
.icon-button,
.example-chip,
.tabs a {
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease,
        border-color .2s ease,
        color .2s ease;
}

.button {
    min-height: 44px;
    padding: 11px 17px;
    border-radius: 999px;
    font-weight: 900;
}

.button:hover,
.icon-button:hover,
.example-chip:hover,
.tabs a:hover {
    transform: translateY(-2px);
}

.button-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--green), #13bf82);
    border-color: transparent;
    box-shadow: var(--shadow-green);
}

.button-primary:hover {
    background: linear-gradient(135deg, #0b9668, #14c987);
    box-shadow: 0 28px 70px rgba(10, 163, 110, .32);
}

.button-secondary {
    color: #3d2b00;
    background: linear-gradient(135deg, #fff7d8, #ffffff);
    border-color: rgba(245, 188, 22, .34);
    box-shadow: 0 14px 34px rgba(245, 188, 22, .12);
}

.button-ghost {
    border-color: rgba(13, 27, 20, .11);
    background: rgba(255, 255, 255, .82);
    color: rgba(13, 27, 20, .78);
    box-shadow: 0 12px 28px rgba(13, 27, 20, .04);
}

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

.icon-button {
    width: 42px;
    height: 42px;
    border-color: rgba(13, 27, 20, .11);
    border-radius: 15px;
    background: rgba(255, 255, 255, .84);
    color: rgba(13, 27, 20, .74);
}

.icon-button:hover {
    border-color: rgba(10, 163, 110, .28);
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(13, 27, 20, .07);
}

.icon-button.danger:hover {
    border-color: rgba(220, 38, 38, .22);
    color: var(--danger);
}

.toolbar-panel,
.panel,
.stat-card,
.category-card,
.auth-card {
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.toolbar-panel,
.panel {
    margin-bottom: 20px;
    padding: 22px;
}

.panel-header,
.section-title-row,
.filter-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.filter-panel-head h2,
.panel h2,
.section-title-row h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(20px, 1.5vw, 24px);
    font-weight: 900;
    letter-spacing: -.045em;
}

.dashboard-filter-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(250, 255, 252, .88));
}

.filter-toggle {
    display: none;
}

.filter-toggle-close {
    display: none;
}

.dashboard-filter {
    grid-template-columns:
        minmax(160px, .9fr)
        minmax(150px, .8fr)
        minmax(250px, 1.8fr)
        minmax(190px, 1.1fr)
        minmax(150px, .8fr);
    gap: 14px;
}

.dashboard-filter .field:nth-child(3) {
    grid-column: auto;
}

.dashboard-filter .filter-actions {
    grid-column: span 2;
}

.field {
    gap: 7px;
}

.field > span {
    color: rgba(13, 27, 20, .78);
    font-size: 12px;
    font-weight: 900;
}

.field input,
.field select,
.field textarea {
    min-height: 44px;
    border: 1px solid rgba(13, 27, 20, .14);
    border-radius: 15px;
    background: rgba(255, 255, 255, .88);
    color: var(--ink);
    padding: 10px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.field input::placeholder,
.field textarea::placeholder {
    color: rgba(13, 27, 20, .48);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(10, 163, 110, .62);
    box-shadow:
        0 0 0 4px rgba(10, 163, 110, .13),
        inset 0 1px 0 rgba(255, 255, 255, .7);
}

.filter-actions {
    align-self: end;
    gap: 10px;
}

.stats-grid {
    gap: 16px;
}

.stats-grid-finance {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 20px;
}

.stat-card {
    position: relative;
    min-height: 152px;
    padding: 18px;
    overflow: hidden;
    transition:
        transform .22s ease,
        box-shadow .22s ease,
        border-color .22s ease;
    animation: surfaceIn .58s ease both;
}

.stat-card:nth-child(2) {
    animation-delay: .04s;
}

.stat-card:nth-child(3) {
    animation-delay: .08s;
}

.stat-card:nth-child(4) {
    animation-delay: .12s;
}

.stat-card:nth-child(5) {
    animation-delay: .16s;
}

.stat-card:nth-child(6) {
    animation-delay: .2s;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -42px;
    bottom: -50px;
    width: 130px;
    height: 130px;
    border-radius: 36px;
    background: rgba(10, 163, 110, .07);
    transform: rotate(18deg);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(10, 163, 110, .18);
    box-shadow: var(--shadow);
}

.stat-card-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 14px;
    background: linear-gradient(135deg, #e8fff5, #fff4cc);
    color: var(--green-2);
    box-shadow: 0 12px 28px rgba(10, 163, 110, .12);
}

.stat-icon svg {
    width: 18px;
    height: 18px;
}

.stat-card span.stat-label {
    display: block;
    color: rgba(13, 27, 20, .62);
    font-size: 13px;
    font-weight: 900;
}

.stat-card strong,
.stat-card small,
.stat-card .progress {
    position: relative;
    z-index: 1;
}

.stat-card strong {
    margin: 12px 0 6px;
    color: var(--ink);
    font-size: clamp(23px, 1.7vw, 31px);
    font-weight: 900;
    letter-spacing: -.055em;
}

.stat-card small {
    color: rgba(13, 27, 20, .62);
    font-size: 12px;
    font-weight: 650;
}

.stat-income .stat-icon,
.stat-balance.is-positive .stat-icon {
    background: linear-gradient(135deg, #e8fff5, #ffffff);
    color: var(--green-2);
}

.stat-expense .stat-icon,
.stat-balance.is-negative .stat-icon {
    background: linear-gradient(135deg, #fff1f2, #ffffff);
    color: var(--danger);
}

.stat-income strong,
.stat-balance.is-positive strong,
.money-cell.type-income {
    color: var(--green-2);
}

.stat-expense strong,
.stat-balance.is-negative strong,
.money-cell.type-expense {
    color: var(--danger);
}

.progress {
    height: 8px;
    margin: 10px 0 5px;
    background: rgba(13, 27, 20, .08);
}

.progress span {
    background: linear-gradient(90deg, var(--green), var(--gold));
}

.dashboard-grid {
    gap: 20px;
}

.chart-panel {
    position: relative;
    overflow: hidden;
}

.chart-panel::after {
    content: "";
    position: absolute;
    right: -58px;
    top: -62px;
    width: 170px;
    height: 170px;
    border-radius: 42px;
    background: rgba(245, 188, 22, .08);
    transform: rotate(18deg);
    pointer-events: none;
}

.chart-panel .panel-header,
.chart-box {
    position: relative;
    z-index: 1;
}

.chart-box {
    height: 324px;
}

.chart-box-donut {
    height: 342px;
}

.chart-box-wide {
    height: 360px;
}

.table-wrap {
    border-radius: 20px;
}

.data-table {
    min-width: 860px;
}

.data-table th {
    padding: 13px 12px;
    color: rgba(13, 27, 20, .62);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
}

.data-table td {
    padding: 14px 12px;
    color: rgba(13, 27, 20, .84);
}

.data-table tbody tr {
    transition: background .18s ease, transform .18s ease;
}

.data-table tbody tr:hover {
    background: rgba(232, 255, 245, .48);
}

.recent-description {
    font-weight: 800;
}

.category-pill,
.type-pill,
.status-pill {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
}

.type-pill.type-income {
    background: #e8fff5;
    color: var(--green-2);
}

.type-pill.type-expense {
    background: #fff1f2;
    color: var(--danger);
}

.category-pill {
    border: 1px solid color-mix(in srgb, var(--pill-color) 18%, white);
    background: color-mix(in srgb, var(--pill-color) 14%, white);
}

.empty-inline {
    border-color: rgba(10, 163, 110, .2);
    border-radius: 18px;
    background: rgba(232, 255, 245, .45);
    color: rgba(13, 27, 20, .62);
}

.tabs a,
.example-chip {
    border-radius: 999px;
}

.category-card {
    padding: 18px;
}

.category-card,
.panel,
.toolbar-panel {
    animation: surfaceIn .6s ease both;
}

@keyframes surfaceIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1280px) {
    .stats-grid-finance {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .dashboard-filter .filter-actions,
    .dashboard-filter .field:nth-child(3) {
        grid-column: auto;
    }
}

@media (max-width: 980px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .chart-box-donut {
        height: 310px;
    }
}

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

    .sidebar {
        position: fixed;
        z-index: 45;
        inset: 12px auto 12px 12px;
        width: min(82vw, 306px);
        height: auto;
        max-width: calc(100vw - 44px);
        border: 1px solid rgba(13, 27, 20, .1);
        border-radius: 28px;
        box-shadow: 0 30px 80px rgba(13, 27, 20, .2);
        transform: translateX(calc(-100% - 24px));
    }

    .sidebar-overlay {
        background: rgba(13, 27, 20, .46);
        backdrop-filter: blur(5px);
    }

    .main-content {
        padding: 18px clamp(14px, 4vw, 22px) 32px;
    }

    .topbar-dashboard {
        min-height: 0;
        align-items: flex-start;
        padding: 20px;
        border-radius: 26px;
    }

    .topbar-dashboard [data-sidebar-toggle] {
        margin-top: 2px;
    }

    .topbar h1 {
        font-size: clamp(28px, 9vw, 38px);
    }

    .topbar-action {
        align-self: center;
    }
}

@media (max-width: 700px) {
    .dashboard-recent-table,
    .dashboard-recent-table thead,
    .dashboard-recent-table tbody,
    .dashboard-recent-table tr,
    .dashboard-recent-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .dashboard-recent-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 12px;
    }

    .dashboard-recent-table thead {
        display: none;
    }

    .dashboard-recent-table tbody tr {
        padding: 14px;
        border: 1px solid rgba(13, 27, 20, .08);
        border-radius: 20px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(250, 255, 252, .9));
        box-shadow: 0 12px 30px rgba(13, 27, 20, .06);
    }

    .dashboard-recent-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 9px 0;
        border-bottom: 1px solid rgba(13, 27, 20, .07);
        text-align: right !important;
    }

    .dashboard-recent-table td::before {
        content: attr(data-label);
        color: rgba(13, 27, 20, .55);
        font-size: 11px;
        font-weight: 900;
        letter-spacing: .06em;
        text-transform: uppercase;
        text-align: left;
    }

    .dashboard-recent-table td:first-child {
        padding-top: 0;
    }

    .dashboard-recent-table td:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .dashboard-recent-table .recent-description {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
        color: var(--ink);
        font-size: 16px;
        text-align: left !important;
    }

    .dashboard-recent-table .recent-description::before {
        content: attr(data-label);
    }

    .dashboard-recent-table .table-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .topbar-dashboard {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .topbar-dashboard .topbar-copy {
        min-width: 0;
    }

    .topbar-dashboard .topbar-action {
        grid-column: 1 / -1;
        width: 100%;
    }

    .topbar-copy p {
        font-size: 14px;
    }

    .toolbar-panel,
    .panel {
        padding: 18px;
        border-radius: 22px;
    }

    .filter-panel-head,
    .panel-header,
    .section-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-filter-panel .filter-panel-head {
        gap: 12px;
        margin-bottom: 0;
    }

    .filter-toggle {
        display: inline-flex;
        width: 100%;
    }

    .dashboard-filter {
        grid-template-columns: 1fr;
        max-height: 0;
        margin-top: 0;
        overflow: hidden;
        opacity: 0;
        transition:
            max-height .28s ease,
            opacity .22s ease,
            margin-top .22s ease;
    }

    .dashboard-filter-panel.is-open .dashboard-filter {
        max-height: 920px;
        margin-top: 16px;
        opacity: 1;
    }

    .dashboard-filter-panel.is-open .filter-toggle-open {
        display: none;
    }

    .dashboard-filter-panel.is-open .filter-toggle-close {
        display: inline;
    }

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

    .stat-card {
        min-height: 138px;
        padding: 15px;
        border-radius: 20px;
    }

    .stat-card-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .stat-card strong {
        font-size: clamp(21px, 6vw, 27px);
    }

    .phone-pending-box {
        grid-template-columns: 1fr;
    }

    .chart-box,
    .chart-box-donut,
    .chart-box-wide {
        height: 250px;
    }

    .recent-panel .panel-header .button,
    .filter-actions .button {
        width: 100%;
    }

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .data-table td {
        font-size: 14px;
    }

    .category-filter-panel {
        align-items: stretch;
        flex-direction: column;
        padding: 16px;
        border-radius: 22px;
    }

    .category-type-filter {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        border-radius: 18px;
    }

    .category-type-filter a {
        min-width: 0;
        padding: 9px 8px;
    }

    .category-type-filter a span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 380px) {
    .stats-grid-finance {
        display: flex;
        margin-right: -14px;
        padding-right: 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }

    .stats-grid-finance .stat-card {
        min-width: 218px;
        scroll-snap-align: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-card,
    .panel,
    .toolbar-panel,
    .stat-card {
        animation: none !important;
    }

    .button:hover,
    .icon-button:hover,
    .example-chip:hover,
    .tabs a:hover,
    .nav-list a:hover,
    .stat-card:hover {
        transform: none;
    }
}

/* Brand identity and premium auth experience */
.brand-logo {
    padding: 0;
    background: transparent;
    box-shadow: 0 14px 30px rgba(10, 163, 110, .2);
}

.brand-logo::after {
    display: none;
}

.brand-logo img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: contain;
}

.brand-word,
.brand-kicker {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    font-family: "Sora", "Inter", ui-sans-serif, system-ui, sans-serif;
    letter-spacing: -.045em;
    white-space: nowrap;
}

.brand-word-zapei {
    color: var(--green);
}

.brand-word-gastei {
    color: #66736b;
}

.brand strong.brand-word {
    font-size: 18px;
    font-weight: 800;
}

.brand-large strong.brand-word {
    font-size: 22px;
}

.brand-kicker {
    margin-bottom: 6px;
    color: inherit;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -.035em;
    text-transform: none;
}

.brand-inline {
    display: inline-flex;
    align-items: baseline;
    font-family: "Sora", "Inter", ui-sans-serif, system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -.035em;
    white-space: nowrap;
}

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 10%, rgba(245, 188, 22, .18), transparent 26rem),
        radial-gradient(circle at 88% 16%, rgba(10, 163, 110, .18), transparent 30rem),
        linear-gradient(180deg, #ffffff 0%, #f4faf6 52%, #eef7f1 100%);
}

.auth-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(13, 27, 20, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13, 27, 20, .035) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .9), transparent 84%);
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(1220px, calc(100% - 48px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 26px 0;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 520px);
    gap: 28px;
    align-items: stretch;
}

.auth-panel {
    position: relative;
    min-height: min(840px, calc(100vh - 52px));
    align-self: stretch;
    padding: 34px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 34px;
    background:
        radial-gradient(circle at 86% 14%, rgba(245, 188, 22, .28), transparent 19rem),
        radial-gradient(circle at 12% 82%, rgba(10, 163, 110, .25), transparent 18rem),
        linear-gradient(145deg, #102018, #0d1b14 54%, #123826);
    box-shadow: 0 34px 90px rgba(13, 27, 20, .24);
    color: #ffffff;
    overflow: hidden;
}

.auth-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .85), transparent 92%);
}

.auth-panel::after {
    content: "";
    position: absolute;
    right: -52px;
    bottom: -70px;
    width: 230px;
    height: 230px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 62px;
    transform: rotate(18deg);
}

.auth-panel > * {
    position: relative;
    z-index: 1;
}

.auth-panel .brand-word-gastei {
    color: rgba(238, 244, 240, .76);
}

.auth-panel .brand small {
    color: rgba(255, 255, 255, .7);
}

.auth-copy {
    max-width: 690px;
    margin-top: auto;
}

.auth-kicker {
    color: var(--gold);
}

.auth-copy h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(44px, 5.4vw, 76px);
    line-height: .94;
    letter-spacing: -.078em;
    font-weight: 900;
}

.auth-copy p {
    max-width: 620px;
    margin: 22px 0 0;
    color: rgba(255, 255, 255, .76);
    font-size: clamp(16px, 1.7vw, 19px);
    line-height: 1.7;
}

.auth-preview {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(220px, 1fr);
    gap: 14px;
    margin-top: 26px;
}

.auth-preview-card,
.auth-chat {
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 26px;
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 22px 46px rgba(0, 0, 0, .16);
    backdrop-filter: blur(14px);
}

.auth-preview-card {
    padding: 20px;
}

.auth-preview-card small,
.auth-preview-card span {
    display: block;
    color: rgba(255, 255, 255, .66);
    font-weight: 700;
}

.auth-preview-card strong {
    display: block;
    margin: 10px 0 7px;
    color: #ffffff;
    font-size: 32px;
    line-height: 1;
    letter-spacing: -.06em;
}

.auth-preview-card-main {
    background: linear-gradient(135deg, rgba(10, 163, 110, .92), rgba(18, 200, 136, .82) 54%, rgba(245, 188, 22, .82));
}

.auth-chat {
    display: grid;
    align-content: center;
    gap: 10px;
    padding: 18px;
}

.auth-chat-bubble {
    justify-self: end;
    max-width: 84%;
    padding: 11px 13px;
    border-radius: 18px 18px 5px 18px;
    background: #dcf8c6;
    color: #143024;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
}

.auth-chat-bubble.bot {
    justify-self: start;
    border-radius: 18px 18px 18px 5px;
    background: #ffffff;
}

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

.auth-onboarding div {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 20px;
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
    font-weight: 800;
}

.auth-onboarding svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--gold-2);
}

.auth-card {
    position: relative;
    align-self: stretch;
    display: flex;
    min-height: min(840px, calc(100vh - 52px));
    flex-direction: column;
    justify-content: center;
    width: 100%;
    padding: 36px;
    border-radius: 32px;
    background:
        radial-gradient(circle at top right, rgba(245, 188, 22, .18), transparent 13rem),
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 255, 251, .9));
    box-shadow: 0 28px 80px rgba(13, 27, 20, .12);
    overflow: hidden;
}

.auth-card::after {
    content: "";
    position: absolute;
    right: -48px;
    bottom: -58px;
    width: 150px;
    height: 150px;
    border-radius: 42px;
    background: rgba(10, 163, 110, .08);
    transform: rotate(18deg);
}

.auth-card > * {
    position: relative;
    z-index: 1;
}

.form-heading {
    margin-bottom: 22px;
}

.form-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(29px, 3vw, 38px);
    line-height: 1;
    letter-spacing: -.06em;
    font-weight: 900;
}

.form-heading p {
    max-width: 390px;
    margin: 12px 0 0;
    color: rgba(13, 27, 20, .64);
    line-height: 1.58;
}

.auth-card .stack-form {
    gap: 15px;
}

.auth-card .field input {
    min-height: 50px;
    border-radius: 17px;
    background: rgba(255, 255, 255, .9);
}

.auth-card .button-primary.full {
    min-height: 50px;
    margin-top: 2px;
}

.auth-first-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding: 15px;
    border: 1px solid rgba(10, 163, 110, .16);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(232, 255, 245, .86), rgba(255, 248, 219, .58));
}

.auth-first-steps strong,
.auth-first-steps span {
    display: block;
}

.auth-first-steps strong {
    color: var(--green-2);
    font-size: 13px;
    font-weight: 900;
}

.auth-first-steps span {
    margin-top: 3px;
    color: rgba(13, 27, 20, .66);
    font-size: 12px;
    line-height: 1.45;
}

.auth-first-steps svg {
    width: 24px;
    height: 24px;
    color: var(--gold);
}

.auth-switch {
    margin-top: 20px;
    color: rgba(13, 27, 20, .62);
    font-weight: 650;
}

.auth-switch a {
    color: var(--green-2);
    font-weight: 900;
}

.auth-link-row {
    margin: 12px 0 0;
    text-align: center;
    font-size: 13px;
    font-weight: 850;
}

.auth-link-row a {
    color: var(--green-2);
}

.auth-legal-link,
.auth-legal-links {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    margin-top: 16px;
    color: rgba(13, 27, 20, .54);
    font-size: 12px;
    font-weight: 800;
}

.auth-legal-links {
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.auth-legal-link:hover,
.auth-legal-links a:hover {
    color: var(--green-2);
}

@media (max-width: 1080px) {
    .auth-shell {
        grid-template-columns: 1fr;
        width: min(760px, calc(100% - 32px));
        padding: 18px 0 34px;
    }

    .auth-panel {
        min-height: auto;
        gap: 28px;
    }

    .auth-card {
        min-height: auto;
        justify-content: flex-start;
    }

    .auth-copy {
        margin-top: 28px;
    }

    .auth-copy h1 {
        max-width: 660px;
    }
}

@media (max-width: 680px) {
    .brand-large .brand-mark {
        width: 48px;
        height: 48px;
    }

    .auth-shell {
        width: min(100% - 28px, 760px);
        padding: 14px 0 24px;
    }

    .auth-panel,
    .auth-card {
        border-radius: 26px;
        padding: 22px;
    }

    .auth-panel {
        gap: 20px;
    }

    .auth-copy {
        margin-top: 20px;
    }

    .auth-copy h1 {
        font-size: clamp(32px, 10vw, 42px);
        line-height: 1;
    }

    .auth-copy p {
        margin-top: 16px;
        font-size: 15px;
        line-height: 1.55;
    }

    .auth-preview {
        display: none;
    }

    .auth-onboarding {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 18px;
    }

    .auth-onboarding div {
        min-height: 44px;
        padding: 10px 12px;
    }

    .auth-card .form-grid.two {
        grid-template-columns: 1fr;
    }
}

body.auth-body:not(.admin-auth-body) .auth-shell {
    grid-template-columns: minmax(320px, .86fr) minmax(380px, 520px);
    gap: 28px;
}

body.auth-body:not(.admin-auth-body) .auth-panel {
    display: flex;
    min-height: min(760px, calc(100vh - 52px));
    flex-direction: column;
    justify-content: space-between;
    padding: 36px;
}

body.auth-body:not(.admin-auth-body) .auth-copy {
    max-width: 560px;
    margin-top: auto;
}

body.auth-body:not(.admin-auth-body) .auth-copy h1 {
    max-width: 560px;
    font-size: clamp(40px, 4.6vw, 64px);
    line-height: .96;
}

body.auth-body:not(.admin-auth-body) .auth-copy p {
    max-width: 500px;
    margin-top: 18px;
}

.auth-benefits {
    display: grid;
    gap: 10px;
    max-width: 420px;
    margin-top: 28px;
}

.auth-benefits div,
.auth-whatsapp-mini {
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(12px);
}

.auth-benefits div {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding: 11px 13px;
    border-radius: 18px;
    color: rgba(255, 255, 255, .84);
    font-size: 13px;
    font-weight: 850;
}

.auth-benefits svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--gold-2);
}

.auth-whatsapp-mini {
    display: grid;
    width: min(100%, 360px);
    gap: 9px;
    margin-top: 30px;
    padding: 16px;
    border-radius: 24px;
    color: #143024;
}

.auth-whatsapp-mini span,
.auth-whatsapp-mini strong {
    width: fit-content;
    max-width: 100%;
    padding: 10px 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
    font-size: 13px;
}

.auth-whatsapp-mini span {
    justify-self: end;
    border-radius: 16px 16px 5px 16px;
    background: #dcf8c6;
    font-weight: 850;
}

.auth-whatsapp-mini strong {
    justify-self: start;
    border-radius: 16px 16px 16px 5px;
    background: #ffffff;
    font-weight: 900;
}

@media (max-width: 1080px) {
    body.auth-body:not(.admin-auth-body) .auth-shell {
        grid-template-columns: 1fr;
        width: min(760px, calc(100% - 32px));
    }

    body.auth-body:not(.admin-auth-body) .auth-card {
        order: 1;
    }

    body.auth-body:not(.admin-auth-body) .auth-panel {
        order: 2;
        min-height: auto;
    }
}

@media (max-width: 680px) {
    body.auth-body:not(.admin-auth-body) .auth-shell {
        width: min(100% - 24px, 760px);
        padding: 12px 0 22px;
        gap: 14px;
    }

    body.auth-body:not(.admin-auth-body) .auth-card {
        padding: 22px;
        border-radius: 26px;
    }

    body.auth-body:not(.admin-auth-body) .auth-panel {
        padding: 20px;
        border-radius: 24px;
    }

    body.auth-body:not(.admin-auth-body) .auth-copy {
        margin-top: 28px;
    }

    body.auth-body:not(.admin-auth-body) .auth-copy h1 {
        font-size: clamp(30px, 9vw, 38px);
        line-height: 1;
    }

    body.auth-body:not(.admin-auth-body) .auth-copy p {
        margin-top: 12px;
        font-size: 14px;
        line-height: 1.5;
    }

    .auth-benefits {
        margin-top: 18px;
    }

    .auth-benefits div {
        min-height: 42px;
        padding: 10px 12px;
    }

    .auth-whatsapp-mini {
        display: none;
    }
}

/* Public legal pages */
.public-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 8%, rgba(245, 188, 22, .18), transparent 28rem),
        radial-gradient(circle at 90% 10%, rgba(10, 163, 110, .16), transparent 34rem),
        linear-gradient(180deg, #ffffff 0%, #f5fbf7 48%, #ffffff 100%);
}

.public-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(13, 27, 20, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13, 27, 20, .035) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .86), transparent 90%);
}

.public-nav {
    position: sticky;
    top: 16px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(1180px, calc(100% - 40px));
    margin: 16px auto 0;
    padding: 12px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 24px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 18px 45px rgba(13, 27, 20, .08);
    backdrop-filter: blur(18px);
}

.public-main {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 34px 0 72px;
}

.public-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
    gap: clamp(24px, 5vw, 56px);
    align-items: center;
    min-height: calc(100vh - 150px);
    padding: 18px 0 44px;
}

.landing-hero-copy {
    max-width: 720px;
}

.landing-kicker {
    display: inline-flex;
    margin-bottom: 18px;
    color: var(--green-2);
}

.landing-hero-copy h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(44px, 7vw, 86px);
    line-height: .96;
    font-weight: 900;
}

.landing-hero-copy p {
    max-width: 620px;
    margin: 24px 0 0;
    color: rgba(13, 27, 20, .68);
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.65;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.landing-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.landing-trust span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(10, 163, 110, .14);
    border-radius: 999px;
    background: rgba(255, 255, 255, .74);
    color: rgba(13, 27, 20, .7);
    font-size: 13px;
    font-weight: 850;
}

.landing-trust svg,
.landing-mini-list svg,
.landing-steps svg {
    width: 17px;
    height: 17px;
}

.landing-preview {
    position: relative;
    display: grid;
    gap: 18px;
    align-content: center;
}

.landing-phone,
.landing-dashboard-card,
.landing-steps article {
    border: 1px solid rgba(13, 27, 20, .08);
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.landing-phone {
    width: min(100%, 390px);
    justify-self: end;
    padding: 18px;
    border-radius: 34px;
    background:
        linear-gradient(180deg, rgba(237, 255, 247, .96), rgba(255, 255, 255, .96));
}

.landing-phone-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(13, 27, 20, .08);
}

.landing-phone-top strong,
.landing-phone-top small {
    display: block;
}

.landing-phone-top strong {
    color: var(--ink);
    font-weight: 900;
}

.landing-phone-top small {
    margin-top: 2px;
    color: rgba(13, 27, 20, .55);
    font-size: 12px;
}

.landing-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(13, 27, 20, .08);
}

.landing-avatar img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.landing-chat-line {
    width: fit-content;
    max-width: 82%;
    margin-top: 14px;
    padding: 11px 13px;
    border-radius: 18px;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
}

.landing-chat-line.sent {
    margin-left: auto;
    border-bottom-right-radius: 6px;
    background: #d9fdd3;
}

.landing-chat-line.received {
    border-bottom-left-radius: 6px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(13, 27, 20, .07);
}

.landing-dashboard-card {
    width: min(100%, 420px);
    margin-top: -12px;
    padding: 22px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(245, 188, 22, .22), transparent 12rem),
        #ffffff;
}

.landing-dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.landing-dashboard-header span {
    color: rgba(13, 27, 20, .58);
    font-size: 13px;
    font-weight: 800;
}

.landing-dashboard-header strong {
    color: var(--green-2);
    font-size: 26px;
    line-height: 1;
}

.landing-bars {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    align-items: end;
    height: 118px;
    margin-top: 22px;
    padding: 12px;
    border-radius: 22px;
    background: rgba(232, 255, 245, .58);
}

.landing-bars span {
    display: block;
    min-height: 24px;
    height: var(--bar-height);
    border-radius: 999px 999px 8px 8px;
    background: linear-gradient(180deg, var(--green), var(--gold));
}

.landing-mini-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.landing-mini-list span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 16px;
    color: rgba(13, 27, 20, .72);
    font-size: 13px;
    font-weight: 800;
}

.landing-mini-list strong {
    margin-left: auto;
    color: var(--ink);
}

.landing-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 16px;
}

.landing-steps article {
    padding: 24px;
    border-radius: 28px;
}

.landing-steps svg {
    width: 24px;
    height: 24px;
    color: var(--green);
}

.landing-steps h2 {
    margin: 18px 0 0;
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
}

.landing-steps p {
    margin: 12px 0 0;
    color: rgba(13, 27, 20, .68);
    line-height: 1.65;
}

.legal-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 22px;
    align-items: stretch;
    margin-bottom: 22px;
}

.legal-hero-copy,
.legal-summary-card,
.legal-card,
.legal-toc {
    border: 1px solid rgba(13, 27, 20, .08);
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.legal-hero-copy {
    position: relative;
    padding: clamp(28px, 5vw, 54px);
    border-radius: 34px;
    background:
        radial-gradient(circle at 92% 15%, rgba(245, 188, 22, .24), transparent 18rem),
        linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(244, 255, 249, .9));
    overflow: hidden;
}

.legal-hero-copy::after {
    content: "";
    position: absolute;
    right: -42px;
    bottom: -64px;
    width: 180px;
    height: 180px;
    border: 1px solid rgba(10, 163, 110, .13);
    border-radius: 50px;
    transform: rotate(18deg);
}

.legal-hero-copy h1 {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0;
    color: var(--ink);
    font-size: clamp(42px, 6vw, 76px);
    line-height: .94;
    letter-spacing: -.078em;
    font-weight: 900;
}

.legal-hero-copy p {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 22px 0 0;
    color: rgba(13, 27, 20, .68);
    font-size: clamp(16px, 1.7vw, 19px);
    line-height: 1.7;
}

.legal-meta {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.legal-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid rgba(10, 163, 110, .14);
    border-radius: 999px;
    background: rgba(255, 255, 255, .74);
    color: rgba(13, 27, 20, .68);
    font-size: 12px;
    font-weight: 850;
}

.legal-meta svg {
    width: 16px;
    height: 16px;
    color: var(--green);
}

.legal-summary-card {
    position: relative;
    padding: 28px;
    border-radius: 34px;
    background:
        radial-gradient(circle at top right, rgba(245, 188, 22, .3), transparent 12rem),
        linear-gradient(145deg, #102018, #0d1b14 60%, #123826);
    color: #ffffff;
    overflow: hidden;
}

.legal-summary-card::after {
    content: "";
    position: absolute;
    right: -56px;
    bottom: -62px;
    width: 160px;
    height: 160px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 44px;
    transform: rotate(18deg);
}

.legal-summary-icon {
    display: inline-grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--green), var(--gold));
    box-shadow: 0 18px 40px rgba(10, 163, 110, .22);
}

.legal-summary-icon svg {
    width: 24px;
    height: 24px;
}

.legal-summary-card h2 {
    margin: 24px 0 0;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -.055em;
}

.legal-summary-card p {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, .74);
    line-height: 1.7;
}

.legal-layout {
    display: grid;
    grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.legal-toc {
    position: sticky;
    top: 112px;
    display: grid;
    gap: 7px;
    padding: 18px;
    border-radius: 24px;
}

.legal-toc strong {
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
}

.legal-toc a {
    padding: 10px 11px;
    border-radius: 14px;
    color: rgba(13, 27, 20, .68);
    font-size: 13px;
    font-weight: 800;
    transition:
        background .2s ease,
        color .2s ease,
        transform .2s ease;
}

.legal-toc a:hover {
    transform: translateX(2px);
    background: linear-gradient(135deg, rgba(232, 255, 245, .9), rgba(255, 248, 219, .6));
    color: var(--green-2);
}

.legal-card {
    padding: clamp(22px, 4vw, 42px);
    border-radius: 30px;
}

.legal-section {
    scroll-margin-top: 120px;
    padding: 8px 0 30px;
    border-bottom: 1px solid rgba(13, 27, 20, .08);
}

.legal-section:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.legal-section + .legal-section {
    padding-top: 30px;
}

.legal-section h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(24px, 2.5vw, 34px);
    line-height: 1;
    letter-spacing: -.055em;
}

.legal-section p {
    margin: 14px 0 0;
    color: rgba(13, 27, 20, .72);
    font-size: 16px;
    line-height: 1.75;
}

.legal-list {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.legal-list li {
    position: relative;
    padding: 12px 14px 12px 42px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 18px;
    background: rgba(248, 255, 251, .72);
    color: rgba(13, 27, 20, .72);
    line-height: 1.55;
}

.legal-list li::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), var(--gold));
    box-shadow: 0 0 0 5px rgba(10, 163, 110, .1);
}

.legal-highlight {
    margin: 28px -14px 0;
    padding: 28px 14px 30px;
    border: 1px solid rgba(10, 163, 110, .14);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(245, 188, 22, .16), transparent 14rem),
        rgba(232, 255, 245, .45);
}

.legal-contact {
    padding-bottom: 0;
}

.legal-email {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 13px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--green), #13bf82);
    color: #ffffff;
    font-weight: 900;
    box-shadow: var(--shadow-green);
}

.legal-email svg {
    width: 18px;
    height: 18px;
}

.legal-note {
    padding: 12px 14px;
    border: 1px solid rgba(245, 188, 22, .28);
    border-radius: 18px;
    background: rgba(255, 248, 219, .7);
    font-size: 13px !important;
}

@media (max-width: 940px) {
    .landing-hero,
    .landing-steps,
    .legal-hero,
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .landing-hero {
        min-height: auto;
        padding-top: 28px;
    }

    .landing-phone,
    .landing-dashboard-card {
        justify-self: stretch;
        width: 100%;
    }

    .legal-toc {
        position: static;
    }
}

@media (max-width: 640px) {
    .public-nav,
    .public-main {
        width: min(100% - 28px, 1180px);
    }

    .public-nav {
        top: 10px;
        align-items: stretch;
        flex-direction: column;
    }

    .public-nav-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .public-nav .button,
    .landing-actions .button {
        width: 100%;
    }

    .public-main {
        padding-top: 24px;
    }

    .landing-hero-copy h1 {
        font-size: clamp(38px, 12vw, 54px);
    }

    .landing-actions,
    .landing-trust {
        display: grid;
        grid-template-columns: 1fr;
    }

    .landing-trust span {
        justify-content: center;
    }

    .legal-hero-copy,
    .legal-summary-card,
    .legal-card {
        border-radius: 26px;
    }

    .legal-hero-copy,
    .legal-summary-card,
    .legal-card,
    .legal-toc {
        padding: 22px;
    }

    .legal-hero-copy h1 {
        font-size: clamp(36px, 12vw, 48px);
    }

    .legal-meta span,
    .legal-email {
        width: 100%;
        justify-content: center;
    }

.legal-highlight {
    margin-inline: 0;
    padding-inline: 18px;
}
}

@media (max-width: 1180px) {
    .payables-filter {
        grid-template-columns: 1fr 1fr;
    }

    .payables-filter .filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 840px) {
    .dashboard-payables-panel {
        grid-template-columns: 1fr;
    }

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

    .payables-stats,
    .payables-filter {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 640px) {
    .dashboard-payables-panel {
        padding: 18px;
        border-radius: 22px;
    }

    .dashboard-payables-metrics {
        grid-template-columns: 1fr;
    }

    .payable-card-head {
        align-items: stretch;
        flex-direction: column;
    }

    .payable-values {
        grid-template-columns: 1fr;
    }
}

.button .fa-solid,
.button .fa-brands,
.mobile-bottom-nav .fa-solid,
.mobile-bottom-nav .fa-brands {
    width: 18px;
    text-align: center;
    line-height: 1;
}

.topbar-whatsapp {
    position: relative;
    z-index: 1;
    margin-left: auto;
}

.app-footer-note {
    display: flex;
    justify-content: center;
    gap: 10px 14px;
    flex-wrap: wrap;
    margin: 22px auto 0;
    padding: 8px 12px;
    color: rgba(13, 27, 20, .52);
    font-size: 12px;
    font-weight: 750;
    text-align: center;
}

.app-footer-note a {
    color: rgba(13, 27, 20, .66);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.app-footer-note a:hover {
    color: var(--primary-strong);
}

.app-modal[hidden],
.mobile-bottom-nav {
    display: none;
}

.app-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 22px;
}

.app-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(13, 27, 20, .48);
    backdrop-filter: blur(7px);
}

.app-modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    padding: 24px;
    border: 1px solid rgba(13, 27, 20, .1);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(245, 188, 22, .2), transparent 14rem),
        linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(244, 255, 249, .94));
    box-shadow: 0 32px 90px rgba(13, 27, 20, .24);
}

.app-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, .9);
}

.app-modal-card h2,
.app-modal-card p {
    margin: 0;
}

.app-modal-card h2 {
    max-width: 92%;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -.06em;
}

.app-modal-card p {
    margin-top: 12px;
    color: rgba(13, 27, 20, .68);
    line-height: 1.55;
    font-weight: 650;
}

.app-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.modal-icon {
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 16px;
}

.modal-icon svg {
    width: 22px;
    height: 22px;
}

.modal-icon-danger {
    background: #fff1f2;
    color: var(--danger);
}

.confirm-modal-card {
    width: min(100%, 440px);
}

.whatsapp-modal-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
    gap: 20px;
    align-items: center;
    width: min(100%, 720px);
}

@media (max-width: 840px) {
    body {
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
    }

    .topbar-whatsapp {
        display: none;
    }

    .app-footer-note {
        margin-bottom: 8px;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: max(12px, env(safe-area-inset-left));
        right: max(12px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
        z-index: 900;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        width: auto;
        max-width: 560px;
        margin: 0 auto;
        padding: 8px;
        border: 1px solid rgba(13, 27, 20, .1);
        border-radius: 24px;
        background: rgba(255, 255, 255, .94);
        box-shadow: 0 18px 52px rgba(13, 27, 20, .18);
        backdrop-filter: blur(16px);
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        display: grid;
        justify-items: center;
        gap: 5px;
        min-width: 0;
        min-height: 54px;
        padding: 8px 4px;
        border: 0;
        border-radius: 18px;
        background: transparent;
        color: rgba(13, 27, 20, .62);
        font-size: 11px;
        font-weight: 900;
        line-height: 1.1;
    }

    .mobile-bottom-nav i {
        font-size: 18px;
    }

    .mobile-bottom-nav a.is-active,
    .mobile-bottom-nav button:hover {
        background: linear-gradient(135deg, rgba(232, 255, 245, .96), rgba(255, 248, 219, .74));
        color: var(--primary-strong);
    }
}

@media (max-width: 640px) {
    .app-modal {
        align-items: end;
        padding: 14px;
    }

    .app-modal-card {
        width: 100%;
        max-height: calc(100vh - 28px);
        overflow: auto;
        padding: 22px;
        border-radius: 24px;
    }

    .app-modal-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .whatsapp-modal-card {
        grid-template-columns: 1fr;
    }

    .whatsapp-modal-card .whatsapp-qr-card {
        grid-template-columns: auto minmax(0, 1fr);
        justify-items: start;
        text-align: left;
    }

    .whatsapp-modal-card .whatsapp-qr-card img {
        width: 104px;
    }
}

/* Admin panel */
.admin-body .main-content {
    max-width: 1500px;
}

.admin-sidebar .nav-list a.is-active,
.admin-sidebar .nav-list a:hover {
    background: linear-gradient(135deg, rgba(232, 255, 245, .94), rgba(255, 248, 219, .66));
}

.admin-auth-panel {
    background:
        radial-gradient(circle at 18% 12%, rgba(245, 188, 22, .2), transparent 18rem),
        linear-gradient(145deg, #102018, #0d1b14 58%, #123826);
}

.admin-auth-preview .auth-preview-card strong {
    letter-spacing: -.08em;
}

.admin-stats-grid {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.admin-filter-grid {
    grid-template-columns: minmax(240px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
}

.admin-filter-grid .field-wide {
    grid-column: auto;
}

.admin-table-title {
    display: block;
    color: var(--ink);
    font-weight: 900;
}

.admin-table-action {
    min-height: 36px;
    padding: 8px 11px;
    font-size: 12px;
}

.admin-pill {
    margin-top: 7px;
    background: linear-gradient(135deg, rgba(232, 255, 245, .94), rgba(255, 248, 219, .74));
    color: var(--green-2);
}

.status-active {
    background: #eefaf4;
    color: #0f6b49;
}

.status-trialing {
    background: #e8eefc;
    color: #1d4ed8;
}

.status-past_due {
    background: #fff8e6;
    color: #8a5b12;
}

.status-canceled {
    background: #fff1f2;
    color: #b91c1c;
}

.admin-user-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.admin-user-title {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.admin-user-title h2,
.admin-user-title p {
    margin: 0;
}

.admin-user-title h2 {
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1;
    letter-spacing: -.06em;
    font-weight: 900;
}

.admin-user-title p {
    margin-top: 7px;
    color: rgba(13, 27, 20, .62);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.admin-avatar {
    display: inline-grid;
    width: 58px;
    height: 58px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--green), #19c989 52%, var(--gold));
    color: #ffffff;
    font-size: 22px;
    font-weight: 950;
    box-shadow: var(--shadow-green);
}

.admin-user-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.admin-plan-card {
    background:
        radial-gradient(circle at top right, rgba(245, 188, 22, .2), transparent 13rem),
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 255, 251, .9));
}

.admin-plan-card p {
    margin: 0 0 16px;
    color: rgba(13, 27, 20, .68);
    line-height: 1.6;
    font-weight: 650;
}

.admin-meta-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.admin-meta-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(13, 27, 20, .08);
}

.admin-meta-list div:last-child {
    border-bottom: 0;
}

.admin-meta-list dt {
    color: rgba(13, 27, 20, .58);
    font-weight: 800;
}

.admin-meta-list dd {
    margin: 0;
    color: var(--ink);
    font-weight: 900;
    text-align: right;
}

.admin-security-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(245, 188, 22, .24);
    border-radius: 18px;
    background: rgba(255, 248, 219, .62);
    color: rgba(13, 27, 20, .68);
    font-size: 13px;
    line-height: 1.5;
    font-weight: 700;
}

.admin-security-note svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--gold);
}

.admin-security-note code {
    color: var(--green-2);
    font-weight: 900;
}

.admin-captcha-slot {
    min-height: 1px;
}

.admin-whatsapp-hero {
    align-items: center;
}

.admin-whatsapp-hero p {
    max-width: 820px;
    margin: 8px 0 0;
    color: rgba(13, 27, 20, .66);
    line-height: 1.6;
    font-weight: 650;
}

.admin-template-layout {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.admin-template-list {
    position: sticky;
    top: 18px;
}

.admin-template-nav {
    display: grid;
    gap: 10px;
}

.admin-template-nav a {
    display: grid;
    gap: 5px;
    padding: 14px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 18px;
    background: rgba(255, 255, 255, .72);
    color: rgba(13, 27, 20, .68);
    text-decoration: none;
}

.admin-template-nav a:hover,
.admin-template-nav a.is-active {
    border-color: rgba(10, 163, 110, .22);
    background: linear-gradient(135deg, rgba(232, 255, 245, .9), rgba(255, 248, 219, .6));
    color: var(--ink);
}

.admin-template-nav strong {
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
}

.admin-template-nav span {
    font-size: 12px;
    line-height: 1.45;
    font-weight: 650;
}

.admin-template-nav small {
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(10, 163, 110, .12);
    color: var(--green-2);
    font-size: 11px;
    font-weight: 900;
}

.admin-template-editor textarea {
    min-height: 120px;
    font-family: "Inter", system-ui, sans-serif;
    line-height: 1.5;
}

.admin-template-editor textarea[name="body"] {
    min-height: 360px;
}

.admin-template-toggle {
    justify-content: flex-start;
    text-align: left;
}

.admin-template-help,
.admin-template-preview {
    padding: 16px;
    border: 1px solid rgba(13, 27, 20, .08);
    border-radius: 20px;
    background: rgba(255, 255, 255, .72);
}

.admin-template-help h3 {
    margin: 3px 0 0;
    font-size: 18px;
    letter-spacing: -.03em;
}

.admin-template-help p {
    margin: 8px 0 0;
    color: rgba(13, 27, 20, .62);
    font-weight: 700;
}

.admin-template-vars {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.admin-template-vars code,
.admin-template-preview code {
    padding: 5px 8px;
    border-radius: 10px;
    background: rgba(13, 27, 20, .06);
    color: var(--green-2);
    font-size: 12px;
    font-weight: 900;
}

.admin-template-preview pre {
    max-height: 300px;
    margin: 10px 0 0;
    overflow: auto;
    white-space: pre-wrap;
    color: rgba(13, 27, 20, .72);
    font: 700 13px/1.55 "Inter", system-ui, sans-serif;
}

.admin-template-preview small {
    display: block;
    margin-top: 12px;
    color: rgba(13, 27, 20, .62);
    font-weight: 800;
}

@media (max-width: 1180px) {
    .admin-filter-grid,
    .admin-detail-grid,
    .admin-template-layout {
        grid-template-columns: 1fr;
    }

    .admin-template-list {
        position: static;
    }
}

@media (max-width: 840px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-user-hero {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-user-title {
        align-items: flex-start;
    }

    .admin-avatar {
        width: 50px;
        height: 50px;
        border-radius: 18px;
    }

    .admin-meta-list div {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .admin-meta-list dd {
        text-align: left;
    }

    .admin-template-editor textarea[name="body"] {
        min-height: 280px;
    }
}
