/* ==========================================================================
   QWeb Admin — 2026 Design System
   ========================================================================== */

:root {
  --bg-base: #06080d;
  --bg-elevated: #0d1119;
  --bg-surface: #121820;
  --bg-surface-2: #181f2a;
  --bg-hover: #1e2736;
  --bg-active: rgba(34, 211, 238, 0.1);

  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #22d3ee;
  --accent-2: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #22d3ee 0%, #6366f1 50%, #a855f7 100%);
  --accent-glow: rgba(34, 211, 238, 0.25);

  --success: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;

  --sidebar-w: 280px;
  --topbar-h: 72px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 60px rgba(34, 211, 238, 0.08);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.2s var(--ease);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #67e8f9; }

code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.85em;
  background: var(--bg-hover);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  color: #a5f3fc;
}

.gradient-text {
  display: inline-block;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Background effects */
.app-bg,
.login-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(34, 211, 238, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(139, 92, 246, 0.1), transparent 50%),
    var(--bg-base);
}

/* feTurbulence SVG filter tam ekranda Chrome repaint buguna yol acar (hover ile gorunur) */
.app-bg::after,
.login-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.04) 0%, transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(255, 255, 255, 0.03) 0%, transparent 40%);
}

/* ==========================================================================
   Login
   ========================================================================== */

.login-page { min-height: 100vh; position: relative; }

.login-layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-hero {
  display: flex;
  align-items: center;
  padding: 3rem 4rem;
  border-right: 1px solid var(--border);
}

.login-hero-inner { max-width: 480px; }

.brand-lg {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

.brand-lg em {
  font-style: normal;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-mark {
  display: flex;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-mark.lg { width: 44px; height: 44px; }

.brand-mark svg { width: 100%; height: 100%; }

.login-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.login-hero-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  max-width: 400px;
}

.login-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.feat-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  width: min(420px, 100%);
  padding: 2.25rem;
  background: rgba(18, 24, 32, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), var(--shadow-glow);
}

.login-card-head { margin-bottom: 1.75rem; }
.login-card-head h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.login-card-head p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.35rem; }

.login-hint {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.alert-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

/* ==========================================================================
   Admin shell
   ========================================================================== */

.admin-body {
  min-height: 100vh;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  z-index: 200;
  transition: transform 0.3s var(--ease);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.15rem 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text em {
  display: inline-block;
  font-style: normal;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-close { display: none; }

.app-switcher-wrap {
  margin: 0 0.85rem 0.5rem;
  padding: 0.75rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-inset, inset 0 1px 0 rgba(255, 255, 255, 0.04));
}

.app-switcher-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.app-switcher {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.app-switcher-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
  line-height: 1.35;
}

.app-switcher-wrap.mode-all {
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.12);
}

.app-switcher-wrap.mode-app {
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.08);
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0.75rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}

.side-nav::-webkit-scrollbar { width: 4px; }
.side-nav::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 4px; }

.nav-section {
  padding: 0.85rem 0.5rem 0.35rem;
  margin-top: 0.35rem;
}

.nav-section-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 0.35rem;
}

.nav-section-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 0.2rem 0.35rem 0.5rem;
  line-height: 1.35;
  opacity: 0.85;
}

.scope-badge {
  display: inline-flex;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.scope-badge.scope-platform {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

.scope-badge.scope-app {
  background: rgba(34, 211, 238, 0.15);
  color: #67e8f9;
}

.scope-badge.scope-quiz {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition), transform 0.1s;
}

.nav-link svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-link:hover svg { opacity: 1; }

.nav-link.active {
  background: var(--bg-active);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-link.active svg {
  opacity: 1;
  color: var(--accent);
}

/* Collapsible nav group (Quiz) */
.nav-group {
  margin-bottom: 4px;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.nav-group-toggle svg.nav-icon { flex-shrink: 0; opacity: 0.75; }

.nav-group-toggle .nav-chevron {
  margin-left: auto;
  opacity: 0.5;
  transition: transform 0.25s var(--ease);
}

.nav-group.open .nav-group-toggle {
  color: var(--text);
  background: var(--bg-hover);
}

.nav-group.open .nav-group-toggle .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-group.open .nav-group-toggle svg.nav-icon { color: var(--accent); opacity: 1; }

.nav-group.has-active > .nav-group-toggle {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.06);
}

.nav-group[data-nav-group="nav-quiz"] .nav-children {
  border-left-color: rgba(251, 191, 36, 0.35);
}

.nav-group[data-nav-group="nav-quiz"].has-active > .nav-group-toggle {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.08);
}

.nav-children {
  display: none;
  padding: 0.25rem 0 0.35rem 0.35rem;
  margin-left: 0.85rem;
  border-left: 1px solid var(--border);
}

.nav-group.open .nav-children { display: block; }

.nav-child {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem 0.5rem 0.85rem;
  margin-bottom: 1px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-child::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.4;
  flex-shrink: 0;
  display: none; /* Soldaki kucuk isaret noktalarini kaldir */
}

.nav-child:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.nav-child:hover::before { background: var(--accent); opacity: 1; }

.nav-child.active {
  color: var(--accent);
  background: var(--bg-active);
}

.nav-child.active::before {
  background: var(--accent);
  opacity: 1;
  box-shadow: 0 0 8px var(--accent-glow);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 150;
}

/* Main — sidebar fixed: tek margin, cift bosluk yok */
.main-wrap {
  position: relative;
  z-index: 1;
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--topbar-h);
  padding: 0 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-start {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.page-head { min-width: 0; }

.page-breadcrumb {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.topbar h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.content {
  flex: 1;
  width: 100%;
  padding: 1rem 1.25rem 1.5rem;
  position: relative;
  min-height: 280px;
}

.mobile-menu { display: none; }

/* ==========================================================================
   Components
   ========================================================================== */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card, 0 4px 24px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.04) inset);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover, 0 8px 32px rgba(0, 0, 0, 0.28));
}

.card h2, .card h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  color: var(--text);
}

.card-compact {
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.card-compact h3 { margin-bottom: 0.65rem; font-size: 0.92rem; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.card-header-row .toolbar { margin-top: 0; }

.table-compact th,
.table-compact td { padding: 0.45rem 0.55rem; font-size: 0.82rem; }

.tabs-compact { margin-bottom: 0.65rem; }

.form-compact label { font-size: 0.8rem; gap: 0.25rem; }

.form-compact input,
.form-compact select,
.form-compact textarea { padding: 0.4rem 0.55rem; font-size: 0.85rem; }

.field-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.stat-grid-compact { gap: 0.65rem; margin-bottom: 0.75rem; }

.stat-grid-compact .stat-card { padding: 0.75rem 0.85rem; }

.stat-grid-compact .val { font-size: 1.35rem; }

.search-inline { max-width: 220px; padding: 0.4rem 0.6rem; font-size: 0.85rem; }

.input-sm { font-size: 0.8rem; padding: 0.35rem 0.5rem; }

.tiny { font-size: 0.72rem; color: var(--text-muted); }

.mt-sm { margin-top: 0.75rem; }

.section-mini { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin: 0.75rem 0 0.4rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-2);
  font-weight: 700;
  font-size: 0.85rem;
}

.user-avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}

.user-avatar-lg.fallback,
.user-avatar-sm.fallback {
  background: var(--accent-gradient);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-hero,
.user-detail-top,
.overview-app {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.app-icon-lg {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
}

.app-icon-lg.fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
}

.link-list { list-style: none; padding: 0; margin: 0; }

.link-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }

.link-list a { color: var(--text); text-decoration: none; }

.link-list a:hover { color: var(--accent); }

.msg-admin { border-left: 3px solid var(--accent); padding-left: 0.65rem; }

.msg-user { border-left: 3px solid var(--text-muted); padding-left: 0.65rem; }

fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; margin: 0; }

legend { font-size: 0.75rem; color: var(--text-muted); padding: 0 0.25rem; }

.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  position: relative;
  overflow: visible;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.stat-card:hover::before { opacity: 1; }

.stat-card h4 {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card .val {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 0.4rem;
  color: var(--text);
}

.stat-card.warn { border-color: rgba(251, 191, 36, 0.35); }
.stat-card.warn::before { background: var(--warn); opacity: 1; }
.stat-card.danger { border-color: rgba(248, 113, 113, 0.35); }
.stat-card.danger::before { background: var(--danger); opacity: 1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, box-shadow var(--transition), background var(--transition), color var(--transition);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent-gradient);
  color: #0f172a;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(34, 211, 238, 0.35);
  filter: brightness(1.08);
}

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

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

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

.btn-block { width: 100%; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.25rem; font-size: 0.95rem; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}

.btn-icon:hover { background: var(--bg-hover); }

/* Forms */
.form-stack, .form-grid { display: flex; flex-direction: column; gap: 1rem; }
.form-grid.cols-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.field, label.field { display: flex; flex-direction: column; gap: 0.4rem; }

.field-label, label > span:first-child {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

label:not(.field) {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

.field-input-wrap input { padding-left: 2.75rem !important; }

input, select, textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

input[type="search"] { max-width: 280px; }

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr { transition: background var(--transition); }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.badge.ok { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.badge.warn { background: rgba(251, 191, 36, 0.15); color: var(--warn); }
.badge.danger { background: rgba(248, 113, 113, 0.15); color: var(--danger); }

/* Tabs */
.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  padding: 0.25rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  width: fit-content;
}

.tabs button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all var(--transition);
}

.tabs button:hover { color: var(--text); background: var(--bg-hover); }

.tabs button.active {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* Filters & layout */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: flex-end;
  padding: 1rem 1.15rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hint { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.5rem; line-height: 1.5; }

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.flex-between h3 { margin: 0; font-size: 1.1rem; font-weight: 700; }

/* Notifications */
.notif-dropdown { position: relative; }

.notif-dropdown .btn-icon { position: relative; }

.notif-dropdown .notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  margin-left: 0;
}

.notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(380px, calc(100vw - 2rem));
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
  animation: fadeDown 0.2s var(--ease);
}

.notif-panel.open { display: block; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.notif-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.notif-item strong { display: block; margin-bottom: 0.25rem; }
.notif-item p { color: var(--text-secondary); font-size: 0.8125rem; margin-bottom: 0.5rem; }

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.notif-panel-head strong { font-size: 0.95rem; }

.notif-panel-actions { display: flex; align-items: center; gap: 0.5rem; }

.notif-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.6rem 0.75rem 0.35rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.notif-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
}

.notif-tab-btn.active {
  background: var(--bg-surface);
  border-color: rgba(34, 211, 238, 0.35);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.notif-list { padding: 0.2rem 0.2rem 0.3rem 0.2rem; }

.notif-item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.notif-item-row:last-child { border-bottom: none; }

.notif-item-row .notif-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.notif-item-row .notif-item-title strong { display: block; }

.notif-item-row .notif-meta {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-top: 0.35rem;
}

.notif-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.notif-item-actions a { font-size: 0.75rem; }

.notif-empty {
  padding: 1rem;
  color: var(--text-muted);
}

.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 99px;
}

/* Loader */
.loader-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.loader-ring {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: auto;
  animation: slideIn 0.3s var(--ease);
  max-width: 360px;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Message blocks in support */
.msg-block {
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.msg-block small {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
}

/* SPA: loader overlay; #app-root app-bg uzerinde izole yigin */
#app-loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  background: var(--bg-base);
}

#app-loader.is-hidden {
  display: none !important;
}

#app-root {
  position: relative;
  z-index: 1;
  isolation: isolate;
  min-height: 120px;
}

#app-root .stat-card .val,
#app-root .stat-card h4,
#app-root .revenue-hero,
#app-root table td,
#app-root table th {
  -webkit-text-fill-color: currentColor;
}

.stat-card::before {
  opacity: 0.35;
}

.stat-card:hover::before {
  opacity: 1;
}

.overview-hero,
.user-detail-page > .card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Responsive */
@media (max-width: 1024px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-panel { min-height: 100vh; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-close { display: flex; }

  .sidebar-backdrop.open { display: block; }

  .main-wrap { margin-left: 0; width: 100%; }

  .mobile-menu { display: inline-flex; }

  .user-menu-text { display: none; }

  .content { padding: 1.25rem; }

  .topbar { padding: 0 1rem; }

  .integration-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .integration-item.integration-item-row {
    grid-template-columns: 1fr;
  }

  .ads-app-row,
  .ads-id-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .ads-id-input {
    width: 100%;
    min-width: 0;
  }

  .ads-switch {
    justify-self: start;
  }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .topbar h1 { font-size: 1.1rem; }
}

/* ==========================================================================
   Header: kullanici menusu & tema
   ========================================================================== */

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f172a;
  flex-shrink: 0;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.user-menu-wrap { position: relative; }

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}

.user-menu-trigger:hover,
.user-menu-wrap.open .user-menu-trigger {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.user-menu-text { text-align: left; line-height: 1.2; }

.user-greeting {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-menu-text .user-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chevron { opacity: 0.5; transition: transform 0.2s; }
.user-menu-wrap.open .user-chevron { transform: rotate(180deg); opacity: 1; }

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
  z-index: 300;
  overflow: hidden;
  animation: fadeDown 0.2s var(--ease);
}

.user-menu-wrap.open .user-menu-panel { display: block; }

.user-menu-head {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.user-menu-head strong { display: block; font-size: 0.9rem; }
.user-menu-head span { font-size: 0.75rem; color: var(--text-muted); }

.user-menu-item {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.user-menu-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.user-menu-item-danger { color: var(--danger); }
.user-menu-item-danger:hover { background: rgba(248, 113, 113, 0.12); color: #fecaca; }

.user-menu-divider { height: 1px; background: var(--border); margin: 0.25rem 0; }
.user-menu-logout { margin: 0; }

#theme-toggle .icon-moon { display: none; }
[data-theme="light"] #theme-toggle .icon-sun { display: none; }
[data-theme="light"] #theme-toggle .icon-moon { display: block; }

/* ==========================================================================
   Aksiyon cubugu (butonlar)
   ========================================================================== */

.action-bar,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.action-bar-title { display: none; }

.action-bar-buttons { display: contents; }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* Uygulama kartlari (ana sayfa) */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.app-card {
  display: block;
  padding: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 12px 40px rgba(34, 211, 238, 0.12);
  color: inherit;
}

.app-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.app-card .pkg {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.app-card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.app-card-metrics span { color: var(--text-muted); }
.app-card-metrics strong { color: var(--accent); font-weight: 700; }

.revenue-hero {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent-glow);
}

/* Dashboard */
.dashboard-section {
  margin-bottom: 1.5rem;
}

.dashboard-section:last-child {
  margin-bottom: 0;
}

.dashboard-section .section-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
}

.dashboard-section.quick-actions-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.dashboard-section.quick-actions-card h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.quick-action {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.quick-action:hover {
  border-color: rgba(34, 211, 238, 0.4);
  background: var(--bg-hover);
  color: var(--accent);
  transform: translateY(-1px);
}

.revenue-card {
  margin-bottom: 0;
}

.revenue-card .revenue-hero {
  margin-top: 0.25rem;
}

.stat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.stat-card-top h4 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.stat-range-select {
  display: block;
  width: 100%;
  margin: 0.35rem 0 0.5rem;
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text);
  cursor: pointer;
}

.stat-card-wide { min-width: 220px; }

.revenue-card .stat-card-top { margin-bottom: 0.25rem; }

.revenue-card .stat-range-select { max-width: 200px; }

.stat-card .stat-card-top + .val,
.stat-card .stat-val {
  margin-top: 0.15rem;
}

.quiz-summary {
  margin-bottom: 1rem;
}

.quiz-tabs {
  margin-bottom: 1rem;
}

#quiz-panel .card:last-child {
  margin-bottom: 0;
}

.panel-block {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  overflow: hidden;
}

.panel-head {
  padding: 0.55rem 0.85rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.panel-head h3 { margin: 0; font-size: 0.88rem; font-weight: 700; }

.panel-body { padding: 0.85rem; }

.radio-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.radio-card { position: relative; cursor: pointer; margin: 0; }

.radio-card input { position: absolute; opacity: 0; pointer-events: none; }

.radio-card-inner {
  display: block;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.radio-card-inner strong { display: block; font-size: 0.85rem; }

.radio-card-inner small { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }

.radio-card.selected .radio-card-inner,
.radio-card input:checked + .radio-card-inner {
  border-color: var(--accent);
  background: var(--bg-active);
}

.toggle-yesno {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.toggle-label { font-size: 0.85rem; font-weight: 600; }

.toggle-opts { display: flex; gap: 0.35rem; }

.toggle-opt {
  cursor: pointer;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.toggle-opt input { position: absolute; opacity: 0; }

.toggle-opt.selected,
.toggle-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--bg-active);
  color: var(--accent);
}

.dropdown-wrap { position: relative; }

.dropdown-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 50;
  padding: 0.35rem 0;
}

.dropdown-wrap.open .dropdown-panel { display: block; }

.dropdown-panel a {
  display: block;
  padding: 0.5rem 0.85rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
}

.dropdown-panel a:hover { background: var(--bg-hover); color: var(--accent); }

.user-detail-page .detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.user-detail-page .detail-stat {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  text-align: center;
}

.user-detail-page .detail-stat span {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.user-detail-page .detail-stat strong { font-size: 1.1rem; color: var(--text); }

/* ==========================================================================
   Aydinlik tema
   ========================================================================== */

[data-theme="light"] {
  --bg-base: #f0f4f8;
  --bg-elevated: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-2: #f8fafc;
  --bg-hover: #f1f5f9;
  --bg-active: rgba(14, 165, 233, 0.1);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #0891b2;
  --accent-2: #7c3aed;
  --accent-gradient: linear-gradient(135deg, #06b6d4, #6366f1, #8b5cf6);
  --accent-glow: rgba(6, 182, 212, 0.2);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
  --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-card-hover: 0 12px 36px rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .app-bg,
[data-theme="light"] .login-bg {
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(6, 182, 212, 0.08), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(124, 58, 237, 0.06), transparent 50%),
    var(--bg-base);
}

[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .btn-primary { color: #fff; }

[data-theme="light"] .scope-badge.scope-platform { color: #6d28d9; }
[data-theme="light"] .scope-badge.scope-app { color: #0e7490; }
[data-theme="light"] .scope-badge.scope-quiz { color: #b45309; }

[data-theme="light"] code { color: #0e7490; }

/* Modal */
body.modal-open { overflow: hidden; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: min(640px, 100%);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.modal-dialog.modal-lg { width: min(920px, 100%); }
.modal-dialog.modal-xl { width: min(1120px, 100%); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 1.1rem; margin: 0; }

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}

.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 4px; }

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
}

.modal-footer-split { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; width: 100%; }
.modal-footer-right { display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }

.bulk-q-panel-top { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.65rem; }
.bulk-q-check { display: inline-flex; gap: 0.5rem; align-items: center; font-weight: 600; }
.bulk-q-preview-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1rem; align-items: start; }
.bulk-q-options { display: grid; gap: 0.5rem; font-size: 0.9rem; }
.bulk-q-options .badge { margin-right: 0.4rem; }

.modal-close { font-size: 1.5rem; line-height: 1; }

/* Switch */
.form-row-switch {
  grid-column: 1 / -1;
  max-width: 320px;
}

.form-row-switch .switch-field {
  justify-content: flex-start;
  gap: 0.85rem;
  padding: 0.35rem 0;
  margin: 0;
}

.switch-field {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  padding: 0.35rem 0;
  width: auto;
}

.switch-label { font-size: 0.875rem; font-weight: 600; color: var(--text); }

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  transition: background var(--transition), border-color var(--transition);
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 2px;
  top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s var(--ease), background var(--transition);
}

.switch input:checked + .switch-slider {
  background: rgba(34, 211, 238, 0.2);
  border-color: var(--accent);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
  background: var(--accent);
}

/* Lang tabs */
.lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.lang-tab {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.lang-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-active);
}

.lang-panel[hidden] { display: none !important; }
.question-options-stack { display: grid; grid-template-columns: 1fr; gap: 0.55rem; }
.question-options-stack label { display: grid; grid-template-columns: 16px 1fr; gap: 0.5rem; align-items: center; }
.question-options-stack label input { width: 100%; font-size: 0.85rem; padding: 0.35rem 0.5rem; }
.level-list { display: grid; gap: 0.65rem; }
.level-row { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 0.8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); }
.level-row-main { display: grid; gap: 0.2rem; }
.cover-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); background: var(--bg-elevated); display: inline-block; }

.loc-key-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr 1fr;
  gap: 0.75rem 1rem;
  align-items: start;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  margin-bottom: 0.65rem;
}

.loc-key-row:last-child { margin-bottom: 0; }

.loc-key-meta code {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

.loc-key-meta small {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.loc-key-source textarea[readonly] { margin-top: 0.15rem; min-height: 56px; opacity: 0.9; background: var(--bg-elevated); width: 100%; }
.loc-key-target textarea { width: 100%; }

.loc-key-meta input[readonly] {
  opacity: 0.85;
  cursor: default;
  background: var(--bg-elevated);
}

/* Busy toast (AI uretim vb.) */
.toast-busy {
  border-left: 3px solid var(--accent);
}
.toast-busy-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.toast-busy-spinner {
  width: 22px;
  height: 22px;
  border-width: 3px;
}
.toast-busy-eta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.default-lang-box {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(139, 92, 246, 0.06));
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.default-lang-box h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.store-tabs, .season-lb-tabs, .rewards-main-tabs, .wd-section-tabs, .sub-tabs, .quiz-tabs, .quiz-cat-tabs { margin-bottom: 1rem; }

/* Leaderboard tarzi tam genislik sekme cubugu (buton gorunumlu degil) */
.tabs.season-lb-tabs,
.tabs.store-tabs,
.tabs.quiz-tabs,
.tabs.rewards-main-tabs,
.tabs.wd-section-tabs,
.tabs.quiz-cat-tabs,
.tabs.sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  padding: 0.25rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.tabs.season-lb-tabs button,
.tabs.store-tabs button,
.tabs.quiz-tabs button,
.tabs.rewards-main-tabs button,
.tabs.wd-section-tabs button,
.tabs.quiz-cat-tabs button,
.tabs.sub-tabs button {
  flex: 1 1 auto;
  min-width: 7.5rem;
  white-space: normal;
  line-height: 1.25;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all var(--transition);
}

.tabs.season-lb-tabs button:hover,
.tabs.store-tabs button:hover,
.tabs.quiz-tabs button:hover,
.tabs.rewards-main-tabs button:hover,
.tabs.wd-section-tabs button:hover,
.tabs.quiz-cat-tabs button:hover,
.tabs.sub-tabs button:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.tabs.season-lb-tabs button.active,
.tabs.store-tabs button.active,
.tabs.quiz-tabs button.active,
.tabs.rewards-main-tabs button.active,
.tabs.wd-section-tabs button.active,
.tabs.quiz-cat-tabs button.active,
.tabs.sub-tabs button.active {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* Integrations: ads provider pill switch */
.pill-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.pill-switch .pill {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: transform .06s ease, border-color .15s ease, box-shadow .15s ease;
}
.pill-switch .pill:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--border) 65%, var(--accent) 35%);
}
.pill-switch .pill.active {
  border-color: color-mix(in srgb, var(--border) 40%, var(--accent) 60%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.pill-switch .pill-title { font-weight: 700; }
.pill-switch .pill-sub { font-size: 12px; opacity: .75; }

.integration-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.integration-item {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.integration-item span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.integration-item.integration-item-single {
  grid-template-columns: 160px minmax(0, 1fr);
}

.integration-item.integration-item-row {
  grid-template-columns: 140px minmax(0, 1fr) 140px;
  align-items: center;
}

.integration-item.integration-item-row input {
  width: 75%;
  justify-self: start;
}

.integration-active {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  justify-self: end;
  white-space: nowrap;
}

.integration-active input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.ads-modern-form {
  display: grid;
  gap: 0.85rem;
}

.ads-app-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--bg-elevated), color-mix(in srgb, var(--bg-elevated) 88%, var(--accent) 12%));
}

.ads-app-label,
.ads-id-name {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ads-id-name {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.ads-id-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--accent);
  font-size: 0.7rem;
}

.ads-id-list {
  display: grid;
  gap: 0.6rem;
}

.ads-id-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 120px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.ads-id-input {
  width: 75%;
  min-width: 220px;
  justify-self: start;
}

.ads-switch {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.58rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.ads-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ads-switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-hover);
  transition: background var(--transition), border-color var(--transition);
}

.ads-switch-track::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--transition), background var(--transition);
}

.ads-switch-text {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.ads-switch:has(input:checked) {
  border-color: var(--border);
  box-shadow: none;
  background: var(--bg-surface);
}

.ads-switch:has(input:checked) .ads-switch-track {
  border-color: color-mix(in srgb, var(--success) 80%, var(--border) 20%);
  background: color-mix(in srgb, var(--success) 35%, #0b1f14 65%);
}

.ads-switch:has(input:checked) .ads-switch-track::after {
  transform: translateX(16px);
  background: #d1fae5;
}

.ads-switch:has(input:checked) .ads-switch-text {
  color: var(--success);
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.gift-card-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  text-align: center;
  background: var(--bg-elevated);
}

.gift-card-tile img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin: 0 auto 0.5rem;
  display: block;
}

.detail-dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.35rem 1rem;
  margin-bottom: 1rem;
}

.detail-dl dt { color: var(--text-muted); font-size: 0.8rem; }
.detail-dl dd { margin: 0; }

.code-block {
  font-size: 0.75rem;
  background: var(--bg-elevated);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  overflow: auto;
  max-height: 200px;
}

/* Form ayar satirlari (aktif/pasif, switch) */
.form-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  margin-bottom: 0.5rem;
}

.form-setting-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.form-setting-control {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.form-setting-row--switch .switch { margin: 0; }

.form-grid .form-setting-row,
.form-stack .form-setting-row,
.form-field-full {
  grid-column: 1 / -1;
}

.form-grid .radio-cards.form-field-full {
  margin-top: 0.15rem;
}

.segmented-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.segmented-opt {
  position: relative;
  cursor: pointer;
  margin: 0;
  border-radius: 999px;
}

.segmented-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-opt span {
  display: block;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 999px;
  transition: background var(--transition), color var(--transition);
}

.segmented-opt.is-active span,
.segmented-opt.selected span,
.segmented-opt:has(input:checked) span {
  background: var(--bg-active);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.25);
}

/* Odul editoru */
.reward-editor { margin-top: 0.75rem; }

.reward-editor-head {
  display: grid;
  grid-template-columns: 1.4fr 1fr 2.5rem;
  gap: 0.5rem;
  padding: 0 0.35rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.reward-editor-head--chest {
  grid-template-columns: 1.4fr 1fr 0.7fr 2.5rem;
}

.reward-editor-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 2.5rem;
  gap: 0.5rem;
  align-items: end;
  padding: 0.55rem 0.5rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.chest-reward-row {
  grid-template-columns: 1.4fr 1fr 0.7fr 2.5rem;
}

.reward-editor-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.reward-editor-label .amount-unit {
  font-weight: 500;
  font-style: normal;
  color: var(--accent);
}

.reward-type-select,
.table-select {
  width: 100%;
  font-size: 0.85rem;
}

.reward-amount-input {
  width: 100%;
}

.amount-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.amount-cell .amount-unit,
.reward-editor-cell--amount .amount-unit {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.prob-field {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.prob-field input { width: 4.5rem; }

.reward-slots-hint { margin-bottom: 0.75rem; }

.level-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.level-chip--lg {
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
}

.level-reward-modal__hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.level-reward-modal__hero .field-inline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 200px;
}

.level-reward-modal__hero .field-inline input {
  font-weight: 400;
}

.reward-pill {
  display: inline-block;
  margin: 0.15rem 0.35rem 0.15rem 0;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.level-rewards-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.level-rewards-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.level-rewards-scroll {
  max-height: min(70vh, 720px);
  overflow-y: auto;
}

.reward-summary-cell .muted { color: var(--text-muted); font-size: 0.8rem; }

.form-row-switch {
  grid-column: 1 / -1;
  max-width: none;
}

.form-row-switch .form-setting-row {
  max-width: 420px;
}

.storefront-mode-card h3 {
  margin: 0 0 0.5rem;
}

.storefront-mode-options {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .storefront-mode-options {
    grid-template-columns: 1fr 1fr;
  }
}

.storefront-mode-option {
  cursor: pointer;
  display: block;
}

.dq-page .dq-intro h3 {
  margin: 0 0 0.5rem;
}

.dq-quest-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.dq-quest-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dq-quest-card--off {
  opacity: 0.55;
}

.dq-quest-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dq-quest-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.dq-quest-card--off .dq-quest-badge {
  color: var(--text-muted);
}

.dq-quest-sort {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dq-quest-card__title {
  margin: 0;
  font-size: 1rem;
}

.dq-quest-card__desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.dq-quest-card__reward {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: rgba(124, 77, 255, 0.08);
  border-radius: 8px;
}

.dq-quest-card__reward-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.dq-quest-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.dq-preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dq-preview-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.dq-preview-list li em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}

.dq-save-bar {
  position: sticky;
  bottom: 0;
  padding: 0.75rem 0;
  background: linear-gradient(transparent, var(--bg) 30%);
}

.dq-quest-form .field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.dq-empty {
  padding: 1.5rem;
  text-align: center;
}
