/* =====================
   RESET & BASE
   ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #000;
  --bg-2:     #0a0a0a;
  --bg-3:     #111;
  --bg-4:     #161616;
  --border:   rgba(255,255,255,0.08);
  --border-2: rgba(255,255,255,0.12);
  --text:     #f5f5f7;
  --text-2:   #a1a1a6;
  --text-3:   #6e6e73;
  --accent:   #2997ff;
  --accent-2: #0071e3;
  --green:    #30d158;
  --red:      #ff453a;
  --yellow:   #ffd60a;
  --radius:   14px;
  --radius-sm:8px;
  --sb-width: 220px;
  --topbar-h: 56px;
  --transition: 0.25s cubic-bezier(0.25,0.46,0.45,0.94);
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea { font-family: inherit; }

/* =====================
   BUTTONS
   ===================== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px;
  background: var(--accent); color: #fff;
  border-radius: 980px; font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
  transition: background var(--transition), transform var(--transition);
}
.btn-primary:hover { background: var(--accent-2); transform: scale(1.02); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-full { width: 100%; }

.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: rgba(255,69,58,0.12); color: var(--red);
  border: 1px solid rgba(255,69,58,0.25);
  border-radius: 980px; font-size: 12px; font-weight: 500;
  transition: background var(--transition);
}
.btn-danger:hover { background: rgba(255,69,58,0.22); }

.btn-success {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: rgba(48,209,88,0.12); color: var(--green);
  border: 1px solid rgba(48,209,88,0.25);
  border-radius: 980px; font-size: 12px; font-weight: 500;
  transition: background var(--transition);
}
.btn-success:hover { background: rgba(48,209,88,0.22); }

/* =====================
   LOGIN PAGE
   ===================== */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-card {
  width: 100%; max-width: 380px;
  padding: 48px 40px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0;
}

.login-logo {
  width: 52px; height: 52px; object-fit: contain;
  margin-bottom: 20px;
}

.login-title {
  font-size: 22px; font-weight: 700; letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.login-sub {
  font-size: 13px; color: var(--text-3);
  margin-bottom: 32px; line-height: 1.5;
}

.login-form { width: 100%; display: flex; flex-direction: column; gap: 12px; }

.input-wrap { width: 100%; }
.input-wrap.error .panel-input { border-color: var(--red); }

.panel-input {
  width: 100%; padding: 12px 16px;
  background: var(--bg-4); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; outline: none;
  transition: border-color var(--transition);
}
.panel-input:focus { border-color: var(--accent); }
.panel-input::placeholder { color: var(--text-3); }

.login-error {
  font-size: 12px; color: var(--red); min-height: 16px;
  text-align: left;
}

.login-back {
  display: block; margin-top: 24px;
  font-size: 13px; color: var(--text-3);
  transition: color var(--transition);
}
.login-back:hover { color: var(--text); }

/* =====================
   DASHBOARD LAYOUT
   ===================== */
.panel-body {
  display: grid;
  grid-template-columns: var(--sb-width) 1fr;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sb-width);
  height: 100vh;
  position: fixed; top: 0; left: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 50;
}

.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.sb-icon { width: 24px; height: 24px; object-fit: contain; }
.sb-title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }

.sb-nav {
  flex: 1; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}

.sb-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: background var(--transition), color var(--transition);
}
.sb-link:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.sb-link.active { background: rgba(41,151,255,0.12); color: var(--accent); }
.sb-link svg { flex-shrink: 0; opacity: 0.7; }
.sb-link.active svg { opacity: 1; }

.sb-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}

.bot-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-3);
}

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 transparent;
  transition: background 0.3s;
}
.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.offline { background: var(--red); }

.sb-logout {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-3);
  transition: background var(--transition), color var(--transition);
}
.sb-logout:hover { background: rgba(255,69,58,0.1); color: var(--red); }

/* MAIN */
.panel-main {
  margin-left: var(--sb-width);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.panel-topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  position: sticky; top: 0; z-index: 40;
  background: rgba(0,0,0,0.8);
}

.topbar-title { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }

.topbar-right {
  display: flex; align-items: center; gap: 16px;
}

.topbar-ping {
  font-size: 12px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.topbar-site {
  font-size: 12px; color: var(--accent);
  transition: opacity var(--transition);
}
.topbar-site:hover { opacity: 0.7; }

.panel-content {
  flex: 1;
  padding: 28px;
}

/* =====================
   STAT CARDS
   ===================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-2); }

.stat-card-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.04em; text-transform: uppercase;
}

.stat-card-value {
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.stat-card-sub {
  font-size: 11px; color: var(--text-3);
}

.stat-card--green .stat-card-value { color: var(--green); }
.stat-card--blue .stat-card-value { color: var(--accent); }
.stat-card--yellow .stat-card-value { color: var(--yellow); }

/* =====================
   SECTION CARD
   ===================== */
.panel-section {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.panel-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-section-title {
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
}

.panel-section-body { padding: 20px; }

/* =====================
   TABLE
   ===================== */
.panel-table { width: 100%; border-collapse: collapse; }

.panel-table th {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0 16px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.panel-table td {
  padding: 14px 16px;
  font-size: 13px; color: var(--text-2);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

.panel-table tr:last-child td { border-bottom: none; }
.panel-table tr:hover td { background: rgba(255,255,255,0.02); }

.guild-row { display: flex; align-items: center; gap: 10px; }
.guild-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-4); object-fit: cover; flex-shrink: 0;
}
.guild-avatar-placeholder {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-4); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text-3);
}
.guild-name { font-weight: 500; color: var(--text); font-size: 13px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 980px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.badge--green { background: rgba(48,209,88,0.12); color: var(--green); }
.badge--red { background: rgba(255,69,58,0.12); color: var(--red); }
.badge--blue { background: rgba(41,151,255,0.12); color: var(--accent); }
.badge--gray { background: rgba(255,255,255,0.06); color: var(--text-3); }

/* =====================
   ANNOUNCE FORM
   ===================== */
.announce-form {
  display: flex; flex-direction: column; gap: 14px;
}
.form-label { font-size: 12px; color: var(--text-3); font-weight: 500; margin-bottom: 4px; }
.form-group { display: flex; flex-direction: column; }

.panel-textarea {
  width: 100%; min-height: 100px; padding: 12px 16px;
  background: var(--bg-4); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; outline: none; resize: vertical;
  transition: border-color var(--transition);
}
.panel-textarea:focus { border-color: var(--accent); }
.panel-textarea::placeholder { color: var(--text-3); }

.form-hint { font-size: 11px; color: var(--text-3); margin-top: 6px; }

.announce-result {
  font-size: 13px; padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: none;
}
.announce-result.success { background: rgba(48,209,88,0.1); color: var(--green); display: block; }
.announce-result.error { background: rgba(255,69,58,0.1); color: var(--red); display: block; }

/* =====================
   GUARD PAGE
   ===================== */
.guard-add-form {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}

/* =====================
   EMPTY STATE
   ===================== */
.empty-state {
  padding: 40px 20px; text-align: center;
  color: var(--text-3); font-size: 13px;
}

/* =====================
   LOADER
   ===================== */
.loader {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; color: var(--text-3); font-size: 13px; gap: 10px;
}
.loader::before {
  content: '';
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================
   BOT INFO CARD
   ===================== */
.bot-info-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 28px;
}

.bot-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}

.bot-info-text { flex: 1; }
.bot-info-name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.bot-info-id { font-size: 12px; color: var(--text-3); font-family: monospace; margin-top: 2px; }

.bot-info-uptime {
  font-size: 12px; color: var(--text-3);
  text-align: right;
}
.bot-info-uptime span { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-top: 2px; }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .panel-body { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .panel-main { margin-left: 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}


/* ==========================================================================
   DASHBOARD / OAUTH2 SUNUCU SEÇİM EKRANI VE KART STILLERI
   ========================================================================== */
.dash-body {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.dash-topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dash-brand-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.dash-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-ping {
  font-size: 12px;
  color: var(--green);
  font-family: monospace;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 980px;
}

.dash-user-info {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.dash-user-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.dash-user-role {
  font-size: 10px;
  color: var(--accent);
  font-weight: 500;
}

.dash-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.dash-logout-btn {
  color: var(--text-3);
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.dash-logout-btn:hover {
  color: var(--red);
  background: rgba(255, 69, 58, 0.1);
}

.dash-main {
  flex: 1;
  padding: 48px 24px 80px;
}

.dash-content {
  max-width: 1140px;
  margin: 0 auto;
}

.dash-hero {
  margin-bottom: 32px;
}

.dash-hero-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.dash-hero-sub {
  color: var(--text-2);
  font-size: 15px;
}

.dash-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.dash-stat {
  padding: 14px 24px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-stat-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.dash-stat-label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* GUILD GRID & KARTLARI */
.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.guild-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition);
}

.guild-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
}

.guild-card--inactive {
  opacity: 0.75;
}
.guild-card--inactive:hover {
  opacity: 1;
}

.gc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.gc-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--bg-4);
}

.gc-icon-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-2);
}

.gc-badges {
  display: flex;
  gap: 6px;
  flex-direction: column;
  align-items: flex-end;
}

.gc-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 980px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gc-badge--green { background: rgba(48, 209, 88, 0.15); color: var(--green); }
.gc-badge--blue  { background: rgba(41, 151, 255, 0.15); color: var(--accent); }
.gc-badge--gray  { background: rgba(255, 255, 255, 0.06); color: var(--text-3); }

.gc-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gc-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 20px;
}

.gc-actions {
  margin-top: auto;
}

.gc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}

.gc-btn--primary {
  background: var(--accent);
  color: #fff;
}
.gc-btn--primary:hover {
  background: var(--accent-2);
}

.gc-btn--ghost {
  border: 1px solid var(--border);
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.02);
}
.gc-btn--ghost:hover {
  border-color: var(--border-2);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* DISCORD LOGIN BUTONU */
.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: #5865F2;
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}
.btn-discord:hover {
  background: #4752c4;
  transform: translateY(-1px);
}

.login-divider {
  width: 100%;
  margin: 20px 0 10px;
  text-align: center;
  position: relative;
}
.login-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}
.login-divider span {
  position: relative;
  background: var(--bg-3);
  padding: 0 12px;
  color: var(--text-3);
  font-size: 12px;
}

.login-error-box {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: rgba(255, 69, 58, 0.12);
  border: 1px solid rgba(255, 69, 58, 0.25);
  color: var(--red);
  font-size: 12px;
  border-radius: var(--radius-sm);
  text-align: left;
}

/* SIDEBAR SUNUCU BİLGİSİ */
.sb-back-link {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.05);
  transition: all var(--transition);
  flex-shrink: 0;
}
.sb-back-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.sb-guild-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.sb-guild-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.sb-guild-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* TOPBAR USER BADGE & ALIGNMENT */
.topbar-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  padding: 4px 10px 4px 6px;
  border-radius: 980px;
  border: 1px solid var(--border);
}

.topbar-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-4);
}

.topbar-username {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.form-hint-inline {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
  margin-left: 6px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
