/* ============================================================
   Lexmerce Panel — Cloudflare-style design system
   ============================================================ */

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

:root {
  --brand:       #f6821f;   /* Cloudflare orange — marka rengi */
  --accent:      #1d4ed8;   /* Aksiyon mavisi */
  --accent-h:    #1e40af;
  --surface:     #fff;
  --bg:          #f8f8f8;
  --border:      #e2e2e2;
  --border-light:#efefef;
  --text:        #1a1a1a;
  --text-2:      #3d3d3d;
  --text-muted:  #767676;
  --text-faint:  #a0a0a0;
  --ok:          #16a34a;
  --ok-h:        #15803d;
  --ok-bg:       #f0fdf4;
  --ok-border:   #bbf7d0;
  --ok-text-strong: #166534;
  --warn:        #ca8a04;
  --warn-bg:     #fefce8;
  --warn-border: #fde68a;
  --bad:         #dc2626;
  --bad-bg:      #fff1f2;
  --bad-border:  #fecaca;
  --info-bg:     #eff6ff;
  --info-border: #bfdbfe;
  --info-text:   #1d4ed8;
  --radius:      6px;
  --radius-lg:   8px;

  /* Tekrarlayan hafif gri dolgu tonları — kod/rozet/hover arka planları */
  --fill-1: #f4f4f4;
  --fill-2: #f9f9f9;
  --fill-3: #e5e7eb;

  /* "Hedef domain" amber teması — Marka İzleme */
  --target:          #f59e0b;
  --target-bg:        #fef3c7;
  --target-bg-soft:   #fff7ed;
  --target-text:      #9a3412;
  --target-border:    #fde68a;

  --code-tint: rgba(0,0,0,.06);
}

/* ── Dark mode ────────────────────────────────────────────
   Öntanımlı olarak sistem tercihine uyulur; kullanıcı elle seçim
   yaparsa data-theme özniteliği bunu ezer (bkz. app.js / header script). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand:       #f6821f;
    --accent:      #3b82f6;
    --accent-h:    #60a5fa;
    --surface:     #1c1c1e;
    --bg:          #121214;
    --border:      #333336;
    --border-light:#29292b;
    --text:        #f0f0f0;
    --text-2:      #d0d0d0;
    --text-muted:  #9a9a9a;
    --text-faint:  #6f6f72;
    --ok:          #34d399;
    --ok-h:        #10b981;
    --ok-bg:       rgba(52,211,153,.12);
    --ok-border:   rgba(52,211,153,.3);
    --ok-text-strong: #6ee7b7;
    --warn:        #fbbf24;
    --warn-bg:     rgba(251,191,36,.12);
    --warn-border: rgba(251,191,36,.3);
    --bad:         #f87171;
    --bad-bg:      rgba(248,113,113,.12);
    --bad-border:  rgba(248,113,113,.3);
    --info-bg:     rgba(59,130,246,.14);
    --info-border: rgba(59,130,246,.32);
    --info-text:   #60a5fa;

    --fill-1: #2a2a2d;
    --fill-2: #232326;
    --fill-3: #3a3a3d;

    --target:          #fbbf24;
    --target-bg:        rgba(251,191,36,.15);
    --target-bg-soft:   rgba(251,191,36,.08);
    --target-text:      #fcd34d;
    --target-border:    rgba(251,191,36,.35);

    --code-tint: rgba(255,255,255,.12);
  }
}
:root[data-theme="dark"] {
  --brand:       #f6821f;
  --accent:      #3b82f6;
  --accent-h:    #60a5fa;
  --surface:     #1c1c1e;
  --bg:          #121214;
  --border:      #333336;
  --border-light:#29292b;
  --text:        #f0f0f0;
  --text-2:      #d0d0d0;
  --text-muted:  #9a9a9a;
  --text-faint:  #6f6f72;
  --ok:          #34d399;
  --ok-h:        #10b981;
  --ok-bg:       rgba(52,211,153,.12);
  --ok-border:   rgba(52,211,153,.3);
  --ok-text-strong: #6ee7b7;
  --warn:        #fbbf24;
  --warn-bg:     rgba(251,191,36,.12);
  --warn-border: rgba(251,191,36,.3);
  --bad:         #f87171;
  --bad-bg:      rgba(248,113,113,.12);
  --bad-border:  rgba(248,113,113,.3);
  --info-bg:     rgba(59,130,246,.14);
  --info-border: rgba(59,130,246,.32);
  --info-text:   #60a5fa;

  --fill-1: #2a2a2d;
  --fill-2: #232326;
  --fill-3: #3a3a3d;

  --target:          #fbbf24;
  --target-bg:        rgba(251,191,36,.15);
  --target-bg-soft:   rgba(251,191,36,.08);
  --target-text:      #fcd34d;
  --target-border:    rgba(251,191,36,.35);

  --code-tint: rgba(255,255,255,.12);
}
:root[data-theme="dark"] form select:not([multiple]),
:root[data-theme="dark"] select:not([multiple]) {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%239a9a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) form select:not([multiple]),
  :root:not([data-theme="light"]) select:not([multiple]) {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%239a9a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
  }
}

body {
  margin: 0;
  font-family: 'Ubuntu Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top header ─────────────────────────────────────────── */
header.top {
  display: flex; align-items: center; gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 54px;
}
header.top .brand {
  margin-right: 32px;
}
header.top .brand a {
  color: var(--text); font-weight: 700; font-size: 17px;
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.brand-icon { color: var(--brand); font-size: 20px; }
header.top .brand-sub {
  color: var(--text-muted); font-weight: 400; font-size: 12px; margin-left: 6px;
}

/* Module nav — tab style with bottom-border active */
header.top nav.modules {
  display: flex; gap: 0; flex: 1; height: 100%;
}
header.top nav.modules a {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  padding: 0 14px; height: 100%;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  text-decoration: none;
}
header.top nav.modules a:hover {
  color: var(--text); border-bottom-color: var(--border);
}
header.top nav.modules a.active {
  color: var(--text); border-bottom-color: var(--brand);
}

header.top .user {
  color: var(--text-muted); font-size: 13px;
  display: flex; gap: 12px; align-items: center;
  margin-left: 24px;
}

/* ── Submenu (module tabs) ──────────────────────────────── */
nav.submenu {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
nav.submenu .container-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; gap: 0;
}
nav.submenu a {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  padding: 12px 14px; text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
nav.submenu a:hover {
  color: var(--text); border-bottom-color: var(--border);
}
nav.submenu a.active {
  color: var(--text); border-bottom-color: var(--accent);
}

/* ── Page layout ────────────────────────────────────────── */
.container { max-width: 1200px; margin: 28px auto; padding: 0 24px; }

.page-title { margin: 0 0 20px; font-size: 20px; font-weight: 600; color: var(--text); }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.card .hint { color: var(--text-muted); font-size: 13px; margin: 0 0 16px; }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
}
.card-header h2 { margin: 0; }
.integration-status-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Stat grid ──────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }

.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px;
}
.stat .label {
  color: var(--text-muted); font-size: 12px; font-weight: 500;
  letter-spacing: .01em; margin-bottom: 6px;
  display: flex; align-items: center; gap: 5px;
}
.stat .value { font-size: 26px; font-weight: 700; color: var(--text); }
.stat.ok   .value { color: var(--ok); }
.stat.warn .value { color: var(--warn); }
.stat.bad  .value { color: var(--bad); }
.stat .label .bi { opacity: .65; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: inherit;
  transition: background .12s, border-color .12s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--fill-1); text-decoration: none; }

.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); }

.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover { background: var(--ok-h); border-color: var(--ok-h); }

.btn-link { border: none; background: none; color: var(--accent); padding: 0; font-size: 13px; cursor: pointer; font-family: inherit; }
.btn-link:hover { text-decoration: underline; }

.btn-lg { padding: 9px 18px; font-size: 14px; }

.inline { display: inline; }

/* ── Forms ──────────────────────────────────────────────── */
form .row { display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
form label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
form input, form select, form textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
form input:focus, form select:focus, form textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}

/* ── Radio / checkbox normalize ──────────────────────────
   Global form input rule'u checkbox/radio'yu da etkilemesin diye reset.
   :has() selector'ı modern (87%+) — eski tarayıcılarda HTML inline style
   ile fallback eden modüller hala çalışır.
*/
form input[type=checkbox],
form input[type=radio] {
  width: auto;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
}
form input[type=checkbox]:focus,
form input[type=radio]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: none;
}

/* Label içeren bir checkbox/radio satır içi, normal ağırlık olsun. */
form label:has(> input[type=checkbox]),
form label:has(> input[type=radio]) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  cursor: pointer;
  user-select: none;
}

/* Radio/checkbox grup: yan yana, makul aralık. */
.radio-group, .checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 4px 0 10px;
}
.radio-group label, .checkbox-group label {
  margin-bottom: 0 !important;
}
form .col { flex: 1 1 200px; }

/* ── Table ──────────────────────────────────────────────── */
table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); font-size: 13px;
}
table th {
  padding: 9px 12px; text-align: left;
  background: var(--bg); color: var(--text-muted);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border-light);
  color: var(--text-2);
}
table tr:last-child td { border-bottom: none; }
table tbody tr:hover td { background: var(--fill-2); }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge.ok   { background: var(--ok-bg);   color: var(--ok);   border: 1px solid var(--ok-border); }
.badge.bad  { background: var(--bad-bg);  color: var(--bad);  border: 1px solid var(--bad-border); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); }
.badge.info { background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info-border); }
.badge.muted { background: var(--fill-1); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-lg);
  margin-bottom: 16px; font-size: 13px; border: 1px solid;
}
.alert.info  { background: var(--info-bg);  color: var(--info-text); border-color: var(--info-border); }
.alert.error,
.alert.bad   { background: var(--bad-bg);   color: var(--bad);       border-color: var(--bad-border); }
.alert.ok    { background: var(--ok-bg);    color: var(--ok);        border-color: var(--ok-border); }
.alert.warn  { background: var(--warn-bg);  color: var(--warn);      border-color: var(--warn-border); }
.alert .bi   { flex-shrink: 0; margin-top: 1px; font-size: 15px; }
.alert code  { background: var(--code-tint); padding: 1px 5px; border-radius: 3px; font-size: 0.92em; }

/* ── Misc ────────────────────────────────────────────────── */
.mono {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  font-size: 12px; background: var(--fill-1); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 4px; word-break: break-all;
}
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.empty { text-align: center; padding: 48px 24px; color: var(--text-faint); }

/* ── Modal overlay (genel) ────────────────────────────────
   Kullanım: <div class="modal-overlay"> <div class="modal-card card">...</div> </div>
   Inline style ile çağıranlar da otomatik etkilensin.
*/
.modal-overlay,
[id$="-modal"] {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open,
[id$="-modal"][style*="flex"] { display: flex; }

.modal-card {
  width: 520px; max-width: 100%;
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin: 0;
}

/* form içinde inline modal kullanılınca scroll davranışı normal kalsın */
[id$="-modal"] .card {
  max-height: calc(100vh - 40px);
  overflow: auto;
}

/* Field section subheading */
.field-section-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
  margin: 14px 0 6px;
}
.hint { color: var(--text-muted); font-size: 13px; margin: 0 0 14px; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin .7s linear infinite; }

/* ── Login ──────────────────────────────────────────────── */
.login-wrap { max-width: 380px; margin: 80px auto; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .bi { font-size: 40px; color: var(--accent); display: block; margin-bottom: 10px; }
.login-logo h1 { margin: 0; font-size: 22px; font-weight: 700; }

/* ── Module card (home page) ─────────────────────────────── */
.modules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.module-card {
  display: flex; gap: 16px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.module-card:hover {
  border-color: #93c5fd; box-shadow: 0 2px 12px rgba(29,78,216,.08);
  text-decoration: none;
}
.module-card.module-card-disabled { opacity: .5; cursor: default; pointer-events: none; }
.module-icon { font-size: 30px; line-height: 1; color: var(--accent); width: 48px; text-align: center; flex-shrink: 0; }
.module-arrow { display: flex; align-items: center; color: var(--text-faint); margin-left: auto; font-size: 17px; }
.module-body h3 { margin: 0 0 5px; font-size: 15px; font-weight: 600; }
.module-body p { margin: 0 0 10px; color: var(--text-muted); font-size: 13px; }
.module-meta { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Webhook URL box ─────────────────────────────────────── */
.webhook-url-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--fill-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; word-break: break-all;
}
.webhook-url-box .bi { color: var(--accent); flex-shrink: 0; font-size: 15px; }

/* ── Integrations page ───────────────────────────────────── */
.int-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: 16px; overflow: hidden;
}
.int-section.int-section-disabled { opacity: .5; pointer-events: none; }

.int-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; gap: 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--fill-2);
}
.int-section-title { display: flex; align-items: flex-start; gap: 14px; }
.int-section-title > .bi { font-size: 22px; margin-top: 2px; color: var(--accent); flex-shrink: 0; }
.int-section-title h2, .int-section-title h3 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.int-section-title p { margin: 0; font-size: 13px; color: var(--text-muted); }

.int-badge-connected {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ok-bg); color: var(--ok);
  font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 20px;
  border: 1px solid var(--ok-border); white-space: nowrap;
}
.int-badge-connected::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); flex-shrink: 0;
}
.int-badge-pending {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--warn-bg); color: var(--warn);
  font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 20px;
  border: 1px solid var(--warn-border); white-space: nowrap;
}
.int-badge-pending::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--warn); flex-shrink: 0;
}

.int-body { padding: 20px; }

.int-fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.field-group { display: flex; flex-direction: column; gap: 4px; }
.field-group.field-full { grid-column: 1 / -1; }
.field-group label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field-group input, .field-group select {
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.field-group input:focus, .field-group select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,78,216,.1);
}
.field-hint { font-size: 11.5px; color: var(--text-faint); }
.req { color: var(--bad); }

.channel-checks {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
.channel-check-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--fill-2);
  cursor: pointer; font-size: 13px; font-weight: 500;
  transition: border-color .12s, background .12s;
  user-select: none;
}
.channel-check-item:hover { border-color: var(--accent); background: var(--info-bg); }
.channel-check-item input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.channel-check-item .field-hint { font-size: 11px; }

.int-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

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

.test-result { font-size: 13px; font-weight: 500; }
.test-result.test-ok   { color: var(--ok); }
.test-result.test-fail { color: var(--bad); }

.int-sub-card {
  margin-top: 18px; padding: 16px;
  background: var(--fill-2); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.int-sub-card h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }

.section-label {
  margin: 24px 0 6px; font-size: 16px; font-weight: 600; color: var(--text);
}
.platforms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }

/* ── Documentation Page ─────────────────────────────────── */
.docs-wrap {
  display: flex; gap: 32px; align-items: flex-start;
  max-width: 1100px; margin: 28px auto; padding: 0 24px;
}

.docs-nav {
  width: 200px; flex-shrink: 0; position: sticky; top: 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 0; font-size: 13px;
}
.docs-nav-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-faint);
  padding: 0 16px 10px;
}
.docs-nav-link {
  display: block; padding: 7px 12px; color: var(--text-muted);
  text-decoration: none; border-radius: var(--radius);
  transition: color .12s, background .12s;
}
.docs-nav-link:hover { color: var(--text); background: var(--border-light); text-decoration: none; }
.docs-nav-link.active { color: var(--accent); background: var(--info-bg); font-weight: 600; }

.docs-content { flex: 1; min-width: 0; }

.docs-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; margin-bottom: 16px;
}
.docs-h1 {
  margin: 0 0 14px; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; gap: 10px; color: var(--text);
}
.docs-h2 {
  margin: 0 0 14px; font-size: 17px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; color: var(--text);
  padding-bottom: 10px; border-bottom: 1px solid var(--border-light);
}
.docs-h3 { margin: 20px 0 8px; font-size: 14px; font-weight: 600; color: var(--text); }

.docs-section p { margin: 0 0 12px; color: var(--text-2); line-height: 1.65; }

.docs-table {
  width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px;
}
.docs-table th {
  padding: 8px 12px; text-align: left; background: var(--bg);
  color: var(--text-muted); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
.docs-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--border-light); color: var(--text-2);
}
.docs-table tr:last-child td { border-bottom: none; }

.docs-code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 12px; background: var(--fill-1); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px;
}
.docs-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.docs-badge.ok   { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); }
.docs-badge.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); }
.docs-badge.info { background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info-border); }
.docs-badge.muted{ background: var(--fill-1); color: var(--text-muted); border: 1px solid var(--border); }
.docs-badge-row  { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.docs-callout {
  display: flex; gap: 12px; padding: 13px 16px;
  border-radius: var(--radius); margin: 14px 0;
  font-size: 13px; border: 1px solid; line-height: 1.6;
}
.docs-callout.info  { background: var(--info-bg); color: var(--info-text); border-color: var(--info-border); }
.docs-callout.warn  { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.docs-callout .bi   { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.docs-callout strong { font-weight: 600; }
.docs-callout code  { font-family: ui-monospace, monospace; font-size: 12px; }

.docs-steps {
  padding-left: 20px; margin: 8px 0 14px; color: var(--text-2);
  line-height: 1.8; font-size: 14px;
}
.docs-steps li { margin-bottom: 4px; }
.docs-steps strong { color: var(--text); }

.docs-list {
  padding-left: 20px; margin: 8px 0; color: var(--text-2);
  line-height: 1.8; font-size: 14px;
}

/* Flow diagram */
.docs-flow {
  display: flex; align-items: center; gap: 0;
  flex-wrap: wrap; margin: 20px 0; position: relative;
}
.docs-flow-step {
  text-align: center; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 18px; min-width: 110px;
}
.docs-flow-icon { font-size: 24px; color: var(--accent); margin-bottom: 4px; }
.docs-flow-label { font-weight: 600; font-size: 13px; }
.docs-flow-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.docs-flow-arrow { font-size: 18px; color: var(--text-faint); padding: 0 8px; }
.docs-flow-arrow-back { color: var(--warn); }
.docs-flow-back-label { font-size: 11px; color: var(--warn); position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); white-space: nowrap; }

/* Option cards */
.docs-option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
@media (max-width: 640px) { .docs-option-grid { grid-template-columns: 1fr; } }
.docs-option-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.docs-option-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }

/* FAQ */
.docs-faq { display: flex; flex-direction: column; gap: 0; }
.docs-faq-item {
  border-bottom: 1px solid var(--border-light); padding: 14px 0;
}
.docs-faq-item:last-child { border-bottom: none; }
.docs-faq-q {
  font-weight: 600; font-size: 13px; color: var(--text);
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px;
}
.docs-faq-q .bi { color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.docs-faq-a { font-size: 13px; color: var(--text-muted); line-height: 1.6; padding-left: 22px; }
.docs-faq-a strong { color: var(--text-2); }
.docs-faq-a code { font-family: ui-monospace, monospace; font-size: 12px; background: var(--fill-1); padding: 1px 5px; border-radius: 3px; }

@media (max-width: 760px) {
  .docs-wrap { flex-direction: column; }
  .docs-nav  { width: 100%; position: static; }
}

/* ── Setup Wizard ────────────────────────────────────────── */
.setup-wrap { max-width: 760px; margin: 32px auto; padding: 0 24px; }

.setup-hero { text-align: center; margin-bottom: 32px; }
.setup-hero-icon { font-size: 48px; color: var(--accent); display: block; margin-bottom: 12px; }
.setup-hero h1 { margin: 0 0 8px; font-size: 22px; font-weight: 700; }
.setup-hero p  { margin: 0; color: var(--text-muted); font-size: 14px; }

.setup-steps {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
}
.setup-step {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  opacity: .4; transition: opacity .2s;
}
.setup-step.active, .setup-step.done { opacity: 1; }
.step-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--fill-3); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; transition: background .2s, color .2s;
}
.setup-step.active .step-num { background: var(--accent); color: #fff; }
.setup-step.done   .step-num { background: var(--ok);     color: #fff; }
.step-label { font-size: 11px; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.step-line  { flex: 1; height: 1px; background: var(--border); min-width: 40px; max-width: 80px; }

.setup-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px;
  transition: opacity .2s;
}
.setup-card h2 {
  margin: 0 0 6px; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.setup-card .hint { color: var(--text-muted); font-size: 13px; margin-bottom: 18px; }
.setup-card-locked { opacity: .4; pointer-events: none; filter: grayscale(.4); }
.setup-dry-badge   { font-size: 11px; margin-left: 2px; }

.check-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px;
}
@media (max-width: 520px) { .check-grid { grid-template-columns: 1fr; } }

.check-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--fill-2);
}
.check-icon  { font-size: 20px; margin-top: 2px; flex-shrink: 0; }
.check-title { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.check-msg   { font-size: 13px; }

.text-ok    { color: var(--ok); }
.text-fail  { color: var(--bad); }
.text-warn  { color: var(--warn); }
.text-muted { color: var(--text-muted); }

.setup-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.preview-summary {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--fill-2);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px;
}
.preview-stat { font-size: 13px; display: flex; align-items: center; gap: 5px; }

.confirm-summary { margin-bottom: 16px; }
.confirm-info {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; background: var(--ok-bg);
  border: 1px solid var(--ok-border); border-radius: var(--radius);
  font-size: 13px; color: var(--ok-text-strong);
}
.confirm-info .bi { font-size: 16px; flex-shrink: 0; margin-top: 2px; }

.setup-done {
  background: var(--ok-bg); border: 1px solid var(--ok-border);
  border-radius: var(--radius-lg); padding: 48px 24px;
}

/* ── Submenu extras ──────────────────────────────────────── */
.submenu-back {
  color: var(--text-muted) !important;
  font-size: 12px !important;
  opacity: .8;
}
.submenu-back:hover { opacity: 1; }
.submenu-sep {
  width: 1px; background: var(--border); align-self: stretch; margin: 10px 4px;
}

/* ── Integration list (index) ────────────────────────────── */
.int-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.int-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s;
}
.int-card:hover {
  border-color: #93c5fd; box-shadow: 0 2px 10px rgba(29,78,216,.07);
}
.int-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border-light);
  gap: 10px; flex-wrap: wrap;
}
.int-card-title {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
}
.int-badge {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.int-badge-connected { background: var(--ok); }
.int-badge-pending   { background: var(--warn); }

.int-card-meta {
  padding: 12px 16px; display: flex; flex-direction: column; gap: 7px;
  border-bottom: 1px solid var(--border-light);
}
.int-meta-row {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--text-2);
}
.int-meta-row .hint { margin: 0; }

.int-card-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border-light);
}
.int-stat {
  text-align: center; padding: 10px 4px;
  border-right: 1px solid var(--border-light);
}
.int-stat:last-child { border-right: none; }
.int-stat-val { font-size: 18px; font-weight: 700; color: var(--text); }
.int-stat-lbl { font-size: 10px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.int-stat.ok   .int-stat-val { color: var(--ok); }
.int-stat.warn .int-stat-val { color: var(--warn); }
.int-stat.bad  .int-stat-val { color: var(--bad); }

.int-card-actions {
  padding: 12px 16px; display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: auto;
}

/* ── Connections page forms ──────────────────────────────── */
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-group {
  display: flex; flex-direction: column; gap: 4px;
}
.form-group label {
  font-size: 12px; font-weight: 600; color: var(--text-2);
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--text);
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,78,216,.1);
}

/* ── Onboarding Wizard ───────────────────────────────────── */
.ob-wrap { max-width: 760px; margin: 32px auto; padding: 0 24px 60px; }

.ob-hero { text-align: center; margin-bottom: 36px; }
.ob-hero-icon {
  font-size: 52px; color: var(--accent); display: block; margin-bottom: 14px;
}
.ob-hero h1 { margin: 0 0 10px; font-size: 24px; font-weight: 700; }
.ob-hero p  { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.7; }

.ob-steps {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 32px; flex-wrap: nowrap;
}
.ob-step {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  opacity: .35; transition: opacity .25s;
}
.ob-step.active, .ob-step.done { opacity: 1; }
.ob-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--fill-3); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; transition: background .25s, color .25s;
}
.ob-step.active .ob-step-num { background: var(--accent); color: #fff; }
.ob-step.done   .ob-step-num { background: var(--ok);     color: #fff; }
.ob-step.done   { cursor: pointer; }
.ob-step.done:hover .ob-step-num { background: var(--ok-h); }
.ob-step.done:hover .ob-step-lbl::after { content: ' ↩'; font-size: 10px; }
.ob-step-lbl { font-size: 11px; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.ob-step-line { flex: 1; height: 2px; background: var(--border); min-width: 24px; max-width: 60px; }

.ob-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; margin-bottom: 16px;
  transition: opacity .2s, filter .2s;
}
.ob-locked {
  opacity: .35; pointer-events: none; filter: grayscale(.3);
}
.ob-card-head {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px;
}
.ob-card-icon { font-size: 26px; color: var(--accent); margin-top: 2px; flex-shrink: 0; }
.ob-card-head h2 { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.ob-card-head .hint { margin: 0; }

.ob-callout {
  display: flex; gap: 10px; padding: 12px 16px;
  background: var(--info-bg); border: 1px solid var(--info-border);
  border-radius: var(--radius); margin-bottom: 18px; font-size: 13px;
  color: var(--info-text); line-height: 1.6;
}
.ob-callout .bi { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.ob-callout code {
  background: rgba(29,78,216,.1); padding: 1px 6px; border-radius: 3px;
  font-family: ui-monospace, monospace; font-size: 12px;
}
:root[data-theme="dark"] .ob-callout code { background: rgba(59,130,246,.22); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ob-callout code { background: rgba(59,130,246,.22); }
}

.ob-fields { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.ob-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .ob-field-row { grid-template-columns: 1fr; } }

.ob-result { margin-bottom: 14px; font-size: 13px; font-weight: 500; }

.ob-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.ob-pair-summary { margin-bottom: 18px; }
.ob-pair-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.ob-pair-box {
  display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 160px;
}
.ob-pair-box > div { font-size: 14px; }
.ob-pair-box strong { display: block; margin-bottom: 2px; }

.ob-confirm-info {
  display: flex; gap: 10px; padding: 13px 16px;
  background: var(--ok-bg); border: 1px solid var(--ok-border);
  border-radius: var(--radius); font-size: 13px; color: var(--ok-text-strong);
  margin-bottom: 18px; line-height: 1.6;
}

.ob-done {
  text-align: center; padding: 60px 24px;
  background: var(--ok-bg); border: 1px solid var(--ok-border);
  border-radius: var(--radius-lg);
}
.ob-done-icon { font-size: 56px; color: var(--ok); display: block; margin-bottom: 16px; }
.ob-done h1  { margin: 0 0 10px; font-size: 22px; font-weight: 700; }
.ob-done p   { margin: 0; color: var(--ok-text-strong); font-size: 14px; line-height: 1.7; }

/* Onboarding — sync options */
.ob-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin: 20px 0 14px;
  padding-top: 18px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
}
.ob-checks {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px;
}
.ob-check {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 13px; user-select: none;
  transition: border-color 0.15s, background 0.15s;
}
.ob-check:hover { border-color: var(--accent); }
.ob-check input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.ob-check input[type="checkbox"]:checked + span { color: var(--accent); font-weight: 600; }
.ob-check span i { margin-right: 3px; }

/* ── Toast bildirimleri ─────────────────────────────── */
#toast-container {
  position: fixed; bottom: 28px; right: 28px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius-lg);
  font-size: 14px; font-weight: 500; line-height: 1.4;
  min-width: 260px; max-width: 400px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  pointer-events: all;
  opacity: 0; transform: translateY(16px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.toast-in { opacity: 1; transform: translateY(0); }
.toast-ok    { background: #16a34a; color: #fff; }
.toast-error { background: #dc2626; color: #fff; }
.toast-warn  { background: #d97706; color: #fff; }
.toast-info  { background: #1d4ed8; color: #fff; }
.toast .bi   { font-size: 18px; flex-shrink: 0; }
.toast span  { flex: 1; }
.toast button {
  background: none; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0 0 0 8px;
  opacity: .7; color: #fff; flex-shrink: 0;
}
.toast button:hover { opacity: 1; }

/* ============================================================
   App layout — sol sidebar + topbar (Cloudflare-style)
   ============================================================ */
.app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 90;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 18px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.sidebar-brand:hover { text-decoration: none; color: var(--text); }
.sidebar-brand .brand-icon { color: var(--brand); font-size: 20px; }
.sidebar-brand .brand-sub { color: var(--text-muted); font-weight: 400; font-size: 12px; }

.sidebar-nav {
  padding: 10px;
  flex: 1;
}
.side-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
  padding: 14px 8px 6px;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .12s, color .12s;
  margin-bottom: 1px;
}
.side-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.side-item.active { background: var(--info-bg); color: var(--accent); font-weight: 600; }
.side-item .bi { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.side-sub {
  margin: 2px 0 8px;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.side-sub a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.side-sub a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.side-sub a.active { background: var(--info-bg); color: var(--accent); font-weight: 600; }
.side-sub a .bi { font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; }
.side-sub a.side-sub-back { color: var(--text-faint); font-size: 12px; margin-bottom: 3px; }
.side-sub a.side-sub-back:hover { color: var(--text); }

/* ── App body + topbar ── */
.app-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 80;
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.topbar-right { position: relative; display: flex; align-items: center; gap: 10px; }

.menu-toggle {
  display: none;
  width: 34px; height: 34px;
  align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text); font-size: 20px;
  border-radius: var(--radius);
}
.menu-toggle:hover { background: var(--bg); }

/* ── Tema geçiş anahtarı — pill, kayan topuz ──
   Topuz normal flex akışında (sol başlangıç), sadece transform ile kayar —
   piksel bazlı top/left hesabı yerine flex hizalaması güvenilir merkezleme sağlar. */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 46px;
  height: 24px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s ease, border-color .2s ease;
}
.theme-toggle:hover { border-color: var(--text-faint); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.theme-toggle-track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
  pointer-events: none;
}
.theme-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  font-size: 10px;
  line-height: 1;
  color: var(--text-faint);
}

.theme-toggle-knob {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
:root[data-theme="dark"] .theme-toggle-knob { transform: translateX(22px); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle-knob { transform: translateX(22px); }
}

/* ── Profil dropdown ── */
.profile-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: box-shadow .12s;
}
.profile-btn:hover { box-shadow: 0 0 0 3px rgba(246,130,31,.2); }

.profile-menu {
  position: absolute;
  right: 0;
  top: 44px;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 8px;
  display: none;
  z-index: 200;
}
.profile-menu.open { display: block; }
.profile-info {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 6px;
}
.profile-info .p-tenant {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.profile-info .p-email { font-size: 12px; color: var(--text-muted); word-break: break-all; }
.profile-menu form button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--bad);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}
.profile-menu form button:hover { background: var(--bad-bg); }

/* ── İçerik alanı ── */
.content {
  flex: 1;
  padding: 24px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* ── Mobil ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.4);
  z-index: 85;
}
.sidebar-backdrop.open { display: block; }

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.1);
  }
  .sidebar.open { transform: none; }
  .menu-toggle { display: flex; }
  .content { padding: 16px; }
}

/* Sidebar brand satırı topbar ile aynı yükseklik + aynı çizgide */
.sidebar-brand {
  height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.breadcrumb a:hover { background: var(--bg); color: var(--accent); text-decoration: none; }
.breadcrumb .crumb-sep {
  font-size: 10px;
  color: var(--text-faint);
  flex-shrink: 0;
}
.breadcrumb .crumb-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 600;
  padding: 4px 8px;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sayfa başlığı yerine geçen büyük breadcrumb — ikonsuz, sade sayfa üstleri için
   (page-title + dekoratif ikon yerine: topbar zaten sayfa adını gösteriyor, burası
   sadece konum + geri dönüş sağlar). */
.page-breadcrumb {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 20px;
  flex-wrap: wrap;
}
.page-breadcrumb a {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .12s;
}
.page-breadcrumb a:hover { color: var(--accent); }
.page-breadcrumb .crumb-sep {
  font-size: 18px;
  color: var(--text-faint);
}
.page-breadcrumb .crumb-current {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

/* Renk seçici girdiler */
form input[type=color] {
  padding: 2px 4px;
  height: 36px;
  cursor: pointer;
}

/* ============================================================
   Form kontrolleri — panel tasarım diline uyum
   (select / range / color, tüm panelde geçerli)
   ============================================================ */

/* Select: native ok gizlenir, özel gri chevron eklenir */
form select:not([multiple]), select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23767676' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 32px;
  cursor: pointer;
}
form select:hover, select:hover { border-color: var(--text-faint); }
form select:disabled, select:disabled { opacity: .55; cursor: not-allowed; }

/* Range: ince gri ray + accent yuvarlak tutamaç */
form input[type=range], input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  box-shadow: none;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  margin-top: -5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: box-shadow .12s;
}
input[type=range]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}
input[type=range]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
input[type=range]:focus { outline: none; box-shadow: none; }
input[type=range]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(29,78,216,.22);
}
input[type=range]:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(29,78,216,.14);
}

/* Color: swatch panel kutusu gibi çerçeveli */
form input[type=color], input[type=color] {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
form input[type=color]:hover, input[type=color]:hover { border-color: var(--text-faint); }
form input[type=color]:focus, input[type=color]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type=color]::-webkit-color-swatch {
  border: 1px solid var(--border-light);
  border-radius: 3px;
}
input[type=color]::-moz-color-swatch {
  border: 1px solid var(--border-light);
  border-radius: 3px;
}

/* Form dışındaki select'ler de aynı temel görünümde olsun (örn. stil editörü).
   background-color kullanılır ki chevron background-image'ı ezilmesin. */
select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background-color: var(--surface);
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
