﻿:root {
  --bg: #f4f7fb;
  --bg-soft: #e9eff8;
  --surface: #ffffff;
  --surface-2: #f9fbff;
  --line: #d8e1ef;
  --line-strong: #c7d3e6;
  --text: #0f1b2d;
  --muted: #5f6f87;
  --accent: #0a4fb8;
  --accent-strong: #083f93;
  --accent-soft: #e1ecff;
  --ok: #1d7c49;
  --warn: #a26900;
  --bad: #b5302e;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 14px 30px rgba(15, 27, 45, 0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

[data-theme="dark"] {
  --bg: #050d1b;
  --bg-soft: #0b162b;
  --surface: #0e1c33;
  --surface-2: #12243f;
  --line: #223b61;
  --line-strong: #2b4974;
  --text: #f2f6ff;
  --muted: #9fb2d1;
  --accent: #6ba7ff;
  --accent-strong: #4f95f7;
  --accent-soft: rgba(107, 167, 255, 0.2);
  --ok: #6dd39a;
  --warn: #f0be67;
  --bad: #ff9c97;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: "Public Sans", "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background:
    radial-gradient(980px 560px at -12% -20%, rgba(10, 79, 184, 0.14), transparent 58%),
    radial-gradient(860px 520px at 110% -10%, rgba(15, 97, 175, 0.12), transparent 62%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
}

.app-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 18px 12px;
  background: linear-gradient(180deg, rgba(244, 247, 251, 0.94), rgba(244, 247, 251, 0.68));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .app-header {
  background: linear-gradient(180deg, rgba(5, 13, 27, 0.94), rgba(5, 13, 27, 0.72));
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-name {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: 0.2px;
}

.brand-tag {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-btn {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
}

.header-btn:hover {
  background: var(--surface-2);
}

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  background: #d42b2b;
  color: #fff;
  border: 2px solid var(--surface);
}

.view {
  flex: 1;
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 14px 16px calc(96px + var(--safe-bottom));
}

.grid {
  display: grid;
  gap: 14px;
}

.grid-2 {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 980px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 17px;
  font-weight: 740;
}

.panel-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.panel-body {
  padding: 16px;
}

.hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(10, 79, 184, 0.07), transparent 46%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  padding: 18px;
}

.hero h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 760;
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.summary-row {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .summary-row {
    grid-template-columns: 1fr 1fr;
  }
}

.stat-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
}

.stat-value {
  margin-top: 7px;
  font-size: 24px;
  font-weight: 760;
  letter-spacing: 0.2px;
}

.action-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.account-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 14px;
}

.account-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.account-name {
  font-size: 15px;
  font-weight: 710;
}

.account-iban {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.account-balance {
  text-align: right;
  font-size: 20px;
  font-weight: 760;
}

.inline-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.list {
  display: flex;
  flex-direction: column;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.list-row:first-child {
  border-top: 0;
}

.row-main {
  min-width: 0;
}

.row-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.amount--in {
  color: var(--ok);
}

.amount--out {
  color: var(--bad);
}

.amount--neutral {
  color: var(--text);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.label {
  font-size: 12px;
  color: var(--muted);
}

.input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 11px 12px;
  font-size: 14px;
}

textarea.input {
  resize: vertical;
  min-height: 88px;
}

.help {
  font-size: 12px;
  color: var(--muted);
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-strong);
}

.btn--secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn--secondary:hover {
  background: var(--surface-2);
}

.btn--danger {
  background: #c63734;
}

.btn--danger:hover {
  background: #ab2f2c;
}

.btn--inline {
  padding: 7px 10px;
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
}

.primary-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(1160px, 100%);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  background: rgba(244, 247, 251, 0.94);
  backdrop-filter: blur(8px);
  padding: 10px 10px calc(10px + var(--safe-bottom));
  z-index: 24;
}

[data-theme="dark"] .primary-nav {
  background: rgba(5, 13, 27, 0.94);
}

.nav-btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.nav-btn:hover {
  color: var(--text);
}

.nav-btn--active {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 16, 30, 0.48);
}

.modal-card {
  position: relative;
  width: min(780px, 100%);
  max-height: 86vh;
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 840px) {
  .modal {
    place-items: center;
    padding: 14px;
  }

  .modal-card {
    border-radius: 16px;
  }
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

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

.modal-body {
  padding: 14px;
  overflow: auto;
}

.toast-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(780px, calc(100% - 28px));
  bottom: calc(86px + var(--safe-bottom));
  z-index: 60;
  pointer-events: none;
}

.toast {
  margin-top: 10px;
  pointer-events: auto;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

header button:focus-visible,
.btn:focus-visible,
.input:focus-visible,
.nav-btn:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 6px 0;
}
