/* ============================================================
   IGS Client Area — gamepanel-style.css
   Built on top of index-style.css (shared tokens, nav, footer)
   ============================================================ */

.gp-shell {
  display: flex;
  min-height: 100vh;
  padding-top: var(--nav-h);
}

/* ── Sidebar ─────────────────────────────────────────── */
.gp-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
}
.gp-sidebar__brand {
  padding-bottom: 1rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.gp-brand-title { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .02em; line-height: 1; }

.gp-nav { display: flex; flex-direction: column; gap: .2rem; }
.gp-nav-item {
  padding: .6rem .75rem; border-radius: 6px;
  font-size: .9rem; font-weight: 600; color: var(--text-2);
  cursor: pointer; border: 1px solid transparent; transition: all .15s;
}
.gp-nav-item:hover { color: var(--text-1); background: rgba(255,255,255,.03); }
.gp-nav-item.is-active { color: var(--igs-blue); background: rgba(58,134,255,.1); border-color: rgba(58,134,255,.25); }

.gp-nav-group { margin-bottom: .1rem; }
.gp-nav-header {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem .75rem; border-radius: 6px;
  font-size: .9rem; font-weight: 600; color: var(--text-2);
  cursor: pointer; border: 1px solid transparent; transition: all .15s;
}
.gp-nav-header:hover { color: var(--text-1); background: rgba(255,255,255,.03); }
.gp-nav-header.is-active { color: var(--igs-blue); }
.gp-nav-chevron {
  margin-left: auto; opacity: .5; transition: transform .15s; flex-shrink: 0;
}
.gp-nav-chevron.open { transform: rotate(90deg); }

.gp-nav-submenu {
  display: flex; flex-direction: column; gap: .05rem;
  padding: .2rem .25rem .3rem 1.6rem;
}
.gp-nav-submenu.collapsed { display: none; }
.gp-nav-subitem {
  padding: .45rem .6rem; border-radius: 5px;
  font-size: .82rem; font-weight: 500; color: var(--text-2);
  cursor: pointer; border: 1px solid transparent; transition: all .15s;
}
.gp-nav-subitem:hover { color: var(--text-1); background: rgba(255,255,255,.03); }
.gp-nav-subitem.is-active { color: var(--igs-blue); background: rgba(58,134,255,.1); border-color: rgba(58,134,255,.2); }

/* ── Main ────────────────────────────────────────────── */
.gp-main { flex: 1; min-width: 0; padding: 2.25rem 2.5rem 3rem; max-width: 1100px; }

.gp-loading {
  display: flex; align-items: center; gap: .75rem;
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-2); padding: 4rem 2.5rem;
}
.gp-loading[hidden] { display: none; }
.gp-spinner {
  width: 14px; height: 14px; border: 2px solid var(--border-b); border-top-color: var(--igs-blue);
  border-radius: 50%; animation: gpSpin .8s linear infinite;
}
@keyframes gpSpin { to { transform: rotate(360deg); } }

.gp-panel-group[hidden] { display: none; }

.gp-page-head { margin-bottom: 1.75rem; }
.gp-eyebrow { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em; color: var(--text-3); text-transform: uppercase; margin-bottom: .4rem; }
.gp-title { font-family: var(--font-display); font-size: 2.1rem; letter-spacing: .02em; line-height: 1; }
.gp-sub { color: var(--text-2); font-size: .9rem; margin-top: .4rem; }

.gp-section-head { margin: 2rem 0 .9rem; }
.gp-section-head h2 { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .02em; font-weight: 400; }

/* Stats */
.gp-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.gp-stat-card { background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px; padding: 1.1rem 1.25rem; }
.gp-stat-label { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .08em; color: var(--text-3); text-transform: uppercase; margin-bottom: .5rem; }
.gp-stat-value { font-family: var(--font-display); font-size: 2.1rem; line-height: 1; }
.gp-green { color: #57f287; }
.gp-red { color: var(--igs-red); }

/* Empty state */
.gp-empty {
  font-family: var(--font-mono); font-size: .82rem; color: var(--text-2);
  border: 1px dashed var(--border-b); border-radius: 8px; padding: 1.5rem; line-height: 1.6;
}

/* Server / dashboard list (shared by both pages) */
.gp-list { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-1); }
.gp-list-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.gp-list-row:last-child { border-bottom: none; }
.gp-list-row:hover { background: rgba(255,255,255,.025); }
.gp-list-name { font-weight: 600; font-size: .92rem; flex: 1; }
.gp-list-price { font-family: var(--font-mono); font-size: .78rem; color: var(--text-2); }
.gp-list-renews { font-family: var(--font-mono); font-size: .72rem; color: var(--text-3); }

/* Status badges */
.gp-badge {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase;
  padding: .25rem .6rem; border-radius: 4px; border: 1px solid; flex-shrink: 0;
}
.gp-badge--paid     { color: #57f287; border-color: rgba(87,242,135,.35); background: rgba(87,242,135,.08); }
.gp-badge--unpaid   { color: var(--igs-red); border-color: rgba(230,57,70,.35); background: rgba(230,57,70,.08); }
.gp-badge--canceled { color: var(--text-3); border-color: var(--border-b); background: rgba(255,255,255,.03); }

/* Detail view */
.gp-back-link {
  display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1.25rem;
  font-family: var(--font-mono); font-size: .72rem; color: var(--text-2);
  cursor: pointer; text-transform: uppercase; letter-spacing: .05em;
}
.gp-back-link:hover { color: var(--text-1); }
.gp-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.gp-detail-meta { font-family: var(--font-mono); font-size: .78rem; color: var(--text-2); margin-top: .4rem; }

.gp-control-bar { display: flex; gap: .6rem; margin-bottom: .75rem; flex-wrap: wrap; }
.gp-btn {
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .05em; text-transform: uppercase;
  padding: .6rem 1.1rem; border-radius: 5px; border: 1px solid var(--border-b);
  background: var(--bg-2); color: var(--text-2); cursor: pointer; transition: all .15s;
}
.gp-btn:hover { color: var(--text-1); border-color: rgba(255,255,255,.25); }
.gp-btn--start { color: #57f287; border-color: rgba(87,242,135,.3); }
.gp-btn--start:hover { background: rgba(87,242,135,.08); border-color: rgba(87,242,135,.5); }
.gp-btn--stop { color: var(--igs-red); border-color: rgba(230,57,70,.3); }
.gp-btn--stop:hover { background: rgba(230,57,70,.08); border-color: rgba(230,57,70,.5); }
.gp-btn--restart { color: var(--war); border-color: rgba(245,158,11,.3); }
.gp-btn--restart:hover { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.5); }

.gp-control-note {
  font-family: var(--font-mono); font-size: .72rem; color: var(--text-3);
  min-height: 1.2em; margin-bottom: 1.25rem;
}
.gp-console {
  background: #05060a; border: 1px solid var(--border); border-radius: 8px;
  height: 380px; overflow-y: auto;
  padding: .85rem 1rem;
  font-family: var(--font-mono); font-size: .76rem; line-height: 1.6; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
.gp-console-line--player  { color: var(--igs-blue); }
.gp-console-line--warning { color: var(--war); }
.gp-console-line--script  { color: #a78bfa; }
.gp-console-line--error   { color: var(--igs-red); }

/* Game Servers table */
.gp-table { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-1); }
.gp-table-row {
  display: grid;
  grid-template-columns: 1fr .6fr .8fr 1.3fr .8fr .8fr 1fr;
  gap: .75rem; align-items: center;
  padding: .8rem 1.1rem; border-bottom: 1px solid var(--border);
  font-size: .86rem; cursor: pointer; transition: background .15s;
}
.gp-table-row:last-child { border-bottom: none; }
.gp-table-row:hover { background: rgba(255,255,255,.025); }
.gp-table-row--head {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); cursor: default; background: rgba(255,255,255,.02);
}
.gp-table-row--head:hover { background: rgba(255,255,255,.02); }
.gp-table-row--access { grid-template-columns: 1.5fr .8fr .8fr; }

/* Command line editor (also reused by the Sub Users access editor and
   Create Sub User form — same panel/field/button shapes throughout) */
.gp-editor-panel {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px;
  padding: 1.25rem; margin-bottom: 1rem;
}
.gp-editor-title { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: .02em; margin-bottom: .4rem; }
.gp-field { margin: 1rem 0; }
.gp-field label {
  display: block; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: .4rem;
}
.gp-optional { text-transform: none; letter-spacing: 0; font-weight: 400; }
.gp-field textarea,
.gp-field input[type="text"] {
  width: 100%; font-family: var(--font-body); font-size: .9rem; color: var(--text-1);
  background: rgba(255,255,255,.03); border: 1px solid var(--border-b); border-radius: 5px;
  padding: .6rem .75rem; resize: vertical;
}
.gp-field textarea { font-family: var(--font-mono); font-size: .82rem; }
.gp-field textarea:focus,
.gp-field input[type="text"]:focus { outline: none; border-color: var(--igs-blue); background: rgba(58,134,255,.05); }
.gp-checkbox-group { display: flex; flex-wrap: wrap; gap: 1.1rem; margin: 1rem 0; }
.gp-checkbox-group label { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text-2); cursor: pointer; }

/* Standalone search box (Create Sub User) — not inside an .gp-editor-panel,
   so it needs its own bottom margin before the results list. */
#subUserSearchInput { margin-bottom: 1.25rem; max-width: 420px; }

@media (max-width: 780px) {
  .gp-shell { flex-direction: column; }
  .gp-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .gp-nav { flex-direction: row; flex-wrap: wrap; }
  .gp-stat-row { grid-template-columns: 1fr 1fr; }
  .gp-table-row { grid-template-columns: 1fr; gap: .2rem; }
  .gp-table-row--access { grid-template-columns: 1fr; }
  .gp-table-row--head { display: none; }
}