:root {
    --font-main: 'Inter', system-ui, sans-serif;
    --color-bg: #f5f7fa;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #1f2937;
    --color-dim: #6b7280;
    --color-accent: #2563eb;
    --color-income: #0f9d58;
    --color-expense: #d97706;
    --color-expense-strong: #dc2626;
    --color-debt: #b45309;
    --radius: 8px;
    --gap: 18px;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    padding: 40px 24px;
}

a {
    color: var(--color-accent);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

.auth-bar {
    position: fixed;
    top: 10px;
    right: 14px;
    z-index: 50;
    display: flex;
    gap: .5rem;
    font-size: .85rem;
    align-items: center;
}

.auth-bar .btn {
    font-size: .75rem;
    padding: .35rem .75rem
}

.btn {
    background: var(--color-accent);
    border: 1px solid var(--color-accent);
    color: #fff;
    border-radius: 6px;
    padding: .6rem 1rem;
    cursor: pointer;
    display: inline-block;
    font-size: .85rem;
    line-height: 1.1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.btn:hover {
    background: #1d4ed8;
}

.btn-outline {
    background: #fff;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}

.btn-outline:hover {
    background: #eff6ff;
}

.btn-muted {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-muted:hover {
    background: #e2e8f0;
}

.btn-xs {
    padding: .25rem .55rem;
    font-size: .65rem;
    line-height: 1;
    border-radius: 4px;
}

.inline-actions {
    display: flex;
    gap: .4rem;
    align-items: center;
    flex-wrap: wrap;
}

.link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.25rem 1.35rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .04), 0 4px 16px -4px rgba(0, 0, 0, .06);
    position: relative;
}

.card h3 {
    margin: .2rem 0 .6rem;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--color-dim);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.stat-main {
    font-size: 1.05rem;
    font-weight: 600;
}

.stat-sub {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--color-dim);
}

.grid-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1.6rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
    background: #fff;
}

.table th, .table td {
    padding: .5rem .6rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.table th {
    font-size: .65rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-dim);
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 12px;
    font-size: .65rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.badge-income {
    background: #dcfce7;
    color: #166534;
}

.badge-expense {
    background: #fef3c7;
    color: #92400e;
}

.badge-plan {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-fact {
    background: #dbeafe;
    color: #1e3a8a;
}

.notice {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    color: #334155;
    padding: 1.2rem 1.3rem;
    border-radius: var(--radius);
    font-size: .9rem;
    line-height: 1.5;
}

.layout-wrap {
    max-width: 1180px;
    margin: 0 auto;
}

.page-head {
    margin: 0 0 1.2rem;
}

.page-head h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: .03em;
}

.muted {
    color: var(--color-dim);
}

.flex-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.loan-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: var(--gap);
    margin-top: 1rem;
}

.form-wrap {
    max-width: 600px;
}

form .row {
    margin-bottom: .9rem;
}

label {
    display: block;
    font-size: .7rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    margin-bottom: .35rem;
    color: var(--color-dim);
}

input[type=text], input[type=number], input[type=password], select, textarea {
    width: 100%;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #1f2937;
    padding: .65rem .75rem;
    border-radius: 6px;
    font-family: var(--font-main);
    font-size: .85rem;
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid #93c5fd;
    border-color: #2563eb;
}

.field-error input, .field-error select, .field-error textarea {
    border-color: #f87171;
}

.field-success input {
    border-color: #4ade80;
}

.help {
    font-size: .65rem;
    opacity: .65;
    margin-top: .25rem;
}

.error-summary {
    background: #3f1e20;
    border: 1px solid #7f2e38;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    font-size: .7rem;
}

.separator {
    height: 1px;
    background: #e2e8f0;
    margin: 2rem 0;
}

.small {
    font-size: .7rem;
    letter-spacing: .05em;
    color: #64748b;
}

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

.mt1 {
    margin-top: 1rem;
}

.mt2 {
    margin-top: 2rem;
}

.mb0 {
    margin-bottom: 0;
}

.mb2 {
    margin-bottom: 2rem;
}

/* === Главная карта Chillora === */
.home-landing body, body.home-landing { background: var(--color-bg); }
.home-head { max-width: 760px; margin: 0 auto 2.2rem; text-align: center; }
.home-title { font-size: 3.2rem; margin: 0 0 .5rem; letter-spacing: .02em; font-weight: 500; }
.home-sub { margin: 0 0 .4rem; font-size: 1.05rem; color: var(--color-dim); }
.home-note { margin: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .15em; color: #94a3b8; }

.services-grid { display: grid; gap: 1.15rem; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); margin-bottom: 2.5rem; }
.service-card { position: relative; display: flex; flex-direction: column; gap: .55rem; background: var(--color-surface); border: 1px solid var(--color-border); padding: 1rem 1.05rem 1.15rem; border-radius: 14px; text-decoration: none; color: var(--color-text); box-shadow: 0 2px 4px rgba(0,0,0,.03), 0 8px 28px -8px rgba(0,0,0,.08); transition: border-color .25s, box-shadow .25s, transform .25s, background .35s; }
.service-card:focus-visible { outline: 3px solid #bfdbfe; outline-offset: 2px; }
.service-card:hover { border-color: #cbd5e1; box-shadow: 0 4px 10px rgba(0,0,0,.06), 0 12px 36px -14px rgba(0,0,0,.12); transform: translateY(-3px); }
.service-card:active { transform: translateY(-1px); }
.service-card.is-future { opacity: .8; background: linear-gradient(135deg,#f8fafc,#eef2f7); }
.service-card.is-future:hover { opacity: .95; }

.service-top { display:flex; justify-content:space-between; align-items:center; }
.service-badge { font-size:.55rem; letter-spacing:.15em; text-transform:uppercase; background:#e2e8f0; color:#475569; padding:.25rem .5rem; border-radius:24px; font-weight:600; }
.service-future { font-size:.55rem; letter-spacing:.12em; text-transform:uppercase; background:#f5d0fe; color:#86198f; padding:.25rem .55rem; border-radius:20px; font-weight:600; }
.service-name { margin:.1rem 0 .2rem; font-size:1.15rem; line-height:1.15; font-weight:500; letter-spacing:.01em; }
.service-desc { margin:0; font-size:.72rem; line-height:1.3; color:#475569; min-height:2.6em; }
.service-tone { margin-top:auto; font-size:.6rem; letter-spacing:.25em; text-transform:uppercase; color:#94a3b8; }

.home-footer { text-align:center; font-size:.65rem; letter-spacing:.35em; text-transform:uppercase; color:#94a3b8; margin:0 0 3rem; }

@media (min-width: 1100px) {
    .services-grid { grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); }
    .home-title { font-size: 3.6rem; }
}

@media (max-width: 640px) {
    body { padding: 32px 18px; }
    .home-title { font-size: 2.4rem; }
    .services-grid { gap: .85rem; }
}
