:root {
  --ink: #17212b;
  --muted: #667483;
  --line: #dbe2e8;
  --paper: #ffffff;
  --canvas: #f4f7f8;
  --accent: #0d6a61;
  --accent-dark: #084d47;
  --danger: #a93434;
  --success: #176b44;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--accent-dark); }
a:hover { color: var(--accent); }

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner, .page { max-width: 1080px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.header-inner { min-height: 66px; display: flex; gap: 24px; align-items: center; justify-content: space-between; }
.brand { color: var(--ink); font-weight: 700; text-decoration: none; letter-spacing: -0.02em; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.site-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 0.94rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent-dark); }
.logout { display: inline; }
.logout button { padding: 0; color: var(--muted); background: transparent; border: 0; font: inherit; cursor: pointer; }
.logout button:hover { color: var(--accent-dark); }

.page { padding-top: 36px; padding-bottom: 56px; }
.login-page { max-width: 480px; min-height: 100vh; display: flex; align-items: center; }
.login-card { width: 100%; margin: 0; }
.login-card h1 { margin: 0 0 8px; font-size: 1.7rem; letter-spacing: -.025em; }
.eyebrow { margin: 0 0 10px; color: var(--accent-dark); font-size: .84rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.page-heading { margin: 0 0 24px; font-size: 1.7rem; line-height: 1.2; letter-spacing: -0.025em; }
.page-intro { max-width: 680px; margin: -12px 0 24px; color: var(--muted); }

.card { margin-bottom: 20px; padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.card h2 { margin: 0 0 16px; font-size: 1.1rem; }
.card p:last-child { margin-bottom: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 20px; align-items: start; }
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat-label { color: var(--muted); font-size: .93rem; }
.stat-value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.04em; }
.hint { margin: 7px 0 0; color: var(--muted); font-size: .9rem; }

.notice, .error { margin: 0 0 20px; padding: 12px 14px; border-radius: 8px; }
.notice { color: var(--success); background: #edf8f1; border: 1px solid #c9e7d4; }
.error { color: var(--danger); background: #fdf0f0; border: 1px solid #f1cccc; }

.field { margin-bottom: 16px; }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .94rem; }
input, textarea, select {
  width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); background: #fff;
  border: 1px solid #bfcad3; border-radius: 7px; font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input[type="file"] { padding: 8px; }
input:focus, textarea:focus, select:focus, button:focus, a:focus { outline: 3px solid #97ccc6; outline-offset: 2px; }
button, .button {
  display: inline-block; min-height: 42px; padding: 10px 15px; border: 1px solid var(--accent); border-radius: 7px;
  color: #fff; background: var(--accent); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { color: #fff; background: var(--accent-dark); border-color: var(--accent-dark); }
button:disabled { color: #849099; background: #e7ecef; border-color: #e7ecef; cursor: not-allowed; }
.button-secondary { color: var(--accent-dark); background: #fff; }
.button-secondary:hover { color: #fff; }
.button-danger { background: #9e3131; border-color: #9e3131; }
.button-danger:hover { background: #7e2525; border-color: #7e2525; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.inline-form { display: inline; }
.admin-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; white-space: nowrap; }
.credit-button { min-height: 32px; padding: 5px 9px; font-size: .84rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .035em; }
tbody tr:last-child td { border-bottom: 0; }
.amount-positive { color: var(--success); font-weight: 600; }
.amount-negative { color: var(--danger); font-weight: 600; }
.checksum { font-family: Consolas, "Courier New", monospace; white-space: nowrap; }
.status { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .82rem; font-weight: 600; }
.status-active { color: #176b44; background: #e5f4e9; }
.status-inactive { color: #8a3c3c; background: #f8e4e4; }
.empty { margin: 0; color: var(--muted); }
.account-meta { display: flex; gap: 18px; flex-wrap: wrap; margin: 0; color: var(--muted); }
.account-meta strong { color: var(--ink); }
.confirmation-dialog { width: min(440px, calc(100% - 32px)); padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(23, 33, 43, .25); }
.confirmation-dialog::backdrop { background: rgba(23, 33, 43, .48); }
.confirmation-dialog form { padding: 24px; }
.confirmation-dialog h2 { margin: 0 0 12px; font-size: 1.25rem; }
.file-name { overflow-wrap: anywhere; padding: 10px 12px; color: var(--ink); background: var(--canvas); border-radius: 7px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media (max-width: 700px) {
  .header-inner { padding-top: 13px; padding-bottom: 13px; align-items: flex-start; flex-direction: column; gap: 9px; }
  .site-nav { gap: 14px; }
  .page { padding: 26px 16px 40px; }
  .header-inner { padding-left: 16px; padding-right: 16px; }
  .card { padding: 18px; }
  .split { grid-template-columns: 1fr; }
  th, td { padding: 10px 8px; }
}
