:root {
  --bg: #0b0b10;
  --bg-2: #101018;
  --panel: #14141c;
  --panel-2: #1b1b26;
  --line: #2a2a38;
  --text: #f5f5f9;
  --muted: #9b9bb0;
  --gold: #f6b31b;
  --gold-2: #ffcf5c;
  --red: #ff4d5e;
  --green: #35d07f;
  --radius: 18px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid rgba(246, 179, 27, .55); outline-offset: 2px; }

/* ------------------------------------------------------------ LOGIN */
.login {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background:
    radial-gradient(900px 600px at 18% 55%, rgba(246, 179, 27, .16), transparent 60%),
    radial-gradient(700px 500px at 90% 0%, rgba(255, 77, 94, .09), transparent 60%),
    var(--bg);
}
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  padding: 32px 24px 0;
}
.hero .mascot {
  width: min(560px, 92%);
  height: auto;
  max-height: 92vh;
  object-fit: contain;
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .55));
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .hero .mascot { animation: none; } }

.panel-wrap { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; padding: 32px 24px; min-width: 0; }
.card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 34px 30px 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.brand .dot {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), #ff9d1b);
  display: grid; place-items: center; font-size: 20px; color: #1b1300;
}
.brand span { font-weight: 800; letter-spacing: .2px; }
.brand small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.3px; }
.sub { margin: 0 0 22px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 7px; font-weight: 600; }
.field { position: relative; }
input[type=text], input[type=password] {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 13px;
  padding: 14px 16px;
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #5f5f75; }
input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(246, 179, 27, .16); }
.toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--muted); padding: 8px 10px; border-radius: 10px; font-size: 13px;
}
.toggle:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.row { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 6px; }
.check { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; margin: 0; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.btn {
  width: 100%; margin-top: 18px; border: 0; border-radius: 14px; padding: 15px 18px;
  font-weight: 800; font-size: 16px; color: #1b1300;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  box-shadow: 0 10px 30px rgba(246, 179, 27, .28);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn:active { transform: translateY(0); }
.error {
  margin: 0 0 6px; padding: 11px 14px; border-radius: 12px; font-size: 14px;
  color: #ffd9dd; background: rgba(255, 77, 94, .12); border: 1px solid rgba(255, 77, 94, .35);
}
.foot { margin-top: 22px; text-align: center; color: #6c6c82; font-size: 12.5px; }

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .hero { padding-top: 20px; }
  .hero .mascot { width: min(260px, 62%); max-height: 300px; }
  .panel-wrap { align-items: start; padding-top: 8px; }
}

/* ------------------------------------------------------------ DASHBOARD */
.shell { min-height: 100%; background:
  radial-gradient(900px 500px at 85% -10%, rgba(246, 179, 27, .12), transparent 60%), var(--bg); }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 16, .75); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 5;
}
.topbar .left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar img { width: 42px; height: 42px; object-fit: contain; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.topbar strong { display: block; font-size: 16px; }
.topbar small { color: var(--muted); font-size: 12px; }
.ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 12px; font-size: 14px; font-weight: 600;
}
.ghost:hover { color: var(--text); border-color: #3a3a4d; }

.wrap { max-width: 1080px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 40px) 60px; }
.hello h1 { margin: 0 0 6px; font-size: clamp(26px, 4vw, 36px); letter-spacing: -.5px; }
.hello p { margin: 0 0 26px; color: var(--muted); }
.clock { font-variant-numeric: tabular-nums; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.tile {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 10px; min-height: 190px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
a.tile:hover { transform: translateY(-3px); border-color: rgba(246, 179, 27, .5); box-shadow: 0 18px 40px rgba(0, 0, 0, .4); }
.tile .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 23px; background: rgba(246, 179, 27, .12); }
.tile h3 { margin: 4px 0 0; font-size: 18px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; flex: 1; }
.tile .go { color: var(--gold); font-weight: 700; font-size: 14px; }
.tile.wide { grid-column: 1 / -1; min-height: 0; }

.status { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; padding: 7px 13px; border-radius: 999px; font-size: 14px; background: rgba(255, 255, 255, .06); }
.badge i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.badge.ok { background: rgba(53, 208, 127, .13); color: #8ff0bd; } .badge.ok i { background: var(--green); box-shadow: 0 0 0 4px rgba(53, 208, 127, .2); }
.badge.warn { background: rgba(246, 179, 27, .13); color: var(--gold-2); } .badge.warn i { background: var(--gold); }
.badge.bad { background: rgba(255, 77, 94, .13); color: #ffb2ba; } .badge.bad i { background: var(--red); }
.meta { color: var(--muted); font-size: 14px; }
.primary {
  border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 800; color: #1b1300;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
}
.primary:hover { filter: brightness(1.05); }
.link-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.link-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--bg-2); border: 1px solid var(--line); padding: 9px 12px; border-radius: 10px; font-size: 13px; color: var(--muted); }

/* modal QR */
.modal { position: fixed; inset: 0; z-index: 20; display: none; place-items: center; padding: 20px; background: rgba(5, 5, 8, .72); backdrop-filter: blur(6px); }
.modal.open { display: grid; }
.sheet { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 26px; text-align: center; }
.sheet h3 { margin: 0 0 6px; font-size: 22px; }
.sheet p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.qrbox { width: 280px; height: 280px; margin: 0 auto 16px; border-radius: 18px; background: #fff; display: grid; place-items: center; padding: 10px; }
.qrbox img { width: 100%; height: 100%; image-rendering: pixelated; }
.qrbox span { color: #555; font-size: 14px; }
.steps { text-align: left; color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 0 0 16px; padding-left: 18px; }
.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: 3px; font-weight: 700; color: var(--gold-2); }
.success { color: #8ff0bd; font-weight: 700; font-size: 18px; margin: 12px 0 18px; }
