/* YoteShin Admin — Telegram-player style: pure black, dark cards, white text.
   Same visual language as the TG player: rounded corners, soft borders,
   red progress accent, blue interactive accent. */
* { box-sizing: border-box; }
:root {
  --bg: #000;
  --card: #111214;
  --card2: #1a1c1f;
  --border: rgba(255,255,255,.08);
  --text: #fff;
  --muted: #9aa0a6;
  --muted2: #6b7280;
  --blue: #5288c1;
  --red: #e50914;
  --yellow: #f5c518;
  --green: #34c759;
  --radius: 14px;
}
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body { font-family: "Manrope", "Noto Sans Myanmar", system-ui, -apple-system, "Segoe UI", sans-serif; min-height: 100vh; }
h1 { font-size: 22px; margin: 4px 0 16px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: min(360px, 92vw); background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 32px 24px; text-align: center; }
.login-logo { font-size: 28px; font-weight: 800; letter-spacing: .04em; }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 22px; }
.login-card input { width: 100%; background: var(--card2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 15px; padding: 12px 14px; outline: none; }
.login-card input:focus { border-color: var(--blue); }
.btn-primary { width: 100%; margin-top: 12px; background: var(--blue); color: #fff; border: 0; border-radius: 12px; font-size: 15px; font-weight: 700; padding: 12px; cursor: pointer; }
.btn-primary:hover { filter: brightness(1.1); }
.login-error { color: #ff6b6b; font-size: 13px; min-height: 18px; margin: 10px 0 0; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; background: rgba(0,0,0,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.brand { font-size: 17px; font-weight: 800; letter-spacing: .03em; }
.brand span { color: var(--blue); font-weight: 700; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn-ghost { background: var(--card2); color: var(--text); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; font-weight: 600; padding: 7px 14px; cursor: pointer; }
.btn-ghost:hover { border-color: rgba(255,255,255,.25); }
.menu-btn { display: none; background: var(--card2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; width: 38px; height: 38px; font-size: 17px; cursor: pointer; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar { width: 200px; flex: 0 0 200px; padding: 16px 12px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.nav-item { text-align: left; background: transparent; color: var(--muted); border: 0; border-radius: 10px; font-size: 14px; font-weight: 600; padding: 10px 12px; cursor: pointer; }
.nav-item:hover { background: var(--card2); color: var(--text); }
.nav-item.active { background: var(--card2); color: var(--text); }
.nav-item.active::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); margin-right: 8px; vertical-align: 2px; }
.content { flex: 1; min-width: 0; padding: 20px 22px 40px; max-width: 1100px; }
.section[hidden] { display: none; }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { font-size: 26px; font-weight: 800; margin-top: 6px; line-height: 1.1; }
.kpi .sub { color: var(--muted2); font-size: 12px; margin-top: 4px; }

/* ---------- Cards / tables ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col .card { margin-bottom: 0; }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 14px; }
.row:last-child { border-bottom: 0; }
.row .rank { color: var(--muted2); width: 22px; flex: 0 0 22px; font-size: 12px; font-weight: 700; }
.row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.row .bar-track { flex: 0 0 110px; height: 6px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.row .bar-fill { height: 100%; border-radius: 99px; background: var(--red); }
.row .bar-fill.blue { background: var(--blue); }
.empty { color: var(--muted); font-size: 14px; padding: 8px 2px; }

/* ---------- Bar charts (pure CSS, TG style) ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.bars.tall { height: 190px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; justify-content: flex-end; }
.bar-col .bar { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--blue); min-height: 2px; }
.bar-col .bar.red { background: var(--red); }
.bar-col .bar.yellow { background: var(--yellow); }
.bar-col .val { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.bar-col .lbl { font-size: 10px; color: var(--muted2); white-space: nowrap; }
.legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.blue { background: var(--blue); } .dot.red { background: var(--red); } .dot.yellow { background: var(--yellow); }

/* ---------- System ---------- */
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.pill.up { background: rgba(52,199,89,.15); color: var(--green); }
.pill.down { background: rgba(229,9,20,.15); color: #ff6b6b; }
.pill.unknown { background: rgba(255,255,255,.08); color: var(--muted); }
.meter { margin: 12px 0; }
.meter .meter-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.meter .meter-label b { font-variant-numeric: tabular-nums; }
.meter-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 99px; background: var(--blue); }
.meter-fill.warn { background: var(--yellow); }
.meter-fill.bad { background: var(--red); }

/* ---------- API keys ---------- */
.key-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.key-form select, .key-form input { background: var(--card2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 14px; padding: 10px 12px; outline: none; }
.key-form select:focus, .key-form input:focus { border-color: var(--blue); }
.key-form input { flex: 1; min-width: 200px; }
.btn-danger { background: rgba(229,9,20,.15); color: #ff6b6b; border: 1px solid rgba(229,9,20,.35); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 6px 12px; cursor: pointer; }
.btn-danger:hover { background: rgba(229,9,20,.3); }
.btn-small { background: var(--card2); color: var(--text); border: 1px solid var(--border); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 6px 12px; cursor: pointer; }
.btn-small:hover { border-color: rgba(255,255,255,.25); }
.key-row { align-items: flex-start; }
.key-usage { margin-top: 8px; }
.key-usage-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.key-remain { font-weight: 700; font-size: 14px; }
.usage-bar { height: 6px; background: var(--card2); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.usage-fill { height: 100%; background: #34c759; border-radius: 999px; }
.usage-fill.low { background: #e50914; }
.key-usage a { color: var(--blue); text-decoration: none; }
.key-usage a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .sidebar { display: none; position: fixed; left: 0; top: 56px; bottom: 0; z-index: 30; background: #0a0a0a; width: 220px; border-right: 1px solid var(--border); }
  .sidebar.open { display: flex; }
  .content { padding: 16px 14px 32px; }
  .two-col { grid-template-columns: 1fr; }
  .topbar-right .small { display: none; }
}

/* ---- Promo banner editor (v6.5.180) ---- */
.promo-form { display: flex; flex-direction: column; gap: 12px; }
.promo-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.promo-form select, .promo-form input { background: var(--card2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 14px; padding: 10px 12px; outline: none; font-weight: 400; }
.promo-form select:focus, .promo-form input:focus { border-color: var(--blue); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--blue); }
.promo-row { align-items: center; }
.promo-dot { width: 14px; height: 14px; border-radius: 999px; flex: 0 0 auto; }
.promo-preview-wrap { display: flex; flex-direction: column; gap: 6px; }
.promo-preview-live { border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; color: #fff; position: relative; overflow: hidden; border: none; background: rgba(19, 25, 36, 0.6); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.promo-preview-live::before { content: ""; position: absolute; inset: 0; background: var(--banner-tint, transparent); opacity: 0.35; pointer-events: none; }
.promo-preview-live > * { position: relative; z-index: 1; }
.promo-preview-icon { width: 28px; height: 28px; object-fit: contain; }
.promo-icon-picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.promo-icon-preview { width: 44px; height: 44px; object-fit: contain; border-radius: 12px; background: rgba(255,255,255,.16); }
.promo-preview-tag { font-size: 11px; font-weight: 800; letter-spacing: .08em; background: rgba(0,0,0,.35); border-radius: 999px; padding: 3px 8px; text-transform: uppercase; }
.promo-preview-live b { font-size: 17px; }
.promo-preview-desc { font-size: 13px; opacity: .9; }
.promo-form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* [hidden] must beat author display rules (.login-wrap uses display:flex). */
#login[hidden], #app[hidden], .login-wrap[hidden] { display: none !important; }
