:root {
  --bg: #07111a;
  --panel: #0d1b27;
  --card: #122433;
  --line: #1e3648;
  --text: #e8f1f6;
  --muted: #8aa0b3;
  --teal: #14b8a6;
  --teal-2: #0f766e;
  --gold: #f5c16c;
  --danger: #f87171;
  --ok: #34d399;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { display: flex; }
a { color: var(--teal); }
button, input, select {
  font: inherit; color: inherit;
}
button {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.6rem 0.9rem; cursor: pointer;
}
button.primary { background: var(--teal-2); border-color: transparent; color: #ecfdf5; }
button.ghost { background: transparent; }
button.active { background: #134e4a; border-color: var(--teal); }
input, select {
  background: #0b1822; border: 1px solid var(--line); border-radius: 10px; padding: 0.65rem 0.8rem; width: 100%;
}
.auth {
  display: grid; place-items: center; min-height: 100vh;
  background: radial-gradient(1000px 500px at 20% -10%, #134e4a 0%, transparent 50%), var(--bg);
}
.auth-card {
  width: min(420px, 92vw); background: var(--panel); padding: 2rem; border-radius: 20px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.brand { display: flex; gap: 0.85rem; align-items: center; margin-bottom: 1.4rem; }
.logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(160deg, #14b8a6, #0f766e); font-weight: 800;
}
.auth-card h1 { margin: 0; font-size: 1.15rem; }
.auth-card p, .muted { color: var(--muted); margin: 0.2rem 0 0; }
label { display: grid; gap: 0.35rem; margin: 0.8rem 0; font-size: 0.9rem; color: var(--muted); }
.auth-card button { width: 100%; margin-top: 0.6rem; background: var(--teal-2); border: 0; color: white; }
.alert { background: #3f1d1d; color: #fecaca; padding: 0.7rem 0.85rem; border-radius: 10px; }

aside {
  width: 250px; background: var(--panel); border-right: 1px solid var(--line);
  padding: 1.2rem; display: flex; flex-direction: column; gap: 1rem; min-height: 100vh;
}
aside nav { display: grid; gap: 0.4rem; }
aside nav button { text-align: left; }
.aside-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem;
}
.aside-box p, .apk-hint { margin: 0; color: var(--muted); font-size: 0.8rem; }
.aside-box strong { display: block; font-size: 1.6rem; margin: 0.2rem 0; }
.apk-btn {
  display: block; text-align: center; background: var(--gold); color: #1a1204; text-decoration: none;
  font-weight: 700; border-radius: 12px; padding: 0.75rem;
}
.main { flex: 1; padding: 1.3rem 1.6rem 2.5rem; min-width: 0; }
header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
header h1 { margin: 0; font-size: 1.45rem; }
.header-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.header-actions input { width: 260px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin: 1.1rem 0; }
.stats article {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem 1rem;
}
.stats span { color: var(--muted); font-size: 0.8rem; }
.stats strong { display: block; margin-top: 0.3rem; font-size: 1.15rem; }
.toolbar { display: flex; gap: 0.5rem; margin-bottom: 0.8rem; }
.toolbar select { width: auto; }
.list { display: grid; gap: 0.65rem; }
.item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem 1rem;
  display: grid; grid-template-columns: 92px 1fr auto; gap: 0.8rem; align-items: start;
}
.item.bank { border-color: #1d6b62; }
.badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; padding: 0.28rem 0.5rem;
  border-radius: 999px; background: #16313f; color: #9fd7d0; display: inline-block;
}
.badge.bank { background: #134e4a; color: #99f6e4; }
.item h3 { margin: 0 0 0.25rem; font-size: 0.98rem; }
.item p { margin: 0; color: var(--muted); font-size: 0.9rem; white-space: pre-wrap; }
.meta { color: var(--muted); font-size: 0.75rem; margin-top: 0.4rem; }
.amount { font-weight: 800; color: var(--ok); white-space: nowrap; }
.amount.out { color: var(--danger); }
.actions { display: flex; gap: 0.35rem; justify-content: flex-end; margin-top: 0.4rem; }
.actions button { padding: 0.35rem 0.55rem; font-size: 0.78rem; }
.empty { color: var(--muted); padding: 2rem 0.5rem; }
dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.2rem; width: min(480px, 92vw);
}
dialog::backdrop { background: rgba(0,0,0,0.55); }
.pair-code {
  font-size: 2.4rem; letter-spacing: 0.35rem; font-weight: 800; text-align: center;
  background: #0b1822; border-radius: 12px; padding: 0.8rem; margin: 0.8rem 0;
}
.row { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
.device-row {
  display: flex; justify-content: space-between; gap: 0.6rem; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem; margin: 0.45rem 0;
}
@media (max-width: 900px) {
  body { flex-direction: column; }
  aside { width: auto; min-height: auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .item { grid-template-columns: 1fr; }
  .header-actions input { width: 100%; }
}
