:root {
  --bg: #f4f6fb;
  --bg-soft: #eef2f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --brand-soft: #dbeafe;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --cyan: #0891b2;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, .22);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: 252px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, #0b1220 0%, #101b33 100%);
  color: #e2e8f0;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #fff;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  box-shadow: 0 8px 24px rgba(37, 99, 235, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; letter-spacing: .08em; }
.brand-text span { font-size: 11.5px; color: #94a3b8; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 12px; border: 0; border-radius: 11px;
  background: transparent; color: #cbd5e1; text-align: left;
  font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 19px; height: 19px; color: #94a3b8; }
.nav-item:hover { background: rgba(148, 163, 184, .1); color: #fff; }
.nav-item.active { background: rgba(37, 99, 235, .18); color: #fff; }
.nav-item.active svg { color: #60a5fa; }
.nav-count {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: rgba(148, 163, 184, .16); color: #cbd5e1;
  font-size: 11.5px; font-weight: 700; text-align: center;
}
.nav-count:empty { display: none; }
.nav-count.danger { background: rgba(239, 68, 68, .2); color: #fca5a5; }

.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-status {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; border-radius: 12px;
  background: rgba(148, 163, 184, .08);
  border: 1px solid rgba(148, 163, 184, .1);
  font-size: 12px; color: #94a3b8;
}
.side-status strong { display: block; color: #e2e8f0; font-size: 12.5px; margin-top: 2px; }
.pulse {
  width: 9px; height: 9px; margin-top: 5px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .45); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.nav-logout { color: #94a3b8; }
.nav-logout:hover { color: #fca5a5; background: rgba(239, 68, 68, .1); }

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 18px 30px;
  background: rgba(244, 246, 251, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, .7);
}
.page-head { flex: 1; min-width: 0; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.page-head p { margin: 3px 0 0; color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.topbar .menu-btn { display: none; }

.view { padding: 26px 30px 70px; max-width: 1440px; width: 100%; }
.backdrop { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 14px; font-weight: 600; font-size: 13.5px;
  background: var(--panel); color: var(--text);
  transition: transform .06s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}
.btn-primary:hover { background: linear-gradient(180deg, #1d4ed8, #1e40af); }
.btn-ghost { background: var(--panel); border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--line-2); color: var(--text); background: var(--panel-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--green-soft); color: #15803d; border-color: #bbf7d0; }
.btn-success:hover { background: #bbf7d0; color: #14532d; }
.btn-sm { padding: 7px 10px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; transform: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel); color: var(--text-2);
  transition: background .15s, border-color .15s, color .15s;
  position: relative;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); border-color: var(--line-2); }
.icon-btn svg { width: 19px; height: 19px; }
.badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 800; border: 2px solid var(--bg);
}

/* ---------- Cards / summary ---------- */
.summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.sum-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.sum-card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--line);
}
.sum-card.danger::after { background: linear-gradient(90deg, #ef4444, #f97316); }
.sum-card.green::after { background: linear-gradient(90deg, #22c55e, #14b8a6); }
.sum-card.blue::after { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.sum-card.amber::after { background: linear-gradient(90deg, #f59e0b, #eab308); }
.sum-label { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.sum-label svg { width: 15px; height: 15px; }
.sum-value { margin-top: 9px; font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.sum-value.danger { color: var(--red); }
.sum-sub { margin-top: 5px; color: var(--text-3); font-size: 12.5px; }

/* ---------- Sections ---------- */
.section { margin-bottom: 26px; }
.overview-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 26px;
}
.overview-columns > .section { margin-bottom: 0; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 16.5px; letter-spacing: -.01em; }
.section-head .muted { color: var(--text-3); font-size: 12.5px; }
.section-head .spacer { flex: 1; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-pad { padding: 18px; }

/* ---------- Attention list ---------- */
.attention-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 105px 95px 190px;
  align-items: center; gap: 13px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.attention-row:last-child { border-bottom: 0; }
.attention-row:hover { background: var(--panel-2); }
.calm-row { grid-template-columns: 30px minmax(0, 1fr) 80px 80px; gap: 10px; }
.attention-main { min-width: 0; }
.attention-title { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-sub { color: var(--text-3); font-size: 12.5px; margin-top: 1px; }
.attention-row > .status { justify-self: center; text-align: center; }
.attention-amount { font-weight: 800; font-size: 16px; white-space: nowrap; justify-self: end; text-align: right; }
.attention-actions { display: flex; align-items: center; gap: 8px; width: 100%; }
.attention-actions .btn { width: 90px; flex: none; justify-content: center; }
.calm-row .attention-amount { color: var(--text-3); font-weight: 650; }
.calm-row .attention-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attention-amount.danger { color: var(--red); }
.attention-amount.warn { color: var(--amber); }

.provider-logo {
  width: 38px; height: 38px; border-radius: 11px;
  display: block; flex: none; overflow: hidden;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.provider-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.provider-logo.sm { width: 30px; height: 30px; border-radius: 9px; }
.provider-logo.xs { width: 20px; height: 20px; border-radius: 6px; }

/* ---------- Provider chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--text-2);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip b { color: var(--text); }

/* ---------- Status pills ---------- */
.status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
  background: var(--bg-soft); color: var(--text-2);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.debt, .status.error, .status.invalid { background: var(--red-soft); color: #b91c1c; }
.status.due, .status.warn { background: var(--amber-soft); color: #b45309; }
.status.ok, .status.paid, .status.success { background: var(--green-soft); color: #15803d; }
.status.unknown { background: var(--bg-soft); color: var(--text-3); }

/* ---------- Accounts ---------- */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.search {
  position: relative; flex: 1; min-width: 210px; max-width: 340px;
}
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); }
.search .input { padding-left: 36px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
.select.w-auto { width: auto; min-width: 150px; }

.account-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}
.account-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .15s, transform .08s, box-shadow .15s;
}
.account-card:hover { border-color: var(--line-2); box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.account-card.is-debt { border-color: #fecaca; }
.account-head { display: flex; align-items: flex-start; gap: 11px; }
.account-head-text { flex: 1; min-width: 0; }
.account-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-number { color: var(--text-3); font-size: 12.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-menu { display: flex; gap: 2px; margin: -6px -6px 0 0; }
.account-menu .icon-btn { width: 32px; height: 32px; border: 0; background: transparent; }
.account-menu .icon-btn svg { width: 16px; height: 16px; }

.account-amount-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.account-amount { font-size: 25px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.account-amount.danger { color: var(--red); }
.account-amount.warn { color: var(--amber); }
.account-amount.ok { color: var(--green); }
.account-amount.muted { color: var(--text-3); font-size: 21px; }
.account-meta { color: var(--text-3); font-size: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.account-meta .sep { opacity: .5; }
.account-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; }
.account-actions .btn { flex: 1; min-width: 92px; }
.account-note {
  padding: 8px 10px; border-radius: 9px; background: var(--panel-2);
  color: var(--text-2); font-size: 12.5px; border: 1px solid var(--line);
}
.account-reminder {
  display: flex; align-items: center; gap: 7px;
  color: var(--amber); background: var(--amber-soft);
  padding: 7px 10px; border-radius: 9px; font-size: 12px; font-weight: 600;
}

.account-card.disabled { opacity: .55; }

/* ---------- Empty states ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 44px 20px; color: var(--text-3);
}
.empty .empty-icon {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center; margin-bottom: 12px;
  background: var(--bg-soft); color: var(--text-3);
}
.empty .empty-icon svg { width: 26px; height: 26px; }
.empty h3 { margin: 0 0 4px; color: var(--text); font-size: 15px; }
.empty p { margin: 0; font-size: 13px; max-width: 360px; }

/* ---------- Notifications ---------- */
.notif-list { display: flex; flex-direction: column; }
.notif-item {
  display: flex; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background .12s;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--panel-2); }
.notif-item.unread { background: #f8fbff; }
.notif-item.unread:hover { background: #eff6ff; }
.notif-icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--bg-soft); color: var(--text-2);
}
.notif-icon svg { width: 17px; height: 17px; }
.notif-icon.warning { background: var(--amber-soft); color: var(--amber); }
.notif-icon.critical { background: var(--red-soft); color: var(--red); }
.notif-icon.success { background: var(--green-soft); color: var(--green); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 650; font-size: 13.5px; }
.notif-text { color: var(--text-2); font-size: 12.8px; margin-top: 2px; }
.notif-time { color: var(--text-3); font-size: 11.5px; margin-top: 4px; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-top: 7px; flex: none; }

/* ---------- Drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 42, .35); backdrop-filter: blur(2px);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: min(400px, 100vw);
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgba(15, 23, 42, .18);
  display: flex; flex-direction: column;
  animation: slideIn .18s ease-out;
}
@keyframes slideIn { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 12px; }
.drawer-head h2 { margin: 0; font-size: 17px; }
.drawer-actions { display: flex; gap: 8px; padding: 0 18px 12px; border-bottom: 1px solid var(--line); }
.drawer-list { overflow-y: auto; flex: 1; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; background: var(--panel-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--panel-2); }
.table .num { font-weight: 700; }
.table .sub { color: var(--text-3); font-size: 12px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.field-hint { font-size: 11.5px; color: var(--text-3); }
.checkbox { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13.5px; }
.checkbox input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--brand); }
.form-error {
  padding: 10px 12px; border-radius: 10px;
  background: var(--red-soft); color: #b91c1c; font-size: 13px; font-weight: 500;
}
.form-success { padding: 10px 12px; border-radius: 10px; background: var(--green-soft); color: #15803d; font-size: 13px; font-weight: 500; }
.form-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.form-actions .left { margin-right: auto; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 23, 42, .48); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 18px;
  animation: fadeIn .12s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(620px, 100%); max-height: min(88vh, 900px);
  background: var(--panel); border-radius: 18px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  display: flex; flex-direction: column;
  animation: modalIn .16s ease-out;
}
.modal.wide { width: min(820px, 100%); }
@keyframes modalIn { from { transform: translateY(10px) scale(.985); opacity: .7; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 0; }
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.modal-head p { margin: 3px 0 0; color: var(--text-3); font-size: 12.5px; }
.modal-head .icon-btn { margin-left: auto; border: 0; background: transparent; width: 34px; height: 34px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { padding: 0 22px 20px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: #0f172a; color: #e2e8f0;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .3);
  font-size: 13px; animation: toastIn .18s ease-out;
}
.toast.error { background: #7f1d1d; }
.toast.success { background: #14532d; }
.toast svg { width: 18px; height: 18px; margin-top: 1px; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- History chart ---------- */
.chart-wrap { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.chart { width: 100%; height: 190px; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .amount-line { fill: none; stroke: var(--brand); stroke-width: 2.2; }
.chart .amount-area { fill: url(#areaGradient); opacity: .5; }
.chart text { fill: var(--text-3); font-size: 10px; }
.chart .point { fill: var(--panel); stroke: var(--brand); stroke-width: 2; }

/* ---------- Provider info ---------- */
.provider-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel);
}
.provider-card h4 { margin: 0; font-size: 13.5px; }
.provider-card p { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }

/* ---------- Auth ---------- */
.auth-body {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(37, 99, 235, .18), transparent 60%),
    radial-gradient(700px 400px at 90% 100%, rgba(6, 182, 212, .14), transparent 60%),
    #0b1220;
  padding: 20px;
}
.auth-card {
  width: min(400px, 100%);
  background: #fff; border-radius: 20px; padding: 28px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .4);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-title { font-weight: 800; letter-spacing: .1em; font-size: 18px; }
.auth-sub { color: var(--text-3); font-size: 12px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-note { margin: 18px 0 0; color: var(--text-3); font-size: 11.5px; line-height: 1.45; text-align: center; }

/* ---------- Misc ---------- */
.muted { color: var(--text-3); }
.text-danger { color: var(--red); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.mt-0 { margin-top: 0; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.hint-box {
  padding: 12px 14px; border-radius: 11px;
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af;
  font-size: 12.5px; line-height: 1.5;
}
.hint-box.warn { background: var(--amber-soft); border-color: #fde68a; color: #92400e; }
.hint-box a { color: inherit; font-weight: 700; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* ---------- Dark theme ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --bg-soft: #131c2e;
    --panel: #111a2b;
    --panel-2: #0e1626;
    --text: #e2e8f0;
    --text-2: #a8b6ca;
    --text-3: #6b7c93;
    --line: #1e2a3f;
    --line-2: #2b3a53;
    --brand-soft: #172554;
    --green-soft: #052e16;
    --red-soft: #3f1212;
    --amber-soft: #3a2606;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .2);
  }
  .topbar { background: rgba(11, 18, 32, .82); border-bottom-color: rgba(30, 42, 63, .8); }
  .notif-item.unread { background: #0f1c33; }
  .notif-item.unread:hover { background: #13213b; }
  .hint-box { background: #0f1c33; border-color: #1e3a8a; color: #93c5fd; }
  .hint-box.warn { background: #2a1c06; border-color: #4a3208; color: #fcd34d; }
  .auth-card { background: #111a2b; }
  .chart .point { fill: var(--panel); }
  .btn-success { background: #052e16; color: #86efac; border-color: #14532d; }
  .btn-success:hover { background: #14532d; color: #dcfce7; }
  .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7c93' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
  .overview-columns { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.3); }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-open .backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15,23,42,.4); }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: 14px 18px; gap: 12px; }
  .view { padding: 20px 18px 70px; }
  .page-head h1 { font-size: 19px; }
  .page-head p { display: none; }
}

@media (min-width: 701px) and (max-width: 1700px) {
  .attention-row {
    grid-template-columns: 38px minmax(0, 1fr) 105px 95px;
    grid-template-areas:
      "logo main status amount"
      "logo . . actions";
    row-gap: 6px;
  }
  .attention-row > .provider-logo { grid-area: logo; }
  .attention-main { grid-area: main; }
  .attention-row > .status { grid-area: status; justify-self: center; }
  .attention-amount { grid-area: amount; justify-self: end; }
  .attention-actions { grid-area: actions; justify-self: end; width: 190px; }
  .calm-row {
    grid-template-columns: 30px minmax(0, 1fr) 80px 80px;
    grid-template-areas: "logo main status amount";
    gap: 10px;
    row-gap: 0;
  }
  .calm-row > .provider-logo { grid-area: logo; }
  .calm-row .attention-main { grid-area: main; }
  .calm-row > .status { grid-area: status; }
  .calm-row .attention-amount { grid-area: amount; }
}

@media (max-width: 700px) {
  .attention-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    grid-template-areas:
      "logo main status"
      "logo amount actions";
    row-gap: 8px;
  }
  .attention-row > .provider-logo { grid-area: logo; }
  .attention-main { grid-area: main; }
  .attention-row > .status { grid-area: status; justify-self: end; }
  .attention-amount { grid-area: amount; justify-self: start; }
  .attention-actions { grid-area: actions; justify-self: end; }
}

@media (max-width: 640px) {
  .summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sum-card { padding: 14px; }
  .sum-value { font-size: 21px; }
  .account-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .top-actions .btn-primary span { display: none; }
  .top-actions .btn-primary { padding: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .drawer { width: 100vw; }
  .modal { max-height: 92vh; }
  .section-head { flex-wrap: wrap; }
}

@media (max-width: 420px) {
  .summary { grid-template-columns: 1fr; }
}
