/* ------------------------------------------------------------------ */
/* Tokens                                                               */
/* ------------------------------------------------------------------ */
:root {
  color-scheme: light;
  --bg-page: #f9f9f7;
  --bg-surface: #fcfcfb;
  --bg-surface-2: #ffffff;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --gridline: #e1e0d9;
  --border: rgba(11, 11, 11, 0.1);
  --border-strong: rgba(11, 11, 11, 0.16);

  --series-blue: #2a78d6;
  --series-orange: #eb6834;
  --series-aqua: #1baf7a;
  --series-violet: #4a3aa7;

  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;

  --accent: var(--series-blue);
  --accent-2: var(--series-violet);

  --sidebar-bg: #15131c;
  --sidebar-bg-2: #1b1826;
  --sidebar-text: #e8e6f0;
  --sidebar-muted: #9490a8;
  --sidebar-border: rgba(255, 255, 255, 0.08);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(11, 11, 11, 0.04), 0 8px 24px -12px rgba(11, 11, 11, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-page: #0d0d0d;
    --bg-surface: #1a1a19;
    --bg-surface-2: #201f1e;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --gridline: #2c2c2a;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);

    --series-blue: #3987e5;
    --series-orange: #d95926;
    --series-aqua: #199e70;
    --series-violet: #9085e9;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #0d0d0d;
  --bg-surface: #1a1a19;
  --bg-surface-2: #201f1e;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --gridline: #2c2c2a;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);

  --series-blue: #3987e5;
  --series-orange: #d95926;
  --series-aqua: #199e70;
  --series-violet: #9085e9;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
}

/* ------------------------------------------------------------------ */
/* Base                                                                 */
/* ------------------------------------------------------------------ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
button { font-family: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

/* ------------------------------------------------------------------ */
/* Sidebar                                                              */
/* ------------------------------------------------------------------ */
.sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
  color: var(--sidebar-text);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 20px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--series-blue), var(--series-violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex: none;
}
.brand-text .brand-name { font-size: 15px; font-weight: 700; color: #fff; }
.brand-text .brand-sub { font-size: 11px; color: var(--sidebar-muted); margin-top: 1px; }

.nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sidebar-muted);
  padding: 16px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  width: 100%;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); }
.nav-item.active { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: 0.9; }
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--sidebar-muted);
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--status-good); box-shadow: 0 0 0 3px rgba(12,163,12,0.2); flex: none; }
.sidebar-footer .sf-text { font-size: 12px; color: var(--sidebar-muted); }
.sidebar-footer .sf-text strong { color: var(--sidebar-text); font-weight: 600; }

/* ------------------------------------------------------------------ */
/* Main                                                                 */
/* ------------------------------------------------------------------ */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-page);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-title { display: flex; align-items: baseline; gap: 10px; }
.topbar-title h1 { font-size: 19px; }
.demo-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--status-warning);
  background: color-mix(in srgb, var(--status-warning) 16%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--status-warning) 35%, transparent);
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.clock { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.icon-btn svg { width: 16px; height: 16px; }

.content { padding: 24px 28px 48px; flex: 1; }
.view { display: none; }
.view.active { display: block; animation: fade-in 0.18s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.view-intro { margin-bottom: 18px; }
.view-intro h2 { font-size: 16px; margin-bottom: 2px; }
.view-intro p { color: var(--text-secondary); font-size: 13px; }

/* ------------------------------------------------------------------ */
/* Stat tiles                                                          */
/* ------------------------------------------------------------------ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.stat-tile .stat-label { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-tile .stat-value { font-size: 26px; font-weight: 650; letter-spacing: -0.01em; }
.stat-tile .stat-delta { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.stat-delta.up { color: var(--status-good); }
.stat-delta.flat { color: var(--text-muted); }

/* ------------------------------------------------------------------ */
/* Cards / panels                                                       */
/* ------------------------------------------------------------------ */
.panel-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  align-items: start;
}
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-header h3 { font-size: 14px; }
.card-header .card-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ------------------------------------------------------------------ */
/* Guild (network) cards                                                */
/* ------------------------------------------------------------------ */
.guild-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.guild-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.guild-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.guild-card .guild-name { font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.guild-card .guild-id { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.guild-status { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-secondary); flex: none; }
.guild-status .dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-online { background: var(--status-good); }
.dot-idle { background: var(--status-warning); }
.guild-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.guild-stats .gs-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.guild-stats .gs-value { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ */
/* Tables (mod logs)                                                    */
/* ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
table.log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.log-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--gridline);
}
table.log-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--gridline);
  vertical-align: middle;
}
table.log-table tr:last-child td { border-bottom: none; }
table.log-table td.mono { font-variant-numeric: tabular-nums; color: var(--text-secondary); white-space: nowrap; }
.action-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.action-badge .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.action-ban { background: color-mix(in srgb, var(--status-critical) 14%, transparent); color: var(--status-critical); }
.action-ban .dot { background: var(--status-critical); }
.action-kick { background: color-mix(in srgb, var(--status-serious) 16%, transparent); color: var(--status-serious); }
.action-kick .dot { background: var(--status-serious); }
.action-mute { background: color-mix(in srgb, var(--status-warning) 18%, transparent); color: #9a6a00; }
:root[data-theme="dark"] .action-mute, :root:not([data-theme="light"]) .action-mute { color: var(--status-warning); }
.action-mute .dot { background: var(--status-warning); }
.action-purge { background: color-mix(in srgb, var(--status-good) 14%, transparent); color: var(--status-good); }
.action-purge .dot { background: var(--status-good); }

/* ------------------------------------------------------------------ */
/* Commands                                                             */
/* ------------------------------------------------------------------ */
.command-grid { display: grid; gap: 14px; }
.command-category { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-surface); box-shadow: var(--shadow-card); overflow: hidden; }
.command-category-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gridline);
}
.command-category-head .cc-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  flex: none;
}
.command-category-head .cc-icon svg { width: 16px; height: 16px; }
.command-category-head h3 { font-size: 14px; }
.command-list { padding: 4px 18px 10px; }
.command-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 2fr auto;
  gap: 16px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--gridline);
}
.command-row:last-child { border-bottom: none; }
.command-usage {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12.5px;
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
}
.command-desc { color: var(--text-secondary); font-size: 13px; }
.command-perm { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; text-align: right; }

/* ------------------------------------------------------------------ */
/* Config / Ayarlar                                                     */
/* ------------------------------------------------------------------ */
.config-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.config-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--gridline);
}
.config-row:last-child { border-bottom: none; }
.config-key { font-size: 13px; color: var(--text-secondary); }
.config-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.config-value.masked { font-family: monospace; letter-spacing: 0.1em; color: var(--text-muted); font-weight: 400; }
.demo-pill.live-pill {
  color: var(--status-good);
  background: color-mix(in srgb, var(--status-good) 16%, transparent);
  border-color: color-mix(in srgb, var(--status-good) 35%, transparent);
}

.conn-form { display: grid; gap: 12px; max-width: 440px; }
.conn-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-secondary); }
.conn-field input {
  font-family: inherit;
  font-size: 13px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-primary);
}
.conn-field input:focus { outline: none; border-color: var(--accent); }
.conn-actions { display: flex; gap: 10px; margin-top: 2px; }
.btn-primary, .btn-secondary {
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.92; }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-secondary { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.btn-secondary:hover { border-color: var(--border-strong); color: var(--text-primary); }
.conn-status { font-size: 12.5px; padding: 8px 0 0; }
.conn-status.conn-ok { color: var(--status-good); }
.conn-status.conn-error { color: var(--status-critical); }
.conn-status.conn-idle { color: var(--text-muted); }

.note-box {
  margin-top: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* ------------------------------------------------------------------ */
/* Charts                                                               */
/* ------------------------------------------------------------------ */
.viz-root { color-scheme: light; }
.chart-wrap { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-gridline { stroke: var(--gridline); stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis-label { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--series-blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--series-blue); opacity: 0.1; }
.chart-end-dot { fill: var(--series-blue); stroke: var(--bg-surface); stroke-width: 2; }
.chart-end-label { fill: var(--text-primary); font-size: 12.5px; font-weight: 600; }
.chart-crosshair { stroke: var(--text-muted); stroke-width: 1; opacity: 0; pointer-events: none; }
.chart-hover-dot { fill: var(--series-blue); stroke: var(--bg-surface); stroke-width: 2; opacity: 0; pointer-events: none; }
.chart-bar { fill: var(--series-blue); }
.chart-bar:hover, .chart-bar.hovered { fill: var(--accent-2); }
.chart-bar-value { fill: var(--text-primary); font-size: 12px; font-weight: 600; text-anchor: middle; }
.chart-bar-label { fill: var(--text-secondary); font-size: 12px; text-anchor: middle; }
.chart-hit { fill: transparent; cursor: pointer; }

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
  opacity: 0;
  transform: translate(-50%, -100%);
  transition: opacity 0.08s ease;
  white-space: nowrap;
  z-index: 10;
}
.chart-tooltip.visible { opacity: 1; }
.chart-tooltip .tt-value { color: var(--text-primary); font-weight: 650; font-size: 13px; }
.chart-container { position: relative; }
.chart-empty-note {
  padding: 40px 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------------ */
/* Responsive                                                           */
/* ------------------------------------------------------------------ */
@media (max-width: 980px) {
  .panel-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .guild-grid { grid-template-columns: 1fr; }
  .config-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    align-items: center;
    padding: 10px 12px;
  }
  .brand { padding: 0 10px; }
  .nav-section-label { display: none; }
  .nav-item { flex-direction: column; font-size: 10.5px; gap: 4px; padding: 6px 10px; white-space: nowrap; }
  .nav-item .nav-badge { display: none; }
  .sidebar-footer { display: none; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 14px 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .command-row { grid-template-columns: 1fr; gap: 4px; }
  .command-perm { text-align: left; }
}

/* ------------------------------------------------------------------ */
/* Vera Panel v2: giriş, sunucu seçici, yönetim ekranları               */
/* ------------------------------------------------------------------ */
[hidden] { display: none !important; }
a.brand, a.nav-item, a.guild-switch { text-decoration: none; }
.brand-mark { overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-mark.big { width: 56px; height: 56px; font-size: 24px; border-radius: var(--radius-lg); }

.boot-screen, .login-screen {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px 16px;
}
.boot-text { color: var(--text-muted); font-size: 13px; }
.login-screen {
  background:
    radial-gradient(60rem 30rem at 15% -10%, color-mix(in srgb, var(--series-violet) 22%, transparent), transparent 60%),
    radial-gradient(50rem 30rem at 110% 110%, color-mix(in srgb, var(--series-blue) 18%, transparent), transparent 60%),
    var(--bg-page);
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 32px 28px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
}
.login-card h1 { font-size: 22px; }
.login-sub { color: var(--text-secondary); font-size: 13.5px; }
.btn-discord {
  margin-top: 8px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: #5865f2; color: #fff; text-decoration: none;
  font-weight: 600; font-size: 14px; padding: 12px 16px; border-radius: var(--radius-md);
}
.btn-discord:hover { background: #4752c4; }
.btn-discord svg { width: 22px; height: 22px; }
.login-error {
  width: 100%; font-size: 12.5px; color: var(--status-critical);
  background: color-mix(in srgb, var(--status-critical) 10%, transparent);
  border-radius: var(--radius-sm); padding: 8px 10px;
}
.login-foot { font-size: 12px; color: var(--text-muted); }

/* Sidebar ekleri */
.guild-switch {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 6px; padding: 9px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
}
.guild-switch:hover { background: rgba(255, 255, 255, 0.1); }
.gs-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.gs-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-hint { font-size: 11px; color: var(--sidebar-muted); }
.gs-chev { color: var(--sidebar-muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item .nav-icon { display: inline-flex; }

.user-card { gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--sidebar-bg-2); }
.user-meta { min-width: 0; flex: 1; }
.user-name { font-size: 13px; font-weight: 600; color: var(--sidebar-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-tag { font-size: 11px; color: var(--sidebar-muted); }
.logout-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--sidebar-border); color: var(--sidebar-muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
}
.logout-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.logout-btn svg { width: 15px; height: 15px; }

.topbar-crumb { font-size: 12.5px; color: var(--text-muted); }

/* Genel bileşenler */
.view-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.intro-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 13px; color: var(--text-secondary); font-weight: 600; margin: 22px 0 10px; }
.card + .card, .card + .toolbar, .toolbar + .card, .panel-grid + .card, .stat-grid + .panel-grid { margin-top: 16px; }
.card.flush { padding: 6px 8px; }
.link { color: var(--accent); text-decoration: none; font-size: 12.5px; font-weight: 600; }
.link:hover { text-decoration: underline; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 500; color: var(--text-secondary);
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
  padding: 2px 8px; border-radius: 999px; margin-left: 6px;
}
.chip.tiny { font-size: 10px; padding: 0 5px; font-weight: 700; letter-spacing: 0.03em; }
.chip.mono { font-variant-numeric: tabular-nums; }
.muted-text { color: var(--text-muted); font-size: 12.5px; }
.muted-text.small { font-size: 11.5px; }
.right { text-align: right; }
a.btn-primary, a.btn-secondary { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn-danger {
  font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: var(--radius-sm);
  cursor: pointer; border: 1px solid transparent; background: var(--status-critical); color: #fff; white-space: nowrap;
}
.btn-danger:hover { opacity: 0.92; }
.btn-danger:disabled, .btn-secondary:disabled { opacity: 0.6; cursor: default; }
.btn-xs {
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-surface-2); color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
.btn-xs:hover { border-color: var(--border-strong); color: var(--text-primary); }
.btn-xs.warn { color: var(--status-serious); }
.btn-xs.danger { color: var(--status-critical); }
.btn-xs.danger:hover { background: color-mix(in srgb, var(--status-critical) 10%, transparent); }

.loading { display: flex; align-items: center; gap: 10px; color: var(--text-muted); padding: 40px 4px; font-size: 13px; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--gridline); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 13px; }
.empty-title { color: var(--text-secondary); font-weight: 600; margin-bottom: 4px; }
.error-card h3 { margin-bottom: 6px; color: var(--status-critical); }
.error-card p { color: var(--text-secondary); margin-bottom: 12px; }

/* Sunucu ikonları ve kartları */
.g-icon { width: 36px; height: 36px; border-radius: 30%; object-fit: cover; flex: none; }
.g-icon.sm { width: 28px; height: 28px; }
.g-icon.lg { width: 48px; height: 48px; }
.g-icon.xl { width: 72px; height: 72px; border-radius: 24%; }
.g-icon-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--series-blue), var(--series-violet)); color: #fff;
  font-weight: 700; font-size: 13px;
}
.g-icon.xl.g-icon-fallback { font-size: 24px; }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.server-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px; box-shadow: var(--shadow-card);
}
.server-card.muted .g-icon { filter: grayscale(0.7); opacity: 0.75; }
.server-meta { min-width: 0; flex: 1; }
.server-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-sub { font-size: 12px; color: var(--text-muted); }

/* Sunucu genel bakış */
.guild-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.hero-meta h2 { font-size: 20px; }
.hero-desc { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hero-chips .chip { margin-left: 0; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--text-primary) 4%, transparent);
}
.mini-stat span { font-size: 11.5px; color: var(--text-muted); }
.mini-stat strong { font-size: 15px; font-variant-numeric: tabular-nums; }
td.reason { color: var(--text-secondary); max-width: 360px; }

/* Üyeler */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .input[type="search"] { flex: 1; min-width: 200px; max-width: 420px; }
.input {
  font-family: inherit; font-size: 13px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-surface-2); color: var(--text-primary);
  width: 100%;
}
select.input { cursor: pointer; }
.toolbar select.input { width: auto; }
textarea.input { resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.member-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--gridline); }
.member-name { font-weight: 600; font-size: 13px; display: flex; align-items: center; }
.member-sub { font-size: 11.5px; color: var(--text-muted); }
.role-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.role-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
.load-more { display: flex; justify-content: center; margin-top: 14px; }

/* Yasaklar / formlar */
.inline-form { display: grid; grid-template-columns: 1.2fr 1.5fr auto; gap: 10px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-stack > h3 { font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.field-hint { font-size: 11.5px; color: var(--text-muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-result { font-size: 12.5px; color: var(--status-good); }
.color-input { width: 56px; height: 34px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-surface-2); padding: 2px; cursor: pointer; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; user-select: none; position: relative; }
.toggle-input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  width: 36px; height: 20px; border-radius: 999px; background: var(--gridline); position: relative; flex: none;
  transition: background 0.15s ease;
}
.toggle-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: transform 0.15s ease;
}
.toggle-input:checked + .toggle-track { background: var(--accent); }
.toggle-input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle-input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.filter-chip {
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-secondary);
}
.filter-chip.active { background: var(--text-primary); color: var(--bg-page); border-color: var(--text-primary); }

/* Ayarlar */
.settings-wrap { max-width: 760px; padding-bottom: 70px; }
.settings-wrap .card { margin-top: 14px; }
.welcome-preview {
  white-space: pre-wrap; font-size: 13px; color: var(--text-secondary);
  border-left: 3px solid var(--series-aqua); background: color-mix(in srgb, var(--text-primary) 4%, transparent);
  padding: 10px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.save-bar {
  position: sticky; bottom: 16px; margin-top: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--sidebar-bg); color: var(--sidebar-text);
  border-radius: var(--radius-md); padding: 10px 12px 10px 16px; font-size: 13px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}
.save-actions { display: flex; gap: 8px; }
.save-bar .btn-secondary { color: var(--sidebar-text); border-color: var(--sidebar-border); }

/* Duyuru + Discord önizleme */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
.split .card + .card { margin-top: 0; }
.discord-preview { display: flex; gap: 12px; background: #313338; color: #dbdee1; border-radius: var(--radius-md); padding: 14px; }
.discord-preview .avatar { width: 40px; height: 40px; }
.dp-body { min-width: 0; flex: 1; }
.dp-name { font-weight: 600; color: #f2f3f5; display: flex; align-items: center; font-size: 14px; }
.dp-name .chip { background: #5865f2; color: #fff; }
.embed-mention { margin-top: 2px; color: #c9cdfb; font-size: 13px; background: rgba(88,101,242,0.3); border-radius: 3px; padding: 0 2px; display: inline-block; }
.embed { display: flex; margin-top: 6px; background: #2b2d31; border-radius: 4px; overflow: hidden; max-width: 460px; }
.embed-bar { width: 4px; flex: none; }
.embed-inner { padding: 10px 14px 12px; min-width: 0; }
.embed-title { font-weight: 700; color: #f2f3f5; margin-bottom: 4px; font-size: 14px; }
.embed-desc { white-space: pre-wrap; font-size: 13.5px; word-break: break-word; }
.embed-foot { font-size: 11.5px; color: #949ba4; margin-top: 8px; }

/* Modal + toast */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 8, 12, 0.55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  width: 100%; max-width: 440px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5); animation: fade-in 0.15s ease;
}
.modal-head { padding: 16px 20px 0; }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 14px 20px; display: flex; flex-direction: column; gap: 12px; color: var(--text-secondary); }
.modal-error { color: var(--status-critical); font-size: 12.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast {
  background: var(--bg-surface-2); border: 1px solid var(--border); border-left: 4px solid var(--status-good);
  box-shadow: var(--shadow-card); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13px; animation: fade-in 0.15s ease; transition: opacity 0.3s ease;
}
.toast-error { border-left-color: var(--status-critical); }
.toast.leaving { opacity: 0; }

@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .split .card + .card { margin-top: 0; }
  .inline-form { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .guild-switch { display: none; }
  .nav { flex-direction: row; }
  /* Telefonda kullanıcı kartı küçülür ama çıkış butonu kalır */
  .sidebar-footer.user-card { display: flex; margin: 0; padding: 0 0 0 8px; border: none; }
  .user-card .user-meta { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .guild-hero { flex-direction: column; align-items: flex-start; }
  .server-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* Mesaj logları */
.msg-list { display: flex; flex-direction: column; gap: 10px; }
.msg-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
}
.msg-head { display: flex; align-items: center; gap: 10px; }
.msg-who { flex: 1; min-width: 0; }
.msg-content {
  white-space: pre-wrap; word-break: break-word; font-size: 13px;
  background: color-mix(in srgb, var(--text-primary) 4%, transparent);
  border-radius: var(--radius-sm); padding: 8px 10px;
}
.msg-content.old { border-left: 3px solid var(--status-critical); }
.msg-content.new { border-left: 3px solid var(--status-good); }
.msg-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.msg-diff > .link { grid-column: 1 / -1; }
.msg-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.msg-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
@media (max-width: 720px) { .msg-diff { grid-template-columns: 1fr; } }

/* Doğrulama sayfası (/verify/<id>) */
.verify-card { max-width: 440px; gap: 14px; }
.verify-card .loading { padding: 24px 0; }
.verify-guild { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.verify-guild h1 { font-size: 20px; }
.verify-guild .login-sub { margin-top: -4px; }
.verify-title { font-size: 18px; }
.verify-user {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px;
  background: var(--bg-surface-2);
}
.verify-user-meta { flex: 1; min-width: 0; }
.req-list { list-style: none; padding: 0; margin: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.req { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.req-icon { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.req-icon svg { width: 13px; height: 13px; }
.req-ok { background: color-mix(in srgb, var(--status-good) 16%, transparent); color: var(--status-good); }
.req-fail { background: color-mix(in srgb, var(--status-critical) 14%, transparent); color: var(--status-critical); }
.req-wait { background: color-mix(in srgb, var(--text-primary) 7%, transparent); color: var(--text-muted); }
.verify-btn { width: 100%; padding: 12px 16px; font-size: 14px; }
.captcha-box { min-height: 65px; display: flex; justify-content: center; }
.verify-result { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.verify-result .req-icon { width: 64px; height: 64px; }
.verify-result .req-icon svg { width: 30px; height: 30px; }
.verify-foot { font-size: 11.5px; color: var(--text-muted); }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }
.callout {
  font-size: 12.5px; color: var(--text-secondary); border-radius: var(--radius-sm); padding: 10px 12px;
  background: color-mix(in srgb, var(--status-warning) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--status-warning) 30%, transparent);
}
.callout.info {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}
.action-verify { background: color-mix(in srgb, var(--series-aqua) 15%, transparent); color: var(--series-aqua); }
.action-verify .dot { background: var(--series-aqua); }
.input-num { max-width: 140px; }

/* Klavye odağı ve uzun metinler */
a:focus-visible, button:focus-visible, select:focus-visible, .filter-chip:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.nav-item:focus-visible, .guild-switch:focus-visible, .logout-btn:focus-visible { outline-color: #fff; }
.member-name, .server-name, .verify-user-meta .member-name { overflow-wrap: anywhere; }
.msg-who .member-sub { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Ticketlar */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.subnav-item {
  padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--text-secondary); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.subnav-item:hover { color: var(--text-primary); }
.subnav-item.active { color: var(--accent); border-bottom-color: var(--accent); }
.action-neutral { background: color-mix(in srgb, var(--text-primary) 8%, transparent); color: var(--text-secondary); }
.action-neutral .dot { background: var(--text-muted); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td, tr.clickable:focus-visible td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
tr.clickable:focus-visible { outline: none; }
.ticket-subject { font-weight: 600; overflow-wrap: anywhere; }
.tiny-chip { margin: 3px 0 0; font-size: 10.5px; }
.avatar.sm { width: 24px; height: 24px; }
.stars { color: #f0b232; letter-spacing: 1px; white-space: nowrap; }
.stars-off { color: var(--gridline); }
.stat-suffix { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.back-link { display: inline-block; margin-bottom: 12px; }
.ticket-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ticket-code { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ticket-hero h2 { font-size: 19px; overflow-wrap: anywhere; }
.ticket-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.ticket-info > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--text-primary) 4%, transparent); min-width: 0; }
.ticket-info span { font-size: 11.5px; color: var(--text-muted); }
.ticket-info strong { font-size: 13px; overflow-wrap: anywhere; }

.dc-card { background: #313338; border-color: #1f2023; color: #dbdee1; }
.dc-card .card-header h3 { color: #f2f3f5; }
.dc-card .card-sub { color: #949ba4; }
.dc-card .empty-state, .dc-card .empty-title { color: #949ba4; }
.dc-log { display: flex; flex-direction: column; max-height: 70vh; overflow-y: auto; margin: 0 -20px -18px; padding: 0 0 12px; }
.dc-msg { display: flex; gap: 14px; padding: 2px 20px; margin-top: 14px; }
.dc-msg.grouped { margin-top: 0; }
.dc-msg:hover { background: #2e3035; }
.dc-msg .avatar { width: 40px; height: 40px; }
.dc-gutter { width: 40px; flex: none; }
.dc-body { min-width: 0; flex: 1; }
.dc-head { display: flex; align-items: center; gap: 6px; }
.dc-name { color: #f2f3f5; font-weight: 600; font-size: 14.5px; }
.dc-bot { background: #5865f2 !important; color: #fff !important; margin-left: 0; }
.dc-time { color: #949ba4; font-size: 11.5px; }
.dc-content { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.dc-img { max-width: min(360px, 100%); max-height: 260px; border-radius: 6px; margin-top: 4px; display: block; }
.dc-file { display: inline-block; margin-top: 4px; background: #2b2d31; border: 1px solid #1e1f22; border-radius: 6px; padding: 8px 12px; color: #00a8fc; text-decoration: none; font-size: 13px; }
.dc-embed { max-width: 520px; }
.dc-field { margin-top: 6px; font-size: 13px; }
.dc-field b { color: #f2f3f5; display: block; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc-button { font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 4px; color: #fff; }
.dc-primary { background: #5865f2; } .dc-secondary { background: #4e5058; } .dc-success { background: #248046; } .dc-danger { background: #da373c; }

.role-checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; }
.role-check { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }
.role-check:hover { border-color: var(--border-strong); }
.role-check span:nth-child(3) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-check input { accent-color: var(--accent); }
.type-editor { display: flex; flex-direction: column; gap: 8px; }
.type-row { display: grid; grid-template-columns: 56px 1fr 1.6fr 100px auto; gap: 8px; align-items: center; }
.type-emoji { text-align: center; }
.settings-wrap.wide { max-width: 1180px; }
.sticky-card { position: sticky; top: 84px; }
@media (max-width: 980px) {
  .sticky-card { position: static; }
  .type-row { grid-template-columns: 56px 1fr; }
  .type-row > :nth-child(3) { grid-column: 1 / -1; }
}

/* Grid öğeleri içeriğe göre genişleyip sayfayı taşırmasın (tablolar kendi içinde kayar) */
.panel-grid > *, .split > *, .stat-grid > * { min-width: 0; }
.subnav { overflow-x: visible; }
.ticket-subject { min-width: 180px; }
.log-table td .member-cell { min-width: 0; white-space: nowrap; }
.chart-card-narrow { max-width: 560px; }
.stat-grid + .toolbar { margin-top: 4px; }
