/* Cổng web Teemo Cloud — cùng tông màu với app quán. */
:root {
  --bg: #0b0d10;
  --panel: #12161b;
  --panel-2: #171c22;
  --line: #242b33;
  --text: #e8edf2;
  --muted: #8b96a3;
  --accent: #39e75f;
  --accent-strong: #22c55e;
  --accent-soft: #15241a;
  --accent-fg: #07110a;
  --danger: #f87171;
  --warn: #fbbf24;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, #10261a 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.5 "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: #3a4552; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--danger { color: var(--danger); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn--lg { height: 52px; padding: 0 22px; font-size: 17px; border-radius: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.input {
  height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: #0e1216; outline: none; width: 100%;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(57, 231, 95, .15); }

.err { color: var(--danger); font-size: 14px; min-height: 20px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

/* ---------- Trang đăng nhập ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
}
.login__card {
  width: 100%; max-width: 420px; background: rgba(18, 22, 27, .92); border: 1px solid var(--line);
  border-radius: 20px; padding: 32px 28px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  display: flex; flex-direction: column; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { width: 56px; height: 56px; border-radius: 14px; }
.brand__name { font-size: 20px; font-weight: 800; }
.brand__sub { font-size: 13px; color: var(--muted); }
.login__hint { font-size: 13px; color: var(--muted); margin: 0; }

/* ---------- Khung trang ---------- */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px;
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: rgba(11, 13, 16, .9); backdrop-filter: blur(8px);
}
.top .brand img { width: 36px; height: 36px; border-radius: 10px; }
.top .brand__name { font-size: 16px; }
.top__spacer { flex: 1; }
.page { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card__head h2 { font-size: 17px; }
.card__head .spacer { flex: 1; }

.hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, #12251a 0%, var(--panel) 55%); border: 1px solid #1f3a28;
}
.hero__info { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.hero__name { font-size: 24px; font-weight: 800; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--on { color: var(--accent); border-color: rgba(57, 231, 95, .4); background: rgba(57, 231, 95, .08); }
.pill--off { color: var(--muted); border-color: var(--line); }
.pill--bad { color: var(--danger); border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .08); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat__label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.stat__value { font-size: 22px; font-weight: 800; margin-top: 4px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal__card { width: 100%; max-width: 520px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 32px); overflow: auto; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.keybox {
  display: flex; gap: 8px; align-items: center; padding: 12px; border-radius: 10px; border: 1px dashed rgba(57, 231, 95, .5);
  background: var(--accent-soft); word-break: break-all;
}
.keybox code { flex: 1; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  background: #10261a; border: 1px solid rgba(57, 231, 95, .5); color: var(--text); padding: 10px 16px; border-radius: 10px; font-weight: 600;
}
.toast--bad { background: #2a1214; border-color: rgba(248, 113, 113, .5); }

@media (max-width: 640px) {
  .top { padding: 10px 16px; }
  .page { padding: 16px 16px 48px; }
  .hero__name { font-size: 20px; }
  .top .brand__sub { display: none; }
}
