/* =========================================================
   Givoti SMS — WhatsApp Mesajlaşma Paneli
   Ortak tasarım sistemi
   ========================================================= */

/* ---------- Tokenlar ---------- */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --bg: #f4f6f7;
  --surface: #ffffff;
  --surface-2: #f2f5f6;
  --surface-3: #e8edef;
  --border: #e2e8ea;
  --border-strong: #cdd6d9;
  --text: #0e1a1d;
  --text-2: #3b4a4f;
  --muted: #5c6b70; /* açık temada bg/surface-2 üzerinde ≥4.5:1 */

  --primary: #0a8f5a;
  --primary-hover: #077a4b;
  --primary-soft: #e2f4eb;
  --primary-text: #05663f;
  --on-primary: #ffffff;

  /* Rozet metinleri kendi -soft zemini üzerinde ≥4.5:1 kontrast */
  --success: #0b7a3c; --success-soft: #e3f5ea;
  --warning: #935800; --warning-soft: #fdf1dc;
  --danger:  #bf2a24; --danger-soft:  #fdeceb;
  --info:    #1d56d6; --info-soft:    #e8effd;
  --violet:  #7c3aed; --violet-soft:  #f1eafe;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(14, 26, 29, .06);
  --shadow: 0 1px 3px rgba(14, 26, 29, .07), 0 1px 2px rgba(14, 26, 29, .04);
  --shadow-lg: 0 18px 40px -12px rgba(14, 26, 29, .22);
  --ring: 0 0 0 3px rgba(10, 143, 90, .22);

  --sidebar-w: 264px;
  --topbar-h: 64px;
  --bottomnav-h: 64px;

  --wa-bg: #efeae2;
  --wa-out: #d9fdd3;
  --wa-in: #ffffff;
  --wa-head: #075e54;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1214; --surface: #111a1d; --surface-2: #162125; --surface-3: #1d2a2f;
    --border: #223237; --border-strong: #2f444a;
    --text: #e8f0f1; --text-2: #b8c7ca; --muted: #81979c;
    --primary: #1fb877; --primary-hover: #2bcb87; --primary-soft: #10301f; --primary-text: #5fe0a5; --on-primary: #04150d;
    --success: #3ccf7c; --success-soft: #0f2c1b;
    --warning: #f0a83a; --warning-soft: #33240b;
    --danger: #f2655f; --danger-soft: #361513;
    --info: #6b9cff; --info-soft: #14213d;
    --violet: #a78bfa; --violet-soft: #241a3d;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 1px 3px rgba(0,0,0,.45);
    --shadow-lg: 0 18px 40px -12px rgba(0,0,0,.7);
    --ring: 0 0 0 3px rgba(31, 184, 119, .3);
    --wa-bg: #0b141a; --wa-out: #005c4b; --wa-in: #202c33; --wa-head: #1f2c34;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1214; --surface: #111a1d; --surface-2: #162125; --surface-3: #1d2a2f;
  --border: #223237; --border-strong: #2f444a;
  --text: #e8f0f1; --text-2: #b8c7ca; --muted: #81979c;
  --primary: #1fb877; --primary-hover: #2bcb87; --primary-soft: #10301f; --primary-text: #5fe0a5; --on-primary: #04150d;
  --success: #3ccf7c; --success-soft: #0f2c1b;
  --warning: #f0a83a; --warning-soft: #33240b;
  --danger: #f2655f; --danger-soft: #361513;
  --info: #6b9cff; --info-soft: #14213d;
  --violet: #a78bfa; --violet-soft: #241a3d;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 3px rgba(0,0,0,.45);
  --shadow-lg: 0 18px 40px -12px rgba(0,0,0,.7);
  --ring: 0 0 0 3px rgba(31, 184, 119, .3);
  --wa-bg: #0b141a; --wa-out: #005c4b; --wa-in: #202c33; --wa-head: #1f2c34;
  color-scheme: dark;
}

/* ---------- Temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.25; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
code, kbd, pre { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
::selection { background: var(--primary-soft); }

[data-lucide], .lucide, .icon { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }
.icon-sm, .icon-sm[data-lucide] { width: 15px; height: 15px; }
.icon-lg, .icon-lg[data-lucide] { width: 22px; height: 22px; }

/* ---------- Yardımcılar ---------- */
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.bold { font-weight: 600; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary-text); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden { display: none !important; }
@media (max-width: 640px) { .hide-xs { display: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.row { display: flex; align-items: center; gap: 12px; }
.row-sm { display: flex; align-items: center; gap: 6px; }
.row.wrap, .row-sm.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.grow { flex: 1; min-width: 0; }
.ml-auto { margin-left: auto; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-aside { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-aside { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1024px) {
  .grid-3, .grid-main, .grid-aside { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .grid-2:not(.keep-2) { grid-template-columns: minmax(0, 1fr); }
  .grid-4.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4:not(.keep-2) { grid-template-columns: minmax(0, 1fr); }
  .grid { gap: 12px; }
}

/* ---------- Uygulama düzeni ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: transform .25s ease;
}
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1400px; margin: 0 auto; padding: 24px 28px 48px; }
.content.wide { max-width: none; }

.brand { display: flex; align-items: center; gap: 10px; height: var(--topbar-h); padding: 0 20px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #12b874, #077a4b);
  color: #fff; box-shadow: 0 4px 12px -4px rgba(10, 143, 90, .6);
}
.brand-mark svg { width: 18px; height: 18px; }

.nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; scrollbar-width: thin; }
.nav-group { margin-top: 10px; }
.nav-group:first-child { margin-top: 4px; }
.nav-label { padding: 0 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; margin: 1px 0;
  border-radius: 9px;
  color: var(--text-2); font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.nav-link.active [data-lucide], .nav-link.active svg { color: var(--primary); }
.nav-link .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.nav-link .tag-new { margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--violet-soft); color: var(--violet); }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.usage-card { padding: 12px; border-radius: var(--radius); background: var(--surface-2); }
.usage-card .row { gap: 8px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .menu-btn { display: none; }
.topbar-title { font-weight: 650; font-size: 15px; }
.topbar-search { position: relative; flex: 1; max-width: 420px; }
.topbar-search input { padding-left: 36px; background: var(--surface); }
.topbar-search > [data-lucide], .topbar-search > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.topbar-search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.line-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px 0 10px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); cursor: pointer;
  font-weight: 500; font-size: 13px; white-space: nowrap;
}
.line-pill:hover { border-color: var(--border-strong); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.dot.on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot.warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.dot.off { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

.bottom-nav { display: none; }
.overlay { position: fixed; inset: 0; z-index: 35; background: rgba(5, 12, 14, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.show { opacity: 1; pointer-events: auto; }

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 20px 20px 40px; }
}
@media (max-width: 768px) {
  .topbar-search, .topbar .hide-mobile { display: none; }
  .content { padding: 16px 16px calc(var(--bottomnav-h) + 28px); }
  .bottom-nav {
    position: fixed; inset: auto 0 0 0; z-index: 30;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; cursor: pointer;
    font-size: 10.5px; font-weight: 500; color: var(--muted); text-decoration: none; position: relative;
  }
  .bottom-nav .active { color: var(--primary-text); }
  .bottom-nav .active [data-lucide], .bottom-nav .active svg { color: var(--primary); }
  .bottom-nav .fab span.fab-circle { width: 44px; height: 44px; margin-top: -18px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 20px -6px rgba(10,143,90,.7); }
  .bottom-nav .fab span.fab-circle svg { color: var(--on-primary); }
  .bottom-nav .badge-dot { position: absolute; top: 9px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; display: grid; place-items: center; }
}

/* ---------- Sayfa başlığı ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-header p { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb svg { width: 14px; height: 14px; }
@media (max-width: 640px) {
  .page-header { align-items: stretch; flex-direction: column; }
  .page-header h1 { font-size: 21px; }
  .page-actions > .btn { flex: 1; }
}

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  cursor: pointer; text-decoration: none; user-select: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 1px 2px rgba(10, 143, 90, .3), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary-text); }
.btn-soft:hover { filter: brightness(.97); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 10px 0 0 10px; }
.btn-group .btn:last-child { border-radius: 0 10px 10px 0; }
.btn-group .btn + .btn { margin-left: -1px; }

.icon-btn {
  position: relative; width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  border-radius: 10px; border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .badge-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- Kart ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header.plain { border-bottom: 0; padding-bottom: 4px; }
.card-header p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 12px; }
.card-body.flush { padding: 0; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card.hover { transition: border-color .15s, box-shadow .15s, transform .15s; }
.card.hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
a.card { display: block; color: inherit; text-decoration: none; }
@media (max-width: 640px) {
  .card-header { padding: 14px 16px; flex-wrap: wrap; }
  .card-body { padding: 16px; }
  .card-footer { padding: 12px 16px; }
}

/* İstatistik */
.stat { padding: 18px 20px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { color: var(--muted); font-weight: 500; font-size: 13px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }
.trend svg { width: 14px; height: 14px; }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-icon.info { background: var(--info-soft); color: var(--info); }
.stat-icon.warning { background: var(--warning-soft); color: var(--warning); }
.stat-icon.danger { background: var(--danger-soft); color: var(--danger); }
.stat-icon.violet { background: var(--violet-soft); color: var(--violet); }
@media (max-width: 640px) { .stat { padding: 14px 16px; } .stat-value { font-size: 22px; } }

/* ---------- Rozet, çip ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.badge svg { width: 12px; height: 12px; }
.badge .dot { width: 6px; height: 6px; box-shadow: none; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.success .dot { background: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.warning .dot { background: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.danger .dot { background: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.info .dot { background: var(--info); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.primary { background: var(--primary-soft); color: var(--primary-text); }
.badge.outline { background: transparent; border: 1px solid var(--border); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip svg { width: 14px; height: 14px; }
.chip .x { opacity: .6; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; scroll-snap-type: x proximity; }
.chips.scroll > .chip { flex-shrink: 0; scroll-snap-align: start; }
/* Kaydırılabilir çiplerde kenar solması: sağda/solda devamı olduğu görünür (app.js more-l / more-r sınıfları) */
.chips.scroll.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.chips.scroll.more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
.chips.scroll.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
.chips.scroll::-webkit-scrollbar { display: none; }

.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.tag.green { background: var(--success-soft); color: var(--success); }
.tag.blue { background: var(--info-soft); color: var(--info); }
.tag.orange { background: var(--warning-soft); color: var(--warning); }
.tag.purple { background: var(--violet-soft); color: var(--violet); }
.tag.red { background: var(--danger-soft); color: var(--danger); }

/* ---------- Formlar ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-weight: 600; font-size: 13px; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.label .opt { font-weight: 400; color: var(--muted); font-size: 12px; }
.hint { font-size: 12px; color: var(--muted); }
.error-text { font-size: 12px; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .85; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: var(--ring); }
.input.invalid { border-color: var(--danger); }
.input-sm { height: 34px; font-size: 13px; }
.textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a797e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group > [data-lucide], .input-group > svg { position: absolute; left: 12px; color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.input-group > .input { padding-left: 36px; }
.input-group > .addon-right { position: absolute; right: 6px; }
.input-affix { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.input-affix:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.input-affix .affix { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); color: var(--muted); border-right: 1px solid var(--border); font-size: 13px; white-space: nowrap; }
.input-affix .input { border: 0; border-radius: 0; box-shadow: none; }
.input-affix.invalid { border-color: var(--danger); }
.input-affix.invalid:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.phone-note { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--warning); }
.phone-note svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none; }
.check input { appearance: none; -webkit-appearance: none; margin: 1px 0 0; width: 18px; height: 18px; flex-shrink: 0; border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--surface); cursor: pointer; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input[type="checkbox"]:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--on-primary); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check input[type="radio"]:checked::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--on-primary); }
.check input:focus-visible { box-shadow: var(--ring); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; -webkit-appearance: none; margin: 0; width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { box-shadow: var(--ring); }
.switch input:disabled { opacity: .45; cursor: not-allowed; }
.switch.block { display: flex; justify-content: space-between; width: 100%; }
.switch.block input { order: 2; }

.option-card {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.option-card:hover { border-color: var(--border-strong); }
.option-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card .oc-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex-shrink: 0; }
.option-card:has(input:checked) .oc-icon { background: var(--primary); color: var(--on-primary); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-3); }
.segmented button, .segmented label { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-weight: 500; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.segmented .active, .segmented label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.segmented input { display: none; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 28px 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.dropzone .dz-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ---------- Tablo ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .col-check { width: 44px; padding-right: 0; }
.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-user .name { font-weight: 600; }
.cell-user .sub { font-size: 12px; color: var(--muted); }
@media (max-width: 768px) {
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table.responsive tr:last-child { border-bottom: 0; }
  .table.responsive td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
  .table.responsive td::before { content: attr(data-label); font-size: 12px; font-weight: 500; color: var(--muted); text-align: left; flex-shrink: 0; }
  .table.responsive td.td-main { justify-content: flex-start; text-align: left; padding-bottom: 8px; }
  .table.responsive td.td-main::before, .table.responsive td.col-check::before, .table.responsive td.col-actions::before { display: none; }
  .table.responsive td.col-check { position: absolute; width: auto; right: 16px; }
  .table.responsive tr { position: relative; }
  .table.responsive td.col-actions { justify-content: flex-end; padding-top: 8px; }
  .table.responsive td:has(> .progress) { flex-wrap: wrap; justify-content: flex-end; column-gap: 10px; }
  .table.responsive td:has(> .progress)::before { margin-right: auto; }
  .table.responsive td .progress { width: 120px; flex: 0 0 120px; }
  .table.responsive td > .progress + * { margin-top: 0; }
}

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.toolbar .input-group { flex: 1; min-width: 200px; max-width: 360px; }
@media (max-width: 640px) { .toolbar .input-group { max-width: none; min-width: 100%; } }
.bulk-bar { display: none; align-items: center; gap: 8px; padding: 10px 16px; background: var(--primary-soft); color: var(--primary-text); font-weight: 600; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.bulk-bar.show { display: flex; }

.pagination { display: flex; align-items: center; gap: 4px; }
.pagination button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; font-weight: 500; }
.pagination button:hover { background: var(--surface-3); }
.pagination button.active { background: var(--surface); border-color: var(--border); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- Liste ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
a.list-item { color: inherit; text-decoration: none; }
a.list-item:hover { background: var(--surface-2); }
@media (max-width: 640px) {
  .list-item { padding: 12px 16px; }
  .list-item.wrap-mobile { flex-wrap: wrap; }
  .list-item.wrap-mobile > .grow { flex-basis: calc(100% - 60px); }
  .list-item.wrap-mobile > :last-child:not(.grow) { margin-left: auto; }
}

/* ---------- Avatar ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, #5b8def, #3b5bdb);
  overflow: hidden;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.avatar.c1 { background: linear-gradient(135deg, #34d399, #059669); }
.avatar.c2 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.avatar.c3 { background: linear-gradient(135deg, #f472b6, #db2777); }
.avatar.c4 { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.avatar.c5 { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.avatar.c6 { background: linear-gradient(135deg, #fb7185, #e11d48); }
.avatar.more { background: var(--surface-3); color: var(--text-2); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -8px; }

/* ---------- Sekmeler ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border: 0; background: none; color: var(--muted); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); font-weight: 600; }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }
.tab .badge { height: 18px; padding: 0 6px; font-size: 11px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- İlerleme ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .4s; }
.progress.sm { height: 5px; }
.progress.warning > span { background: var(--warning); }
.progress.danger > span { background: var(--danger); }
.progress.info > span { background: var(--info); }
.progress-multi { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.progress-multi span { height: 100%; }

/* ---------- Adım göstergesi ---------- */
.stepper { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.step { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--muted); font-weight: 500; }
.step .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; border: 1.5px solid var(--border-strong); background: var(--surface); }
.step.active { color: var(--text); font-weight: 600; }
.step.active .num { border-color: var(--primary); background: var(--primary); color: var(--on-primary); box-shadow: var(--ring); }
.step.done .num { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.step-line { flex: 1; min-width: 20px; height: 2px; border-radius: 2px; background: var(--border); }
.step-line.done { background: var(--primary); }
@media (max-width: 640px) { .step:not(.active) .step-text { display: none; } }

/* ---------- Uyarı kutusu ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); }
.alert > svg { margin-top: 1px; }
.alert .alert-title { font-weight: 600; color: var(--text); }
.alert.info { background: var(--info-soft); border-color: transparent; }
.alert.info > svg { color: var(--info); }
.alert.success { background: var(--success-soft); border-color: transparent; }
.alert.success > svg { color: var(--success); }
.alert.warning { background: var(--warning-soft); border-color: transparent; }
.alert.warning > svg { color: var(--warning); }
.alert.danger { background: var(--danger-soft); border-color: transparent; }
.alert.danger > svg { color: var(--danger); }

/* ---------- Boş durum ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 20px; }
.empty .empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); margin-bottom: 4px; }
.empty .empty-icon svg { width: 26px; height: 26px; }
.empty p { color: var(--muted); max-width: 380px; }

/* ---------- Açılır menü ---------- */
.dropdown { position: relative; display: inline-flex; }
.menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s, transform .15s;
}
.menu.left { right: auto; left: 0; }
.menu.up { top: auto; bottom: calc(100% + 6px); }
.dropdown.open > .menu { opacity: 1; transform: none; pointer-events: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-size: 13.5px; text-align: left; cursor: pointer; text-decoration: none; white-space: nowrap; }
.menu-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.menu-item svg { width: 16px; height: 16px; }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; margin: 6px 0; background: var(--border); }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }

.notif-menu { width: 360px; padding: 0; }
.notif-menu .notif { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-menu .notif.unread { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.notif-menu .notif .ni { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
@media (max-width: 480px) { .notif-menu { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; } }

/* ---------- Modal & Çekmece ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 20px;
  background: rgba(5, 12, 14, .5);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 520px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.98); transition: transform .2s;
}
.modal.lg { max-width: 760px; }
.modal.sm { max-width: 420px; }
.modal-backdrop.open .modal { transform: none; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal-header p { color: var(--muted); margin-top: 4px; font-size: 13px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .modal-backdrop { place-items: end stretch; padding: 0; }
  .modal, .modal.lg, .modal.sm { max-width: none; max-height: 92vh; border-radius: 22px 22px 0 0; transform: translateY(40px); }
  .modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 8px auto 0; }
  .modal-footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal-footer .btn { flex: 1; }
}

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80;
  width: 100%; max-width: 460px;
  display: flex; flex-direction: column;
  background: var(--surface); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .25s ease;
}
.drawer.open { transform: none; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }
.drawer-backdrop { position: fixed; inset: 0; z-index: 79; background: rgba(5, 12, 14, .4); opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

/* ---------- Bildirim (toast) ---------- */
.toasts { position: fixed; z-index: 100; right: 20px; top: 76px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 500; pointer-events: auto; animation: toastIn .25s ease; }
.toast svg { color: var(--primary); }
.toast.error svg { color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 768px) { .toasts { top: auto; left: 16px; right: 16px; bottom: calc(var(--bottomnav-h) + 16px); } .toast { max-width: none; } }

/* ---------- Kod bloğu ---------- */
.code {
  position: relative; margin: 0; padding: 14px 16px; overflow-x: auto;
  border-radius: var(--radius); background: #0d1719; color: #d6e4e6;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
}
.code .k { color: #7fd7ff; } .code .s { color: #a5e8a0; } .code .n { color: #ffcb8b; } .code .c { color: #6c8589; } .code .p { color: #f79ccf; }
.code-copy { position: absolute; top: 8px; right: 8px; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-radius: var(--radius) var(--radius) 0 0; background: #13201f; color: #9fb4b7; font-size: 12px; }
.code-head + .code { border-radius: 0 0 var(--radius) var(--radius); }
kbd { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--border); border-bottom-width: 2px; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.inline-code { padding: 1px 6px; border-radius: 5px; background: var(--surface-3); font-family: var(--mono); font-size: 12px; }
.var { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--info-soft); color: var(--info); font-family: var(--mono); font-size: 12px; font-weight: 500; cursor: pointer; border: 0; }
.var:hover { filter: brightness(.96); }

/* ---------- WhatsApp önizleme ---------- */
.phone {
  width: 100%; max-width: 320px; margin: 0 auto;
  border-radius: 34px; padding: 10px;
  background: #11191b; box-shadow: var(--shadow-lg), inset 0 0 0 2px #2a3537;
}
.phone-screen { border-radius: 26px; overflow: hidden; background: var(--wa-bg); display: flex; flex-direction: column; height: 540px; }
.phone-head { display: flex; align-items: center; gap: 10px; padding: 26px 12px 10px; background: var(--wa-head); color: #fff; }
.phone-head .avatar { width: 32px; height: 32px; }
.phone-head .t { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.phone-head .s { font-size: 11px; opacity: .8; }
.phone-body {
  flex: 1; padding: 12px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px);
  background-size: 14px 14px;
}
.phone-foot { display: flex; align-items: center; gap: 8px; padding: 8px; }
.phone-foot .fake-input { flex: 1; height: 36px; border-radius: 18px; background: var(--wa-in); color: var(--muted); display: flex; align-items: center; padding: 0 14px; font-size: 13px; }
.phone-foot .fake-mic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #00a884; color: #fff; }
.bubble {
  position: relative; max-width: 85%; padding: 6px 9px 18px; border-radius: 10px;
  background: var(--wa-in); color: var(--text); font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 1px .5px rgba(0,0,0,.13); white-space: pre-wrap; word-wrap: break-word;
}
.bubble.out { align-self: flex-end; background: var(--wa-out); border-top-right-radius: 3px; }
.bubble.in { align-self: flex-start; border-top-left-radius: 3px; }
.bubble .meta { position: absolute; right: 8px; bottom: 3px; display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); }
.bubble .meta svg { width: 14px; height: 14px; color: #53bdeb; }
.bubble img, .bubble .media { border-radius: 7px; margin: -2px -5px 6px; width: calc(100% + 10px); max-width: none; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); }
.bubble .btns { margin: 8px -9px -18px; border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent); }
.bubble .btns div { padding: 8px; text-align: center; color: #00a5f4; font-weight: 500; border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
.bubble .btns div:last-child { border-bottom: 0; }
.bubble b { font-weight: 700; }
.day-sep { align-self: center; padding: 4px 10px; border-radius: 8px; background: var(--wa-in); color: var(--muted); font-size: 11.5px; box-shadow: 0 1px .5px rgba(0,0,0,.1); }

/* ---------- Grafik (saf CSS) ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 220px; padding-top: 10px; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; min-width: 0; }
.bar-chart .bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bar-chart .bar { width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px; background: var(--primary); position: relative; transition: height .5s ease, opacity .15s; }
.bar-chart .bar.b2 { background: color-mix(in srgb, var(--primary) 35%, var(--surface-3)); }
.bar-chart .bar:hover { opacity: .85; }
.bar-chart .bar-label { font-size: 11.5px; color: var(--muted); }
.bar-chart .bar[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 4px 8px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: 11.5px; white-space: nowrap; z-index: 5; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; 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; }
.donut { width: 140px; height: 140px; border-radius: 50%; position: relative; flex-shrink: 0; }
.donut::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: var(--surface); }
.donut .donut-center { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; text-align: center; }
.spark { width: 100%; height: 40px; }

/* ---------- Kişisel öğeler ---------- */
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

.feature-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.feature-icon.info { background: var(--info-soft); color: var(--info); }
.feature-icon.warning { background: var(--warning-soft); color: var(--warning); }
.feature-icon.violet { background: var(--violet-soft); color: var(--violet); }
.feature-icon.danger { background: var(--danger-soft); color: var(--danger); }

.qr-box { width: 220px; height: 220px; border-radius: var(--radius); background: #fff; padding: 12px; box-shadow: var(--shadow); position: relative; }
.qr-box svg { width: 100%; height: 100%; }

.skeleton { border-radius: 6px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.timeline { position: relative; display: flex; flex-direction: column; gap: 18px; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -24px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }

/* ---------- Kimlik doğrulama sayfaları ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-form { display: flex; flex-direction: column; padding: 28px 40px; }
.auth-form .inner { width: 100%; max-width: 400px; margin: auto; padding: 32px 0; }
.auth-side {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 56px;
  background: radial-gradient(1200px 600px at 100% 0%, #13c27e 0%, transparent 55%), linear-gradient(160deg, #06402a, #04261a);
  color: #e6fff3;
}
.auth-side h2 { color: #fff; font-size: 28px; line-height: 1.25; }
@media (max-width: 960px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } .auth-form { padding: 20px; } }

/* ---------- Animasyon tercihi ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================
   U1 — kabuk erişilebilirliği, genel arama, yükleniyor iskeleti, bildirimler
   ========================================================= */
/* "İçeriğe geç": yalnızca klavye odağında görünür */
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 2000; padding: 10px 14px; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-weight: 600; transform: translateY(-150%); transition: transform .15s; }
.skip-link:focus { transform: none; outline: 2px solid var(--text); outline-offset: 2px; }
.content[tabindex="-1"]:focus { outline: none; }

/* Kapalı modal/çekmecedeki alanlara Tab ile gidilemesin */
.modal-backdrop:not(.open) { visibility: hidden; transition: opacity .2s, visibility 0s .2s; }
.drawer:not(.open) { visibility: hidden; transition: transform .25s ease, visibility 0s .25s; }
.modal:focus, .drawer:focus { outline: none; }

/* Bildirimler: masaüstünde sağ altta, mobilde alt menünün üstünde — üstteki kabuk bantlarını ve sayfa düğmelerini örtmez */
@media (min-width: 769px) { .toasts { top: auto; bottom: 20px; right: 20px; left: auto; align-items: flex-end; } }
@media (max-width: 768px) { .toasts { top: auto; bottom: calc(var(--bottomnav-h, 64px) + 12px); left: 12px; right: 12px; } }
/* Altta yapışkan eylem çubuğu olan sayfalarda (sihirbaz "Devam et", kampanya "İleri") bildirimler çubuğun üstünde */
body:has(.wz-nav, .wiz-foot) .toasts { bottom: 92px; }
body:has(#composer) .toasts { bottom: 128px; }
@media (max-width: 768px) { body:has(.wz-nav, .wiz-foot) .toasts { bottom: calc(var(--bottomnav-h, 64px) + 84px); } body:has(#composer) .toasts { bottom: calc(var(--bottomnav-h, 64px) + 130px); } }
/* Kabuk bantları: aynı anda en fazla biri (en önemlisi), kalanlar "+N uyarı" ile açılır */
.shell-banner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 9px 16px; font-size: 13.5px; color: var(--text); }
.shell-banner .sb-more { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 2px 4px; white-space: nowrap; }
#shell-banners:not(.expanded) .shell-banner.extra { display: none; }
@media (max-width: 768px) { .shell-banner { padding: 7px 12px; font-size: 12.5px; gap: 8px; } .shell-banner .btn { height: 28px; padding: 0 10px; } }
/* Gönderim kapalı (deneme bitti, ödeme bekleniyor, kota doldu, bağlı hat yok): düğmenin yanında neden + bağlantı */
.chart-empty { position: absolute; inset: 0 0 24px; display: flex; align-items: center; justify-content: center; gap: 10px; text-align: left; font-size: 13.5px; color: var(--text-2); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.chart-empty svg { width: 22px; height: 22px; color: var(--muted); }
.send-gate { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); padding: 8px 12px; border-radius: 10px; background: var(--warning-soft); }
.send-gate svg { width: 15px; height: 15px; color: var(--warning); flex-shrink: 0; margin-top: 1px; }
.send-gate a { font-weight: 600; white-space: nowrap; }
.card > .send-gate { margin: 0 16px 14px; }
.toast-action { margin-left: 4px; padding: 4px 10px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.toast-action:hover { background: color-mix(in srgb, var(--bg) 30%, transparent); }

/* Genel arama sonuçları */
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; max-height: min(460px, 70vh); overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); }
.search-results .sr-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.search-results .sr-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; }
.search-results .sr-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }
.search-results .sr-item:hover, .search-results .sr-item.active { background: var(--surface-2); color: var(--text); }
.search-results .sr-item.active { box-shadow: inset 2px 0 0 var(--primary); }
.search-results .sr-title { display: block; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .sr-sub { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .sr-all { border-top: 1px solid var(--border); margin-top: 4px; border-radius: 0 0 8px 8px; font-size: 13px; }
.search-results .sr-empty { padding: 12px 10px; }
.topbar-search:focus-within kbd { display: none; }

/* Bildirim menüsü: tıklanabilir satırlar ve karşılama kartı */
.notif-menu a.notif { color: inherit; text-decoration: none; }
.notif-menu a.notif:hover { background: var(--surface-2); }
.notif-menu .notif-welcome { background: color-mix(in srgb, var(--primary-soft) 40%, transparent); }

/* Yükleniyor iskeleti: panel sayfaları (body[data-page]) AÇILDIĞI ANDAN itibaren yükleniyor görünümündedir;
   JavaScript'i beklemez, böylece ilk boyamada boş/eski içerik görünmez. Veri gelince app.js body.is-ready ekler.
   [data-skel]     → değeri sonradan yazılacak alan (sayı, ad, satır); bu sırada titreşen gri blok
   [data-skel-row] → yalnızca yüklenirken görünen yer tutucu satır */
body[data-page]:not(.is-ready) [data-skel] { color: transparent !important; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%) !important; background-size: 200% 100% !important; animation: shimmer 1.4s infinite; user-select: none; pointer-events: none; }
body[data-page]:not(.is-ready) [data-skel] > * { visibility: hidden; }
body[data-page]:not(.is-ready) [data-skel]:empty { display: inline-block; min-width: 4em; min-height: 1em; }
body.is-offline [data-skel] { animation: none; }
.offline-state { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: 12px; background: var(--danger-soft); color: var(--text); }
.offline-state > svg { width: 22px; height: 22px; color: var(--danger); flex-shrink: 0; }
/* Yalnızca yüklenirken görünen yer tutucu satırlar (sunucusuz önizlemede de gizli) */
body.is-ready [data-skel-row], body:not([data-page]) [data-skel-row] { display: none !important; }

/* Mobil genel arama (UX #69): üst bardaki büyüteç tam genişlikte arama şeridini açar; sonuçlar altında */
.search-close { display: none; }
@media (max-width: 768px) {
  /* Üst bar dar ekranda sığsın: tema düğmesi avatar menüsünde de var; başlık tek satır */
  .topbar { gap: 8px; }
  .topbar-actions { gap: 2px; }
  .topbar-actions > .icon-btn[data-theme-toggle] { display: none; }
  .topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.search-open .topbar-search { display: flex; align-items: center; position: absolute; inset: 0; z-index: 5; max-width: none; padding: 0 8px 0 12px; gap: 6px; background: var(--surface); }
  body.search-open .topbar-search > [data-lucide], body.search-open .topbar-search > svg { left: 23px; }
  body.search-open .topbar-search input { flex: 1; min-width: 0; font-size: 16px; }
  body.search-open .topbar-search kbd { display: none; }
  body.search-open .search-close { display: inline-flex; flex-shrink: 0; }
  body.search-open .topbar-search input::-webkit-search-cancel-button { display: none; }
  body.search-open .search-results { position: absolute; top: 100%; left: 0; right: 0; border-radius: 0 0 12px 12px; max-height: calc(100dvh - var(--topbar-h) - var(--bottomnav-h) - 8px); }
}

/* Yer tutucu satır parçaları ([data-skel-row] içinde): .sk satır, .sk.lg büyük sayı, .sk.block kutu */
.sk { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.sk + .sk { margin-top: 8px; }
.sk.lg { height: 26px; width: 45%; }
.sk.block { height: 100%; min-height: 120px; border-radius: 10px; }
.sk-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.sk-row .sk-av { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.sk-row > .grow > .sk:first-child { width: 55%; }
.sk-row > .grow > .sk:last-child:not(:first-child) { width: 80%; height: 10px; }
body.is-offline .sk { animation: none; }
/* Panel "Gönderilen (bugün)": mobilde eğilim ve sıra bilgisi alt alta, kırılmadan (UX #74) */
.stat-foot .trend { white-space: nowrap; }
.stat-foot .nowrap { white-space: nowrap; }
/* Terim yardımı (UX #82): jargonun yanında küçük "?" — yardim.html sözlüğüne gider */
.qhelp { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 4px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--muted); font-size: 10.5px; font-weight: 700; line-height: 1; text-decoration: none; vertical-align: 1px; flex-shrink: 0; font-style: normal; }
.qhelp:hover, .qhelp:focus-visible { color: var(--primary-text); border-color: var(--primary); text-decoration: none; }
.tab-intro { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
/* Görselli / konumlu önizleme baloncuğu kısa metinle daralmasın (UX #80) */
.bubble:has(> img), .bubble:has(> .media) { width: min(85%, 300px); }

/* Kabuk (kenar menüsü + üst bar) JavaScript ile kurulur. Kurulana kadar aynı ölçülerde yer tutucular gösterilir:
   ilk boyamada içerik yukarıda başlayıp sonra aşağı zıplamaz, kenar şeridi boş/koyu görünmez. */
body[data-page]:not([data-shell]) .main::before { content: ""; flex: none; height: var(--topbar-h); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 82%, transparent); }
@media (min-width: 769px) {
  body[data-page]:not([data-shell]) .app::before { content: ""; position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); z-index: 1; }
}

/* Temsilci rolü: rehberi toplu dışa aktarma, toplu silme ve KVKK silme yetkisi yok (sunucu 403 döner) */
body[data-role="agent"] [data-export],
body[data-role="agent"] [data-forget],
body[data-role="agent"] [data-bulk-delete] { display: none !important; }

/* Ödeme logoları (iyzico başvurusu: "iyzico ile Öde", Visa, Mastercard). Logolar koyu temada da okunsun diye beyaz zemin üzerinde */
.pay-band { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.pay-band-t { color: var(--muted); font-size: 12.5px; margin-right: 4px; }
.pay-logo { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 10px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; }
.pay-logo img { display: block; height: 20px; width: auto; }
.pay-logo img[alt="iyzico ile Öde"] { height: 26px; }
.pw-foot .pay-band { margin-top: 0; padding-top: 0; border-top: 0; width: 100%; }
/* Rol yetkileri (sunucuda da denetlenir): temsilci ve geliştirici kampanya oluşturamaz; geliştirici gelen kutusunu görmez */
body[data-role="agent"] a[href^="kampanya-olustur"],
body[data-role="developer"] a[href^="kampanya-olustur"],
body[data-role="developer"] a[href="gelen-kutusu"] { display: none !important; }
/* Gelen kutusu > Yeni sohbet: rehberden kişi önerileri */
.nc-suggest { margin-top: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 4px; max-height: 240px; overflow: auto; }
.nc-suggest .menu-item .grow { flex: 1; min-width: 0; }
/* Duyuru / bakım bandı (Sistem yönetimi > Sistem ayarları) */
.site-notice { background: #fff4d6; color: #5c4300; border-bottom: 1px solid #f2d48a; padding: 9px 16px; font-size: 13.5px; text-align: center; line-height: 1.45; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-notice { background: #3a2f12; color: #ffe3a3; border-color: #5c4a1a; } }
[data-theme="dark"] .site-notice { background: #3a2f12; color: #ffe3a3; border-color: #5c4a1a; }
/* Hat kartları: dar sütuna sıkışıp numara/açıklama satır satır kırılmasın */
#lines-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
/* Raporlar: iki tablo yan yana ancak geniş ekranda (dar ekranda sütunlar sıkışıp yatay kaydırma gerekiyordu) */
.r-tables { grid-template-columns: 1fr; }
@media (min-width: 1400px) { .r-tables { grid-template-columns: 1fr 1fr; } }
/* Gelen kutusu: sohbet başlığı daralınca kişi adı kaybolmasın; düğmeler simgeye iner */
.chat-head { container-type: inline-size; }
.chat-head > .grow { min-width: 140px; }
@container (max-width: 720px) {
  .chat-head #resolveBtn .hide-sm { display: none; }
  .chat-head #assignBtn { font-size: 0; gap: 0; }
  .chat-head #assignBtn .avatar { font-size: 9px; }
}
/* Sistem yönetimi: sunucu / motor / kuyruk kartları dar sütuna sıkışmasın */
#a-health { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.btn-block { white-space: normal; }
/* Kampanyalar: orta genişlikte "Hat" sütunu gizlenir, kampanya adı 3 satıra bölünmesin */
#camp-table td.td-main { min-width: 200px; }
@media (min-width: 769px) and (max-width: 1350px) {
  #camp-table th:nth-child(5), #camp-table td:nth-child(5) { display: none; }
}
/* Seçenek kartları dar sütunda (ör. kampanya zamanlama 3'lü ızgarası): simge üstte, metin tam genişlikte; kelime kelime kırılmasın */
.grid:has(> .option-card) { container-type: inline-size; }
@container (max-width: 520px) {
  .grid-3 > .option-card { flex-direction: column; align-items: flex-start; gap: 8px; }
}
/* Hızlı gönder › Son gönderilenler: numara satırlara bölünmesin; mesaj sütunu kısalsın */
#recent td:first-child { min-width: 190px; }
#recent .cell-user .name, #recent .cell-user .sub { white-space: nowrap; }
#recent td:nth-child(2) { max-width: 220px; }
#recent td:nth-child(2) .truncate { max-width: 220px; }
@media (max-width: 768px) { #recent td:first-child, #recent td:nth-child(2), #recent td:nth-child(2) .truncate { min-width: 0; max-width: none; } }
/* Anahtar-değer listeleri dar kartta (ör. Paketim yan sütunu): etiket üstte, değer altta; e-posta 3 satıra bölünmesin */
.card-body:has(> .kv) { container-type: inline-size; }
@container (max-width: 320px) {
  .kv { grid-template-columns: 1fr !important; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
}
/* Paketim › ek paketler: dar sütunda açıklama kelime kelime kırılmasın, fiyat yazıya binmesin */
#addons { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
#addons [data-addon-price] { white-space: nowrap; }
/* Tablolarda tek parça değerler (numara, fatura no, kod) satırlara bölünmesin */
.table td .mono { white-space: nowrap; }
/* Hızlı gönder › şablon menüsü: şablon adları kesilmesin */
#tpl-menu { min-width: min(300px, calc(100vw - 32px)); }
/* Onay / metin penceresi (Ulak.confirm / Ulak.prompt) açık yan panel ve pencerelerin üstünde kalır */
.modal-backdrop[id^="ulak-ask-"] { z-index: 95; }
/* iyzico'nun resmi "iyzico ile Öde" alt bilgi bandı (Mastercard, Visa, Amex, Troy dahil); telefonda daralır */
.pay-logo-band { height: 40px; padding: 0 12px; max-width: 100%; }
.pay-logo-band img { height: 24px; max-width: 100%; object-fit: contain; }
