:root {
  --bg: #07070b;
  --bg-2: #0d0d14;
  --panel: #111119;
  --panel-2: #161620;
  --line: #22222e;
  --line-2: #2d2d3b;
  --text: #ececf3;
  --muted: #8d8da3;
  --faint: #5c5c70;
  --accent: #a78bfa;
  --accent-2: #22d3ee;
  --grad: linear-gradient(135deg, #a78bfa 0%, #7c8bfa 45%, #22d3ee 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --r: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hl { color: var(--text); font-weight: 600; }

/* ---------- marka */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark svg { display: block; }
.brand-name { font-size: 16px; color: var(--muted); letter-spacing: -0.01em; }
.brand-name b { color: var(--text); font-weight: 600; }

/* ---------- auth */
body.auth { min-height: 100vh; overflow-x: hidden; }
.auth-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.glow-a { width: 520px; height: 520px; background: #6d4aff; top: -180px; left: 50%; transform: translateX(-70%); opacity: .35; animation: drift 14s ease-in-out infinite alternate; }
.glow-b { width: 420px; height: 420px; background: #0ea5c6; bottom: -200px; right: -120px; opacity: .22; animation: drift 18s ease-in-out infinite alternate-reverse; }
.grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 65%);
}
@keyframes drift { to { transform: translate(-40%, 40px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .glow { animation: none; } }

.auth-wrap {
  position: relative; z-index: 1;
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 16px; gap: 28px;
}
.auth-card {
  width: 100%; max-width: 410px;
  background: linear-gradient(180deg, rgba(22,22,32,.82), rgba(14,14,21,.82));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 32px 30px;
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 30px 80px -20px rgba(0,0,0,.7);
  position: relative;
}
.auth-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 20px; padding: 1px;
  background: linear-gradient(160deg, rgba(167,139,250,.45), transparent 35%, transparent 70%, rgba(34,211,238,.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.auth-card h1 { font-size: 24px; font-weight: 600; margin-bottom: 6px; }
.auth-card > .muted { margin-bottom: 24px; }
.auth-foot { color: var(--faint); font-size: 12px; text-align: center; }

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field input {
  height: 46px; padding: 0 14px; border-radius: 11px;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text);
  font: inherit; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--faint); }
.field input:focus, .otp-box:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(167,139,250,.15); }

.btn {
  height: 46px; border: 0; border-radius: 11px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 15px; font-weight: 600; transition: transform .08s, filter .15s, opacity .15s;
}
.btn-primary { background: var(--grad); color: #08080d; box-shadow: 0 8px 28px -8px rgba(124,139,250,.6); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.3); }

.alert { border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.3); color: #fecaca; }
.alert-ok { background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.3); color: #a7f3d0; }

.divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 14px; color: var(--faint); font-size: 12px; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
.perks li { display: flex; align-items: center; gap: 10px; }
.perks .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--grad); flex: none; }

.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; }
.otp-box {
  width: 100%; height: 56px; text-align: center; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text);
  font: 600 22px "JetBrains Mono", ui-monospace, monospace; outline: none; transition: border-color .15s, box-shadow .15s;
}
.otp-box.filled { border-color: #4b4b63; background: var(--panel-2); }
.auth-links { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 12px; flex-wrap: wrap; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.link:hover:not(:disabled) { color: var(--text); }
.link:disabled { opacity: .5; cursor: default; }

/* ---------- uygulama */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--bg-2); border-right: 1px solid var(--line); padding: 20px 14px;
}
.brand-sm { padding: 2px 8px 22px; }
.brand-sm .brand-name { font-size: 14.5px; }
.brand-sm svg { width: 28px; height: 28px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 16px 10px 6px; }
.nav-label:first-child { padding-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
  color: var(--muted); font-weight: 500; font-size: 13.5px; cursor: pointer; transition: background .12s, color .12s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav-item.active svg { color: var(--accent); }
.nav-item[aria-disabled="true"] { cursor: default; }
.soon { margin-left: auto; font-size: 10.5px; color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

.side-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 14px 4px 0; }
.user { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.avatar { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); color: #08080d; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.user-mail { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: 1px solid transparent; color: var(--muted); width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--panel); border-color: var(--line); color: var(--text); }

.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 22px 32px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
  background: rgba(7,7,11,.8); backdrop-filter: blur(14px);
}
.page-title { font-size: 20px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.select { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; color: var(--muted); font-size: 13px; background: var(--panel); }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500; border: 1px solid; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.pill-warn { color: var(--warn); border-color: rgba(251,191,36,.3); background: rgba(251,191,36,.07); }
.pill-ok { color: var(--ok); border-color: rgba(52,211,153,.3); background: rgba(52,211,153,.07); }

.content { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1360px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.card-head h3 { font-size: 15px; font-weight: 600; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12px; display: grid; place-items: center; color: var(--muted); }

.connect { background: radial-gradient(120% 140% at 0% 0%, rgba(167,139,250,.12), transparent 50%), var(--panel); border-color: #2b2740; }
.connect-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.connect-head h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.connect-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(167,139,250,.12); color: var(--accent); border: 1px solid rgba(167,139,250,.25); flex: none; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.steps li { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.steps b { font-size: 13.5px; font-weight: 600; }
.steps p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.step-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; border: 1px solid var(--line-2); color: var(--muted); }
.steps li.done .step-n { background: var(--ok); border-color: var(--ok); color: #05130d; font-size: 0; }
.steps li.done .step-n::after { content: "✓"; font-size: 13px; }

.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin: 8px 0 4px; color: var(--faint); }
.kpi-sub { font-size: 12px; color: var(--faint); }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.table { display: flex; flex-direction: column; }
.tr { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); align-items: center; }
.th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding-top: 0; }
.skeleton i { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--panel-2), #1e1e2a, var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.6s infinite; }
.skeleton span:first-child i { width: 70%; }
.skeleton span:not(:first-child) i { width: 55%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { color: var(--faint); font-size: 12.5px; text-align: center; padding-top: 16px; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 12px; color: var(--muted); }
.empty-state svg { color: var(--faint); margin-bottom: 4px; }
.empty-state p { color: var(--text); font-weight: 500; }

.rules { display: flex; flex-direction: column; }
.rule { display: flex; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.rule:last-child { border-bottom: 0; }
.rule > div { flex: 1; min-width: 0; }
.rule b { font-weight: 600; font-size: 13.5px; }
.tag { font-size: 11.5px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 8px; }
.switch { width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; opacity: .6; }
.switch::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); top: 3px; left: 3px; }

/* ---------- responsive */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 20; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid; }
  .topbar { padding: 16px; }
  .content { padding: 20px 16px 40px; }
  .grid-2 { grid-template-columns: 1fr; }
  .select { display: none; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px 24px; }
  .otp { gap: 6px; }
  .otp-box { height: 50px; font-size: 20px; }
  .topbar .muted.small { display: none; }
  .pill { font-size: 0; padding: 0 9px; gap: 0; }
  .tr { grid-template-columns: 1.6fr 1fr 1fr; }
  .tr > span:last-child { display: none; }
}
