/* AUTO-GENERATED at server startup from src/config/branding.ts. */
/* Do not hand-edit -- your changes will be overwritten on next boot.    */

:root {
  --bg: #0B0F1A;
  --surface: #131826;
  --surface-alt: #1B2233;
  --border: #252D40;
  --text: #EDEFF5;
  --text-muted: #8B93A7;
  --accent-blue: #2F7BFF;
  --accent-amber: #F5A623;
  --good: #3FBF6F;
  --warn: #F5A623;
  --bad: #E2564F;

  --font-display: 'Sora', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Looks like a link, is a <button> — used for POST-only actions like Log out. */
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-blue); cursor: pointer; }
.link-button:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; letter-spacing: 0.06em; }

code, .mono, .value-mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- top nav ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text);
  font-size: 1rem;
  text-transform: uppercase;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  height: 32px;
  width: auto;
  display: inline-block;
  flex-shrink: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.9rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.nav-user img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

/* ---------- eyebrow labels ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-amber);
  margin: 0 0 10px;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--accent-amber);
  flex-shrink: 0;
}

/* ---------- layout shells ---------- */

.page {
  padding: 40px 0 80px;
}

/* ---------- guild dashboard sidebar (partials/guild-nav.ejs) ---------- */

.dashboard-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.guild-nav {
  flex: 0 0 200px;
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.guild-nav a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
}

.guild-nav a:hover {
  background: var(--surface-alt);
  text-decoration: none;
}

.guild-nav a.active {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--accent-amber);
  font-weight: 700;
}

.guild-nav a.guild-nav-exit {
  margin-top: 10px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.dashboard-main {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 860px) {
  .dashboard-layout {
    flex-direction: column;
    gap: 18px;
  }
  .guild-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    gap: 6px;
  }
  .guild-nav a.guild-nav-exit {
    margin-top: 0;
    padding-top: 9px;
    border-top: none;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}

.card + .card { margin-top: 20px; }

/* Cards inside a .two-col row are side-by-side, not stacked — the
   adjacent-sibling rule above would otherwise push the second one down. */
.two-col > .card + .card { margin-top: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.guild-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guild-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guild-card-header img,
.guild-icon-fallback {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
}

.guild-card-name {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-card-id {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  margin-top: 24px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 11px 20px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-primary:hover { opacity: 0.88; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--text);
  text-decoration: none;
}

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

/* ---------- forms ---------- */

fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px 22px;
  margin: 0 0 22px;
}

legend {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  padding: 0 8px;
}

.field {
  margin-bottom: 18px;
}

.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--text);
}

.field .help {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.92rem;
}

.field input[type="text"].mono-input,
.field input[type="password"].mono-input {
  font-family: var(--font-mono);
}

.field textarea {
  resize: vertical;
  min-height: 72px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(47, 123, 255, 0.25);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.field-label-row label { margin-bottom: 0; }

/* ---------- emoji picker (partials/emoji-picker.ejs) ---------- */

.emoji-picker {
  position: relative;
  display: inline-block;
}

.emoji-picker-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: 264px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.emoji-picker-search {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 7px 10px;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.emoji-picker-search:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.emoji-picker-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 10px 0 6px;
}

.emoji-picker-label:first-of-type { margin-top: 0; }

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.emoji-picker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 1.15rem;
  padding: 0;
  line-height: 1;
}

.emoji-picker-item:hover,
.emoji-picker-item:focus-visible {
  background: var(--surface-alt);
  border-color: var(--border);
  outline: none;
}

.emoji-picker-item img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.radio-option input { accent-color: var(--accent-blue); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 640px) {
  .two-col { grid-template-columns: 1fr; }
}

.conditional-block {
  border-top: 1px solid var(--border);
  margin-top: 18px;
  padding-top: 18px;
}

.connected-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(63, 191, 111, 0.12);
  border: 1px solid rgba(63, 191, 111, 0.35);
  color: var(--good);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 8px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

.banner {
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 22px;
  font-size: 0.9rem;
}

.banner-success {
  background: rgba(63, 191, 111, 0.12);
  border: 1px solid rgba(63, 191, 111, 0.35);
  color: var(--good);
}

.banner-error {
  background: rgba(226, 86, 79, 0.12);
  border: 1px solid rgba(226, 86, 79, 0.35);
  color: var(--bad);
}

.banner-warn {
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.35);
  color: var(--warn);
}

/* ---------- issues table ---------- */

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-alt);
}

.filter-pill.active {
  color: var(--bg);
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.table-scroll { overflow-x: auto; }

table.issues-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.issues-table th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  white-space: nowrap;
}

.issues-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.issues-table tr:last-child td { border-bottom: none; }

.level-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
}

.level-INFO { background: rgba(63, 191, 111, 0.14); color: var(--good); }
.level-WARN { background: rgba(245, 166, 35, 0.14); color: var(--warn); }
.level-ERROR { background: rgba(226, 86, 79, 0.14); color: var(--bad); }

.issue-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 320px;
}

/* ---------- setup checklist ---------- */

.setup-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.setup-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.setup-card-top h3 { margin: 0; }

.setup-fraction {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.setup-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  overflow: hidden;
}

.setup-bar-fill {
  height: 100%;
  background: var(--accent-blue);
  transition: width 0.2s ease;
}

.setup-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.setup-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  font-size: 0.86rem;
  text-decoration: none;
  color: var(--text);
}

.setup-step:hover { border-color: var(--accent-blue); text-decoration: none; }

.setup-step-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.setup-step.done .setup-step-check {
  background: rgba(63, 191, 111, 0.16);
  border-color: rgba(63, 191, 111, 0.4);
  color: var(--good);
}

/* ---------- tickets ---------- */

.ticket-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

table.tickets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.tickets-table th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  white-space: nowrap;
}

.tickets-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.tickets-table tr:last-child td { border-bottom: none; }

.status-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
}

.status-OPEN { background: rgba(47, 123, 255, 0.14); color: var(--accent-blue); }
.status-CLOSED { background: rgba(139, 147, 167, 0.16); color: var(--text-muted); }

.status-PENDING { background: rgba(245, 166, 35, 0.16); color: var(--warn); }
.status-ACCEPTED { background: rgba(63, 191, 111, 0.16); color: var(--good); }
.status-REJECTED { background: rgba(226, 86, 79, 0.16); color: var(--bad); }

.priority-LOW { background: rgba(139, 147, 167, 0.16); color: var(--text-muted); }
.priority-NORMAL { background: rgba(47, 123, 255, 0.14); color: var(--accent-blue); }
.priority-HIGH { background: rgba(245, 166, 35, 0.16); color: var(--warn); }
.priority-URGENT { background: rgba(226, 86, 79, 0.16); color: var(--bad); }

.action-WARN { background: rgba(245, 166, 35, 0.16); color: var(--warn); }
.action-MUTE { background: rgba(47, 123, 255, 0.14); color: var(--accent-blue); }
.action-UNMUTE { background: rgba(63, 191, 111, 0.14); color: var(--good); }
.action-KICK { background: rgba(226, 86, 79, 0.14); color: var(--bad); }
.action-BAN { background: rgba(226, 86, 79, 0.24); color: var(--bad); font-weight: 700; }
.action-UNBAN { background: rgba(63, 191, 111, 0.16); color: var(--good); }

/* ---------- bot status badge ---------- */
/* Live "is the bot actually in this server" indicator on the settings page
   header (dashboard/routes/dashboard.ts's getBotGuildMember check). */

.bot-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.bot-status-online {
  background: rgba(63, 191, 111, 0.14);
  border-color: rgba(63, 191, 111, 0.35);
  color: var(--good);
}

.bot-status-offline {
  background: rgba(226, 86, 79, 0.14);
  border-color: rgba(226, 86, 79, 0.35);
  color: var(--bad);
}

.bot-status-unknown {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text-muted);
}

.bot-status-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  font-size: 0.68rem;
  line-height: 1;
  background: currentColor;
}

.bot-status-dot::after {
  content: attr(data-icon);
  color: var(--surface);
  font-weight: 800;
}

/* ---------- overview page: live server status + activity graph ---------- */

.overview-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stat-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stat-chip {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  flex: 1 1 100px;
}

.stat-chip-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.stat-chip-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
}

.activity-chart-wrap {
  position: relative;
}

.activity-chart {
  width: 100%;
  height: 240px;
}

.activity-chart-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-family: var(--font-mono);
  margin-top: 6px;
}

.activity-tooltip {
  position: absolute;
  display: none;
  pointer-events: none;
  transform: translate(-50%, -100%);
  margin-top: -10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  z-index: 5;
}

.activity-tooltip-value {
  font-weight: 700;
}

.activity-tooltip-date {
  color: var(--text-muted);
  margin-top: 1px;
}

.server-status-table td { vertical-align: middle; }

.server-status-players {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- tickets: filters & pagination ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-bar .field { margin-bottom: 0; min-width: 160px; }
.filter-bar .field.filter-search { flex: 1 1 220px; }

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pagination-bar .btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.45;
}

/* ---------- tickets: internal notes ---------- */

.ticket-notes { display: flex; flex-direction: column; gap: 10px; }

.ticket-note {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--surface-alt);
}

.ticket-note-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.ticket-note-body { font-size: 0.92rem; white-space: pre-wrap; word-break: break-word; }

.transcript {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 6px;
}

.transcript-msg {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--surface-alt);
}

.transcript-msg-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.transcript-msg-body {
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- landing page ---------- */

.landing-hero {
  padding: 90px 0 70px;
  text-align: center;
}

.landing-hero .eyebrow { justify-content: center; }

.landing-hero h1 {
  font-size: 2.4rem;
  margin: 0 auto 18px;
  max-width: 640px;
}

.landing-hero p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 30px;
}

.forbidden-box, .info-box {
  max-width: 520px;
  margin: 60px auto;
  text-align: center;
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}
