* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #1f2937; background: #f4f6f8; }
a { color: inherit; text-decoration: none; }
button, .button { border: 1px solid #c7d0dc; background: #fff; border-radius: 6px; padding: 9px 13px; cursor: pointer; font-weight: 650; display: inline-block; }
button:hover, .button:hover { background: #f2f5f9; }
.primary { background: #176b87; border-color: #176b87; color: #fff; min-height: 44px; }
.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 12px 20px; background: #102a43; color: #fff; }
.brand { font-size: 20px; font-weight: 800; white-space: nowrap; }
.topbar nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar nav a { padding: 8px 10px; border-radius: 6px; }
.topbar nav a:hover { background: rgba(255,255,255,.12); }
.page { width: 100%; max-width: none; margin: 0; padding: 22px; }
.panel { background: #fff; border: 1px solid #d8e0e8; border-radius: 8px; padding: 18px; margin-bottom: 18px; }
h1, h2 { margin: 0 0 14px; line-height: 1.25; }
h1 { font-size: 24px; } h2 { font-size: 18px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { background: #fff; border: 1px solid #d8e0e8; border-radius: 8px; padding: 18px; }
.metric span { display: block; color: #64748b; margin-bottom: 8px; }
.metric strong { font-size: 26px; }
.grid-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
label { display: grid; gap: 6px; font-weight: 650; color: #334155; position: relative; }
input, select, textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 10px; font: inherit; background: #fff; }
textarea { min-height: 88px; resize: vertical; }
.compact-deposit-form { grid-template-columns: 130px 210px 120px 170px 170px 110px 130px minmax(180px, 1fr) 86px; gap: 8px; }
.compact-deposit-form label { font-size: 12px; gap: 4px; }
.compact-deposit-form input, .compact-deposit-form select { height: 34px; padding: 6px 8px; font-size: 14px; }
.compact-deposit-form .primary { min-height: 34px; height: 34px; padding: 6px 12px; align-self: end; }
.wide { grid-column: span 2; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filters input, .filters select { width: auto; min-width: 150px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-head div, .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1500px; }
.bank-table { min-width: 1350px; }
th.col-date, td:has(.inline-deposit-date) { width: 120px; }
th.col-client, td:has(.inline-client-name) { width: 190px; }
th.col-bank, td:has(.inline-bank) { width: 70px; }
th.col-account, td:has(.inline-account-number) { width: 145px; }
th.col-holder, td:has(.inline-account-holder) { width: 145px; }
th.col-tax, td:has(.inline-tax-invoice) { width: 65px; }
th.col-amount, td:has(.inline-amount) { width: 85px; }
th.col-memo, td:has(.inline-memo) { width: 360px; }
th.col-status, td:has(.inline-status) { width: 105px; }
th.col-paid-date, td:has(.inline-paid-date) { width: 130px; }
th.col-actions { width: 112px; }
th, td { border-bottom: 1px solid #e2e8f0; padding: 10px; text-align: left; vertical-align: top; }
th { background: #f8fafc; font-size: 13px; color: #475569; white-space: nowrap; }
td { font-size: 14px; }
.sheet-input { width: 100%; min-width: 90px; border: 1px solid transparent; border-radius: 4px; padding: 7px 8px; background: #fff; }
.sheet-input:focus { border-color: #176b87; outline: 2px solid rgba(23,107,135,.12); }
.inline-deposit-date, .inline-paid-date { min-width: 120px; }
.inline-client-name { min-width: 180px; }
.inline-bank { min-width: 60px; }
.inline-tax-invoice { min-width: 55px; }
.inline-amount { min-width: 75px; }
.inline-account-number { min-width: 135px; }
.inline-account-holder { min-width: 135px; }
.inline-memo { min-width: 340px; }
.inline-status { min-width: 95px; }
.money-input { text-align: right; }
.row-actions { white-space: nowrap; }
.row-actions button { padding: 7px 9px; margin-right: 4px; }
.pagination, .bottom-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding-top: 14px; }
.bottom-pagination { padding: 0 0 22px; }
.danger-panel { border-color: #fecaca; }
.danger { background: #b42318; border-color: #b42318; color: #fff; }
.danger:hover { background: #8f1d14; }
.log-box { min-height: 180px; max-height: 360px; overflow: auto; background: #0f172a; color: #dbeafe; border-radius: 6px; padding: 12px; white-space: pre-wrap; font-size: 13px; line-height: 1.5; }
.money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.message { color: #176b87; font-weight: 700; }
.error { color: #b42318; font-weight: 700; }
.suggestions { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; box-shadow: 0 8px 24px rgba(15,23,42,.15); z-index: 20; max-height: 280px; overflow: auto; }
.suggestions:empty { display: none; }
.suggestions button { display: block; width: 100%; border: 0; border-radius: 0; text-align: left; padding: 10px; }
.suggestions button.active { background: #e8f3f7; }
.row-suggestions { position: fixed; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; box-shadow: 0 8px 24px rgba(15,23,42,.15); z-index: 30; max-height: 240px; overflow: auto; min-width: 260px; }
.row-suggestions:empty { display: none; }
.row-suggestions button { display: block; width: 100%; border: 0; border-radius: 0; text-align: left; padding: 9px; }
.row-suggestions button.active { background: #e8f3f7; }
.search { margin-bottom: 12px; max-width: 360px; }
.login-body { min-height: 100vh; display: grid; place-items: center; background: #102a43; padding: 20px; }
.login-box { width: min(420px, 100%); display: grid; gap: 14px; background: #fff; border-radius: 8px; padding: 28px; }
.login-box h1 { text-align: center; }
.import-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.upload-form { border: 1px solid #d8e0e8; border-radius: 8px; padding: 14px; display: grid; gap: 12px; }
@media (max-width: 860px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .summary-grid, .grid-form, .import-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .section-head { align-items: flex-start; flex-direction: column; }
}
