:root {
  --primary: #4318ff;
  --primary-2: #7c5cff;
  --bg: #f4f7fe;
  --card: #ffffff;
  --text: #1b2559;
  --muted: #8f9bba;
  --dark: #1e1e2d;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 14px 36px rgba(112, 144, 176, .12);
  --radius: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: "DM Sans", system-ui, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; background: #2a1550; }
.login-aurora { position: absolute; inset: -20%; background:
  radial-gradient(ellipse 55% 50% at 18% 28%, rgba(180,90,255,.85), transparent 55%),
  radial-gradient(ellipse 50% 45% at 82% 22%, rgba(90,70,255,.9), transparent 50%),
  linear-gradient(145deg, #1a0a3a, #5b2a9a); filter: blur(28px); }
.login-card { position: relative; z-index: 1; width: min(100%, 380px); text-align: center; color: #fff; }
.login-mark { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, #868cff, #4318ff); font-size: 28px; font-weight: 700; }
.login-card h1 { margin: 0; font-size: 28px; }
.login-card p { color: rgba(255,255,255,.72); }
.login-card label { display: block; text-align: left; font-size: 13px; margin-top: 12px; }
.login-card input, .field { width: 100%; margin-top: 6px; padding: 14px 16px; border: 0; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff; font-size: 16px; }
.login-card input::placeholder { color: rgba(255,255,255,.6); }
.login-card button, .btn { width: 100%; margin-top: 16px; padding: 14px; border: 0; border-radius: 999px; background: #ebe4f5; color: #4a3f5c; font-weight: 700; font-size: 16px; }
.install-btn { background: #fff !important; color: #4318ff !important; }
.install-hint { font-size: 13px; line-height: 1.45; margin-top: 18px; }
.error { color: #fecaca; min-height: 18px; }
.app-shell { min-height: 100dvh; padding-bottom: 86px; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; background: var(--dark); color: #fff; }
.topbar small { display: block; color: rgba(255,255,255,.55); margin-top: 2px; }
.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 8px 12px; }
main { padding: 16px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card, .tile { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin: 0 0 10px; }
.stat { font-size: 26px; font-weight: 700; color: var(--primary); }
.muted { color: var(--muted); font-size: 13px; }
h2, h3 { margin: 8px 0 12px; }
.row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.badge { border-radius: 999px; padding: 4px 8px; font-size: 11px; background: #eee9ff; color: var(--primary); white-space: nowrap; }
.badge.warn { background: #fff4d6; color: #92400e; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.ok { background: #d1fae5; color: #065f46; }
.search { width: 100%; padding: 12px 14px; border: 1px solid #e4eaf6; border-radius: 14px; margin-bottom: 12px; font-size: 16px; }
.modules { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.module { background: var(--card); border: 0; border-radius: 18px; padding: 16px; text-align: left; box-shadow: var(--shadow); color: var(--text); }
.module i { color: var(--primary); font-size: 20px; }
.module.disabled { opacity: .45; }
.form label { display: block; font-size: 13px; margin: 10px 0 4px; }
.form input, .form select, .form textarea { width: 100%; padding: 12px; border: 1px solid #e4eaf6; border-radius: 12px; font-size: 16px; background: #fff; color: var(--text); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid #edf0f7; padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { flex: 1; background: none; border: 0; padding: 10px 0 8px; color: var(--muted); font-size: 11px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.tabbar button.active { color: var(--primary); font-weight: 700; }
.tabbar i { font-size: 18px; }
.fab { position: fixed; right: 16px; bottom: 96px; width: 54px; height: 54px; border-radius: 18px; border: 0; background: linear-gradient(135deg, #868cff, #4318ff); color: #fff; font-size: 28px; box-shadow: 0 12px 24px rgba(67,24,255,.35); }
.back { background: none; border: 0; color: var(--primary); font-weight: 600; padding: 0 0 10px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px; font-size: 14px; }
.kv span { color: var(--muted); }
