@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&family=Barlow+Condensed:wght@600;700;800;900&family=JetBrains+Mono:wght@500;700&display=swap');

/* ============================================================
   BETA-PB GM · FPS Tactical HUD Theme
   ============================================================ */

:root {
  --bg: #05070b;
  --bg2: #090f18;
  --panel: #0e1522;
  --panel2: #121d2e;
  --line: #233149;
  --line2: #31435f;
  --text: #dbe7ff;
  --muted: #8ca0bf;
  --dim: #5f718d;
  --cyan: #00d9ff;
  --cyan-dim: rgba(0, 217, 255, 0.4);
  --cyan-soft: rgba(0, 217, 255, 0.08);
  --orange: #ff9544;
  --orange-soft: rgba(255, 149, 68, 0.1);
  --orange-dim: rgba(255, 149, 68, 0.4);
  --green: #00e08a;
  --red: #ff4a57;
  --yellow: #ffd166;
  --radius: 2px;
  --clip-md: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  --clip-sm: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(0, 217, 255, 0.025) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(0, 217, 255, 0.025) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(ellipse at top, rgba(0, 217, 255, 0.04) 0%, transparent 60%),
    linear-gradient(180deg, #05070b 0%, #090f18 100%);
  color: var(--text);
  font-family: 'Noto Sans Thai', system-ui, sans-serif;
  font-size: 15px;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ============================================================
   TOP BAR · Tactical Command Strip
   ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 clamp(12px, 3vw, 24px);
  background: rgba(5, 7, 11, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-dim) 20%, var(--cyan-dim) 80%, transparent);
  opacity: 0.5;
}

.brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 0;
  margin-right: 8px;
  border-right: 1px solid var(--line);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.brand::before {
  content: 'GM';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--cyan);
  color: #021018;
  font-size: 13px;
  font-weight: 900;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.brand span { color: var(--cyan); }

.topbar .nav { flex: 1 1 auto; }
.nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 14px 14px;
  color: var(--dim);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.nav a:hover {
  color: #fff;
  background: var(--cyan-soft);
  text-decoration: none;
}
.nav a.active {
  color: #fff;
  border-bottom-color: var(--cyan);
  background: linear-gradient(180deg, transparent 0%, var(--cyan-soft) 100%);
}

.profile-menu {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding-left: 12px;
  margin-left: 8px;
  border-left: 1px solid var(--line);
}
.profile-toggle {
  position: relative;
  min-height: 36px;
  max-width: 220px;
  padding: 7px 14px 7px 22px;
  border: 1px solid var(--cyan-dim);
  background: var(--cyan-soft);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  clip-path: var(--clip-sm);
}
.profile-toggle::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  display: none;
  min-width: 200px;
  padding: 4px;
  border: 1px solid var(--line2);
  background: var(--bg2);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}
.profile-menu:hover .profile-dropdown,
.profile-menu:focus-within .profile-dropdown {
  display: grid;
}
.profile-dropdown a {
  padding: 10px 12px;
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.profile-dropdown a:hover,
.profile-dropdown a.active {
  color: #fff;
  background: var(--cyan-soft);
  text-decoration: none;
}

/* ============================================================
   LAYOUT SHELL
   ============================================================ */

.shell {
  width: min(1220px, calc(100% - 24px));
  margin: 24px auto 48px;
}
.shell-admin {
  width: min(1580px, calc(100% - 24px));
}

h1, h2, h3 {
  margin: 0;
  font-family: 'Barlow Condensed', 'Noto Sans Thai', sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: #fff;
  text-transform: uppercase;
}
h1 { font-size: clamp(28px, 4.5vw, 42px); letter-spacing: 0.04em; }
h2 { font-size: 20px; letter-spacing: 0.06em; }
h3 { font-size: 15px; letter-spacing: 0.1em; color: var(--muted); }

h2::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  margin-right: 8px;
  background: var(--cyan);
  vertical-align: -3px;
}

p { color: var(--muted); line-height: 1.6; }

/* ============================================================
   HERO · Operative Briefing
   ============================================================ */

.hero {
  position: relative;
  padding: 22px 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(0, 217, 255, 0.08), rgba(255, 149, 68, 0.04)),
    var(--panel);
  clip-path: var(--clip-md);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 120px;
  height: 2px;
  background: var(--cyan);
}
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 40px;
  background: var(--cyan);
}
.hero h1 { color: #fff; }
.hero h1 + p { margin-top: 8px; }

/* ============================================================
   GRID & PANELS
   ============================================================ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.two {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 12px;
}

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px;
}
.panel::before,
.panel::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--cyan);
  pointer-events: none;
}
.panel::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}
.panel::after {
  bottom: -1px;
  right: -1px;
  border-left: 0;
  border-top: 0;
}

.panel-soft {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  padding: 12px;
}
.panel-soft p { margin: 6px 0 0; }

/* ============================================================
   METRIC CARD · HUD Stat Readout
   ============================================================ */

.metric {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 16px 14px;
}
.metric strong {
  display: block;
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.metric span {
  display: block;
  margin-top: 8px;
  color: var(--dim);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gm-point-side { margin-bottom: 14px; }

.danger-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--orange);
  background: var(--orange-soft);
  color: #ffc4a0;
  font-weight: 700;
  font-size: 13px;
}

/* ============================================================
   TOOLBAR & BUTTONS
   ============================================================ */

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  padding: 10px 18px;
  border: 1px solid var(--cyan-dim);
  background: var(--cyan-soft);
  color: #fff;
  cursor: pointer;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  clip-path: var(--clip-sm);
  transition: background 0.15s, color 0.15s;
}
.btn:hover {
  background: rgba(0, 217, 255, 0.18);
  color: #fff;
}
.btn.primary {
  background: var(--cyan);
  color: #021018;
  border-color: var(--cyan);
}
.btn.primary:hover {
  background: #5be8ff;
  color: #021018;
}
.btn.danger {
  background: rgba(255, 74, 87, 0.1);
  color: #ffb5bc;
  border-color: rgba(255, 74, 87, 0.45);
}
.btn.danger:hover {
  background: rgba(255, 74, 87, 0.22);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   FORMS
   ============================================================ */

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

label {
  display: grid;
  gap: 6px;
  color: var(--dim);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line2);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font: inherit;
  font-family: 'Noto Sans Thai', system-ui, sans-serif;
  transition: border-color 0.15s, background 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--cyan);
  background: rgba(0, 217, 255, 0.05);
}
input[type="file"] {
  padding: 8px 12px;
  font-size: 13px;
}
select {
  color-scheme: dark;
  background-color: #07101d;
  cursor: pointer;
}
select option {
  background: #07101d;
  color: #f4f8ff;
}
select option:checked,
select option:hover {
  background: #12324a;
  color: #ffffff;
}
textarea {
  min-height: 110px;
  resize: vertical;
  font-family: 'Noto Sans Thai', system-ui, sans-serif;
}

.inline-grant {
  display: grid;
  grid-template-columns: minmax(82px, 110px) minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.inline-grant input { min-width: 0; }

/* ============================================================
   BATCH ITEM TOOL
   ============================================================ */

.batch-item-tool { display: grid; gap: 14px; }
.batch-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.72fr);
  gap: 14px;
  align-items: start;
}
.control-stack { display: grid; gap: 10px; }

.mode-radios {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  margin: 0;
  border: 1px solid var(--line2);
  min-height: 61px;
}
.mode-radios legend {
  padding: 0 6px;
  color: var(--dim);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.mode-radios label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-transform: none;
  font-family: 'Noto Sans Thai', sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}
.mode-radios input {
  width: auto;
  margin: 0;
  accent-color: var(--cyan);
}

.batch-picker {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
}
.batch-picker-3 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(190px, 0.55fr);
}
.batch-grant-form { display: contents; }

.pick-list,
.selected-list {
  height: 336px;
  max-height: 336px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  scrollbar-width: thin;
  scrollbar-color: var(--line2) transparent;
}
.pick-list::-webkit-scrollbar,
.selected-list::-webkit-scrollbar { width: 6px; }
.pick-list::-webkit-scrollbar-thumb,
.selected-list::-webkit-scrollbar-thumb { background: var(--line2); }

.pick-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pick-item {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  background: transparent !important;
  color: var(--text);
  cursor: pointer;
  font-family: 'Noto Sans Thai', system-ui, sans-serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  overflow: hidden;
  transition: border-color 0.1s, background 0.1s;
}
.pick-item:hover {
  border-color: var(--cyan-dim);
  border-left-color: var(--cyan);
  background: var(--cyan-soft) !important;
}
.pick-item strong {
  display: block;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  line-height: 1.35;
}
.selected-item-row span {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 12px;
}

.selected-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 7px 8px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--line);
}
.selected-item-row:last-child { border-bottom: 0; }
.selected-item-row.active {
  border-left-color: var(--cyan);
  background: var(--cyan-soft);
}
.selected-name {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-settings-panel {
  min-height: 160px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}
.settings-item-name { margin-bottom: 12px; }
.settings-item-name span {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 12px;
}

/* ============================================================
   TIME POPUP
   ============================================================ */

.time-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
.time-popup {
  position: relative;
  width: min(360px, calc(100% - 24px));
  padding: 18px 16px 14px;
  border: 1px solid var(--cyan-dim);
  background: #121820;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
  clip-path: var(--clip-md);
}
.time-grid { display: grid; gap: 10px; margin-bottom: 14px; }
.time-grid label {
  grid-template-columns: 80px 1fr;
  align-items: center;
}
.time-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.time-presets button {
  padding: 6px 10px;
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.time-presets button:hover {
  border-color: var(--cyan);
  background: var(--cyan-soft);
  color: #fff;
}
.time-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}
.time-close:hover { color: #fff; }

/* ============================================================
   TABLE
   ============================================================ */

table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--dim);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
td { color: var(--muted); font-size: 14px; }
tbody tr:hover td { background: rgba(0, 217, 255, 0.03); color: var(--text); }
.table-wrap { overflow-x: auto; }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */

.flash {
  position: relative;
  margin-bottom: 14px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line2);
  background: var(--panel2);
  font-weight: 700;
}
.flash.success {
  border-color: rgba(0, 224, 138, 0.45);
  border-left-color: var(--green);
  background: rgba(0, 224, 138, 0.06);
  color: #bcffdf;
}
.flash.error {
  border-color: rgba(255, 74, 87, 0.5);
  border-left-color: var(--red);
  background: rgba(255, 74, 87, 0.06);
  color: #ffc4c9;
}

/* ============================================================
   BADGE · Tactical Pill
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.04);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.badge-active,
.badge-joined,
.badge-interested,
.badge-success { color: var(--green); background: rgba(0, 224, 138, 0.08); }
.badge-inactive,
.badge-rejected,
.badge-failed { color: var(--red); background: rgba(255, 74, 87, 0.08); }
.badge-followup,
.badge-visited,
.badge-invited { color: var(--yellow); background: rgba(255, 209, 102, 0.08); }

/* ============================================================
   WARN PANEL · Diagonal Stripes
   ============================================================ */

.panel.warn {
  border-color: rgba(255, 149, 68, 0.45);
  background:
    repeating-linear-gradient(135deg, rgba(255, 149, 68, 0.06) 0, rgba(255, 149, 68, 0.06) 8px, transparent 8px, transparent 16px),
    var(--panel);
}
.panel.warn::before,
.panel.warn::after { border-color: var(--orange); }
.panel.warn h1,
.panel.warn h2 { color: #ffd9bf; }
.panel.warn h2::before { background: var(--orange); }

.warn {
  border-color: rgba(255, 209, 102, 0.45);
  background: rgba(255, 209, 102, 0.06);
}

/* ============================================================
   LOGIN
   ============================================================ */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}
.login .panel {
  width: min(420px, 100%);
  padding: 28px 24px;
}
.login .panel h1 {
  font-size: 32px;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.login .panel p {
  margin-bottom: 18px;
  font-size: 13px;
}

/* ============================================================
   UTILITY
   ============================================================ */

.muted { color: var(--muted); }
.mono { font-family: 'JetBrains Mono', monospace; }
.rank-badge {
  display: inline-block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  vertical-align: middle;
}

/* ============================================================
   ONLINE CHART
   ============================================================ */

.online-chart {
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--line);
}
.online-chart:last-child { border-bottom: 0; }
.online-bars {
  display: flex;
  align-items: end;
  gap: 6px;
  min-height: 132px;
  height: 132px;
  padding: 10px 10px 0;
  margin-top: 12px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.online-bars span {
  display: block;
  flex: 0 0 12px;
  height: 104px;
  background: rgba(255, 74, 87, 0.42);
}
.online-bars span.on {
  background: linear-gradient(180deg, var(--cyan), rgba(0, 224, 138, 0.82));
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.35);
}
.online-bars span.off { height: 26px; }

.online-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.online-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.online-dot {
  width: 10px;
  height: 10px;
  border: 1px solid var(--line);
  display: inline-block;
}
.online-dot.on {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.45);
}
.online-dot.off { background: rgba(148, 163, 184, 0.18); }
.online-grid table { min-width: 1180px; }
.online-grid th,
.online-grid td {
  text-align: center;
  vertical-align: middle;
}
.online-grid th:first-child,
.online-grid td:first-child {
  text-align: left;
  min-width: 180px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--panel);
}
.online-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-height: 30px;
  border: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.online-day.on {
  color: #001018;
  background: linear-gradient(180deg, var(--cyan), #00e08a);
  border-color: rgba(0, 217, 255, 0.75);
  box-shadow: 0 0 14px rgba(0, 217, 255, 0.25);
}
.online-day.off {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.08);
}

/* ============================================================
   POINTS HELP PAGE
   ============================================================ */

.points-help { display: grid; gap: 18px; }
.points-help-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}
.points-help-head p { margin: 8px 0 0; }

.points-rate {
  position: relative;
  min-width: 158px;
  padding: 16px 20px;
  border: 1px solid var(--cyan-dim);
  background: var(--cyan-soft);
  clip-path: var(--clip-sm);
}
.points-rate strong {
  display: block;
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}
.points-rate span {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.points-help-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.points-card,
.points-example,
.points-spend {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}
.points-card { overflow: hidden; }
.points-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 2px;
  background: var(--cyan);
}
.points-number {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 800;
}
.points-card h2,
.points-example h2,
.points-spend h2 { font-size: 18px; }
.points-card p { margin: 8px 0 0; }
.points-card strong,
.points-example strong,
.points-spend strong { color: #fff; }

.points-example-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.points-example-list div {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--cyan);
  background: var(--cyan-soft);
}
.points-example-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.points-spend ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
}
.points-spend ul li::marker { color: var(--cyan); }

.points-warning {
  padding: 14px 16px;
  border: 1px solid rgba(255, 149, 68, 0.5);
  border-left: 3px solid var(--orange);
  background:
    repeating-linear-gradient(135deg, rgba(255, 149, 68, 0.06) 0, rgba(255, 149, 68, 0.06) 8px, transparent 8px, transparent 16px),
    rgba(255, 149, 68, 0.04);
  color: #ffd9bf;
  font-weight: 700;
}

.points-raw {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.points-raw summary {
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 800px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }
  .brand {
    margin-right: 0;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav { padding: 0 8px; }
  .nav a { padding: 12px 10px; font-size: 12px; }
  .profile-menu {
    width: 100%;
    margin-left: 0;
    padding: 8px 12px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .profile-toggle { max-width: none; width: 100%; text-align: left; }
  .profile-dropdown { left: 12px; right: 12px; }
  .two { grid-template-columns: 1fr; }
  .batch-controls { grid-template-columns: 1fr; }
  .batch-picker { grid-template-columns: 1fr; }
  .batch-picker-3 { grid-template-columns: 1fr; }
  .selected-item-row { grid-template-columns: 1fr; }
  .points-help-head,
  .points-help-grid,
  .points-example-list { grid-template-columns: 1fr; }
  th, td { padding: 8px; font-size: 13px; }
}

/* ============================================================
   HUD UTILITIES · Pills, Dots, Hero Head, Invite Code
   ============================================================ */

.hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
}
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.hero-meta {
  flex-shrink: 0;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}
.hero-meta .label {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.15em;
  line-height: 1.6;
}
.hero-meta .value {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.fps-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.03);
  color: var(--dim);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.fps-pill.cyan { color: var(--cyan); background: var(--cyan-soft); }
.fps-pill.orange { color: var(--orange); background: var(--orange-soft); }
.fps-pill.green { color: var(--green); background: rgba(0, 224, 138, 0.08); }
.fps-pill.red { color: var(--red); background: rgba(255, 74, 87, 0.08); }
.fps-pill.dim { color: var(--dim); }

.fps-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.invite-code-box {
  text-align: center;
  padding: 16px 14px;
  margin-top: 10px;
  border: 1px dashed var(--cyan-dim);
  background: var(--cyan-soft);
  cursor: pointer;
  user-select: all;
  transition: background 0.15s, border-color 0.15s;
}
.invite-code-box:hover {
  border-style: solid;
  background: rgba(0, 217, 255, 0.14);
}
.invite-code-box .code {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.22em;
  line-height: 1;
}
.invite-code-box .hint {
  display: block;
  margin-top: 8px;
  color: var(--dim);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.section-head h2 { margin: 0; }

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 0;
}
.action-row .btn {
  flex: 1 1 0;
  min-height: 50px;
  font-size: 14px;
}

/* ============================================================
   GM/MOD HOME READABILITY
   ============================================================ */

.dashboard-hero {
  background:
    linear-gradient(135deg, rgba(0, 217, 255, 0.12), rgba(18, 29, 46, 0.98)),
    #101a2a;
  border-color: rgba(0, 217, 255, 0.38);
}
.dashboard-hero h1 {
  font-size: clamp(34px, 4.8vw, 48px);
  letter-spacing: 0.03em;
}
.dashboard-hero p,
.dashboard-card p,
.dashboard-warning p,
.dashboard-notice p {
  color: #b9c9e6;
}
.dashboard-notice {
  padding: 20px 22px;
  border-color: rgba(255, 149, 68, 0.7);
  background:
    linear-gradient(90deg, rgba(255, 149, 68, 0.16), rgba(14, 21, 34, 0.96)),
    #101725;
}
.dashboard-notice h2,
.dashboard-warning h2 {
  color: #ffe3cc;
  font-size: 24px;
}
.dashboard-notice p {
  margin: 10px 0 0;
  max-width: 980px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.75;
}
.dashboard-metrics {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.dashboard-metrics .metric {
  min-height: 86px;
  background: #101929;
  border-color: rgba(0, 217, 255, 0.36);
}
.dashboard-metrics .metric strong {
  font-size: 30px;
}
.dashboard-metrics .metric span {
  color: #9db1d0;
  font-size: 12px;
}
.dashboard-card {
  background: #101929;
  border-color: rgba(0, 217, 255, 0.32);
}
.dashboard-card h2,
.dashboard-warning h2 {
  color: #fff;
}
.dashboard-card th {
  color: #7fa1d2;
  font-size: 12px;
}
.dashboard-card td {
  color: #c5d5f0;
  font-size: 15px;
}
.dashboard-card td strong {
  color: #fff !important;
}
.dashboard-card tbody tr:hover td {
  background: rgba(0, 217, 255, 0.08);
}
.dashboard-warning {
  background:
    linear-gradient(90deg, rgba(255, 149, 68, 0.14), rgba(14, 21, 34, 0.96)),
    #101725;
}
.dashboard-warning p {
  font-size: 15px;
  font-weight: 600;
}
.dashboard-card .invite-code-box {
  background: rgba(0, 217, 255, 0.12);
  border-color: rgba(0, 217, 255, 0.55);
}
.dashboard-card .invite-code-box .code {
  color: #57e8ff;
  text-shadow: 0 0 18px rgba(0, 217, 255, 0.24);
}
.dashboard-card .invite-code-box .hint {
  color: #9db1d0;
}

@media (max-width: 800px) {
  .hero-head { flex-direction: column; }
  .hero-meta { text-align: left; }
  .action-row { flex-direction: column; }
}

/* Admin item audit: keep action column visible and avoid clipping wide tables. */
.audit-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.audit-tabs {
  margin: 14px 0 0;
  padding: 6px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}
.audit-tabs .btn {
  min-width: 190px;
}
.audit-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.audit-table {
  min-width: 980px;
  table-layout: fixed;
}
.audit-table th:nth-child(1),
.audit-table td:nth-child(1) { width: 90px; }
.audit-table th:nth-child(2),
.audit-table td:nth-child(2) { width: 130px; }
.audit-table th:nth-child(3),
.audit-table td:nth-child(3) { width: 190px; }
.audit-table th:nth-child(4),
.audit-table td:nth-child(4) { width: 120px; }
.audit-table th:nth-child(5),
.audit-table td:nth-child(5) { width: 60px; text-align: center; }
.audit-table th:nth-child(6),
.audit-table td:nth-child(6) { width: 100px; }
.audit-table th:nth-child(7),
.audit-table td:nth-child(7) { width: 130px; }
.audit-table th:nth-child(8),
.audit-table td:nth-child(8),
.audit-table th:nth-child(9),
.audit-table td:nth-child(9) { width: 140px; }
.audit-table td {
  vertical-align: top;
  word-break: break-word;
}
.audit-rule .badge {
  display: inline-flex;
  min-width: 58px;
  justify-content: center;
  margin-right: 6px;
}
.audit-rule-bad-live {
  color: #ff9aa3;
  background: rgba(255, 74, 87, 0.08);
}
.audit-rule-bad-live .badge.danger {
  border-color: var(--red);
  background: rgba(255, 74, 87, 0.2);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 74, 87, 0.28);
}
.audit-rule-bad-live .mono {
  color: #ff9aa3;
  font-weight: 800;
}
.audit-bad-count {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 74, 87, 0.7);
  background: rgba(255, 74, 87, 0.16);
  color: #ffccd1;
  font-size: 11px;
  font-weight: 800;
}
.audit-actions form {
  margin: 0 0 6px;
}
.audit-actions .btn {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  font-size: 11px;
}

@media (max-width: 900px) {
  .audit-table {
    min-width: 860px;
  }
}

/* Admin reports: full-width workflow cards with clear case actions. */
.report-panel {
  width: min(100%, 1560px);
  margin-inline: auto;
}
.report-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.report-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}
.report-card-pending {
  border-color: rgba(0, 217, 255, 0.38);
  background: rgba(0, 217, 255, 0.045);
}
.report-card-closed {
  opacity: 0.86;
}
.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 700;
}
.report-body-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.15fr);
  gap: 14px;
}
.report-body-grid p,
.report-reply p {
  margin: 8px 0 0;
  color: var(--text);
}
.report-reply {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.report-action {
  min-width: 0;
}
.report-form {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 520px);
  gap: 14px;
  align-items: end;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.report-form textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}
.report-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.report-buttons .btn {
  width: 100%;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  line-height: 1.2;
  white-space: normal;
}
.report-buttons .btn span {
  color: var(--muted);
  font-size: 11px;
}
.report-reviewed {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .report-body-grid,
  .report-form,
  .report-buttons {
    grid-template-columns: 1fr;
  }
}
