:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #18212f;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 86px;
}

a { color: inherit; text-decoration: none; }
.container { width: min(1180px, calc(100% - 18px)); margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(244,247,251,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; }
.logo { font-weight: 900; letter-spacing: -.04em; font-size: 18px; }
.logo span { color: var(--primary); }
.top-action { min-height: 36px; padding: 8px 11px; border-radius: 12px; font-size: 13px; }
.page-title { font-size: 23px; margin: 16px 0 6px; letter-spacing: -.04em; }
.page-desc { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.grid { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15,23,42,.05);
}
.stat-card { padding: 12px; }
.stat-title { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 24px; font-weight: 900; margin-top: 3px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 12px;
  min-height: 40px; padding: 9px 12px;
  background: var(--primary); color: #fff;
  font-weight: 800; cursor: pointer;
  width: auto; font-size: 14px;
}
.btn:hover { background: var(--primary-dark); }
.btn-sm { min-height: 34px; padding: 7px 9px; border-radius: 11px; font-size: 12px; }
.btn-light { background: #eef2ff; color: #1e40af; }
.btn-light:hover { background: #dbeafe; }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: #dcfce7; color: var(--success); }
.btn-success:hover { background: #bbf7d0; }
.btn-full { width: 100%; }
.form-group { margin-bottom: 13px; }
label { display: block; font-weight: 800; margin-bottom: 7px; font-size: 14px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 13px;
  padding: 12px 13px; font-size: 16px; outline: none; background: #fff;
}
textarea { min-height: 105px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.1); }

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-items: start;
}
.account-card { display: grid; gap: 8px; padding: 10px; border-radius: 15px; }
.account-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.account-title { font-size: 15px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
.badge { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: 10px; font-weight: 900; white-space: nowrap; }
.copy-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 8px;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.35;
  min-height: 38px;
}
.copy-label { font-size: 11px; color: var(--muted); font-weight: 800; margin-bottom: 4px; }
.compact-meta { color: var(--muted); font-size: 11px; line-height: 1.25; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.search-row { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 10px; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255,255,255,.94); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav-inner { max-width: 560px; margin: 0 auto; display: flex; justify-content: center; gap: 6px; }
.nav-item { flex: 1; max-width: 130px; display: grid; place-items: center; gap: 2px; padding: 7px 4px; border-radius: 13px; color: #64748b; font-size: 11px; font-weight: 800; }
.nav-item.active, .nav-item:hover { background: #eef2ff; color: #1d4ed8; }
.nav-icon { font-size: 18px; line-height: 1; }
.alert { padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; font-weight: 700; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); }
.small { font-size: 12px; color: var(--muted); }
.mt-12 { margin-top: 8px; }
.mb-12 { margin-bottom: 10px; }
.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(12px);
  background: #111827;
  color: #fff;
  padding: 11px 16px;
  border-radius: 999px;
  font-weight: 900;
  z-index: 9999;
  box-shadow: 0 14px 40px rgba(0,0,0,.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 520px) {
  .accounts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 820px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .search-row { grid-template-columns: 1fr 220px; }
  .accounts-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .quick-actions { grid-template-columns: 180px 180px; }
}

@media (max-width: 360px) {
  .accounts-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-title { font-size: 21px; }
  .stat-value { font-size: 22px; }
}
