@import url('https://fonts.googleapis.com/css2?family=Chewy&family=Griffy&family=Nunito:wght@400;600;800&display=swap');

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: linear-gradient(180deg, var(--bg-deep, #0b0713), var(--bg-mid, #1a1027));
  color: var(--text-main, #f4ecff);
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: inherit; }

/* ---------------------------- LOGIN SCREEN ------------------------------- */
.login-shell {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.2rem;
}
.login-card {
  width: 100%; max-width: 360px;
  background: var(--bg-panel, #201533);
  border: 2px solid var(--accent, #ff7a1a);
  border-radius: 20px;
  padding: 2rem 1.6rem;
  box-shadow: var(--glow, 0 0 18px rgba(255,122,26,.5)), 0 20px 50px rgba(0,0,0,.5);
  text-align: center;
}
.login-card h1 {
  font-family: 'Griffy', cursive;
  color: var(--accent-3, #39ff14);
  margin: 0 0 .3rem;
  font-size: 1.7rem;
}
.login-card p.sub { color: var(--text-muted, #b9a9d6); margin: 0 0 1.4rem; font-weight: 600; font-size: .9rem; }
.field { text-align: left; margin-bottom: 1rem; }
.field label { display: block; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted, #b9a9d6); margin-bottom: .35rem; }
.field input {
  width: 100%;
  padding: .75rem .9rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.25);
  color: var(--text-main, #fff);
  font-size: 1rem;
}
.field input:focus { outline: 2px solid var(--accent, #ff7a1a); }
.error-msg { color: #ff6b6b; font-weight: 700; font-size: .85rem; min-height: 1.2em; margin-bottom: .6rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .75rem 1.2rem;
  border-radius: 12px;
  border: none;
  background: var(--accent, #ff7a1a);
  color: #1a1027;
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.25);
  transition: transform .1s ease;
  width: 100%;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.btn.secondary { background: rgba(255,255,255,.08); color: var(--text-main, #fff); border: 1px solid rgba(255,255,255,.18); width: auto; }
.btn.danger { background: #e14b4b; color: #fff; width: auto; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------------------------- DASHBOARD ---------------------------------- */
.admin-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .9rem 1rem;
  background: rgba(11,7,19,.85);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--accent, #ff7a1a);
}
.admin-header .brand { font-family: 'Griffy', cursive; color: var(--accent-3, #39ff14); font-size: 1.15rem; }
.admin-main { max-width: 1080px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }

.tabs { display: flex; gap: .5rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.tab-btn {
  padding: .55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.15);
  background: var(--bg-panel, #201533);
  color: var(--text-main, #fff);
  font-weight: 800;
  font-size: .85rem;
  cursor: pointer;
}
.tab-btn.active { background: var(--accent, #ff7a1a); color: #1a1027; border-color: transparent; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.card {
  background: var(--bg-panel, #201533);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}
.card h2 { margin-top: 0; font-size: 1.05rem; }
.card h2 .muted { color: var(--text-muted, #b9a9d6); font-weight: 600; font-size: .8rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat-box { background: rgba(255,255,255,.04); border-radius: 12px; padding: .8rem; text-align: center; }
.stat-box .num { font-size: 1.6rem; font-weight: 800; color: var(--accent-3, #39ff14); }
.stat-box .lbl { font-size: .72rem; color: var(--text-muted, #b9a9d6); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

table.sessions-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
table.sessions-table th, table.sessions-table td { padding: .55rem .6rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,.08); white-space: nowrap; }
table.sessions-table th { color: var(--text-muted, #b9a9d6); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; position: sticky; top: 0; background: var(--bg-panel, #201533); }
table.sessions-table tbody tr:hover { background: rgba(255,255,255,.03); }
.table-scroll { overflow-x: auto; max-height: 60vh; overflow-y: auto; border-radius: 10px; }
.pill-live { background: var(--accent-3, #39ff14); color: #0b0713; padding: .1rem .5rem; border-radius: 999px; font-weight: 800; font-size: .68rem; }
.pill-ended { background: rgba(255,255,255,.12); color: var(--text-muted, #b9a9d6); padding: .1rem .5rem; border-radius: 999px; font-weight: 800; font-size: .68rem; }

.skin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.skin-option {
  border: 2px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 1rem;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s ease, transform .1s ease;
}
.skin-option:hover { transform: translateY(-2px); }
.skin-option.selected { border-color: var(--accent-3, #39ff14); box-shadow: 0 0 0 2px rgba(57,255,20,.3); }
.skin-option .swatch { height: 56px; border-radius: 10px; margin-bottom: .6rem; }
.skin-option .name { font-weight: 800; }
.skin-option .desc { font-size: .78rem; color: var(--text-muted, #b9a9d6); margin-top: .2rem; }
.current-badge { font-size: .68rem; font-weight: 800; text-transform: uppercase; background: var(--accent, #ff7a1a); color: #1a1027; padding: .1rem .5rem; border-radius: 999px; display: inline-block; margin-top: .5rem; }

.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.small { font-size: .8rem; color: var(--text-muted, #b9a9d6); }
.toast-note { padding: .6rem .9rem; border-radius: 10px; background: rgba(57,255,20,.12); border: 1px solid rgba(57,255,20,.35); font-weight: 700; font-size: .85rem; display: none; }
.toast-note.show { display: block; }
.toast-note.error { background: rgba(255,107,107,.12); border-color: rgba(255,107,107,.4); color: #ff9b9b; }

.empty-state { text-align: center; padding: 2rem 1rem; color: var(--text-muted, #b9a9d6); }

/* ---------------------------- v2 dashboard ------------------------------- */
.toolbar { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; padding: .7rem .9rem; background: var(--bg-panel, #201533); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; }
.toolbar label { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted, #b9a9d6); display: flex; flex-direction: column; gap: .2rem; }
.toolbar label.chk { flex-direction: row; align-items: center; gap: .4rem; text-transform: none; font-size: .82rem; letter-spacing: 0; }
select, .search, input[type=number], input[type=text] {
  padding: .5rem .6rem; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.3);
  color: var(--text-main, #fff); font-size: .85rem; font-family: inherit;
}
input[type=number] { width: 100%; }
.search { min-width: 180px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; }
.three-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.two-col .card, .three-col .card { margin-bottom: 0; }
.two-col, .three-col { margin-bottom: 1.2rem; }
.stat-box .sub { font-size: .68rem; color: var(--text-muted, #b9a9d6); margin-top: .15rem; }
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }

.hbar { display: grid; grid-template-columns: minmax(70px, 38%) 1fr auto; gap: .5rem; align-items: center; margin: .32rem 0; font-size: .8rem; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 10px; background: rgba(255,255,255,.08); border-radius: 6px; overflow: hidden; }
.hbar .fill { height: 100%; background: linear-gradient(90deg, var(--accent, #ff7a1a), var(--accent-2, #7c3aed)); border-radius: 6px; }
.hbar .num { color: var(--text-muted, #b9a9d6); font-variant-numeric: tabular-nums; }
.daychart { display: flex; align-items: flex-end; gap: 2px; height: 130px; padding-top: 8px; }
.daychart.small-chart { height: 110px; }
.daychart .col { flex: 1; min-width: 2px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.daychart .bar { background: linear-gradient(180deg, var(--accent-3, #39ff14), var(--accent-2, #7c3aed)); border-radius: 3px 3px 0 0; min-height: 1px; }
.daychart .bar.zero { background: rgba(255,255,255,.1); height: 2px !important; }
.axis { display: flex; justify-content: space-between; font-size: .68rem; color: var(--text-muted, #b9a9d6); margin-top: .3rem; }

.badge { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.badge.human { background: var(--accent-3, #39ff14); color: #0b0713; }
.badge.passive { background: rgba(255,255,255,.14); color: var(--text-main, #fff); }
.badge.bot { background: #ff6b6b; color: #1a0505; }
.badge.suspect { background: #ffb347; color: #231300; }
.badge.flag { background: rgba(255,255,255,.1); color: var(--text-muted, #b9a9d6); margin: 0 .2rem .2rem 0; }
.badge.live { background: var(--accent-3, #39ff14); color: #0b0713; }
.badge.ended { background: rgba(255,255,255,.12); color: var(--text-muted, #b9a9d6); }
.badge.you { background: var(--accent, #ff7a1a); color: #1a1027; }

table.sessions-table td.wrap { white-space: normal; min-width: 140px; }
table.sessions-table tr.clickable { cursor: pointer; }
table.sessions-table tr.detail > td { white-space: normal; background: rgba(0,0,0,.22); padding: .9rem; cursor: default; }
.table-scroll.tall { max-height: 70vh; }
.mini { padding: .25rem .55rem; border-radius: 8px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07); color: var(--text-main, #fff); font-size: .72rem; font-weight: 700; cursor: pointer; margin-right: .25rem; }
.mini:hover { background: var(--accent, #ff7a1a); color: #1a1027; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .5rem 1.2rem; font-size: .8rem; margin-bottom: .8rem; }
.kv div b { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted, #b9a9d6); }
.kv div span { word-break: break-word; }
.sub-table { width: 100%; font-size: .76rem; border-collapse: collapse; margin: .4rem 0 .8rem; }
.sub-table th, .sub-table td { text-align: left; padding: .3rem .5rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.sub-table th { color: var(--text-muted, #b9a9d6); font-size: .66rem; text-transform: uppercase; }
.sep { border: 0; border-top: 1px solid rgba(255,255,255,.1); margin: 1rem 0; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 1rem; overflow-y: auto; }
.modal-bg.open { display: flex; }
.modal-box { position: relative; background: var(--bg-panel, #201533); border: 2px solid var(--accent, #ff7a1a); border-radius: 16px; padding: 1.2rem; width: 100%; max-width: 820px; margin: 3rem 0; }
.close-x { position: absolute; right: .7rem; top: .7rem; padding: .3rem .7rem !important; }
.chip-games { font-size: 1rem; letter-spacing: .1rem; }
.ignored-item { display: flex; justify-content: space-between; gap: .5rem; padding: .25rem 0; border-bottom: 1px solid rgba(255,255,255,.07); }
