/* BetYonetim — Clean glass + soft charcoal */
:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --surface: rgba(18, 19, 24, 0.82);
  --surface-2: rgba(14, 15, 19, 0.94);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.11);
  --text: #f1f0f2;
  --muted: rgba(241, 240, 242, 0.46);
  --accent: #d4a5b0;
  --accent-soft: rgba(212, 165, 176, 0.12);
  --accent-ink: #ebe0e4;
  --success: #5eead4;
  --danger: #f0a0ab;
  --warn: #f0c878;
  --info: #8ec5e8;
  --radius: 14px;
  --radius-sm: 10px;
  --space: 8px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  min-height: 100%;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(880px 420px at 50% -10%, rgba(150, 130, 150, 0.11), transparent 62%),
    radial-gradient(640px 320px at 92% 8%, rgba(120, 140, 170, 0.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

.font-mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* Surfaces */
.glass {
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.glass-strong {
  background: var(--surface-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.glass-input {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.glass-input:focus {
  outline: none;
  border-color: rgba(212, 165, 176, 0.45);
  box-shadow: 0 0 0 3px rgba(212, 165, 176, 0.1);
}
.glass-input::placeholder { color: rgba(241, 240, 242, 0.3); }
.glass-input:disabled { opacity: 0.5; cursor: not-allowed; }

/* Nav */
.nav-item {
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: color 160ms ease, background 160ms ease;
}
.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.nav-item.active {
  color: #fff;
  background: var(--accent-soft);
}

.site-chip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.site-chip:hover { color: var(--text); border-color: var(--border-strong); }
.site-chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: rgba(212, 165, 176, 0.32);
  color: var(--accent-ink);
}

.row-hover:hover { background: rgba(255, 255, 255, 0.025); }

/* Type helpers */
.label-xs {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.muted { color: var(--muted); }

/* KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (min-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.kpi-card {
  padding: 20px 22px;
}
.kpi-card .kpi-value {
  margin-top: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Panel */
.panel { overflow: hidden; }
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-body { padding: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: rgba(212, 165, 176, 0.22);
}
.btn-primary:hover:not(:disabled) { background: rgba(212, 165, 176, 0.2); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); background: rgba(255,255,255,0.04); }
.btn-danger {
  background: rgba(240, 160, 171, 0.1);
  color: var(--danger);
  border-color: rgba(240, 160, 171, 0.22);
}
.btn-danger:hover:not(:disabled) { background: rgba(240, 160, 171, 0.18); }

.link-action {
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 160ms ease;
  background: none;
  border: none;
  padding: 0;
}
.link-ok { color: var(--success); }
.link-ok:hover { color: #fff; }
.link-danger { color: var(--danger); }
.link-danger:hover { color: #fff; }

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.toast-enter { animation: toast-in 200ms ease-out; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-in { animation: fade-up 320ms ease-out both; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .toast-enter, .anim-in, * {
    animation: none !important;
    transition: none !important;
  }
}

.role-badge-superuser {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.role-badge-tawk {
  background: rgba(142, 197, 232, 0.12);
  color: var(--info);
}

.settings-tab {
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: color 160ms ease, background 160ms ease;
}
.settings-tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.settings-tab[aria-selected="true"] {
  background: var(--accent-soft);
  color: #fff;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-toggle {
  position: relative;
  width: 2.5rem;
  height: 1.375rem;
  flex-shrink: 0;
  cursor: pointer;
  appearance: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 180ms ease;
}
.settings-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background: #fff;
  transition: transform 180ms ease;
}
.settings-toggle:checked { background: rgba(212, 165, 176, 0.48); }
.settings-toggle:checked::after { transform: translateX(1.125rem); }
.settings-toggle:disabled { opacity: 0.4; cursor: not-allowed; }
.perm-yes { color: var(--success); }
.perm-no { color: rgba(255, 255, 255, 0.2); }

/* Shell */
.app-shell { display: flex; min-height: 100%; }
.app-sidebar {
  width: 15rem;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
}
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 3.75rem;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 12, 15, 0.78);
  backdrop-filter: blur(16px);
}
.app-content {
  flex: 1;
  padding: 28px 28px 48px;
  width: 100%;
  max-width: none;
  margin: 0;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 24px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
