/* =====================================================================
   FerdiSoft WhatsApp Gateway — arayüz
   Marka: FerdiSoft mavisi (#0747B5 → #38A3FF) + turuncu vurgu (#FFB224)
   Geçit yeşili yalnızca WhatsApp bağlantı durumlarını işaret eder.
   CSP: satır içi stil yok; tüm görünüm bu dosyada.
   ===================================================================== */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #070d1a; --bg-2: #0a1224; --surface: #0e1729; --surface-2: #121d33; --surface-3: #18253f;
  --border: #1c2a45; --border-2: #263757; --text: #e6edf7; --text-2: #b6c3d9; --muted: #7f8fa9;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -14px rgba(0,0,0,.65);
  --ring: 0 0 0 3px rgba(56,163,255,.35);
  --hero-grid: rgba(255,255,255,.045);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fb; --bg-2: #ffffff; --surface: #ffffff; --surface-2: #f6f8fc; --surface-3: #edf2f9;
  --border: #e3e9f2; --border-2: #d3dce9; --text: #0f1b2d; --text-2: #3a4a63; --muted: #6b7a93;
  --shadow: 0 1px 2px rgba(15,27,45,.05), 0 10px 26px -14px rgba(15,27,45,.2);
  --ring: 0 0 0 3px rgba(11,108,240,.22);
}
:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --r: 14px; --r-sm: 10px; --r-xs: 8px;
  --brand-900: #062f7a; --brand-700: #0747b5; --brand-500: #0b6cf0; --brand-300: #38a3ff; --accent: #ffb224;
  --wa: #22c55e; --wa-600: #16a34a; --wa-300: #4ade80;
  --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444; --info: #38bdf8; --idle: #94a3b8;
  --tone: var(--brand-300);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--brand-300); text-decoration: none; }
a:hover { text-decoration: underline; }
[data-theme="light"] a { color: var(--brand-500); }
img { max-width: 100%; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
.ic { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.break { word-break: break-word; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- tonlar */
.tone-ok { --tone: var(--ok); } .tone-warn { --tone: var(--warn); } .tone-bad { --tone: var(--bad); }
.tone-info { --tone: var(--info); } .tone-idle { --tone: var(--idle); } .tone-brand { --tone: var(--brand-300); }
.tone-wa { --tone: var(--wa); } .tone-accent { --tone: var(--accent); }
.tone-fail { --tone: var(--bad); }

/* ---------------------------------------------------------------- iskelet */
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; background: var(--bg-2); border-right: 1px solid var(--border); padding: 18px 14px; overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 16px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 8px 18px -8px rgba(11,108,240,.7); }
.brand strong { display: block; font-size: 15.5px; letter-spacing: .01em; color: var(--text); }
.brand small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--wa-300); font-weight: 600; }
[data-theme="light"] .brand small { color: var(--wa-600); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 2.2s infinite; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 12px 11px 6px; font-weight: 700; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--text-2); font-weight: 550; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); background: linear-gradient(90deg, rgba(11,108,240,.2), rgba(11,108,240,.04)); box-shadow: inset 2px 0 0 var(--brand-300); }
.nav a.active .ic { color: var(--brand-300); }
.nav .tag { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.sidebar-foot { margin-top: auto; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); display: grid; gap: 8px; }
.sidebar-foot .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.sidebar-overlay { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px; min-height: 64px; background: var(--bg); background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 17px; font-weight: 700; }
.topbar .crumb { font-size: 12px; color: var(--muted); }
.topbar-title { min-width: 0; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.burger { display: none; }
.content { padding: 26px 28px 40px; width: 100%; max-width: 1440px; }
.foot { margin-top: auto; padding: 18px 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }

/* kullanıcı menüsü */
.user-btn { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px 0 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--brand-300)); }
.user-btn .who { display: grid; text-align: left; line-height: 1.15; }
.user-btn .who b { font-size: 13px; }
.user-btn .who span { font-size: 11px; color: var(--muted); }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow); z-index: 50; }
.menu[hidden] { display: none; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; border: 0; background: none; color: var(--text-2); font: inherit; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.menu .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu .danger { color: #fca5a5; }
[data-theme="light"] .menu .danger { color: #b91c1c; }

/* ---------------------------------------------------------------- bileşenler */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-head h2 { font-size: 22px; font-weight: 750; }
.page-head p { color: var(--muted); margin-top: 4px; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.mt { margin-top: 16px; } .mt-lg { margin-top: 24px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-head h3 .ic { color: var(--muted); }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-body { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.kpi-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--tone); background: rgba(56,163,255,.12); background: color-mix(in srgb, var(--tone) 14%, transparent); flex: none; }
.kpi-ic .ic { width: 20px; height: 20px; }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi-val { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-val.sm { font-size: 17px; line-height: 1.5; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; color: var(--tone); background: rgba(56,163,255,.12); background: color-mix(in srgb, var(--tone) 13%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent); white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.live .dot { animation: pulse 2s infinite; }
.badge.plain { color: var(--text-2); --tone: var(--idle); }
.pill-engine { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.pill-engine .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 22%, transparent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap; transition: transform .06s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #1f80ff, #0b6cf0); border-color: transparent; color: #fff !important; box-shadow: 0 8px 18px -8px rgba(11,108,240,.75); }
.btn-primary:hover { background: linear-gradient(180deg, #3590ff, #0f72f5); border-color: transparent; }
.btn-wa { background: linear-gradient(180deg, #2ad06a, #16a34a); border-color: transparent; color: #fff !important; }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: #fca5a5; }
[data-theme="light"] .btn-danger { color: #b91c1c; }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn.is-loading { pointer-events: none; opacity: .9; }
.btn.is-loading::before { content: ""; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* formlar */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.label { font-size: 13px; font-weight: 650; color: var(--text-2); }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 96px; padding: 10px 13px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-300); box-shadow: var(--ring); }
.input[readonly] { color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); }
.input-group { position: relative; }
.input-group .input { padding-right: 46px; }
.input-addon { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.input-addon:hover { color: var(--text); background: var(--surface-3); }
.input-addon .eye-off { display: none; }
.input-addon.on .eye { display: none; }
.input-addon.on .eye-off { display: block; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* uyarılar */
.alert { display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--tone) 32%, transparent); background: color-mix(in srgb, var(--tone) 9%, transparent); color: var(--text); font-size: 13.5px; }
.alert > .ic { color: var(--tone); margin-top: 1px; }
.alert b { font-weight: 700; }
.alert + .alert { margin-top: 10px; }

/* tablolar */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }

/* listeler */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; }
.list .l-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, transparent); }
.list .l-ic .ic { width: 16px; height: 16px; }
.list .l-main { min-width: 0; flex: 1; }
.list .l-title { font-weight: 600; font-size: 13.5px; }
.list .l-sub { font-size: 12px; color: var(--muted); }
.list .l-time { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* boş durum */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 34px 18px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; color: var(--border-2); }
.empty b { color: var(--text-2); font-size: 14px; }
.empty p { font-size: 13px; max-width: 46ch; }

/* sekmeler */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 650; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-color: var(--brand-300); }

/* toast */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 100; width: min(390px, calc(100vw - 36px)); }
.toast { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 12px 40px 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow); animation: toast-in .22s ease; overflow: hidden; font-size: 13.5px; }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone); }
.toast .t-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--tone); flex: none; }
.toast .t-close { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.toast .t-close:hover { background: var(--surface-3); color: var(--text); }
.toast.out { animation: toast-out .2s ease forwards; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 18px; background: rgba(3,7,18,.62); backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.modal-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); padding: 22px; animation: toast-in .18s ease; }
.modal-card h3 { font-size: 16px; display: flex; gap: 10px; align-items: center; }
.modal-card p { color: var(--text-2); margin: 10px 0 18px; }
.modal-card .btn-row { justify-content: flex-end; }

/* ---------------------------------------------------------------- genel bakış */
.engine-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 20px 22px; border-radius: 16px; border: 1px solid var(--border); background: radial-gradient(600px 200px at 0% 0%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 70%), var(--surface); box-shadow: var(--shadow); }
.engine-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 15%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent); }
.engine-ic .ic { width: 26px; height: 26px; }
.engine-card h3 { font-size: 18px; font-weight: 750; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.engine-card p { color: var(--text-2); margin-top: 4px; font-size: 13.5px; }
.engine-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.engine-meta b { color: var(--text-2); font-weight: 600; }

.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: 230px; }
.chart .gl { stroke: var(--border); stroke-width: 1; }
.chart .bar-out { fill: var(--brand-500); }
.chart .bar-in { fill: var(--wa); }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend .lo { background: var(--brand-500); } .legend .li { background: var(--wa); }

.meter-svg { display: block; width: 100%; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.meter-svg .m-ok { fill: var(--ok); } .meter-svg .m-warn { fill: var(--warn); } .meter-svg .m-fail { fill: var(--bad); } .meter-svg .m-info { fill: var(--idle); }
.counts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------------------------------------------------------------- tanılama */
.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 20px 22px; }
.verdict .engine-ic { width: 48px; height: 48px; }
.verdict h3 { font-size: 16.5px; }
.verdict p { color: var(--text-2); margin-top: 6px; font-size: 13.5px; }
.check { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, auto); gap: 12px; align-items: start; padding: 12px 18px; border-top: 1px solid var(--border); }
.check:first-child { border-top: 0; }
.check-ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); margin-top: 1px; }
.check-ic .ic { width: 14px; height: 14px; }
.check-title { font-weight: 650; font-size: 13.5px; }
.check-detail { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.check-val { font-size: 13px; color: var(--text-2); text-align: right; max-width: 42ch; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- yakında modülü */
.roadmap { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.roadmap li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); }
.roadmap li .ic { color: var(--brand-300); margin-top: 2px; }

/* ---------------------------------------------------------------- giriş sayfası */
.auth-body { background: var(--bg); }
.auth { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; padding: 38px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; color: #e6edf7;
  background:
    radial-gradient(900px 520px at -8% -12%, rgba(56,163,255,.38), transparent 62%),
    radial-gradient(760px 460px at 112% 112%, rgba(34,197,94,.24), transparent 58%),
    linear-gradient(160deg, #050f29 0%, #0a1f4d 55%, #062f7a 100%); }
.auth-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(var(--hero-grid) 1px, transparent 1px), linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%); }
.auth-hero > * { position: relative; }
.hero-logo { height: 40px; width: auto; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.chip-wa { color: #86efac; background: rgba(34,197,94,.12); border: 1px solid rgba(74,222,128,.32); }
.hero-main h1 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; letter-spacing: -.03em; margin: 18px 0 14px; line-height: 1.08; }
.hero-main h1 em { font-style: normal; background: linear-gradient(90deg, #7cc4ff, #38a3ff 40%, #4ade80); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-main > p { color: #b9c7de; max-width: 54ch; font-size: 15px; }
.hero-diagram { margin: 26px 0 8px; max-width: 560px; }
.hero-diagram svg { width: 100%; height: auto; display: block; }
.hd-node { fill: rgba(255,255,255,.06); stroke: rgba(255,255,255,.18); }
.hd-hub { fill: url(#hubg); stroke: rgba(124,196,255,.55); }
.hd-phone { fill: rgba(34,197,94,.14); stroke: rgba(74,222,128,.6); }
.hd-line { stroke: rgba(148,197,255,.35); stroke-width: 1.6; fill: none; }
.hd-flow { stroke: #7cc4ff; stroke-width: 2; fill: none; stroke-dasharray: 3 9; animation: flow 1.4s linear infinite; }
.hd-flow.wa { stroke: #4ade80; animation-duration: 1.1s; }
.hd-txt { fill: #dbe7f7; font: 600 12px var(--font); }
.hd-sub { fill: #8fa4c4; font: 500 10.5px var(--font); }
.hd-ic { stroke: #e6edf7; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hd-ic.wa { stroke: #86efac; }
.hero-points { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.hero-points li { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #cfdaeb; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
.hero-points .ic { width: 15px; height: 15px; color: #7cc4ff; }
.hero-foot { font-size: 12px; color: #8fa4c4; display: flex; flex-wrap: wrap; gap: 6px 16px; }

.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 36px 20px; }
.auth-card { width: min(430px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px 28px 24px; box-shadow: var(--shadow); }
.auth-card-head { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.gw-mark { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #16a34a, #22c55e 55%, #4ade80); box-shadow: 0 10px 22px -10px rgba(34,197,94,.8); flex: none; }
.gw-mark .ic { width: 24px; height: 24px; }
.auth-card-head h2 { font-size: 19px; font-weight: 750; }
.auth-card-head p { font-size: 13px; color: var(--muted); }
.auth-card .form { gap: 16px; }
.auth-card .alert { margin-bottom: 16px; }
.auth-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.auth-note .ic { width: 16px; height: 16px; margin-top: 2px; color: var(--brand-300); }
.auth-meta { width: min(430px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.tm-note { width: min(430px, 100%); font-size: 11.5px; color: var(--muted); text-align: center; opacity: .85; }

/* ---------------------------------------------------------------- kurulum */
.install { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; max-width: 1120px; margin: 0 auto; padding: 32px 20px 48px; }
.install-side { display: grid; gap: 18px; align-content: start; }
.install-brand { display: flex; align-items: center; gap: 12px; }
.install-brand img { width: 42px; height: 42px; border-radius: 12px; }
.install-brand b { display: block; font-size: 15px; }
.install-brand span { font-size: 12px; color: var(--wa-300); font-weight: 650; }
.steps { list-style: none; margin: 0; padding: 8px; display: grid; gap: 2px; }
.steps li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-size: 13.5px; font-weight: 550; }
.steps li.done { color: var(--text-2); }
.steps li.current { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--brand-300); }
.step-no { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 750; background: var(--surface-3); color: var(--muted); flex: none; }
.steps li.done .step-no { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.steps li.current .step-no { background: var(--brand-500); color: #fff; }

/* ---------------------------------------------------------------- hata sayfası */
.page-error { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.error-box { width: min(460px, 100%); text-align: center; padding: 34px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.error-code { font-size: 46px; font-weight: 800; letter-spacing: -.04em; background: linear-gradient(90deg, var(--brand-300), var(--wa)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-box h1 { font-size: 19px; margin: 8px 0; }
.error-box p { color: var(--text-2); margin-bottom: 18px; }
.error-box .ref { font-size: 12.5px; color: var(--muted); }

/* entegrasyon / API (FAZ 4-5) */
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.fieldset { border: 0; padding: 0; margin: 0; }
.fieldset legend { margin-bottom: 8px; }
.checks-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.checks-grid.one { grid-template-columns: minmax(0, 1fr); }
.check-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.check-opt:hover { border-color: var(--border-2); }
.check-opt.inline { display: inline-flex; }
.check-opt input { margin-top: 3px; accent-color: var(--brand-500); width: 16px; height: 16px; flex: none; }
.check-opt b { display: block; font-size: 13px; font-weight: 650; }
.check-opt code { font-size: 11px; }
.secret-card { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.secret-box { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--border-2); }
.secret-box code { flex: 1; min-width: 0; background: none; padding: 0; font-size: 14px; color: var(--text); }
.danger-zone { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.wh-item + .wh-item { border-top: 1px solid var(--border); }
pre.code { margin: 0; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: var(--text-2); overflow-x: auto; white-space: pre; }
.page-head h2 .badge { vertical-align: middle; margin-left: 6px; }
@media (max-width: 720px) { .checks-grid { grid-template-columns: minmax(0, 1fr); } .secret-box { flex-direction: column; align-items: stretch; } }

/* kullanıcılar */
.user-item + .user-item { border-top: 1px solid var(--border); }
.user-main { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.user-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.user-form .field { min-width: 180px; }
.check-opt .small.muted { display: block; font-weight: 400; margin-top: 2px; }

/* mesaj merkezi (FAZ 7) */
.ic.sm { width: 14px; height: 14px; }
.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; font-size: 11px; font-weight: 750; color: var(--text); background: color-mix(in srgb, var(--warn) 26%, transparent); vertical-align: 1px; }
.filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) auto; gap: 12px; align-items: end; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.filters .input, .filters .select { height: 38px; font-size: 13.5px; }
.filters-actions { display: flex; gap: 8px; }
.filters-actions .btn { height: 38px; }
.list-meta { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--border); }
.list-meta b { color: var(--text-2); }
.msg-table td { vertical-align: middle; }
.msg-cell { max-width: 460px; }
.msg-preview { display: flex; gap: 8px; align-items: center; color: var(--text-2); }
.msg-preview:hover { color: var(--text); text-decoration: none; }
.msg-preview .badge { flex: none; gap: 5px; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 14px 18px; border-top: 1px solid var(--border); }
.pager-gap { align-self: center; color: var(--muted); padding: 0 2px; }
.bubble { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.55; max-width: 62ch; border: 1px solid var(--border); background: var(--surface-2); }
.bubble.out { border-color: color-mix(in srgb, var(--brand-500) 35%, transparent); background: color-mix(in srgb, var(--brand-500) 10%, var(--surface-2)); border-top-right-radius: 4px; }
.bubble.in { border-color: color-mix(in srgb, var(--wa) 35%, transparent); background: color-mix(in srgb, var(--wa) 9%, var(--surface-2)); border-top-left-radius: 4px; }
.media-box { display: grid; gap: 10px; }
.msg-media { display: block; max-width: 100%; max-height: 420px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); }
audio.msg-media { width: 100%; max-width: 460px; border: 0; background: none; }
.media-meta { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); max-width: 520px; }
.media-meta > div { flex: 1; min-width: 0; }
.media-meta > .ic { color: var(--muted); }
.assign-form { display: grid; gap: 10px; max-width: 420px; }
.timeline { list-style: none; margin: 0; padding: 8px 18px 14px; display: grid; gap: 0; }
.timeline li { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.timeline li + li::before { content: ""; position: absolute; left: 13px; top: -6px; height: 14px; width: 2px; background: var(--border); }
.timeline li.todo { opacity: .6; }
.timeline b { font-size: 13.5px; font-weight: 650; }
.tl-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); }
.tl-ic .ic { width: 15px; height: 15px; }
.list li.current { background: color-mix(in srgb, var(--brand-500) 8%, transparent); }
.log-detail pre.code { max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 1280px) { .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } .filters-actions { grid-column: 1 / -1; } }
@media (max-width: 720px) { .filters { grid-template-columns: minmax(0, 1fr); } .msg-cell { max-width: none; } .list-meta { flex-direction: column; gap: 2px; } }

.qr-box { display: grid; justify-items: center; gap: 10px; padding: 16px; border-radius: 14px; background: #fff; color: #334155; max-width: 340px; margin: 0 auto; }
.qr-box[hidden], .empty[hidden] { display: none; }
.qr-box img { width: 280px; height: 280px; image-rendering: pixelated; }
.btn-row form { margin: 0; }

/* tema simgeleri: koyu temada güneş (açığa geç), açık temada ay */
[data-theme="dark"] .th-moon, :root:not([data-theme]) .th-moon { display: none; }
[data-theme="light"] .th-sun { display: none; }
.modal-card h3 .ic, .alert .ic.tone-warn { color: var(--tone); }
.hint[class*="tone-"] { color: var(--tone); }
.flip { transform: scaleX(-1); }
.mb { margin-bottom: 14px; }
h4.mt { font-size: 13.5px; color: var(--text-2); margin-bottom: 4px; }
.checks { border-top: 0; }
.card > .checks .check:first-child { border-top: 0; }
main.card > .card-body .checks { border: 1px solid var(--border); border-radius: 12px; }

/* ---------------------------------------------------------------- animasyon */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flow { to { stroke-dashoffset: -24; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------------------------------------------------------------- duyarlı */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 20px 0 50px -20px rgba(0,0,0,.6); }
  .sb-open .sidebar { transform: none; }
  .sb-open .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(3,7,18,.55); backdrop-filter: blur(2px); }
  .burger { display: inline-grid; }
  .cols-main, .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { padding: 26px 22px 28px; gap: 14px; }
  .hero-diagram, .hero-points, .hero-foot { display: none; }
  .hero-main h1 { font-size: 26px; margin: 12px 0 8px; }
  .hero-main > p { font-size: 13.5px; }
  .install { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar { padding: 10px 14px; }
  .content { padding: 18px 14px 32px; }
  .foot { padding: 16px 14px; }
  .user-btn .who, .pill-engine .pe-text { display: none; }
  .pill-engine { padding: 0 11px; }
  .kpis, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .engine-card { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px; }
  .engine-card .engine-ic { width: 44px; height: 44px; border-radius: 13px; }
  .engine-card .engine-ic .ic { width: 22px; height: 22px; }
  .check { grid-template-columns: 26px minmax(0, 1fr); }
  .check-val { grid-column: 2; text-align: left; max-width: none; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { padding: 8px 0; border-bottom: 1px solid var(--border); }
  .table.stack td { display: flex; justify-content: space-between; gap: 14px; border: 0; padding: 5px 16px; text-align: right; }
  .table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 650; text-align: left; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-card { padding: 22px 18px 18px; border-radius: 16px; }
}
