/* ============================================================
   Omero Dashboard — Design System
   ============================================================ */

/* ---------- Custom properties ---------- */
:root {
  --bg:           #0c1017;
  --bg-panel:     #111827;
  --bg-raised:    #1a2235;
  --bg-hover:     #1e2d42;
  --border:       #1f2d3d;
  --border-light: #263348;

  --blurple:      #5865f2;
  --blurple-dark: #4752c4;
  --blurple-dim:  rgba(88,101,242,.15);

  --text:         #f1f5f9;
  --text-muted:   #8b98b1;
  --text-faint:   #4b5d76;

  --green:        #22c55e;
  --green-dim:    rgba(34,197,94,.15);
  --amber:        #f59e0b;
  --amber-dim:    rgba(245,158,11,.15);
  --red:          #ef4444;
  --red-dim:      rgba(239,68,68,.15);
  --cyan:         #06b6d4;
  --cyan-dim:     rgba(6,182,212,.15);
  --purple:       #a855f7;
  --purple-dim:   rgba(168,85,247,.15);

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --shadow:     0 2px 12px rgba(0,0,0,.35);
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--blurple); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; color: var(--text-muted); }

img { display: block; }

/* ---------- Top Nav ---------- */
.topnav {
  height: 56px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topnav-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topnav-brand:hover { text-decoration: none; opacity: .85; }

.topnav-brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blurple);
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topnav-links a {
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: color .15s, background .15s;
}
.topnav-links a:hover { color: var(--text); background: var(--bg-raised); text-decoration: none; }

.topnav-spacer { flex: 1; }

.topnav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.topnav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-raised);
  object-fit: cover;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background .15s, opacity .15s;
  line-height: 1;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--blurple); color: #fff; border-color: var(--blurple-dark); }
.btn-primary:hover { background: var(--blurple-dark); }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-raised); color: var(--text); }

.btn-danger { background: var(--red-dim); color: var(--red); border-color: rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.25); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: var(--radius); }

/* ---------- Public Pages (centered layout) ---------- */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Hero Section ---------- */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--blurple), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Feature Cards ---------- */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 0 20px 60px;
  max-width: 1100px;
  margin: 0 auto;
}

.feat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color .15s, box-shadow .15s;
}
.feat-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow);
}

.feat-icon {
  font-size: 24px;
  margin-bottom: 12px;
}

.feat-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.feat-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------- Section header ---------- */
.section-title {
  text-align: center;
  margin: 0 auto 32px;
  max-width: 600px;
  padding: 0 20px;
}
.section-title h2 { font-size: 1.6rem; color: var(--text); margin-bottom: 8px; }
.section-title p  { color: var(--text-muted); font-size: 14px; }

/* ---------- Guild Selection ---------- */
.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.guild-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color .15s;
}
.guild-card:hover { border-color: var(--border-light); }
.guild-card.dim { opacity: .45; filter: grayscale(60%); }

.guild-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}
.guild-icon img { width: 52px; height: 52px; object-fit: cover; }

.guild-info { flex: 1; min-width: 0; }
.guild-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.guild-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Dashboard Shell (Sidebar Layout) ---------- */
.dash-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 56px);
}

.sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.sidebar-guild {
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-guild-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-raised);
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-guild-icon img { width: 36px; height: 36px; object-fit: cover; }

.sidebar-guild-name { font-weight: 600; font-size: 13px; line-height: 1.3; }
.sidebar-guild-back { font-size: 11px; color: var(--text-muted); }
.sidebar-guild-back a { color: var(--text-muted); }
.sidebar-guild-back a:hover { color: var(--text); }

.nav-section-label {
  padding: 6px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  border-radius: 0;
  transition: background .1s, color .1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg-raised); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--blurple-dim); color: var(--text); }
.nav-item.active .nav-icon { color: var(--blurple); }
.nav-item[disabled] { opacity: .35; cursor: not-allowed; pointer-events: none; }

.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-count { font-size: 11px; background: var(--bg-raised); padding: 1px 6px; border-radius: 999px; color: var(--text-muted); }

.dash-main {
  padding: 24px;
  min-width: 0;
}

/* ---------- Stat Cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
}

/* ---------- Content Panel ---------- */
.content-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-header h3 { font-size: 14px; }
.panel-header-actions { margin-left: auto; }

.panel-body { padding: 16px; }

.loading-state {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-success { background: var(--green-dim);  color: var(--green);  border-color: rgba(34,197,94,.3); }
.badge-warning { background: var(--amber-dim);  color: var(--amber);  border-color: rgba(245,158,11,.3); }
.badge-danger  { background: var(--red-dim);    color: var(--red);    border-color: rgba(239,68,68,.3); }
.badge-info    { background: var(--cyan-dim);   color: var(--cyan);   border-color: rgba(6,182,212,.3); }
.badge-accent  { background: var(--blurple-dim);color: var(--blurple);border-color: rgba(88,101,242,.3); }
.badge-purple  { background: var(--purple-dim); color: var(--purple); border-color: rgba(168,85,247,.3); }
.badge-neutral { background: var(--bg-raised);  color: var(--text-muted); border-color: var(--border); }

/* Case type badges */
.badge-BAN     { background: rgba(239,68,68,.15);   color: #f87171; border-color: rgba(239,68,68,.3); }
.badge-KICK    { background: rgba(245,158,11,.15);  color: #fcd34d; border-color: rgba(245,158,11,.3); }
.badge-TIMEOUT { background: rgba(168,85,247,.15);  color: #c084fc; border-color: rgba(168,85,247,.3); }
.badge-WARN    { background: rgba(6,182,212,.15);   color: #22d3ee; border-color: rgba(6,182,212,.3); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-raised); }

.table-mono { font-family: "Menlo", "Consolas", monospace; font-size: 12px; }
.cell-muted { color: var(--text-muted); }

/* ---------- Discord user chip ---------- */
.discord-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.discord-user img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  vertical-align: middle;
}

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.field-hint { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

.input {
  width: 100%;
  max-width: 420px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  transition: border-color .15s;
  outline: none;
}
.input:focus { border-color: var(--blurple); }
.input::placeholder { color: var(--text-faint); }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blurple); cursor: pointer; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.card h4 { font-size: 13px; margin-bottom: 12px; }

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 36px; margin-bottom: 12px; }
.empty-state p { font-size: 13px; }

/* ---------- Alert ---------- */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-info    { background: var(--cyan-dim);   color: var(--cyan);   border-color: rgba(6,182,212,.3); }
.alert-warning { background: var(--amber-dim);  color: var(--amber);  border-color: rgba(245,158,11,.3); }

/* ---------- Page header ---------- */
.page-header {
  margin-bottom: 24px;
}
.page-header h2 { font-size: 20px; color: var(--text); margin-bottom: 4px; }
.page-header p  { font-size: 13px; color: var(--text-muted); }

/* ---------- Table search ---------- */
.table-search {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
  width: 220px;
  transition: border-color .15s;
}
.table-search:focus { border-color: var(--blurple); }
.table-search::placeholder { color: var(--text-faint); }

/* ---------- Appeal actions ---------- */
.action-form { display: inline-flex; gap: 4px; }
.btn-approve {
  background: var(--green-dim); color: var(--green);
  border: 1px solid rgba(34,197,94,.3);
  padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-approve:hover { background: rgba(34,197,94,.25); }
.btn-reject {
  background: var(--red-dim); color: var(--red);
  border: 1px solid rgba(239,68,68,.3);
  padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-reject:hover { background: rgba(239,68,68,.25); }

/* ---------- User lookup ---------- */
.lookup-form { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.lookup-form .input { flex: 1; min-width: 240px; max-width: 400px; }

.history-section { margin-bottom: 24px; }
.history-section h3 { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Transcript link ---------- */
.transcript-link {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--blurple-dim); color: var(--blurple);
  border: 1px solid rgba(88,101,242,.3);
  padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  text-decoration: none;
}
.transcript-link:hover { background: rgba(88,101,242,.25); text-decoration: none; }

/* ---------- Live badge ---------- */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 4px; }

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .dash-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    padding: 8px;
    gap: 4px;
    overflow-x: auto;
  }

  .sidebar-guild { display: none; }
  .nav-section-label { display: none; }

  .nav-item {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    width: auto;
    flex-shrink: 0;
  }
  .nav-count { display: none; }

  .dash-main { padding: 16px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .feat-grid { grid-template-columns: 1fr; }

  .topnav-links { display: none; }
}
