:root {
  --m-bg: #0b1220;
  --m-card: #152033;
  --m-line: #243247;
  --m-text: #e8eef8;
  --m-muted: #93a4bd;
  --m-accent: #5b6cff;
  --m-ok: #22c55e;
  --m-danger: #ef4444;
  --m-warn: #f59e0b;
  --top-h: 56px;
  --bot-h: 64px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--m-bg);
  color: var(--m-text);
  min-height: 100vh;
  padding-top: var(--top-h);
  padding-bottom: calc(var(--bot-h) + 12px);
}
a { color: #93c5fd; text-decoration: none; }
.m-top {
  position: fixed; top: 0; left: 0; right: 0; height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; background: rgba(15, 23, 42, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--m-line); z-index: 40;
}
.m-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.m-brand img { height: 28px; width: auto; border-radius: 6px; }
.m-burger {
  width: 42px; height: 42px; border: 0; border-radius: 10px;
  background: var(--m-card); color: var(--m-text); font-size: 1.2rem;
}
.m-drawer {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  opacity: 0; pointer-events: none; transition: .2s;
}
.m-drawer.open { opacity: 1; pointer-events: auto; }
.m-drawer-panel {
  position: absolute; top: 0; right: 0; width: min(300px, 86vw); height: 100%;
  background: #101826; padding: 18px 14px; transform: translateX(100%); transition: .25s;
  border-left: 1px solid var(--m-line);
}
.m-drawer.open .m-drawer-panel { transform: none; }
.m-drawer a {
  display: flex; gap: 10px; align-items: center; padding: 12px;
  color: var(--m-text); border-radius: 10px; margin-bottom: 4px;
}
.m-drawer a:hover, .m-drawer a.active { background: var(--m-card); }
.m-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--bot-h);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(15, 23, 42, .96); border-top: 1px solid var(--m-line); z-index: 40;
}
.m-bottom a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--m-muted); font-size: .68rem; font-weight: 600;
}
.m-bottom a i { font-size: 1.15rem; }
.m-bottom a.active { color: #a5b4fc; }
.m-wrap { max-width: 480px; margin: 0 auto; padding: 14px; }
.m-card {
  background: var(--m-card); border: 1px solid var(--m-line);
  border-radius: 16px; padding: 16px; margin-bottom: 12px;
}
.m-card h1, .m-card h2 { margin: 0 0 8px; font-size: 1.15rem; }
.muted { color: var(--m-muted); font-size: .9rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 0; border-radius: 12px; padding: 13px 14px;
  background: var(--m-accent); color: #fff; font-weight: 700; font: inherit; cursor: pointer;
}
.btn.secondary { background: #334155; }
.btn.ok { background: var(--m-ok); }
.btn.danger { background: var(--m-danger); }
.btn:disabled { opacity: .5; }
input, select {
  width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--m-line);
  background: #0f172a; color: var(--m-text); font: inherit; margin: 6px 0 12px;
}
label { font-size: .82rem; color: var(--m-muted); }
.flash { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: .9rem; }
.flash.ok { background: #064e3b; color: #a7f3d0; }
.flash.err { background: #7f1d1d; color: #fecaca; }
.row { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--m-line); }
.row:last-child { border-bottom: 0; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; color: #fff; font-size: .78rem; font-weight: 700; }
.pill.pink { background: #ec4899; } .pill.blue { background: #2563eb; } .pill.sky { background: #0ea5e9; }
.pill.green { background: #22c55e; } .pill.amber { background: #f59e0b; } .pill.red { background: #ef4444; }
.stat-big { font-size: 1.8rem; font-weight: 800; margin: 4px 0 2px; }
#reader { border-radius: 12px; overflow: hidden; margin-top: 10px; min-height: 0; }
#reader.active { min-height: 260px; background: #000; }
.login-page { padding-top: 0; padding-bottom: 0; }
.login-page .m-wrap { min-height: 100vh; display: flex; align-items: center; }
