:root {
  --brand: #0b4f8a;
  --brand-dark: #083b68;
  --gold: #b8892d;
  --text: #1f2933;
  --muted: #6b7682;
  --line: #d9dee4;
  --bg: #f3f5f7;
  --white: #fff;
  --green: #1b7f3b;
  --red: #b42318;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: bold; }

/* ---------- Header / Footer ---------- */
.site-header { background: var(--white); border-bottom: 3px solid var(--brand); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 38px; height: 38px; line-height: 38px; text-align: center;
  background: var(--brand); color: #fff; font-weight: bold; letter-spacing: 1px;
  border-bottom: 3px solid var(--gold);
}
.logo-text { font-size: 18px; font-weight: bold; color: var(--brand); line-height: 1.1; }
.logo-text small { display: block; font-size: 11px; font-weight: normal; color: var(--muted); }

.header-right { display: flex; align-items: center; gap: 16px; color: var(--muted); }
.header-right strong { color: var(--text); }

.site-footer { background: #26323d; color: #b9c2cb; font-size: 12px; padding: 14px 0; margin-top: 32px; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- Form / Button ---------- */
label { display: block; font-weight: bold; margin: 14px 0 6px; }

input[type=text], input[type=password], select {
  width: 100%; height: 38px; padding: 0 10px;
  border: 1px solid #b8c0c8; border-radius: 3px; font-size: 14px; background: #fff;
}
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(11,79,138,.15); }

.btn {
  display: inline-block; height: 38px; padding: 0 20px; border-radius: 3px;
  border: 1px solid transparent; font-size: 14px; font-weight: bold; cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-light { background: #fff; color: var(--text); border-color: #b8c0c8; }
.btn-danger { background: #fff; color: var(--red); border-color: #e3b4b0; }
.btn-block { width: 100%; margin-top: 18px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-row { display: flex; gap: 10px; margin-top: 18px; }

.link-btn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

.form-error { color: var(--red); background: #fdf1f0; border: 1px solid #f1c7c3; padding: 8px 10px; margin: 14px 0 0; }
.form-ok { color: var(--green); background: #eff8f1; border: 1px solid #bfe0c8; padding: 8px 10px; margin: 14px 0 0; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 16px; }
.field-hint.ok { color: var(--green); font-weight: bold; }
.field-hint.err { color: var(--red); }

/* ---------- Login ---------- */
.login-layout { display: grid; grid-template-columns: 1fr 380px; gap: 40px; padding-top: 40px; }
.login-info h1 { color: var(--brand); font-size: 26px; margin: 0 0 10px; }
.login-info p { line-height: 1.6; }
.notice { background: #fffaf0; border-left: 4px solid var(--gold); padding: 12px 16px; margin: 20px 0; }
.notice h3 { margin: 0 0 6px; font-size: 14px; }
.notice ul { margin: 0; padding-left: 18px; line-height: 1.7; }

.login-box { background: #fff; border: 1px solid var(--line); padding: 24px 26px; }
.login-box h2 { margin: 0 0 4px; font-size: 20px; }
.pw-field { position: relative; }
.pw-field input { padding-right: 56px; }
.pw-toggle { position: absolute; right: 6px; top: 7px; height: 24px; border: 0; background: none; color: var(--brand); cursor: pointer; font-size: 12px; }
.login-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; }

/* ---------- App layout ---------- */
.app-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding-top: 24px; }
.side-nav { background: #fff; border: 1px solid var(--line); align-self: start; }
.side-nav a { display: block; padding: 12px 16px; color: var(--text); border-left: 3px solid transparent; border-bottom: 1px solid #eef0f2; }
.side-nav a:last-child { border-bottom: 0; }
.side-nav a:hover { background: #f6f8fa; text-decoration: none; }
.side-nav a.active { border-left-color: var(--brand); color: var(--brand); font-weight: bold; background: #f1f6fb; }

.page-title { font-size: 20px; margin: 0 0 16px; }

.panel { background: #fff; border: 1px solid var(--line); padding: 18px 20px; margin-bottom: 20px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }

/* Account card */
.account-card {
  background: var(--brand); color: #fff; padding: 20px 24px; margin-bottom: 20px;
  border-bottom: 4px solid var(--gold);
}
.account-card .muted { color: #c4d6e8; }
.account-head { display: flex; justify-content: space-between; font-size: 13px; }
.account-no { font-size: 22px; letter-spacing: 2px; margin: 10px 0 16px; font-family: "Courier New", monospace; }
.balance-row { display: flex; justify-content: space-between; align-items: flex-end; }
.balance { font-size: 28px; font-weight: bold; }
.account-card .link-btn { color: #fff; text-decoration: underline; }
.account-holder { margin-top: 14px; font-size: 13px; letter-spacing: 1px; color: #dfe9f3; }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 8px; border-bottom: 1px solid #eceff2; text-align: left; vertical-align: top; }
.table th { font-size: 12px; color: var(--muted); font-weight: bold; background: #fafbfc; }
.table .num { text-align: right; white-space: nowrap; }
.table td.empty { text-align: center; color: var(--muted); padding: 20px; }
.amt-in { color: var(--green); font-weight: bold; }
.amt-out { color: var(--red); font-weight: bold; }
.sub { display: block; font-size: 12px; color: var(--muted); }

/* Transfer */
.readonly-field { display: flex; justify-content: space-between; height: 38px; line-height: 38px; padding: 0 10px; background: #f6f8fa; border: 1px solid var(--line); }
#transfer-form, .summary { max-width: 520px; }
#transfer-form .btn { margin-top: 18px; }
.summary { display: grid; grid-template-columns: 160px 1fr; margin: 0; }
.summary dt, .summary dd { padding: 8px 0; border-bottom: 1px solid #eef0f2; margin: 0; }
.summary dt { color: var(--muted); }
.ok-title { color: var(--green); }

/* Badges (admin) */
.tag { display: inline-block; padding: 1px 7px; font-size: 11px; border-radius: 2px; border: 1px solid; }
.tag-ok { color: var(--green); border-color: #a8d5b5; background: #f1f9f3; }
.tag-warn { color: #8a5a00; border-color: #e8cf96; background: #fffaf0; }
.tag-bad { color: var(--red); border-color: #efb9b4; background: #fdf3f2; }
.tag-plain { color: var(--muted); border-color: var(--line); }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar select { width: auto; height: 30px; }
.toolbar label { margin: 0; }
.narrow-form { max-width: 480px; }
.nowrap { white-space: nowrap; }

@media (max-width: 760px) {
  .login-layout, .app-layout { grid-template-columns: 1fr; }
  .header-right span:first-child { display: none; }
}
