/* ===== Gökyıl Lisans Yönetim Merkezi — admin.css ===== */

/* ===== TOKENS ===== */
:root {
  --navy-950: #060b17;
  --navy-900: #0b1324;
  --navy-800: #111c33;
  --navy-700: #1a2947;
  --navy-600: #24375e;
  --brand: #2563eb;
  --brand-600: #1d4ed8;
  --brand-400: #60a5fa;
  --brand-50: #eef4ff;
  --gold: #c9a54e;
  --gold-soft: #e8d6a6;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8f0;
  --border-strong: #cfd7e3;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 8px rgba(15, 23, 42, .05);
  --shadow-2: 0 2px 4px rgba(15, 23, 42, .04), 0 12px 32px rgba(15, 23, 42, .10);
  --shadow-3: 0 30px 80px rgba(2, 6, 23, .45);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ===== LOGIN — 3D SCENE ===== */
.login-screen {
  position: relative; min-height: 100vh; overflow: hidden;
  display: flex; flex-direction: column;
  background: radial-gradient(1200px 700px at 75% 20%, #15284f 0%, transparent 60%),
              linear-gradient(160deg, var(--navy-900) 0%, var(--navy-950) 100%);
  color: #e2e8f0;
  --sx: 0deg; --sy: 0deg;
}
.scene { position: absolute; inset: 0; pointer-events: none; perspective: 900px; }
.scene-glow {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55;
  animation: glowDrift 18s ease-in-out infinite alternate;
}
.glow-a { width: 520px; height: 520px; left: -120px; top: -140px; background: #1d4ed8; }
.glow-b { width: 460px; height: 460px; right: -80px; bottom: -160px; background: #0e7490; opacity: .35; animation-delay: -9s; }
@keyframes glowDrift { to { transform: translate3d(60px, 40px, 0) scale(1.1); } }
.scene-floor {
  position: absolute; left: -50%; right: -50%; bottom: -10%; height: 70%;
  transform: rotateX(68deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%);
          mask-image: linear-gradient(to top, #000 10%, transparent 85%);
}
.scene-grid {
  position: absolute; inset: -60px 0 0;
  background-image:
    linear-gradient(rgba(96, 165, 250, .18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, .18) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridFlow 6s linear infinite;
}
@keyframes gridFlow { to { transform: translateY(60px); } }
.scene-noise {
  position: absolute; inset: 0; opacity: .5;
  background: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 3px 3px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}

.login-shell {
  position: relative; z-index: 1; flex: 1;
  width: 100%; max-width: 1180px; margin: 0 auto; padding: 48px 32px 24px;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 400px);
  gap: 56px; align-items: center;
}
.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.brand-logo {
  width: 48px; height: 48px; object-fit: contain; border-radius: 12px;
  background: #fff; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.brand-row strong { display: block; font-size: 15px; color: #fff; letter-spacing: .2px; }
.brand-row span { display: block; font-size: 12px; color: #94a3b8; letter-spacing: .4px; }
.hero-title {
  font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 44px); line-height: 1.12;
  font-weight: 700; color: #fff; letter-spacing: -.5px; max-width: 560px;
}
.hero-title span {
  background: linear-gradient(90deg, #93c5fd, var(--gold-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { margin-top: 14px; color: #94a3b8; font-size: 15px; max-width: 500px; line-height: 1.6; }

.hero-stage {
  position: relative; height: 300px; margin-top: 34px; max-width: 560px;
  perspective: 1100px; transform-style: preserve-3d;
}
.hero-stage .layer {
  --px: 0px; --py: 0px;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.stage-ring {
  position: absolute; left: 50%; top: 52%; width: 420px; height: 420px; margin: -210px 0 0 -210px;
  border-radius: 50%; border: 1px solid rgba(147, 197, 253, .18);
  transform: translate3d(var(--px), var(--py), 0) rotateX(72deg);
}
.stage-ring::after {
  content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-400); box-shadow: 0 0 14px var(--brand-400);
}
.stage-ring { animation: ringSpin 22s linear infinite; }
.ring-2 { width: 300px; height: 300px; margin: -150px 0 0 -150px; border-color: rgba(201, 165, 78, .22); animation-duration: 14s; animation-direction: reverse; }
.ring-2::after { background: var(--gold); box-shadow: 0 0 14px var(--gold); }
@keyframes ringSpin {
  from { transform: translate3d(var(--px), var(--py), 0) rotateX(72deg) rotateZ(0); }
  to   { transform: translate3d(var(--px), var(--py), 0) rotateX(72deg) rotateZ(360deg); }
}

.lic-card {
  position: absolute; left: 50%; top: 50%; width: 340px; height: 206px; margin: -112px 0 0 -170px;
  transform: translate3d(var(--px), var(--py), 40px) rotateX(calc(14deg + var(--sy))) rotateY(calc(-18deg + var(--sx)));
  transform-style: preserve-3d;
  animation: cardFloat 7s ease-in-out infinite;
}
@keyframes cardFloat { 50% { margin-top: -124px; } }
.lic-card-face {
  position: absolute; inset: 0; border-radius: 18px; padding: 20px 22px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(96,165,250,.35), transparent 50%),
    linear-gradient(145deg, #1e3a8a 0%, #0f1f45 55%, #0b1530 100%);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 40px 70px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.18);
  overflow: hidden;
}
.lic-card-face::before {
  content: ""; position: absolute; inset: -40% -60%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.14) 50%, transparent 60%);
  animation: sheen 6s ease-in-out infinite;
}
@keyframes sheen { 0%, 30% { transform: translateX(-40%); } 70%, 100% { transform: translateX(40%); } }
.lic-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.lic-chip {
  width: 40px; height: 30px; border-radius: 6px;
  background: linear-gradient(135deg, #f3e2b3, var(--gold) 55%, #9c7a2c);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
  position: relative;
}
.lic-chip::before { content: ""; position: absolute; inset: 8px 6px; border: 1px solid rgba(80,55,10,.4); border-radius: 3px; }
.lic-state {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .8px;
  color: #bbf7d0; background: rgba(22,163,74,.18); border: 1px solid rgba(74,222,128,.35);
  padding: 4px 10px; border-radius: 999px;
}
.lic-state i { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.lic-label { font-size: 10.5px; letter-spacing: 2px; color: #93a4c3; font-weight: 600; }
.lic-code { font-family: var(--mono); font-size: 19px; color: #fff; letter-spacing: 1.5px; margin-top: 4px; }
.lic-meta { display: flex; gap: 22px; margin-top: auto; }
.lic-meta small { display: block; font-size: 10px; color: #8193b5; letter-spacing: .5px; }
.lic-meta b { font-size: 12.5px; color: #e2e8f0; font-weight: 600; }
.lic-bar { height: 3px; border-radius: 3px; background: rgba(255,255,255,.12); margin-top: 12px; overflow: hidden; }
.lic-bar span { display: block; height: 100%; width: 72%; background: linear-gradient(90deg, var(--brand-400), var(--gold)); }

.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 12px; font-size: 12.5px; font-weight: 600; color: #e2e8f0;
  background: rgba(15, 28, 58, .72); border: 1px solid rgba(147,197,253,.22);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 16px 36px rgba(0,0,0,.35);
  transform: translate3d(var(--px), var(--py), 80px);
}
.float-chip svg { width: 16px; height: 16px; fill: none; stroke: var(--brand-400); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip-a { left: 0; top: 18px; animation: chipBob 6s ease-in-out infinite; }
.chip-b { right: 0; top: 92px; animation: chipBob 7s ease-in-out -2s infinite; }
.chip-c { left: 40px; bottom: 0; animation: chipBob 8s ease-in-out -4s infinite; }
.chip-c svg { stroke: var(--gold); }
@keyframes chipBob { 50% { margin-top: -8px; } }

.login-box {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 0%;
  position: relative; border-radius: 20px; padding: 1px;
  background: linear-gradient(160deg, rgba(255,255,255,.55), rgba(255,255,255,.08) 40%, rgba(96,165,250,.35));
  box-shadow: var(--shadow-3);
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
  animation: riseIn .7s cubic-bezier(.2,.8,.2,1) both;
}
.login-box.is-tilting { transition: transform .08s linear; }
@keyframes riseIn { from { opacity: 0; transform: perspective(1000px) translateY(24px) rotateX(8deg); } }
.login-box-inner {
  border-radius: 19px; padding: 36px 32px 26px; text-align: center;
  background: radial-gradient(400px 200px at var(--mx) var(--my), rgba(37,99,235,.06), transparent 70%), #fff;
  color: var(--text);
}
.login-logo {
  width: 84px; height: 84px; margin: 0 auto 14px; display: block; object-fit: contain;
  border-radius: 18px; background: #fff; padding: 6px;
  box-shadow: 0 10px 26px rgba(15,23,42,.14), inset 0 0 0 1px var(--border);
}
.login-box h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-box .form-group { text-align: left; }
.input-icon { position: relative; }
.input-icon svg {
  position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%);
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.form-group .input-icon input { padding-left: 38px; height: 44px; font-size: 14px; }
.login-box .btn-full { height: 44px; font-size: 14px; margin-top: 4px; }
.login-secure {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.login-secure svg { width: 14px; height: 14px; fill: none; stroke: var(--success); stroke-width: 2; }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 12px; background: var(--danger-bg); padding: 8px 10px; border-radius: 8px; }
.login-foot { position: relative; z-index: 1; text-align: center; padding: 18px; font-size: 12px; color: #64748b; }

/* ===== APP LAYOUT ===== */
.app-screen { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 248px; min-height: 100vh; flex-shrink: 0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar-header {
  padding: 20px 18px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo {
  width: 42px; height: 42px; display: block; object-fit: contain;
  border-radius: 10px; background: #fff; padding: 3px;
}
.sidebar-brand { display: flex; flex-direction: column; min-width: 0; }
.sidebar-title { font-size: 15px; font-weight: 700; color: #fff; }
.sidebar-sub { font-size: 11.5px; color: #7d8bab; letter-spacing: .3px; }
.sidebar-nav { flex: 1; list-style: none; padding: 10px 10px 16px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #24375e transparent; }
.nav-group {
  padding: 16px 12px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: #5b6b8c;
}
.sidebar-nav li:first-child.nav-group { padding-top: 6px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 1px 0; border-radius: 9px;
  color: #a9b4cc; text-decoration: none; font-size: 13.5px;
  transition: background .2s, color .2s;
}
.nav-ico {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; opacity: .9;
}
.nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link.active {
  color: #fff; font-weight: 600;
  background: linear-gradient(90deg, rgba(37,99,235,.32), rgba(37,99,235,.08));
  box-shadow: inset 0 0 0 1px rgba(96,165,250,.18);
}
.nav-link.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand-400);
}
.nav-link.active .nav-ico { stroke: var(--brand-400); opacity: 1; }
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.06); }

/* ===== MAIN ===== */
.main-content { flex: 1; min-width: 0; padding: 28px 32px 40px; overflow-y: auto; }
.tab-section { display: none; }
.tab-section.active { display: block; animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
.tab-section h1 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 22px; color: var(--text); letter-spacing: -.2px; }

/* ===== SECTION HEADER ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-header h1 { margin-bottom: 0; }
.section-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.subsection-title { font-size: 15px; margin: 18px 0 10px; color: var(--text); }
.crm-block { margin-bottom: 18px; }
.crm-filter-bar {
  display: grid; grid-template-columns: minmax(220px, 320px) minmax(180px, 240px) auto;
  gap: 12px; align-items: end; margin-bottom: 16px;
}
.crm-filter-bar .form-group { margin-bottom: 0; }
.crm-note-cell { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== DASHBOARD HERO ===== */
.dash-hero {
  --sx: 0deg; --sy: 0deg;
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: center; gap: 24px;
  padding: 30px 34px; margin-bottom: 22px; border-radius: 18px; color: #e2e8f0;
  background:
    radial-gradient(700px 300px at 85% 0%, rgba(37,99,235,.45), transparent 60%),
    linear-gradient(135deg, var(--navy-800) 0%, var(--navy-950) 100%);
  box-shadow: 0 18px 44px rgba(11, 19, 36, .28);
}
.dash-hero-bg { position: absolute; inset: 0; z-index: -1; perspective: 700px; overflow: hidden; }
.dash-hero-grid {
  position: absolute; left: -20%; right: -20%; bottom: -40%; height: 120%;
  transform: rotateX(64deg); transform-origin: 50% 100%;
  background-image:
    linear-gradient(rgba(148,163,184,.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.14) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to top, #000, transparent 75%);
          mask-image: linear-gradient(to top, #000, transparent 75%);
  animation: heroGrid 8s linear infinite;
}
@keyframes heroGrid { to { background-position: 0 44px, 0 0; } }
.eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--gold-soft); margin-bottom: 8px;
}
.tab-section h1.dash-title { color: #fff; font-size: 28px; margin-bottom: 6px; letter-spacing: -.4px; }
.dash-lead { color: #a3b1cc; font-size: 14px; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; font-size: 12.5px; color: #8b9bbb; }
.hero-meta b { color: #cbd5e1; font-weight: 600; font-variant-numeric: tabular-nums; }
.live-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 999px;
  background: rgba(22,163,74,.14); border: 1px solid rgba(74,222,128,.3); color: #bbf7d0; font-weight: 600;
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: #4ade80;
  animation: ping 1.8s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

.dash-hero-visual { display: grid; place-items: center; perspective: 800px; }
.emblem {
  position: relative; width: 200px; height: 200px; transform-style: preserve-3d;
  transform: rotateX(var(--sy)) rotateY(var(--sx));
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.dash-hero .emblem { transform: rotateX(calc(var(--sy) * -1)) rotateY(var(--sx)); }
.emblem-layer {
  --px: 0px; --py: 0px;
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(147,197,253,.22);
  transition: translate .5s cubic-bezier(.2,.8,.2,1);
  translate: var(--px) var(--py);
}
.emblem-layer.e1 { transform: translateZ(-40px) scale(1.05); animation: spinZ 26s linear infinite; border-style: dashed; }
.emblem-layer.e2 { inset: 14px; transform: translateZ(-10px); border-color: rgba(201,165,78,.35); animation: spinZ 16s linear infinite reverse; }
.emblem-layer.e2::after {
  content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 12px var(--gold);
}
.emblem-layer.e3 { inset: 30px; background: radial-gradient(circle, rgba(37,99,235,.25), transparent 70%); border: 0; transform: translateZ(10px); }
@keyframes spinZ { to { rotate: 360deg; } }
.emblem-core {
  position: absolute; inset: 34px; border-radius: 50%; transform: translateZ(40px);
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #1e3a8a, var(--navy-900) 70%);
  box-shadow: 0 20px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.12);
}
.health-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.health-ring circle { fill: none; stroke-width: 8; }
.health-ring .track { stroke: rgba(255,255,255,.08); }
.health-ring .value {
  stroke: #4ade80; stroke-linecap: round;
  stroke-dasharray: 326.73; stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1), stroke .3s;
  filter: drop-shadow(0 0 6px rgba(74,222,128,.55));
}
.health-ring .value.warn { stroke: #fbbf24; filter: drop-shadow(0 0 6px rgba(251,191,36,.55)); }
.health-text { position: relative; text-align: center; }
.health-text b { display: block; font-size: 28px; color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.health-text small { display: block; margin-top: 4px; font-size: 10px; color: #94a3b8; letter-spacing: .3px; }

/* ===== STAT CARDS ===== */
.stat-cards {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
  perspective: 1200px;
}
.stat-card {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  --tone: var(--brand); --tone-bg: var(--brand-50);
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px; min-width: 0;
  padding: 18px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translateZ(0);
  transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .3s, border-color .3s;
  animation: cardIn .6s cubic-bezier(.2,.8,.2,1) both;
}
.stat-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx) var(--my), color-mix(in srgb, var(--tone) 12%, transparent), transparent 70%);
}
.stat-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone); opacity: .85;
}
.stat-card:hover { box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.stat-card:hover::before { opacity: 1; }
.stat-card.is-tilting { transition: transform .08s linear, box-shadow .3s, border-color .3s; }
.stat-card:nth-child(2) { animation-delay: .04s; } .stat-card:nth-child(3) { animation-delay: .08s; }
.stat-card:nth-child(4) { animation-delay: .12s; } .stat-card:nth-child(5) { animation-delay: .16s; }
.stat-card:nth-child(6) { animation-delay: .20s; } .stat-card:nth-child(7) { animation-delay: .24s; }
.stat-card:nth-child(8) { animation-delay: .28s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) rotateX(-8deg); } }
.stat-card.clickable { cursor: pointer; }
.tone-blue   { --tone: #2563eb; --tone-bg: #eef4ff; }
.tone-red    { --tone: #dc2626; --tone-bg: #fef2f2; }
.tone-indigo { --tone: #4f46e5; --tone-bg: #eef2ff; }
.tone-green  { --tone: #15803d; --tone-bg: #ecfdf3; }
.tone-slate  { --tone: #475569; --tone-bg: #f1f5f9; }
.tone-cyan   { --tone: #0e7490; --tone-bg: #ecfeff; }
.tone-amber  { --tone: #b45309; --tone-bg: #fffbeb; }
.stat-icon {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--tone-bg); color: var(--tone);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 14%, transparent);
  transform: translateZ(30px);
}
.stat-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.stat-info { display: flex; flex-direction: column; min-width: 0; transform: translateZ(20px); }
.stat-lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat-val {
  font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--text);
  line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.danger-stat .stat-val { color: var(--tone); }
.stat-go {
  margin-left: auto; font-size: 22px; line-height: 1; color: var(--border-strong);
  transition: transform .25s, color .25s; transform: translateZ(10px);
}
.stat-card.clickable:hover .stat-go { color: var(--tone); transform: translateZ(10px) translateX(3px); }

/* ===== PANEL (dashboard table) ===== */
.panel { margin-top: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.online-title {
  font-size: 15px; margin: 0; color: var(--text); font-weight: 700;
  display: inline-flex; align-items: center; gap: 10px;
}
.online-dot {
  position: relative; width: 10px; height: 10px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.18);
}

/* ===== CARD ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-1); }
.card h2 { font-size: 16px; margin-bottom: 10px; color: var(--text); }
.card p { color: var(--text-2); line-height: 1.5; margin-bottom: 16px; }
.database-create-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 480px));
  gap: 18px; align-items: start;
}

/* ===== TABLE ===== */
.table-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: auto; box-shadow: var(--shadow-1);
}
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface-2); }
th {
  padding: 11px 14px; text-align: left; font-size: 11.5px; font-weight: 700; white-space: nowrap;
  color: var(--muted); text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface-2);
}
td { padding: 11px 14px; border-bottom: 1px solid #eef1f6; font-size: 13px; vertical-align: middle; color: var(--text-2); }
td strong { color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f6f9ff; }

/* ===== BADGE ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .2px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg); color: #b91c1c; }
.badge-warning { background: var(--warn-bg); color: var(--warn); }
.badge-muted   { background: #e5e7eb; color: #374151; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border: 1px solid transparent; border-radius: 9px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.2;
  transition: background .15s, box-shadow .15s, transform .1s, filter .15s, opacity .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #3b74f0, var(--brand)); color: #fff;
  box-shadow: 0 1px 2px rgba(29,78,216,.3), 0 4px 12px rgba(37,99,235,.22), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, var(--brand), var(--brand-600)); }
.btn-secondary { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: #b8c3d4; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.92); }
.btn-success   { background: #16a34a; color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(.92); }
.btn-ghost-light { background: rgba(255,255,255,.04); color: #cbd5e1; border-color: rgba(255,255,255,.1); }
.btn-ghost-light:hover { background: rgba(220,38,38,.16); border-color: rgba(248,113,113,.35); color: #fecaca; }
.btn-ico { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 11px; }
.btn-icon { background: none; padding: 5px 9px; color: var(--text-2); border-radius: 7px; }
.btn-icon:hover { color: var(--brand); background: var(--brand-50); }
.btn-danger-icon:hover { color: #fff !important; background: var(--danger) !important; }
.crm-action-pair { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 9px;
  font-family: inherit; font-size: 13px; color: var(--text); background: #fff; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.form-group input[readonly] { background: var(--surface-2); }
.form-group small { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.crm-kayit-picker { position: relative; display: grid; gap: 8px; }
.crm-kayit-tools { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 8px; }
.crm-kayit-dropdown {
  position: absolute; z-index: 25; top: 48px; left: 0; right: 0;
  max-height: 230px; overflow-y: auto; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-2); padding: 6px;
}
.crm-kayit-option,
.crm-kayit-empty {
  width: 100%; display: block; text-align: left; border: 0; background: transparent; color: var(--text);
  padding: 8px 9px; border-radius: 7px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.crm-kayit-option:hover,
.crm-kayit-option.selected { background: var(--brand-50); color: var(--brand-600); }
.crm-kayit-empty { color: var(--muted); cursor: default; }
.crm-kayit-picker small { margin-top: 0; text-align: right; }
.folder-picker-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.folder-list { display: grid; gap: 6px; margin-top: 12px; max-height: 360px; overflow: auto; }
.folder-row {
  width: 100%; justify-content: flex-start; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px;
}
.folder-row:hover { background: var(--brand-50); color: var(--brand-600); }
.folder-current { font-size: 12px; color: var(--text-2); word-break: break-all; }
.form-msg { margin-top: 12px; padding: 10px 14px; border-radius: 9px; font-size: 13px; }
.form-msg.ok  { background: var(--success-bg); color: var(--success); }
.form-msg.err { background: var(--danger-bg); color: #b91c1c; }

/* ===== SERVICE & API ===== */
.service-card, .api-card, .whatsapp-card { max-width: 980px; }
.service-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.service-head p { margin: 4px 0 0; }
.status-badge {
  display: inline-flex; align-items: center; min-height: 28px; padding: 5px 11px;
  border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.status-badge.ok { background: var(--success-bg); color: var(--success); }
.status-badge.warn { background: var(--warn-bg); color: var(--warn); }
.status-badge.err { background: var(--danger-bg); color: #b91c1c; }
.status-badge.muted { background: #e9edf3; color: #475569; }
.service-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.service-grid div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; min-width: 0; }
.service-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.service-grid strong { display: block; color: var(--text); font-size: 14px; word-break: break-word; }
.service-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.support-header { margin: 18px 0 10px; }
.support-header h2 { margin: 0; }
.support-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.support-choice {
  text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; cursor: pointer; color: var(--text); font-family: inherit;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
.support-choice:hover { border-color: var(--brand); background: var(--brand-50); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.support-choice strong { display: block; font-size: 15px; margin-bottom: 6px; }
.support-choice span { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.support-close-summary {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; margin-bottom: 14px;
}
.support-close-summary strong { display: block; margin-bottom: 4px; }
.support-close-summary span { color: var(--muted); font-size: 12px; }
.api-line { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; margin: 10px 0; }
.api-line span { color: var(--muted); font-size: 13px; }
.api-line code, .code-block {
  background: var(--navy-900); color: #e2e8f0; border-radius: 9px; padding: 10px 12px;
  overflow: auto; font-family: var(--mono); font-size: 12px; line-height: 1.55;
}
.code-block { margin: 8px 0 18px; white-space: pre-wrap; }
.plain-wrap { box-shadow: none; margin: 10px 0 18px; }
.whatsapp-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; margin: 18px 0; align-items: start; }
.whatsapp-qr-box {
  min-height: 330px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); padding: 14px;
}
.whatsapp-qr-box img { width: 300px; height: 300px; object-fit: contain; background: #fff; border-radius: 8px; }
.whatsapp-qr-empty { color: var(--muted); font-size: 14px; font-weight: 700; text-align: center; }
.whatsapp-live h2 { margin-top: 0; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6, 11, 23, .55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  perspective: 1200px;
}
.modal-overlay:not(.hidden) .modal-box { animation: modalIn .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) rotateX(10deg) scale(.98); } }
.modal-box {
  background: #fff; border-radius: 16px; width: 560px; max-width: 95vw;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-3); border: 1px solid var(--border);
}
.modal-header {
  padding: 18px 22px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 17px; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted);
  line-height: 1; width: 32px; height: 32px; border-radius: 8px;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 16px 16px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--navy-800); color: #fff; padding: 13px 18px;
  border-radius: 12px; font-size: 13.5px; z-index: 2000;
  box-shadow: 0 12px 30px rgba(2,6,23,.3); max-width: 380px;
  border-left: 4px solid var(--brand-400);
  animation: toastIn .3s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
.toast.success { border-left-color: #4ade80; }
.toast.error   { border-left-color: #f87171; }

/* ===== UTIL ===== */
.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1280px) {
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; gap: 28px; max-width: 480px; padding-top: 32px; }
  .hero-stage, .hero-lead { display: none; }
  .brand-row { margin-bottom: 18px; }
  .hero-title { font-size: 26px; }
}
@media (max-width: 820px) {
  body { font-size: 13px; }
  .app-screen { display: block; min-height: 100vh; }
  .sidebar {
    width: 100%; min-height: 0; height: auto; position: sticky; top: 0; z-index: 50;
    display: block; box-shadow: 0 4px 18px rgba(0,0,0,.18);
  }
  .sidebar-header { padding: 10px 12px; gap: 8px; }
  .sidebar-logo { width: 34px; height: 34px; border-radius: 8px; }
  .sidebar-title { font-size: 14px; }
  .sidebar-nav {
    display: flex; gap: 6px; overflow-x: auto; padding: 8px 8px 10px;
    scrollbar-width: thin; -webkit-overflow-scrolling: touch;
  }
  .nav-group { display: none; }
  .sidebar-nav li { padding: 0; flex: 0 0 auto; }
  .nav-link { padding: 8px 10px; white-space: nowrap; font-size: 12px; gap: 6px; }
  .nav-link.active::before { display: none; }
  .nav-ico { width: 16px; height: 16px; }
  .sidebar-footer { display: none; }
  .main-content { padding: 16px 12px 28px; overflow: visible; }
  .tab-section h1 { font-size: 18px; margin-bottom: 14px; }
  .dash-hero { grid-template-columns: 1fr; padding: 22px 20px; }
  .dash-hero-visual { display: none; }
  .tab-section h1.dash-title { font-size: 22px; }
  .section-header { align-items: stretch; flex-direction: column; gap: 10px; margin-bottom: 14px; }
  .section-actions { justify-content: stretch; }
  .section-actions .btn, .section-header > .btn { width: 100%; justify-content: center; }
  .stat-cards { gap: 10px; }
  .stat-card { padding: 14px 12px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; border-radius: 10px; }
  .stat-icon svg { width: 18px; height: 18px; }
  .stat-val { font-size: 22px; }
  .stat-lbl { font-size: 11px; }
  .stat-go { display: none; }
  .crm-filter-bar,
  .crm-kayit-tools,
  .whatsapp-layout,
  .database-create-grid,
  .form-row,
  .folder-picker-row,
  .api-line,
  .support-choice-grid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .database-create-grid { gap: 12px; }
  .table-wrap { max-width: calc(100vw - 24px); overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 760px; }
  th, td { padding: 9px 10px; font-size: 12px; }
  .btn { min-height: 36px; padding: 8px 12px; font-size: 12px; }
  .btn-icon { min-height: 32px; padding: 6px 8px; }
  .form-group input,
  .form-group select,
  .form-group textarea { min-height: 38px; font-size: 13px; }
  .crm-kayit-dropdown { top: 88px; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box { width: 100%; max-width: 100vw; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-footer { border-radius: 0; }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; }
  .modal-footer .btn { flex: 1; justify-content: center; }
  .toast { left: 10px; right: 10px; bottom: 10px; max-width: none; }
  .login-shell { padding: 24px 16px 12px; }
  .login-box-inner { padding: 28px 22px 22px; }
}
@media (max-width: 480px) {
  .main-content { padding: 12px 10px 24px; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .stat-card { flex-direction: column; align-items: flex-start; }
  .online-title { font-size: 13px; }
  table { min-width: 680px; }
  .service-head { flex-direction: column; }
  .service-actions .btn { width: 100%; justify-content: center; }
  .modal-footer { flex-direction: column-reverse; }
}

/* ===== HAREKET AZALTMA ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ===== v2: büyük logo + tek satır kutucuklar ===== */
.sidebar-header { flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 24px 16px 20px; }
.sidebar-logo { width: 104px; height: 104px; border-radius: 22px; padding: 6px; box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.sidebar-brand { align-items: center; }
.sidebar-title { font-size: 16px; letter-spacing: .3px; }

.stat-cards { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.stat-card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 14px 14px; }
.stat-card .stat-icon { width: 38px; height: 38px; border-radius: 10px; }
.stat-card .stat-icon svg { width: 19px; height: 19px; }
.stat-card .stat-lbl { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stat-card .stat-info { width: 100%; }
.stat-card .stat-val { font-size: 26px; }
.stat-card .stat-go { position: absolute; top: 14px; right: 12px; margin: 0; }
@media (max-width: 1500px) and (min-width: 821px) {
  .stat-cards { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 14px 11px 12px; }
  .stat-card .stat-val { font-size: 22px; }
  .stat-card .stat-lbl { font-size: 11px; }
  .stat-card .stat-go { display: none; }
}
@media (max-width: 1180px) and (min-width: 821px) {
  .stat-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .sidebar-header { flex-direction: row; text-align: left; padding: 10px 12px; }
  .sidebar-logo { width: 44px; height: 44px; border-radius: 10px; padding: 3px; }
  .sidebar-brand { align-items: flex-start; }
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== v3: kutucuklar karşılama alanının içinde ===== */
.dash-hero { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) 220px; gap: 28px; padding: 26px 30px; }
.dash-hero .dash-hero-visual { order: 3; }
.dash-hero .emblem { width: 190px; height: 190px; }
.dash-hero .stat-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; perspective: 900px; }
.dash-hero .stat-card {
  flex-direction: row; align-items: center; gap: 10px; padding: 12px 12px;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.dash-hero .stat-card:hover { background: rgba(255,255,255,.08); border-color: rgba(147,197,253,.3); box-shadow: 0 12px 28px rgba(0,0,0,.35); }
.dash-hero .stat-card::after { opacity: .9; top: 10px; bottom: 10px; border-radius: 0 3px 3px 0; }
.dash-hero .stat-card .stat-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: color-mix(in srgb, var(--tone) 22%, transparent); color: color-mix(in srgb, var(--tone) 45%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 40%, transparent);
}
.dash-hero .stat-card .stat-icon svg { width: 17px; height: 17px; }
.dash-hero .stat-card .stat-lbl { color: #9fb0cf; font-size: 11.5px; }
.dash-hero .stat-card .stat-val { color: #fff; font-size: 22px; }
.dash-hero .danger-stat .stat-val { color: color-mix(in srgb, var(--tone) 55%, #fff); }
.dash-hero .stat-card .stat-go { display: none; }
.dash-hero .tone-slate { --tone: #94a3b8; }
@media (max-width: 1500px) and (min-width: 821px) {
  .dash-hero { grid-template-columns: minmax(0, 1fr) 200px; }
  .dash-hero .stat-cards { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .dash-hero .stat-card { flex-direction: column; align-items: flex-start; }
  .dash-hero .dash-hero-visual { grid-row: 1; grid-column: 2; }
  .dash-hero .stat-card .stat-lbl { font-size: 11.5px; }
  .dash-hero .stat-card .stat-val { font-size: 22px; }
}
@media (max-width: 1180px) and (min-width: 821px) {
  .dash-hero .stat-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .dash-hero { grid-template-columns: 1fr; }
  .dash-hero .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.panel { margin-top: 0; }

.health-text small { max-width: 92px; margin-left: auto; margin-right: auto; line-height: 1.2; }

/* ===== AYARLAR ===== */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.settings-head p { margin-bottom: 8px; }
.settings-note code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-family: var(--mono); font-size: 12px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 0 2px; min-width: 0; }
.sidebar-user-av {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  box-shadow: 0 0 0 2px rgba(255,255,255,.08);
}
.sidebar-user b { display: block; color: #e2e8f0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user small { display: block; color: #7d8bab; font-size: 11.5px; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .settings-head { flex-direction: column; } .settings-head .btn { width: 100%; justify-content: center; } }

.settings-grid { grid-template-columns: minmax(0, 1fr) 380px; }
.settings-links { grid-column: 2; }
.settings-note { grid-column: 2; }
.settings-grid > .card:first-child { grid-row: span 2; }
.link-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; margin-top: 10px; }
.link-row span { font-size: 12px; color: var(--muted); font-weight: 600; }
.link-row code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.link-row a.btn { text-decoration: none; }
@media (max-width: 1100px) { .settings-links, .settings-note { grid-column: auto; } .settings-grid > .card:first-child { grid-row: auto; } }
@media (max-width: 560px) { .link-row { grid-template-columns: 1fr 1fr; } .link-row span, .link-row code { grid-column: 1 / -1; } }
.link-row { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 5px; margin-top: 12px; }
.link-row span { grid-column: 1 / -1; }
.link-row code { white-space: normal; word-break: break-all; }

/* ===== YETKİLER & ROLLER ===== */
.settings-grid { grid-template-columns: minmax(0, 1fr) 380px; }
.settings-grid > .card:first-child { grid-column: 1; grid-row: 1; }
.settings-roles { grid-column: 1; grid-row: 2; }
.settings-links { grid-column: 2; grid-row: 1; }
.settings-note { grid-column: 2; grid-row: 2; }
.settings-grid > .card:first-child { grid-row: 1; }
.perm-cell { max-width: 360px; }
.perm-chip {
  display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
  background: var(--brand-50); color: var(--brand-600); border: 1px solid #d6e4fd; white-space: nowrap;
}
.perm-chip.more { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.perm-chip.gold { background: #fbf5e6; color: #8a6a1f; border-color: #eedfb5; }
.perm-none { color: var(--muted); font-size: 12px; }
.role-pill {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: linear-gradient(180deg, #eef2ff, #e0e7ff); color: #3730a3; border: 1px solid #c7d2fe;
}
.root-row { background: linear-gradient(90deg, rgba(201,165,78,.07), transparent 60%); }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.perm-group { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.perm-group strong { display: block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.form-group .perm-item, .perm-item { display: flex; align-items: center; gap: 8px; padding: 5px 2px; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; margin: 0; }
.form-group .perm-item input, .perm-item input { width: 16px; height: 16px; min-height: 0; accent-color: var(--brand); flex: 0 0 auto; }
.perm-item.from-role { color: var(--muted); cursor: default; }
.perm-item em { font-style: normal; font-size: 11px; color: #4f46e5; }
.perm-tools { display: flex; gap: 8px; margin-top: 10px; }
.stat-card.no-access { cursor: default; }
.stat-card.no-access .stat-go { display: none; }
.modal-box:has(.perm-grid) { width: 680px; }
@media (max-width: 1100px) {
  .settings-grid > .card, .settings-roles, .settings-links, .settings-note { grid-column: auto !important; grid-row: auto !important; }
}
@media (max-width: 640px) { .perm-grid { grid-template-columns: 1fr; } }

/* cPanel kart */
#cpanelCard .settings-head .btn{white-space:nowrap;flex:0 0 auto}
#cpanelCard code{word-break:normal;overflow-wrap:anywhere}

/* Marka / lisans yeri rozetleri */
.marka-badge{display:inline-block;padding:1px 8px;border-radius:999px;font-size:.72rem;font-weight:700;letter-spacing:.02em;vertical-align:middle;line-height:1.6}
.marka-gokyil{background:#dbeafe;color:#1d4ed8}
.marka-foodtag{background:#ffedd5;color:#c2410c}
.marka-cpanel{background:#dcfce7;color:#15803d}
.marka-dizin{background:#e2e8f0;color:#334155}
.marka-checks{display:flex;gap:18px;flex-wrap:wrap;padding:6px 0}
.marka-checks label{display:flex;align-items:center;gap:8px;font-weight:500;cursor:pointer}
.marka-checks input{width:auto}

#cpanelCard .cpanel-url-row{display:flex;gap:8px;flex-wrap:wrap}
#cpanelCard .cpanel-url-row input{flex:1 1 220px;min-width:0}

/* ===== AYARLAR SEKMELERİ ===== */
.settings-tabs{display:flex;gap:6px;margin:0 0 18px;padding:5px;background:var(--surface-2);border:1px solid var(--border);border-radius:12px;width:max-content;max-width:100%;flex-wrap:wrap}
.settings-tab{border:0;background:transparent;color:var(--muted);font:inherit;font-size:13.5px;font-weight:700;padding:9px 16px;border-radius:9px;cursor:pointer;transition:background .15s,color .15s,box-shadow .15s}
.settings-tab:hover{color:var(--text)}
.settings-tab.active{background:#fff;color:var(--brand-600);box-shadow:0 1px 2px rgba(15,23,42,.08),0 4px 12px rgba(37,99,235,.10)}
.settings-pane[hidden]{display:none!important}
.cpanel-pane #cpanelCard{max-width:820px}
.cpanel-pane .link-row{grid-template-columns:200px minmax(0,1fr) auto;row-gap:0}
.cpanel-pane .link-row span{grid-column:auto}
@media (max-width:700px){.cpanel-pane .link-row{grid-template-columns:minmax(0,1fr) auto;row-gap:5px}.cpanel-pane .link-row span{grid-column:1/-1}}

/* ===== MOBİL: soldan açılır kapanır menü ===== */
.mobile-topbar, .mobile-menu-backdrop { display: none; }
@media (max-width: 820px) {
  .mobile-topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 60;
    padding: 10px 12px; background: linear-gradient(180deg, #0f1a33, #0b1426); color: #e2e8f0;
    box-shadow: 0 4px 18px rgba(0,0,0,.22);
  }
  .mobile-menu-btn {
    width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; cursor: pointer;
    border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #fff;
  }
  .mobile-menu-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  .mobile-topbar-logo { width: 36px; height: 36px; border-radius: 9px; background: #fff; padding: 2px; object-fit: contain; }
  .mobile-topbar-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
  .mobile-topbar-title b { font-size: 15px; color: #fff; }
  .mobile-topbar-title span { font-size: 12px; color: #93a4c3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .app-screen .sidebar {
    position: fixed !important; top: 0; left: 0; bottom: 0; z-index: 80;
    width: min(290px, 84vw) !important; height: 100vh !important; height: 100dvh !important;
    display: flex !important; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateX(-105%); transition: transform .25s ease; box-shadow: 8px 0 30px rgba(0,0,0,.35);
  }
  .app-screen.menu-open .sidebar { transform: translateX(0); }
  .app-screen .sidebar .sidebar-nav { display: block !important; overflow: visible !important; padding: 8px 10px !important; flex: 1 1 auto; }
  .app-screen .sidebar .nav-group { display: block !important; }
  .app-screen .sidebar .sidebar-nav li { flex: none; }
  .app-screen .sidebar .nav-link { padding: 11px 12px !important; font-size: 14px !important; gap: 10px !important; }
  .app-screen .sidebar .nav-ico { width: 18px !important; height: 18px !important; }
  .app-screen .sidebar .sidebar-footer { display: block !important; }
  .mobile-menu-backdrop {
    display: block; position: fixed; inset: 0; z-index: 70; background: rgba(2,6,23,.55);
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  .app-screen.menu-open .mobile-menu-backdrop { opacity: 1; pointer-events: auto; }
  body.menu-locked { overflow: hidden; }
}

/* ===== MOBİL: tablolar kart görünümünde ===== */
@media (max-width: 820px) {
  body { font-size: 14px; }
  .main-content { padding: 14px 12px 32px !important; }
  .tab-section h1 { font-size: 21px !important; }
  .table-wrap { max-width: none !important; overflow: visible !important; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; }
  table.mk { min-width: 0 !important; width: 100%; border-collapse: separate; border-spacing: 0; background: transparent; }
  table.mk thead { display: none; }
  table.mk tbody, table.mk tr, table.mk td { display: block; }
  table.mk tbody tr {
    background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 6px 14px 8px; margin: 0 0 12px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 16px rgba(15,23,42,.05);
  }
  table.mk tbody tr:hover { background: #fff; }
  table.mk td {
    position: relative; padding: 9px 0 9px 38% !important; min-height: 36px; border: 0 !important; border-bottom: 1px dashed #e5e9f2 !important;
    font-size: 14px !important; line-height: 1.4; text-align: left !important; white-space: normal !important; overflow-wrap: anywhere; max-width: none !important;
  }
  table.mk td::before {
    content: attr(data-label); position: absolute; left: 0; top: 10px; width: 34%;
    font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #64748b; line-height: 1.3;
  }
  table.mk td:first-child { padding: 10px 0 10px 0 !important; font-size: 16px !important; font-weight: 700; border-bottom: 1px solid #e5e9f2 !important; }
  table.mk td:first-child::before { position: static; display: block; width: auto; margin-bottom: 3px; }
  table.mk td:last-child { border-bottom: 0 !important; }
  table.mk td.td-actions { padding: 12px 0 4px !important; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
  table.mk td.td-actions::before { content: none; }
  table.mk td.td-actions .btn, table.mk td.td-actions button { min-height: 40px; min-width: 44px; }
  table.mk td.td-full { padding: 18px 0 !important; text-align: center !important; color: var(--muted); border: 0 !important; }
  table.mk td.td-full::before { content: none; }
  table.mk td.td-bos { display: none; }
  table.mk small { font-size: 12.5px; }
  /* Gösterge kutularındaki yazılar kesilmesin */
  .stat-card .stat-lbl, .dash-hero .stat-card .stat-lbl { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; font-size: 12px !important; line-height: 1.25; }
  .dash-hero .stat-card { padding: 12px !important; }
  .settings-tabs { width: 100%; }
  .settings-tab { flex: 1 1 auto; text-align: center; }
}

/* Ayarlar: dar ekranda kartlar alt alta (üst üste binmesin) */
@media (max-width: 1100px) {
  .settings-grid { display: block !important; }
  .settings-grid > .card { margin-bottom: 18px; }
}
@media (max-width: 820px) {
  .link-row { grid-template-columns: minmax(0,1fr) auto auto !important; }
  .link-row span, .link-row code { grid-column: 1 / -1 !important; }
  .link-row .btn { justify-self: start; }
}

.marka-badge.marka-yonetici{background:#ede9fe;color:#5b21b6}

/* CRM randevu + WhatsApp kullanicilari */
.randevu-row .randevu-bilgi{display:flex;align-items:flex-end}
.randevu-row .randevu-bilgi small{color:#475569;line-height:1.45;padding-bottom:8px}
.randevu-gitti{color:#15803d;font-weight:600}
.randevu-chip{display:inline-block;margin-top:3px;padding:1px 8px;border-radius:999px;background:#e0f2fe;color:#075985;font-size:.78rem;font-weight:600;white-space:nowrap}
.whatsapp-users-card{margin-top:18px}
.whatsapp-users-card .section-header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.whatsapp-users-card h2{margin:0 0 4px}
.whatsapp-users-card .muted-text{margin:0;color:#64748b;font-size:.88rem}

/* CRM teklif bolumu */
.randevu-bilgi{margin:-4px 0 12px}
.randevu-bilgi small{color:#475569;line-height:1.45}
.teklif-bolum{border:1px solid #fde68a;background:#fffbeb;border-radius:12px;padding:12px 14px 4px;margin-bottom:14px}
.teklif-bolum.hidden{display:none}
.teklif-baslik{font-weight:700;color:#92400e;margin-bottom:8px}
.teklif-foto-butonlar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.teklif-foto-btn{cursor:pointer;margin:0}
.teklif-foto-butonlar small{color:#64748b}
.teklif-fotolar{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.teklif-foto{position:relative;width:88px;height:88px;border-radius:10px;overflow:hidden;border:1px solid #e2e8f0;background:#fff}
.teklif-foto img{width:100%;height:100%;object-fit:cover;display:block}
.teklif-foto-sil{position:absolute;top:3px;right:3px;width:24px;height:24px;border-radius:50%;border:0;background:rgba(15,23,42,.75);color:#fff;font-size:16px;line-height:22px;cursor:pointer;padding:0}
.teklif-ozet{color:#92400e;font-weight:600}
.badge-info{background:#e0f2fe;color:#075985}
.crm-gecmis{margin-top:6px;font-size:.78rem}
.crm-gecmis summary{cursor:pointer;color:#1d4ed8;font-weight:600}
.crm-gecmis-satir{display:block;width:100%;text-align:left;background:none;border:0;border-left:2px solid #cbd5e1;padding:2px 0 2px 8px;margin-top:3px;color:#334155;font:inherit;cursor:pointer;white-space:nowrap}
.crm-gecmis-satir:hover{color:#1d4ed8;border-left-color:#1d4ed8}

.teklif-tutar{display:flex;gap:8px}
.teklif-tutar input{flex:1;min-width:0}
.teklif-tutar select{width:110px;flex:none}

/* WhatsApp sekmeleri + bildirim ayarlari */
.wa-tabs{display:flex;gap:6px;margin:4px 0 14px;border-bottom:1px solid #e2e8f0}
.wa-tab{background:none;border:0;border-bottom:3px solid transparent;padding:9px 16px;font:inherit;font-weight:600;color:#64748b;cursor:pointer;margin-bottom:-1px}
.wa-tab.active{color:#1d4ed8;border-bottom-color:#1d4ed8}
.wa-pane.hidden{display:none}
.wa-bildirim-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.wa-bildirim-head h2{margin:0 0 4px}
.wa-bildirim-head .muted-text{margin:0;color:#64748b;font-size:.88rem}
.wa-anahtar{display:flex;align-items:center;gap:8px;font-weight:600;background:#f0fdf4;border:1px solid #bbf7d0;padding:8px 12px;border-radius:10px;cursor:pointer}
.wa-anahtar input{width:18px;height:18px}
.wa-admin-bilgi{display:grid;grid-template-columns:1fr 2fr;gap:14px;align-items:end;margin-bottom:14px}
.wa-admin-bilgi>div:first-child{background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:10px 12px}
.wa-admin-bilgi span{display:block;font-size:.78rem;color:#64748b}
.wa-admin-bilgi strong{display:block;margin:2px 0}
.wa-admin-bilgi small{color:#94a3b8;font-size:.74rem}
.wa-tablo td,.wa-tablo th{vertical-align:middle}
.wa-tablo th:not(:first-child),.wa-tablo td:not(:first-child){text-align:center}
.wa-cb input{width:20px;height:20px;cursor:pointer}
.wa-yok{color:#cbd5e1}
.wa-ornek{white-space:nowrap}
.wa-sayi{width:72px;padding:6px 8px;border:1px solid #cbd5e1;border-radius:8px;text-align:center}
@media (max-width:820px){.wa-admin-bilgi{grid-template-columns:1fr}.wa-tablo th:not(:first-child),.wa-tablo td:not(:first-child){text-align:left}}

/* ===== Lisanslar: müşteri bazında gruplu görünüm ===== */
.lg-toolbar{display:flex;align-items:center;gap:12px;margin:0 0 12px;flex-wrap:wrap}
.lg-toolbar input[type=search]{flex:1 1 280px;max-width:420px;padding:9px 12px;border:1px solid var(--border-strong);border-radius:10px;background:#fff;font-size:14px}
.lg-toolbar input[type=search]:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-50)}
.lg-sayac{color:var(--muted);font-size:13px;margin-right:auto}
#lisanslarTable tr.lg-grup{cursor:pointer}
#lisanslarTable tr.lg-grup td{padding-top:12px;padding-bottom:12px;vertical-align:middle}
#lisanslarTable tr.lg-grup:hover td{background:var(--surface-2)}
#lisanslarTable tr.lg-grup.acik td{background:var(--brand-50);border-bottom-color:transparent}
.lg-firma{display:flex;align-items:center;gap:10px}
.lg-chev{flex:0 0 auto;display:inline-flex;width:24px;height:24px;border-radius:7px;align-items:center;justify-content:center;background:var(--brand-50);color:var(--brand);font-size:17px;font-weight:700;line-height:1;transition:transform .18s ease}
.lg-grup.acik .lg-chev{transform:rotate(90deg);background:var(--brand);color:#fff}
.lg-say{margin-left:4px;font-size:11px;font-weight:700;padding:2px 8px;border-radius:999px;background:#eef2f7;color:#475569;white-space:nowrap}
.lg-prg{display:inline-block;font-size:11.5px;padding:2px 8px;border-radius:6px;background:#f1f5f9;color:#334155;margin:2px 4px 2px 0;white-space:nowrap}
.lg-prg-fazla{background:#e2e8f0;font-weight:700}
.lg-yakin{font-size:13px;color:var(--text-2)}
.lg-yakin.uyari{color:var(--warn);font-weight:700}
.lg-durum{display:inline-block;font-size:11px;font-weight:700;padding:3px 8px;border-radius:999px;margin:2px 4px 2px 0;white-space:nowrap}
.lg-durum.aktif{background:var(--success-bg);color:var(--success)}
.lg-durum.pasif{background:var(--danger-bg);color:var(--danger)}
#lisanslarTable tr.lg-alt td{background:#fbfcfe;font-size:13px;padding-top:7px;padding-bottom:7px}
#lisanslarTable tr.lg-alt td:first-child{border-left:3px solid var(--brand)}
#lisanslarTable tr.lg-alt.gizli{display:none !important}
.lg-ac-btn{white-space:nowrap}
@media (max-width: 820px){
  #lisanslarTable tr.lg-alt{margin-left:14px !important;border-left:3px solid var(--brand) !important}
  #lisanslarTable tr.lg-alt td:first-child{border-left:0}
  #lisanslarTable tr.lg-grup.acik{margin-bottom:6px !important}
  .lg-toolbar input[type=search]{max-width:none}
}
