:root { font-family: system-ui, sans-serif; color: #172738; background: #edf2f6; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at top left, #dcece7, transparent 60%); }
.card { width: 100%; max-width: 440px; background: white; border: 1px solid #dce4e9; border-radius: 24px; padding: 40px; box-shadow: 0 18px 60px #1727380d; }
.brand { font-size: 11px; letter-spacing: 2px; font-weight: 750; color: #287162; margin: 0 0 32px; }
h1 { font-size: 28px; letter-spacing: -.8px; margin: 0 0 12px; overflow-wrap: anywhere; }
.subtitle { color: #667381; line-height: 1.6; margin: 0 0 28px; }
label { display: block; margin: 18px 0 8px; font-size: 14px; font-weight: 600; }
input { width: 100%; border: 1px solid #bdcbd4; border-radius: 10px; padding: 12px; font: inherit; }
input:focus-visible, button:focus-visible { outline: 3px solid #7ab8a8; outline-offset: 3px; }
button { width: 100%; border: 0; border-radius: 10px; padding: 14px; font: inherit; font-weight: 650; background: #206a59; color: white; cursor: pointer; margin-top: 26px; }
button:hover { background: #185242; }
button span { float: right; }
.secondary { background: #edf3f1; color: #206a59; }
.secondary:hover { background: #dceae5; }
.notice { padding: 12px; border-radius: 8px; background: #e8f4ee; font-size: 14px; line-height: 1.5; }
.error { background: #fff0ee; color: #963d30; }
.success-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #e8f4ee; color: #206a59; font-size: 24px; margin-bottom: 22px; }
@media (max-width: 480px) { .card { padding: 28px 24px; } }
a { color: #206a59; text-underline-offset: 3px; }
.button-link { display: block; background: #206a59; color: white; border-radius: 10px; padding: 14px; text-align: center; text-decoration: none; font-weight: 650; }
.workspace { display: block; padding: 0 24px 40px; }
.app-shell { width: 100%; max-width: 1180px; margin: auto; }
.app-header, .account, .section-heading, .form-actions { display: flex; align-items: center; gap: 18px; }
.app-header { justify-content: space-between; padding: 24px 0; }
.app-header .brand { margin: 0; text-decoration: none; }
.compact { width: auto; margin: 0; padding: 11px 20px; }
.tabs { border-bottom: 1px solid #cddbd5; margin-bottom: 32px; }
.tabs a { display: inline-block; padding: 12px 20px; border-bottom: 3px solid transparent; text-decoration: none; font-weight: 650; color: #667381; }
.tabs a[aria-current="page"] { border-bottom-color: #206a59; color: #206a59; }
.subtabs { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.subtabs a { padding: 10px 20px; border-radius: 10px; text-decoration: none; color: #667381; }
.subtabs a[aria-current="page"] { background: #dceae5; color: #206a59; font-weight: 650; }
.panel { background: white; border: 1px solid #dce4e9; border-radius: 16px; padding: 28px; margin-top: 24px; }
h2 { font-size: 19px; margin: 0 0 16px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
select { width: 100%; border: 1px solid #bdcbd4; border-radius: 10px; padding: 12px; font: inherit; background: white; }
select:focus-visible, a:focus-visible { outline: 3px solid #7ab8a8; outline-offset: 3px; }
.hint { color: #667381; font-size: 13px; line-height: 1.6; }
.field-error { color: #963d30; font-size: 13px; }
.field-error:empty { display: none; }
.section-heading { justify-content: space-between; flex-wrap: wrap; }
.section-heading h2 { margin: 0; }
.section-heading p { margin: 0; font-size: 14px; }
.empty { color: #667381; padding: 20px 0; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; text-align: left; }
th, td { padding: 15px 14px; border-bottom: 1px solid #e8edef; white-space: nowrap; }
thead { color: #667381; background: #f5f8f7; font-size: 12px; }
.table-sort-button { display: inline-flex; align-items: center; gap: 8px; width: auto; margin: 0; padding: 4px 0; border-radius: 4px; background: transparent; color: inherit; font: inherit; font-weight: 650; text-align: left; }
.table-sort-button:hover { background: transparent; color: #206a59; }
.table-sort-button .sort-indicator { float: none; color: #667381; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: #206a59; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.quote-meta { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 11px; color: #667381; font-weight: 400; white-space: normal; max-width: 380px; line-height: 1.5; }
.delete-resource { margin-top: 20px; padding-top: 20px; border-top: 1px solid #e8edef; }
.danger { background: #fff0ee; color: #963d30; }
.danger:hover { background: #f8dcd7; }
.loan-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.loan-form-grid + .form-actions { margin-top: 24px; }
.expense-actions { margin-top: 24px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.summary-card { border: 1px solid #dce4e9; background: #f5f8f7; border-radius: 12px; padding: 20px; }
.summary-card p { margin: 0 0 10px; font-size: 13px; color: #667381; }
.summary-card strong { display: block; font-size: 25px; overflow-wrap: anywhere; }
.summary-card small { display: block; margin-top: 10px; color: #667381; line-height: 1.5; }
.loan-ended, .rental-ended { color: #707b84; background: #f0f2f3; }
.loan-ended a, .rental-ended a { color: #50655e; }
.income-total { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 20px; margin: 20px 0; padding: 24px; border-radius: 16px; background: #d1e4d9; border: 1px solid #aacbb9; }
.income-total p { margin: 0 0 8px; color: #426456; font-size: 14px; }
.income-total strong { font-size: 30px; overflow-wrap: anywhere; }
.income-breakdown { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #426456; }
.dashboard { margin: 0 0 28px; }
.dashboard-primary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metric-card { padding: 20px 24px; border: 1px solid #c6dcd1; border-radius: 14px; background: #e1eee8; color: #264f3c; min-width: 0; }
.metric-card p { margin: 0 0 8px; font-size: 14px; font-weight: 650; }
.metric-card strong { display: block; font-size: 27px; line-height: 1.3; overflow-wrap: anywhere; }
.metric-card small { display: block; font-size: 12px; margin-top: 6px; line-height: 1.5; }
.dashboard-derived { display: grid; gap: 12px; margin-top: 14px; }
.metric-derived { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.metric-derived p { margin-bottom: 0; }
.metric-net { background: #e6f0fd; border-color: #bdd5f4; color: #184d85; }
.metric-allocation { background: #fff3d9; border-color: #e9d199; color: #795300; }
.metric-consumption { background: #efe8fa; border-color: #d2c0ec; color: #623a8a; }
@media (max-width: 700px) { .dashboard-primary { grid-template-columns: 1fr; gap: 10px; } .metric-derived { align-items: flex-start; flex-direction: column; gap: 10px; } .metric-card strong { font-size: 24px; } }
.loan-name { min-width: 160px; max-width: 280px; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 900px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .workspace { padding: 0 12px 24px; } .panel { padding: 20px 16px; } .form-grid, .summary-grid { grid-template-columns: 1fr; gap: 0; } .summary-grid { gap: 12px; } .app-header { gap: 12px; } .account { gap: 8px; font-size: 13px; } .app-header .brand { font-size: 9px; letter-spacing: 1px; } }
