/* Goarrow admin portal (same design system as the Fytrade admin portal) */

:root {
  --bg: #080a12;
  --bg-2: #0c0f1a;
  --panel: #111522;
  --panel-2: #171c2c;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #e9ecf6;
  --sub: #9aa3bd;
  --muted: #646d88;
  --brand: #4f6bff;
  --brand-2: #8a9bff;
  --brand-bg: rgba(110, 132, 255, 0.12);
  --green: #2fd6a1;
  --green-bg: rgba(47, 214, 161, 0.12);
  --red: #ff6b7d;
  --red-bg: rgba(255, 107, 125, 0.12);
  --amber: #ffc164;
  --amber-bg: rgba(255, 193, 100, 0.12);
  --purple: #b38cff;
  --purple-bg: rgba(179, 140, 255, 0.12);
  --radius: 14px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --scroll-max: min(520px, 65vh);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(110, 132, 255, 0.35); }

.boot { height: 100vh; display: grid; place-items: center; }
.boot img { border-radius: 14px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* login */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(79, 107, 255, 0.26), transparent 70%),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--bg);
}
.login-card { width: 100%; max-width: 400px; background: rgba(17, 21, 34, 0.92); border: 1px solid var(--line-2); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand img { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 0 24px rgba(79, 107, 255, 0.5); }
.login-brand b { display: block; font-size: 18px; }
.login-brand span { color: var(--sub); font-size: 12.5px; }
.login-foot { margin-top: 18px; color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }

/* layout */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; }
.side-brand img { width: 32px; height: 32px; border-radius: 9px; }
.side-brand b { font-size: 15px; }
.side-brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--sub); font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.04); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--brand-bg); color: var(--brand-2); }
.nav a .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.nav a .live-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.nav-label { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 6px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #0b0f1d; background: linear-gradient(135deg, var(--brand-2), var(--brand)); flex: none; font-size: 13px; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who small { color: var(--muted); font-size: 11.5px; text-transform: capitalize; }

.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 14px; padding: 18px 28px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(8, 10, 18, 0.85); backdrop-filter: blur(10px); z-index: 5; }
.top .menu { display: none; }
.top .spacer { flex: 1; }
.content { padding: 24px 28px 48px; max-width: 1320px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .top .menu { display: inline-flex; }
  .top, .content { padding-left: 16px; padding-right: 16px; }
}

/* elements */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 600 13px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: #1e2438; border-color: rgba(255,255,255,.2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); border-color: rgba(255,107,125,.35); background: var(--red-bg); }
.btn.danger:hover { background: rgba(255,107,125,.2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--sub); }
.btn.ghost:hover { background: rgba(255,255,255,.05); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; height: 42px; }
.icon { width: 18px; height: 18px; flex: none; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--sub); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
input, select, textarea {
  width: 100%; background: #0b0e18; border: 1px solid var(--line-2); color: var(--text);
  border-radius: 10px; padding: 9px 12px; font: 14px var(--font); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 107, 255, .2); }
textarea { resize: vertical; min-height: 90px; }
input[type="checkbox"] { width: auto; }
.code-input { font: 600 22px var(--mono); letter-spacing: .4em; text-align: center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; } }

.kpi { padding: 18px; position: relative; }
.kpi small { color: var(--sub); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.kpi small .icon { width: 16px; height: 16px; color: var(--brand-2); }
.kpi b { display: block; font-size: 28px; font-weight: 650; letter-spacing: -0.02em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 12.5px; }
.kpi .up { color: var(--green); }
.kpi .warn { color: var(--amber); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { color: var(--green); background: var(--green-bg); }
.pill.red { color: var(--red); background: var(--red-bg); }
.pill.amber { color: var(--amber); background: var(--amber-bg); }
.pill.blue { color: var(--brand-2); background: var(--brand-bg); }
.pill.purple { color: var(--purple); background: var(--purple-bg); }
.pill.grey { color: var(--sub); background: rgba(255,255,255,.06); }
.tag { display: inline-block; font: 600 11px var(--mono); padding: 2px 7px; border-radius: 6px; background: rgba(255,255,255,.06); color: var(--sub); }

.table-wrap { overflow: auto; max-height: var(--scroll-max); overscroll-behavior: contain; }
.table-wrap thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); box-shadow: inset 0 -1px 0 var(--line); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: rgba(255,255,255,.025); }
td .sub { display: block; color: var(--muted); font-size: 12.5px; }
td.nowrap { white-space: nowrap; }
td.detail { min-width: 220px; max-width: 420px; font: 12.5px/1.5 var(--mono); overflow-wrap: anywhere; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.ellipsis { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-cell { display: flex; align-items: center; gap: 10px; }
.who-cell .avatar { width: 30px; height: 30px; font-size: 12px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; min-width: 0; }
.toolbar input[type="search"] { max-width: 320px; }
.toolbar select { width: auto; max-width: 100%; }
.toolbar .spacer { flex: 1; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.page-head .spacer { flex: 1; }
.page-head p { color: var(--sub); margin: 4px 0 0; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--sub); margin-bottom: 12px; font-size: 13px; }

dl.props { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; }
dl.props dt { color: var(--muted); font-size: 13px; }
dl.props dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { dl.props { grid-template-columns: 1fr; gap: 2px; } dl.props dd { margin-bottom: 10px; } }

.list { display: grid; max-height: var(--scroll-max); overflow-y: auto; overscroll-behavior: contain; align-content: start; }
.list-item { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item small { color: var(--muted); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.green { background: var(--green); } .dot.red { background: var(--red); } .dot.amber { background: var(--amber); }

.empty { padding: 40px 18px; text-align: center; color: var(--muted); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid; margin-bottom: 16px; }
.notice.amber { border-color: rgba(255,193,100,.3); background: var(--amber-bg); color: #f6dcb0; }
.notice.red { border-color: rgba(255,107,125,.3); background: var(--red-bg); color: #ffc9d0; }
.notice.green { border-color: rgba(47,214,161,.3); background: var(--green-bg); color: #c9f2e5; }
.notice p:last-child { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--muted); }
.sub { color: var(--sub); }
.mt { margin-top: 16px; }
.secret { font: 600 14px var(--mono); letter-spacing: .12em; background: #0b0e18; border: 1px dashed var(--line-2); padding: 10px 12px; border-radius: 10px; overflow-wrap: anywhere; }
pre.metrics { margin: 0; padding: 16px 18px; font: 12px/1.6 var(--mono); color: var(--sub); max-height: var(--scroll-max); overflow: auto; }

.chart { width: 100%; height: 190px; display: block; }
.chart .bar { fill: var(--brand); }
.chart .bar.alt { fill: var(--green); }
.chart .bar:hover { fill: var(--brand-2); }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart .gridline { stroke: rgba(255,255,255,.06); }

.meter { height: 8px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 8px; min-width: 80px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.meter.green > span { background: var(--green); } .meter.amber > span { background: var(--amber); } .meter.red > span { background: var(--red); }

.split { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.07); gap: 2px; }
.split span { display: block; height: 100%; }
.seg-ranked { background: var(--brand); } .seg-room { background: var(--green); } .seg-tournament { background: var(--purple); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.legend > span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; display: inline-block; }

.bracket { display: flex; gap: 18px; overflow-x: auto; padding: 18px; }
.round { min-width: 220px; display: grid; gap: 10px; align-content: start; }
.round h3 { color: var(--sub); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.bout { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); overflow: hidden; }
.bout div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; font-size: 13px; }
.bout div + div { border-top: 1px solid var(--line); }
.bout .won { color: var(--green); font-weight: 600; }
.bout small { color: var(--muted); padding: 4px 10px 6px; display: block; border-top: 1px solid var(--line); }

/* overlays */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .12s; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); }
.modal.wide { max-width: 780px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }

#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; max-width: calc(100vw - 32px); }
.toast { background: #191e30; border: 1px solid var(--line-2); border-left: 3px solid var(--brand-2); padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow); min-width: 240px; animation: fade .15s; }
.toast.error { border-left-color: var(--red); }

.err { color: var(--red); font-size: 13px; margin: -4px 0 12px; min-height: 0; }
.err:empty { display: none; }
[hidden] { display: none !important; }

* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }
