/* ═══════════════════════════════════════════════════
   OTOMASYON MARKETİ — SaaS PANEL STİLİ
   Açık tema (2026-09-23 kullanıcı kararı). Marka rengi (mor/mavi) ve logo
   aynı; renkler :root token'larından gelir — yeni kodda sabit renk yazma.
   ═══════════════════════════════════════════════════ */

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

:root {
  color-scheme: light;
  --color-bg: #f4f6fb;
  --color-surface: #ffffff;
  --color-surface-hover: #eef1f8;
  --color-surface-alt: #f1f4f9;
  --color-border: #e2e8f0;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06);

  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;

  --color-primary: #0369a1;
  --color-primary-hover: #0b3d7a;
  --color-accent: #0891b2;
  --color-danger: #dc2626;
  --color-success: #059669;
  --color-warning: #b45309;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

body {
  font-family: var(--font-family);
  background: radial-gradient(circle at 50% 0%, #dff3fb 0%, #f4f6fb 50%, #f4f6fb 100%);
  background-attachment: fixed;
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; }

/* ── Auth Sayfası (index.html) ── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  backdrop-filter: blur(20px);
}

.auth-logo-row { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 20px; }
.auth-logo-row img { width: 36px; height: 36px; border-radius: var(--radius-sm); }
.auth-logo-row span { font-weight: 800; font-size: 1.1rem; }

.auth-tabs { display: flex; gap: 4px; margin-bottom: 22px; background: var(--color-surface-alt); border-radius: var(--radius-md); padding: 4px; }
.auth-tab-btn {
  flex: 1; padding: 10px; border: none; background: transparent; color: var(--color-text-secondary);
  font-family: inherit; font-weight: 700; font-size: 0.85rem; border-radius: var(--radius-sm); cursor: pointer;
  transition: all 150ms ease;
}
.auth-tab-btn.active { background: var(--color-primary); color: #fff; }

.auth-pane { display: none; flex-direction: column; gap: 12px; }
.auth-pane.active { display: flex; }

.auth-pane label { font-size: 0.8rem; color: var(--color-text-secondary); font-weight: 600; }

.auth-pane input {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-md); border: 1px solid var(--color-border);
  background: var(--color-surface-alt); color: var(--color-text); font-family: inherit; font-size: 0.92rem;
}
.auth-pane input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }

.auth-submit-btn {
  margin-top: 6px; width: 100%; padding: 12px; border: none; border-radius: var(--radius-md);
  background: var(--color-primary); color: #fff; font-family: inherit; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; transition: background 150ms ease;
}
.auth-submit-btn:hover { background: var(--color-primary-hover); }
.auth-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-error { color: var(--color-danger); font-size: 0.85rem; min-height: 1.2em; }
.auth-hint { color: var(--color-text-muted); font-size: 0.78rem; text-align: center; margin-top: 14px; }
.auth-hint a { color: var(--color-accent); font-weight: 600; }

/* ── Dashboard Kabuğu (dashboard.html) ── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; flex-shrink: 0; border-right: 1px solid var(--color-border);
  background: #ffffff; display: flex; flex-direction: column; padding: 20px 14px;
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; }
.sidebar-brand img { width: 30px; height: 30px; border-radius: var(--radius-sm); }
.sidebar-brand span { font-weight: 800; font-size: 1rem; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--color-text-secondary); text-decoration: none; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; border: none; background: transparent; width: 100%; text-align: left;
  transition: all 150ms ease;
}
.sidebar-link:hover { background: var(--color-surface-hover); color: var(--color-text); }
.sidebar-link.active { background: var(--color-primary); color: #fff; }

.sidebar-footer { border-top: 1px solid var(--color-border); padding-top: 12px; margin-top: 12px; }
.sidebar-org { font-size: 0.75rem; color: var(--color-text-muted); padding: 0 12px 8px; }
.sidebar-org strong { color: var(--color-text-secondary); display: block; font-size: 0.85rem; }
.sidebar-org span { display: block; overflow-wrap: anywhere; }

.main-area { flex: 1; min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 28px;
  border-bottom: 1px solid var(--color-border); position: sticky; top: 0;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(16px); z-index: 10;
}
.topbar h1 { font-size: 1.15rem; font-weight: 800; }

.content { padding: 28px; max-width: 1200px; }

.page { display: none; }
.page.active { display: block; animation: pageFadeIn 200ms ease; }

@keyframes pageFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Genel Bakış Kartları ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 0.8rem; color: var(--color-text-secondary); }
.stat-value { font-size: 1.7rem; font-weight: 800; }

.section-title { font-size: 1rem; font-weight: 700; margin: 26px 0 12px; }
.section-title:first-child { margin-top: 0; }

.channel-grid { display: flex; flex-wrap: wrap; gap: 10px; }
/* Genel Bakış: solda sayılar, sağda bu ayki kullanım sütunu; dar ekranda alt alta. */
.overview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.overview-usage .section-title { margin-top: 0; }
.overview-usage-list { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 1100px) { .overview-layout { grid-template-columns: 1fr; } }
.channel-pill {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 999px;
  padding: 10px 18px; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 8px;
}

.placeholder-panel {
  border: 1px dashed var(--color-border); border-radius: var(--radius-lg); padding: 48px 24px;
  text-align: center; color: var(--color-text-muted);
}
.placeholder-panel h2 { color: var(--color-text-secondary); font-size: 1.1rem; margin-bottom: 8px; }

/* ── Kanallar ── */
.channel-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 8px; }
.channel-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.channel-card-name { font-weight: 700; font-size: 0.95rem; }
.channel-status { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--color-text-secondary); }
.status-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--color-text-muted); }
.status-dot.on { background: var(--color-success); }
.channel-widget-id { font-size: 0.72rem; color: var(--color-text-muted); word-break: break-all; }
.widget-snippet {
  width: 100%; resize: vertical; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: var(--color-surface-alt); color: var(--color-accent); font-family: 'Courier New', monospace;
  font-size: 0.72rem; word-break: break-all;
}
.channel-btn {
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: var(--color-surface-alt); color: var(--color-text); font-family: inherit; font-weight: 600;
  font-size: 0.82rem; cursor: pointer; transition: all 150ms ease;
}
.channel-btn.primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.channel-btn.primary:hover { background: var(--color-primary-hover); }
.channel-btn.danger:hover { border-color: var(--color-danger); color: var(--color-danger); }
.channel-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.mock-form { display: flex; flex-direction: column; gap: 10px; max-width: 480px; margin-top: 14px; }
.mock-form select, .mock-form input, .mock-form textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--color-border);
  background: var(--color-surface-alt); color: var(--color-text); font-family: inherit; font-size: 0.88rem; resize: vertical;
}
.mock-success { color: var(--color-success); font-size: 0.85rem; min-height: 1.2em; }

/* ── Gelen Kutusu ── */
.inbox-shell {
  display: grid; grid-template-columns: 320px 1fr; gap: 16px; height: calc(100vh - 160px); min-height: 420px;
}
.inbox-list-pane { display: flex; flex-direction: column; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.inbox-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-bottom: 1px solid var(--color-border); }
.filter-chip {
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--color-border); background: transparent;
  color: var(--color-text-secondary); font-family: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer;
}
.filter-chip.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

.conversation-list { flex: 1; overflow-y: auto; }
.conversation-item {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--color-border-light, var(--color-border));
  cursor: pointer; transition: background 150ms ease;
}
.conversation-item:hover { background: var(--color-surface-hover); }
.conversation-item.active { background: var(--color-surface-hover); border-left: 3px solid var(--color-primary); }
.conv-top-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.conv-name { font-weight: 700; font-size: 0.88rem; }
.conv-meta { font-size: 0.7rem; color: var(--color-text-muted); }
.conv-last-msg { font-size: 0.8rem; color: var(--color-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-badges { display: flex; gap: 4px; align-items: center; }
.nav-badge {
  margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--color-primary);
  color: #fff; font-size: 0.7rem; font-weight: 700; text-align: center; line-height: 1.5;
}
.sidebar-link.active .nav-badge { background: #fff; color: var(--color-primary); }
.unread-badge { background: var(--color-primary); color: #fff; font-size: 0.68rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.handler-badge { font-size: 0.68rem; padding: 1px 7px; border-radius: 999px; background: var(--color-surface-alt); color: var(--color-text-secondary); }

.inbox-thread-pane { border: 1px solid var(--color-border); border-radius: var(--radius-md); display: flex; flex-direction: column; overflow: hidden; }
.thread-header { padding: 14px; border-bottom: 1px solid var(--color-border); display: flex; justify-content: space-between; align-items: center; }
.thread-header h3 { font-size: 0.95rem; }
.thread-header-meta { font-size: 0.75rem; color: var(--color-text-muted); }
.thread-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.thread-msg { max-width: 70%; padding: 9px 13px; border-radius: var(--radius-md); font-size: 0.85rem; line-height: 1.4; }
.thread-msg.in { align-self: flex-start; background: var(--color-surface-alt); }
.thread-msg.out { align-self: flex-end; background: var(--color-primary); color: #fff; }
.thread-msg-meta { font-size: 0.65rem; opacity: 0.7; margin-top: 4px; }
.thread-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--color-border); }
.thread-compose textarea {
  flex: 1; resize: none; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--color-border);
  background: var(--color-surface-alt); color: var(--color-text); font-family: inherit; font-size: 0.85rem;
}

.handler-switch { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.handler-option { display: flex; }
.handler-option .handler-btn { width: 100%; }
.handler-btn {
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: var(--color-surface-alt); color: var(--color-text-secondary); font-family: inherit; font-weight: 700;
  font-size: 0.8rem; cursor: pointer; transition: all 150ms ease; white-space: nowrap;
}
.handler-btn:hover:not(.active):not(:disabled) { border-color: var(--color-primary); color: var(--color-text); }
.handler-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; cursor: default; }
.handler-btn:disabled:not(.active) { opacity: 0.6; cursor: not-allowed; }

/* ── Ayar Formları (AI Asistan) ── */
.settings-form { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.settings-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--color-text-secondary); font-weight: 600; }
.settings-form input, .settings-form select, .settings-form textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--color-border);
  background: var(--color-surface-alt); color: var(--color-text); font-family: inherit; font-size: 0.88rem; font-weight: 400; resize: vertical;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row[hidden] { display: none; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ── Bilgi Bankası ── */
.knowledge-form { margin-bottom: 24px; }
.knowledge-list { display: flex; flex-direction: column; gap: 10px; }
.knowledge-item {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 14px 16px; display: flex; justify-content: space-between; gap: 14px; align-items: flex-start;
}
.knowledge-item-body { flex: 1; min-width: 0; }
.knowledge-item-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.knowledge-item-content { font-size: 0.82rem; color: var(--color-text-secondary); white-space: pre-wrap; }
.knowledge-type-badge {
  display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--color-primary-light, rgba(3, 105, 161, 0.15)); color: var(--color-primary); margin-bottom: 6px;
}
.knowledge-delete-btn {
  border: none; background: transparent; color: var(--color-text-muted); cursor: pointer; font-size: 0.78rem;
  padding: 4px 8px; border-radius: var(--radius-sm); transition: all 150ms ease; flex-shrink: 0;
}
.knowledge-delete-btn:hover { color: var(--color-danger); background: rgba(248, 113, 113, 0.1); }

/* ── Otomasyonlar ── */
.automation-list { display: flex; flex-direction: column; gap: 2px; max-width: 640px; }
.automation-item {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 16px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 8px;
}
.automation-label { font-size: 0.88rem; font-weight: 600; }
.toggle-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; z-index: 1; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--color-surface-alt); border: 1px solid var(--color-border);
  border-radius: 999px; transition: background 150ms ease;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: var(--color-text-muted);
  border-radius: 999px; transition: all 150ms ease;
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-primary); border-color: var(--color-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); background: #fff; }

/* ── Randevular ── */
.appt-subpage { display: none; }
.appt-subpage.active { display: block; animation: pageFadeIn 200ms ease; }

.hint-text { color: var(--color-text-muted); font-size: 0.82rem; margin-bottom: 14px; }

/* Yeni Randevu formu solda, onay ayarı kartı sağdaki boşlukta; dar ekranda alt alta. */
.appt-top { display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 600px); gap: 28px; align-items: start; }
/* Randevu Onayı + WhatsApp bildirimleri: yan yana, eşit yükseklik (grid satırı en uzun karta göre uzar). */
.appt-side-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; margin-top: 26px; }
.appt-approval-card {
  background: var(--color-surface); border: 1px solid var(--color-border); box-shadow: var(--shadow-card);
  border-radius: var(--radius-md); padding: 18px; display: flex; flex-direction: column;
}
.appt-approval-card .section-title { margin: 0 0 14px; }
.appt-approval-card .hint-text { margin: 10px 0 0; }
.appt-capacity-card { grid-column: 1 / -1; }
.appt-capacity-card .capacity-row { max-width: none; margin-bottom: 0; }
.approval-row { display: flex; align-items: flex-start; gap: 10px; }
.approval-label { font-weight: 700; font-size: 0.88rem; line-height: 1.35; cursor: pointer; }
.approval-state { margin: 10px 0 0; font-size: 0.8rem; font-weight: 700; color: var(--color-text-muted); }
.approval-state.on { color: var(--color-success); }
.approval-state.error { color: var(--color-danger, #dc2626); }
.approval-row + .approval-row { margin-top: 10px; }
/* Randevu satırındaki WhatsApp bildirim/hatırlatma sonucu. */
.appt-msg-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  white-space: nowrap; cursor: default;
}
.appt-msg-badge.ok { background: rgba(22, 163, 74, 0.12); color: var(--color-success); }
.appt-msg-badge.fail { background: rgba(220, 38, 38, 0.1); color: var(--color-danger, #dc2626); }
.appt-time-hint { margin: -4px 0 0; }

/* Randevular: Liste | Takvim geçişi ve haftalık saat çizelgesi */
.appt-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.view-toggle { display: flex; gap: 6px; margin-top: 14px; }
.appointment-list[hidden], .appt-calendar[hidden], .cal-detail[hidden] { display: none; }
.appt-calendar { margin-top: 14px; }
.cal-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-nav {
  padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text); font-family: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer;
}
.cal-nav:hover { border-color: var(--color-primary); }
.cal-range { font-weight: 700; font-size: 0.9rem; margin-left: 4px; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.75rem; color: var(--color-text-secondary); margin-bottom: 10px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-dot.PENDING { background: var(--color-warning); }
.cal-dot.CONFIRMED { background: var(--color-success); }
.cal-dot.COMPLETED { background: var(--color-primary); }
.cal-dot.CANCELED { background: #94a3b8; }
.cal-scroll { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.cal-grid { display: grid; grid-template-columns: 52px repeat(7, minmax(92px, 1fr)); min-width: 700px; }
.cal-col { border-left: 1px solid var(--color-border); min-width: 0; }
.cal-times { border-left: none; position: sticky; left: 0; z-index: 3; background: var(--color-surface); }
.cal-day-head {
  height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 0.72rem; color: var(--color-text-secondary); border-bottom: 1px solid var(--color-border);
}
.cal-day-head b { font-size: 0.95rem; color: var(--color-text); }
.cal-day-head small { font-size: 0.62rem; color: var(--color-text-muted); }
.cal-col.today .cal-day-head, .cal-col.today .cal-day-head b { color: var(--color-primary); }
.cal-day-body {
  position: relative;
  background-image:
    repeating-linear-gradient(to bottom, var(--color-border) 0 1px, transparent 1px 52px),
    repeating-linear-gradient(to bottom, transparent 0 26px, var(--color-surface-alt) 26px 27px, transparent 27px 52px);
}
.cal-col.closed .cal-day-body { background-color: var(--color-surface-alt); }
.cal-times .cal-day-body { background: none; }
.cal-time { font-size: 0.68rem; color: var(--color-text-muted); text-align: right; padding-right: 6px; line-height: 1; transform: translateY(-5px); }
.cal-event {
  position: absolute; border: none; border-left: 3px solid; border-radius: 6px; padding: 3px 5px;
  font-family: inherit; font-size: 0.7rem; line-height: 1.25; text-align: left; cursor: pointer;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.cal-event.PENDING { background: rgba(180, 83, 9, 0.13); border-color: var(--color-warning); color: #7c2d12; }
.cal-event.CONFIRMED { background: rgba(5, 150, 105, 0.14); border-color: var(--color-success); color: #065f46; }
.cal-event.COMPLETED { background: rgba(3, 105, 161, 0.13); border-color: var(--color-primary); color: #0c4a6e; }
.cal-event.CANCELED, .cal-event.NO_SHOW { background: var(--color-surface-alt); border-color: #94a3b8; color: var(--color-text-muted); text-decoration: line-through; }
.cal-event:hover { filter: brightness(0.96); }
.cal-event.selected { box-shadow: 0 0 0 2px var(--color-primary); z-index: 2; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--color-danger); z-index: 1; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-danger); }
.cal-detail { margin-top: 12px; }
.cal-close { border: none; background: transparent; font-size: 0.9rem; cursor: pointer; color: var(--color-text-muted); padding: 4px 6px; }
@media (max-width: 1100px) {
  .appt-top { grid-template-columns: 1fr; gap: 0; }
  .appt-side-cards { max-width: 640px; margin-bottom: 8px; }
}
@media (max-width: 640px) { .appt-side-cards { grid-template-columns: 1fr; } }
.channel-hint { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--color-surface-alt); line-height: 1.45; }
.channel-hint p { margin: 0 0 6px; }
.channel-hint p:last-child { margin-bottom: 0; }

.appointment-list, .simple-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.appointment-item, .simple-item {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 14px 16px; display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap;
}
.appointment-item-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.appointment-contact { font-weight: 700; font-size: 0.9rem; }
.appointment-meta { font-size: 0.78rem; color: var(--color-text-secondary); }
.appointment-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
.appt-confirm-btn {
  padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--color-success); background: var(--color-success);
  color: #fff; font-family: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer;
}
.appt-confirm-btn:disabled { opacity: 0.6; cursor: default; }
.appointment-actions select {
  padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: var(--color-surface-alt); color: var(--color-text); font-family: inherit; font-size: 0.78rem;
}

.status-badge {
  font-size: 0.68rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--color-surface-alt); color: var(--color-text-secondary); white-space: nowrap;
}
.status-badge.PENDING { color: var(--color-warning); }
.status-badge.CONFIRMED { color: var(--color-success); }
.status-badge.CANCELED { color: var(--color-danger); }
.status-badge.COMPLETED { color: var(--color-accent); }
.status-badge.NO_SHOW { color: var(--color-text-muted); }

.simple-item-name { font-weight: 700; font-size: 0.88rem; }
.simple-item-meta { font-size: 0.78rem; color: var(--color-text-secondary); margin-top: 2px; }

.hours-list { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.hours-row {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
}
.hours-day { width: 96px; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.hours-row input[type="time"] {
  padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: var(--color-surface-alt); color: var(--color-text); font-family: inherit; font-size: 0.82rem;
}
.hours-sep { color: var(--color-text-muted); }
.hours-state { width: 48px; flex-shrink: 0; font-size: 0.82rem; font-weight: 600; color: var(--color-success, #16a34a); }
.hours-row.closed .hours-state { color: var(--color-text-muted); }
.hours-row.closed input[type="time"] { opacity: 0.35; pointer-events: none; }
.hours-times { display: flex; align-items: center; gap: 14px; }
/* Telefonda saatler gün/düğme satırının altına iner, satır yatay taşmaz. */
@media (max-width: 640px) {
  .hours-row { flex-wrap: wrap; gap: 10px 12px; }
  .hours-day { width: auto; flex: 1; }
  .hours-times { flex-basis: 100%; gap: 10px; }
}
.capacity-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; max-width: 640px; margin-bottom: 6px; }
.capacity-row label { font-weight: 700; font-size: 0.88rem; }
.capacity-row input {
  width: 76px; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: var(--color-surface-alt); color: var(--color-text); font-family: inherit; font-size: 0.9rem;
}
.capacity-status { font-size: 0.8rem; color: var(--color-text-muted); }
.capacity-status.error { color: var(--color-danger, #dc2626); }

.toggle-inline { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.toggle-inline input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Müşteriler (CRM) ── */
.contacts-subpage { display: none; }
.contacts-subpage.active { display: block; animation: pageFadeIn 200ms ease; }

.form-actions-row { display: flex; gap: 10px; align-items: center; }
.form-actions-row .auth-submit-btn { width: auto; flex: 1; }

.search-input {
  width: 100%; max-width: 420px; padding: 10px 12px; margin: 4px 0 14px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: var(--color-surface-alt); color: var(--color-text);
  font-family: inherit; font-size: 0.85rem; display: block;
}

.contact-list { display: flex; flex-direction: column; gap: 10px; }
.contact-item {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 14px 16px; display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap;
}
.contact-item-body { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.contact-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.contact-name { font-weight: 700; font-size: 0.92rem; }
.contact-meta { font-size: 0.8rem; color: var(--color-text-secondary); }
.contact-notes { font-size: 0.8rem; color: var(--color-text-muted); white-space: pre-wrap; margin-top: 2px; }
.contact-counts { font-size: 0.7rem; color: var(--color-text-muted); }

.contact-tags-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 0.7rem; font-weight: 700;
  padding: 3px 9px 3px 7px; border-radius: 999px; background: var(--color-surface-alt); color: var(--color-text);
}
.tag-chip-dot { width: 7px; height: 7px; border-radius: 999px; flex-shrink: 0; }
.tag-chip-remove { border: none; background: transparent; color: inherit; opacity: 0.6; cursor: pointer; font-size: 0.85em; padding: 0; line-height: 1; }
.tag-chip-remove:hover { opacity: 1; }
.tag-add-select {
  font-size: 0.72rem; padding: 3px 8px; border-radius: 999px; border: 1px dashed var(--color-border);
  background: transparent; color: var(--color-text-secondary); font-family: inherit; cursor: pointer;
}

.contact-actions { display: flex; gap: 6px; flex-shrink: 0; }

.simple-item-swatch { width: 12px; height: 12px; border-radius: 999px; flex-shrink: 0; }
.simple-item-with-swatch { display: flex; align-items: center; gap: 10px; }

/* ── Kullanım / Plan / Abonelik (FAZ 7) ── */
.usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 8px; }
.usage-item {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
}
.usage-item-top { display: flex; justify-content: space-between; font-size: 0.82rem; }
.usage-item-top span:first-child { color: var(--color-text-secondary); font-weight: 600; }
.usage-item-top span:last-child { font-weight: 700; }
.usage-bar { height: 6px; border-radius: 999px; background: var(--color-surface-alt); overflow: hidden; }
.usage-bar-fill { height: 100%; background: var(--color-primary); border-radius: 999px; transition: width 200ms ease; }
.usage-bar-fill.warn { background: var(--color-warning); }
.usage-bar-fill.full { background: var(--color-danger); }

.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.plan-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
}
.plan-card.current { border-color: var(--color-primary); background: rgba(3, 105, 161, 0.08); }
.plan-card-name { font-weight: 800; font-size: 1rem; }
.plan-card-price { font-size: 1.3rem; font-weight: 800; color: var(--color-primary); }
/* Kupon (Ürünler > Paketler, bkz. products.js) */
.plan-card-old-price { font-size: 0.9rem; font-weight: 600; color: var(--color-text-muted); }
.plan-card-coupon-note { font-size: 0.75rem; font-weight: 600; color: var(--color-success); }
.coupon-row { display: flex; gap: 8px; max-width: 420px; margin: 4px 0 10px; }
.coupon-row[hidden] { display: none; }
.coupon-row input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: var(--color-surface-alt); color: var(--color-text); font-family: inherit; font-size: 0.85rem; text-transform: uppercase; }
.coupon-row input::placeholder { text-transform: none; }
.coupon-applied { font-size: 0.85rem; color: var(--color-success); margin: 4px 0 10px; }
.coupon-applied[hidden] { display: none; }
.coupon-remove { border: 0; background: transparent; color: var(--color-text-muted); text-decoration: underline; cursor: pointer; font-family: inherit; font-size: 0.8rem; margin-left: 6px; }
.plan-card-limits { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--color-text-secondary); }
.plan-card-limits li::before { content: '✓ '; color: var(--color-success); }
/* Paket kartında aylık AI yanıt hakkı + Ek AI Yanıtı bölümündeki kullanım göstergesi */
.plan-card-quota { font-weight: 700; font-size: 0.95rem; }
/* Paket/ödeme kilidi: kilit ekranı kartı, menüde kilitli bölümler, ödeme kilidinde yalnız Destek */
.lock-card { max-width: 560px; margin: 40px auto; padding: 32px 28px; text-align: center; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.lock-card h2 { margin: 6px 0 12px; font-size: 1.25rem; }
.lock-card p { margin: 0 0 10px; line-height: 1.55; }
.lock-icon { font-size: 2.4rem; }
.lock-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.lock-actions .auth-submit-btn, .lock-actions .channel-btn { width: auto; margin: 0; padding-left: 20px; padding-right: 20px; }
.sidebar-link.nav-locked { opacity: 0.6; }
.sidebar-link.nav-locked::after { content: ' 🔒'; font-size: 0.8em; }
.app-shell.access-locked .sidebar-link:not([data-page="support"]),
.app-shell.access-locked .sidebar-extra-toggle,
.app-shell.access-locked .account-item[data-account-go] { display: none; }
.app-shell.access-locked #sidebarExtraNav { display: flex; }
.vat-note { margin: 10px 0 0; }
.ai-meter-note { margin: 2px 0 0; font-size: 0.85rem; color: var(--color-danger); }
.addon-locked-hint { grid-column: 1 / -1; margin: 0; }
.plan-card .channel-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.billing-actions-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* Telefon/tablet: menü soldan açılan çekmece olur (☰ ile), üst çubuk sabit kalır. */
.menu-toggle, .sidebar-backdrop, .thread-back { display: none; }
@media (max-width: 860px) {
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: 272px; max-width: 85vw;
    transform: translateX(-100%); transition: transform 200ms ease; background: #ffffff; overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); }
  .sidebar-backdrop.open { display: block; }
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface);
    color: var(--color-text); font-size: 1.25rem; cursor: pointer; margin-right: 12px;
  }
  .topbar { position: sticky; top: 0; z-index: 30; padding: 12px 16px; justify-content: flex-start; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); }
  .content { padding: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .content code { overflow-wrap: anywhere; word-break: break-all; }

  /* Gelen Kutusu: liste ve konuşma aynı anda değil, sırayla tam genişlikte */
  .inbox-shell { grid-template-columns: 1fr; height: calc(100dvh - 110px); min-height: 380px; }
  .inbox-shell .inbox-thread-pane { display: none; }
  .inbox-shell.thread-open .inbox-list-pane { display: none; }
  .inbox-shell.thread-open .inbox-thread-pane { display: flex; }
  .thread-back {
    display: inline-block; margin: 10px 12px 0; padding: 6px 10px; border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); background: transparent; color: var(--color-text-secondary);
    font-family: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; align-self: flex-start;
  }
  .thread-header { flex-wrap: wrap; gap: 8px; }
}

/* Platform admin destek modu şeridi (dashboard.html) */
.impersonation-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 18px; background: rgba(251, 191, 36, 0.12); border-bottom: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--color-warning); font-size: 0.85rem;
}
.impersonation-banner[hidden] { display: none; }
.impersonation-banner button {
  background: var(--color-warning); color: #fff; border: 0; border-radius: var(--radius-sm);
  padding: 6px 12px; font-weight: 700; font-size: 0.8rem; cursor: pointer; font-family: inherit;
}

/* Marka: logo amblemi + "Secreta" koyu, ".Ai" logodaki camgöbeği → lacivert geçiş */
.brand-name { font-weight: 800; letter-spacing: -0.02em; color: var(--color-text); line-height: 1; }
.brand-ai {
  background: linear-gradient(135deg, #06b6d4 0%, #0284c7 50%, #0b2a6b 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-size: 0.8rem; font-weight: 600; color: var(--color-text-secondary); margin-left: 4px; }
.auth-logo-row { margin-bottom: 26px; gap: 14px; }
.auth-logo-row img { width: 68px; height: 68px; border-radius: 16px; box-shadow: 0 6px 24px rgba(6, 182, 212, 0.30); }
.auth-logo-row .brand-name { font-size: 2rem; }
.sidebar-brand { gap: 12px; padding: 4px 8px 24px; }
.sidebar-brand img { width: 46px; height: 46px; border-radius: 12px; box-shadow: 0 4px 16px rgba(6, 182, 212, 0.25); }
.sidebar-brand .brand-name { font-size: 1.4rem; }
/* .auth-logo-row span / .sidebar-brand span kuralları iç içe span'ları da küçültüyordu */
.auth-logo-row .brand-name .brand-ai, .sidebar-brand .brand-name .brand-ai { font-size: 1em; }
.sidebar-brand .brand-sub { font-size: 0.8rem; font-weight: 600; }

/* Uygulamayı yükle (PWA) — giriş ekranı bağlantısı + iPhone talimat penceresi */
.install-app-link {
  display: block; width: 100%; margin-top: 14px; padding: 11px; border-radius: var(--radius-md);
  border: 1px dashed rgba(3, 105, 161, 0.55); background: rgba(3, 105, 161, 0.08); color: var(--color-text);
  font-family: inherit; font-size: 0.88rem; font-weight: 700; cursor: pointer;
}
.install-app-link[hidden], #installAppBtn[hidden] { display: none; }
.install-help { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.6); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.install-help-card { background: #ffffff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 22px; max-width: 420px; width: 100%; }
.install-help-card h3 { font-size: 1.05rem; margin-bottom: 12px; }
.install-help-card ol { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; color: var(--color-text-secondary); }
.install-help-card p { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 12px; }
.install-help-card button { margin-top: 16px; width: 100%; padding: 12px; border: 0; border-radius: var(--radius-md); background: var(--color-primary); color: #fff; font-weight: 700; font-family: inherit; font-size: 0.95rem; }

/* Kanallar: yalnızca yönetici destek modunda görünen geliştirici araçları */
.admin-only-tools { margin-top: 26px; padding: 16px; border: 1px dashed rgba(251, 191, 36, 0.45); border-radius: var(--radius-md); }
.admin-only-tools[hidden] { display: none; }
.admin-only-label { color: var(--color-warning); font-size: 0.8rem; font-weight: 700; margin-bottom: 10px; }

/* Açık tema: kartlara hafif gölge, sohbet panelleri düz beyaz */
.stat-card, .channel-card, .plan-card, .simple-item, .appointment-item, .knowledge-item, .automation-item,
.usage-item, .auth-card, .inbox-list-pane, .inbox-thread-pane { box-shadow: var(--shadow-card); }
.inbox-list-pane, .inbox-thread-pane { background: var(--color-surface); }
.sidebar-backdrop.open { background: rgba(15, 23, 42, 0.35); }

/* Kanallar: ürün gerektiren / AI'ı duraklatılmış kanal notu */
.channel-lock { margin: 0; font-size: 0.8rem; color: var(--color-text-secondary); background: var(--color-surface-alt); border-radius: var(--radius-sm); padding: 8px 10px; }

/* Aylık tahsilat başarısız uyarısı (dashboard üstü) */
.payment-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 18px; background: #fff7ed; border-bottom: 1px solid #fdba74; color: #9a3412; font-size: 0.85rem; font-weight: 600;
}
.payment-banner.paused { background: #fef2f2; border-bottom-color: #fca5a5; color: #991b1b; }
.payment-banner[hidden] { display: none; }
.payment-banner button {
  background: var(--color-primary); color: #fff; border: 0; border-radius: var(--radius-sm);
  padding: 6px 12px; font-weight: 700; font-size: 0.8rem; cursor: pointer; font-family: inherit;
}
.owned-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* AI Telefon Asistanı */
.phone-panel { margin-top: 20px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-card); }
.phone-panel[hidden], .phone-test-tools[hidden], #phoneSipFields[hidden], #phoneTwilioFields[hidden] { display: none; }
.phone-type-choice { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.9rem; }
.settings-form .phone-type-choice label { flex-direction: row; align-items: center; gap: 6px; cursor: pointer; font-size: 0.9rem; color: var(--color-text); }
.settings-form .phone-type-choice input { width: auto; padding: 0; margin: 0; }
.phone-number-big { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: 0.02em; color: var(--color-text); }
.phone-codes { border-collapse: collapse; width: 100%; max-width: 520px; font-size: 0.85rem; }
.phone-codes td { padding: 7px 10px; border-bottom: 1px solid var(--color-border); color: var(--color-text-secondary); }
.phone-codes code { font-size: 0.9rem; font-weight: 700; color: var(--color-text); background: var(--color-surface-alt); padding: 2px 6px; border-radius: 6px; }
.thread-phone-note { margin: 0; padding: 12px 14px; border-top: 1px solid var(--color-border); font-size: 0.82rem; color: var(--color-text-secondary); background: var(--color-surface-alt); }

/* Yönetici paneli: işletme paket satırları */
.admin-product-row { flex-wrap: wrap; gap: 10px; }
.admin-product-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-product-controls select { padding: 6px 8px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); color: var(--color-text); font-size: 0.82rem; }
.admin-product-controls .channel-btn { width: auto; padding: 6px 12px; margin: 0; }
.admin-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--color-surface-alt); color: var(--color-text-secondary); margin-left: 6px; }
.admin-product-chip { display: inline-block; font-size: 0.74rem; padding: 1px 7px; margin: 1px 2px 1px 0; border-radius: 999px; background: var(--color-surface-alt); color: var(--color-text); }
.admin-support-guide { background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 16px; font-size: 0.84rem; color: var(--color-text-secondary); }
.admin-support-guide strong { color: var(--color-text); }
.admin-support-guide ul { margin: 6px 0 0; padding-left: 18px; }
.admin-support-guide li { margin: 3px 0; }
.admin-support-guide b { color: var(--color-text); }
.admin-temp-password { margin-top: 6px; font-size: 0.85rem; color: var(--color-text); }
.admin-temp-password code { font-size: 0.95rem; font-weight: 700; background: var(--color-surface-alt); padding: 2px 8px; border-radius: 6px; user-select: all; }
.auth-link-btn { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--color-accent); font-weight: 600; font-size: 0.85rem; cursor: pointer; text-align: center; text-decoration: none; }
.auth-link-btn:hover { text-decoration: underline; }
.owned-card-status { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 4px 0 8px; font-size: 0.8rem; color: var(--color-text-secondary); }
.plan-card .owned-actions .channel-btn { width: 100%; }
.status-badge { display: inline-block; font-size: 0.74rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-right: 4px; border: 1px solid transparent; }
.status-badge.success { color: var(--color-success); background: rgba(5, 150, 105, 0.1); border-color: rgba(5, 150, 105, 0.3); }
.status-badge.warning { color: var(--color-warning); background: rgba(180, 83, 9, 0.1); border-color: rgba(180, 83, 9, 0.3); }
.status-badge.danger { color: var(--color-danger); background: rgba(220, 38, 38, 0.1); border-color: rgba(220, 38, 38, 0.3); }
.status-badge.primary { color: var(--color-primary); background: rgba(3, 105, 161, 0.1); border-color: rgba(3, 105, 161, 0.3); }
.status-badge.muted { color: var(--color-text-secondary); background: var(--color-surface-alt); }
.owned-flash { margin: 6px 0 0; font-size: 0.8rem; font-weight: 600; color: var(--color-success); }

/* Sağ üst hesap menüsü */
.account-menu { position: relative; margin-left: auto; }
.account-trigger { display: flex; align-items: center; gap: 8px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; color: var(--color-text); font: inherit; font-size: 0.85rem; font-weight: 600; }
.account-trigger:hover { border-color: var(--color-primary); }
.account-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: linear-gradient(135deg, var(--color-primary), #06b6d4); color: #fff; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.02em; }
.account-avatar.large { width: 44px; height: 44px; font-size: 0.95rem; }
.account-trigger-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-caret { font-size: 0.7rem; color: var(--color-text-muted); }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 270px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14); padding: 8px; z-index: 60; }
.account-dropdown[hidden] { display: none; }
.account-dropdown-head { display: flex; gap: 10px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--color-border); margin-bottom: 6px; }
.account-dropdown-head strong { display: block; font-size: 0.9rem; color: var(--color-text); }
.account-dropdown-head > div > span { display: block; font-size: 0.76rem; color: var(--color-text-secondary); overflow-wrap: anywhere; }
.account-dropdown-head .account-org { margin-top: 2px; color: var(--color-text-muted); }
.account-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 0.86rem; color: var(--color-text); cursor: pointer; }
.account-item:hover { background: var(--color-surface-alt); }
.account-item.danger { color: var(--color-danger); }
.account-item[hidden] { display: none; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.account-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-card); }
.account-links { display: flex; flex-wrap: wrap; gap: 8px; }
.account-links .channel-btn { width: auto; margin: 0; }
@media (max-width: 860px) {
  .account-trigger { padding: 3px; }
  .account-trigger-name, .account-caret { display: none; }
  .account-dropdown { position: fixed; right: 12px; top: 64px; width: min(290px, calc(100vw - 24px)); }
}
.sidebar-link[hidden] { display: none; }
.account-card { scroll-margin-top: 80px; transition: box-shadow 300ms ease, border-color 300ms ease; }
.account-card-focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.25); }
.catalog-manage-link { background: none; border: 0; padding: 0; margin-top: 2px; color: var(--color-primary); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; text-align: left; }
.catalog-manage-link:hover { text-decoration: underline; }
.channel-card-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.channel-icon { display: inline-flex; width: 30px; height: 30px; flex-shrink: 0; }
.channel-icon svg { width: 100%; height: 100%; display: block; }
/* Yasal bağlantılar: sol menünün en altı ve giriş ekranı */
.sidebar-legal { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid var(--color-border); display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 0.72rem; color: var(--color-text-muted); }
.sidebar-legal a, .auth-legal a { color: var(--color-text-muted); text-decoration: none; }
.sidebar-legal a:hover, .auth-legal a:hover { color: var(--color-primary); text-decoration: underline; }
.auth-legal { display: flex; justify-content: center; gap: 6px; margin-top: 8px; font-size: 0.74rem; color: var(--color-text-muted); }
.auth-company { text-align: center; margin-top: 6px; font-size: 0.7rem; color: var(--color-text-muted); }
.legal-company { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--color-border, #e5e7eb); font-size: 0.85rem; color: var(--color-text-muted); }
/* Yasal sayfalar (gizlilik, kullanım koşulları, veri silme) */
.legal-page { max-width: 780px; margin: 0 auto; padding: 32px 20px 64px; color: var(--color-text); line-height: 1.65; font-size: 0.95rem; }
.legal-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-text); margin-bottom: 14px; }
.legal-brand img { width: 36px; height: 36px; border-radius: 10px; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-bottom: 14px; border-bottom: 1px solid var(--color-border); margin-bottom: 20px; font-size: 0.85rem; }
.legal-nav a { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.legal-page h1 { font-size: 1.6rem; font-weight: 800; margin: 0 0 4px; }
.legal-page h2 { font-size: 1.1rem; font-weight: 700; margin: 26px 0 8px; }
.legal-page h3 { font-size: 0.95rem; font-weight: 700; margin: 14px 0 6px; }
.legal-page ul, .legal-page ol { padding-left: 22px; margin: 6px 0; }
.legal-page li { margin: 4px 0; }
.legal-page a { color: var(--color-primary); }
.legal-date { color: var(--color-text-muted); font-size: 0.82rem; margin: 0 0 18px; }
/* Otomasyonlar bilgi sayfası (salt okunur; bkz. dashboard.html #page-automations) */
.auto-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.auto-step { display: flex; gap: 12px; align-items: flex-start; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px; }
.auto-step div { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; }
.auto-step span:not(.auto-step-no) { color: var(--color-text-muted); font-size: 0.8rem; }
.auto-step-no { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--color-primary); color: #fff; font-weight: 700; font-size: 0.85rem; display: inline-flex; align-items: center; justify-content: center; }
.auto-card { display: flex; flex-direction: column; gap: 10px; font-size: 0.88rem; line-height: 1.55; color: var(--color-text-secondary); }
.auto-card .section-title { margin: 0; color: var(--color-text); }
.auto-card p { margin: 0; }
.auto-card ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.auto-card .account-links { margin-top: auto; padding-top: 4px; }
/* Destek sayfası (bkz. dashboard.html #page-support) */
.support-contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.support-contact { display: flex; align-items: center; gap: 12px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px; text-decoration: none; color: var(--color-text); box-shadow: var(--shadow-card); transition: border-color 150ms ease; min-width: 0; }
.support-contact:hover { border-color: var(--color-primary); }
.support-contact > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.support-contact > span:last-child > span { color: var(--color-text-muted); font-size: 0.82rem; overflow-wrap: break-word; }
.support-contact-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--color-surface-alt); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; }
/* Bilgi Bankası: solda kayıt formu, sağda ürün detay metni; telefonda alt alta */
.knowledge-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; margin-bottom: 24px; }
.knowledge-layout .knowledge-form { margin-bottom: 0; }
.product-details-card .section-title { margin: 0; }
.product-details-card .hint-text { margin-bottom: 0; }
.product-details-foot { display: flex; align-items: center; gap: 12px; }
.product-details-foot .auth-submit-btn { width: auto; padding-left: 26px; padding-right: 26px; }
.product-details-count { margin-left: auto; font-size: 0.78rem; color: var(--color-text-muted); }
/* Geri tuşuyla siteden çıkma onayı (bkz. dashboard.js showExitDialog) */
.exit-confirm { align-items: center; }
.exit-confirm .install-help-card p { font-size: 0.88rem; color: var(--color-text-secondary); margin-top: 0; }
.exit-confirm-actions { display: flex; gap: 10px; margin-top: 16px; }
.exit-confirm-actions button { margin-top: 0; flex: 1; }
.exit-confirm-actions .exit-stay { background: var(--color-surface-alt); color: var(--color-text); border: 1px solid var(--color-border); }
.knowledge-col { min-width: 0; }
.knowledge-col > .section-title { margin-top: 18px; }
.knowledge-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.knowledge-edit-btn { border: none; background: transparent; color: var(--color-primary); cursor: pointer; font-size: 0.78rem; font-weight: 600; padding: 4px 8px; border-radius: var(--radius-sm); }
.knowledge-edit-btn:hover { background: rgba(3, 105, 161, 0.1); }
.knowledge-delete-btn.confirm { color: #fff; background: var(--color-danger); }
.knowledge-item.editing { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.2); }
.product-details-foot .channel-btn { width: auto; margin: 0; }
.product-details-count.over { color: var(--color-danger); font-weight: 600; }
#supportEmailCopied { margin-top: 10px; }
/* Sol menünün altı: Destek + İletişim (yasal bağlantıların üstünde) */
.sidebar-nav-bottom { flex: none; padding-top: 4px; }
.sidebar-nav-bottom[hidden] { display: none; }
/* Alt grubu katlayan ok: kapalıyken grup gizlenir, ok yukarı döner */
.sidebar-extra-toggle { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 10px; padding: 4px 0; border: 0; border-top: 1px solid var(--color-border); background: none; color: var(--color-text-muted); cursor: pointer; border-radius: 0; }
.sidebar-extra-toggle:hover { color: var(--color-primary); }
.sidebar-extra-toggle svg { transition: transform 200ms ease; }
.sidebar-extra-toggle[aria-expanded="false"] svg { transform: rotate(180deg); }
/* Kapalıyken okun yanında "Diğer" yazısı görünür; açılınca yalnız ok kalır */
.sidebar-extra-label { display: none; }
.sidebar-extra-toggle[aria-expanded="false"] { gap: 6px; padding: 8px 0; font-size: 0.9rem; font-weight: 600; }
.sidebar-extra-toggle[aria-expanded="false"] .sidebar-extra-label { display: inline; }
/* Hesabım > Profil: hesap, işletme ve AI kuralları tek formda */
.profile-card { margin-bottom: 18px; }
.profile-card .settings-form { max-width: 820px; }
.profile-group-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); margin: 10px 0 -4px; padding-top: 12px; border-top: 1px solid var(--color-border); }
.profile-group-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
/* Metin içinde bağlantı gibi görünen düğme */
.inline-link { background: none; border: 0; padding: 0; font: inherit; color: var(--color-primary); font-weight: 600; cursor: pointer; }
.inline-link:hover { text-decoration: underline; }
/* Hesap menüsünün ayrı sayfaları: tek kart, okunaklı genişlik */
.password-card { max-width: 520px; }
/* Destek: açılır kapanır sık sorulanlar listesi */
.faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.faq-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.faq-item summary { list-style: none; cursor: pointer; padding: 16px 44px 16px 18px; font-weight: 700; font-size: 0.92rem; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '▾'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); transition: transform 150ms ease; }
.faq-item[open] summary::after { transform: translateY(-50%) rotate(180deg); }
.faq-item summary:hover { color: var(--color-primary); }
.faq-item[open] { border-color: var(--color-primary); }
.faq-answer { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 0.88rem; line-height: 1.55; color: var(--color-text-secondary); }
.faq-answer ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.faq-answer p { margin: 0; }
.faq-item:not([open]) .faq-answer { display: none; }
/* Destek: solda sık sorulanlar, sağda "Bize ulaşın" kartları (alt alta); dar ekranda alt alta */
.support-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
/* Destek: solda tek mesaj kartı, sağda iletişim kartları. */
.support-message-card { display: flex; flex-direction: column; gap: 12px; }
.support-message-card .section-title { margin: 0; }
.support-message-card textarea { width: 100%; resize: vertical; min-height: 150px; }
.support-message-card .hint-text { margin: 0; }
.support-message-card .auth-error:empty, .support-message-card .mock-success:empty { display: none; }
.support-side .section-title { margin: 0 0 12px; }
.support-side .support-contacts { grid-template-columns: 1fr; }
@media (max-width: 960px) { .support-layout { grid-template-columns: 1fr; } }
.support-message-form { max-width: none; }
/* AI Asistan sayfası: 3 kart alt alta (AI ayarları, Bilgi Bankası, işletme bilgisi);
   her kartta solda form, sağda o bölümün kayıtları. Dar ekranda kayıtlar formun altına iner. */
.ai-section { margin-bottom: 20px; }
/* Bilgi Bankası: bölümler ikişerli yan yana; dar ekranda alt alta. */
.kb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.kb-grid > .ai-section { margin-bottom: 0; min-width: 0; }
.kb-grid .settings-form, .kb-grid .hours-list, .kb-grid .capacity-row { max-width: none; }
.kb-grid .hours-row { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 1100px) { .kb-grid { grid-template-columns: minmax(0, 1fr); } }
.ai-section > .section-title { margin: 0 0 4px; font-size: 1.05rem; }
.ai-section-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 6px; }
.ai-section-grid .settings-form { max-width: none; }
.ai-section-saved { background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px; }
/* Bilgi Bankası kayıtları: tek satır, içerik yazmaz; satıra basınca form doldurulur. */
.knowledge-item.saved-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; }
.saved-row-open.knowledge-edit-btn {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left;
  padding: 8px 10px; font-size: 0.86rem; font-weight: 600; color: var(--color-text);
}
.saved-row-open.knowledge-edit-btn:hover { background: rgba(3, 105, 161, 0.08); color: var(--color-primary); }
.saved-row-open .knowledge-type-badge { flex-shrink: 0; margin: 0; }
.saved-row-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-saved-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); margin: 0 0 10px; }
.ai-saved-body { display: flex; flex-direction: column; gap: 10px; }
.ai-saved-body ul { margin: 0; padding-left: 18px; font-size: 0.82rem; color: var(--color-text-secondary); }
@media (max-width: 900px) { .ai-section-grid { grid-template-columns: 1fr; } }
#aiConfigHint:empty { display: none; }

/* Masaüstü: sol menü ekran boyunda sabit (alttaki Kılavuz / Bilgi Bankası / Destek
   sayfa kaydırılırken görünür kalır), ‹ › düğmesiyle tamamen gizlenir. Telefonda
   menü zaten ☰ ile açılan çekmece, orada bu düğme yok. */
.sidebar-toggle { display: none; }
@media (min-width: 861px) {
  .sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    transition: margin-left 200ms ease, visibility 0s linear 0s;
  }
  .app-shell.sidebar-collapsed .sidebar {
    margin-left: -240px; visibility: hidden;
    transition: margin-left 200ms ease, visibility 0s linear 200ms;
  }
  .sidebar-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    position: fixed; top: 50%; left: 222px; transform: translateY(-50%); z-index: 20;
    width: 36px; height: 36px; border-radius: 50%; border: 2px solid #fff; padding: 0;
    background: var(--color-primary); color: #fff; cursor: pointer;
    box-shadow: 0 4px 14px rgba(11, 61, 122, 0.45), 0 1px 3px rgba(15, 23, 42, 0.2);
    transition: left 200ms ease, transform 150ms ease, box-shadow 150ms ease;
  }
  .sidebar-toggle svg { transition: transform 200ms ease; }
  .sidebar-toggle:hover { transform: translateY(-50%) scale(1.12); box-shadow: 0 6px 18px rgba(11, 61, 122, 0.55), 0 1px 3px rgba(15, 23, 42, 0.2); }
  .sidebar-toggle:focus-visible { outline: 3px solid rgba(11, 61, 122, 0.35); outline-offset: 2px; }
  /* Gizliyken ok sağa döner (menüyü aç). */
  .app-shell.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
  .app-shell.sidebar-collapsed .sidebar-toggle { left: 8px; }
  /* Gizliyken › düğmesi içeriğin üstüne binmesin. */
  .app-shell.sidebar-collapsed .main-area { padding-left: 36px; }
}
/* Kullanım Kılavuzu */
.guide-title { font-size: 1.05rem; font-weight: 800; margin: 26px 0 12px; }
.guide-title:first-of-type { margin-top: 14px; }
.guide-intro { max-width: 760px; }
.guide-list { margin-bottom: 8px; }
.faq-answer ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.faq-answer code { background: var(--color-surface-hover); padding: 1px 5px; border-radius: 4px; font-size: 0.82rem; }

/* Yapılacaklar */
.task-add-card { display: flex; flex-direction: column; gap: 10px; max-width: 820px; margin-bottom: 22px; }
.task-add-card .hint-text { margin: 0; }
.task-form { display: flex; flex-direction: column; gap: 10px; }
.task-form input, .task-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 0.9rem;
}
.task-form #taskTitle { font-size: 1rem; padding: 12px 14px; }
.task-form input:focus, .task-form textarea:focus { outline: none; border-color: var(--color-primary); }
.task-form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.task-when { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted); }
.task-when input { width: auto; padding: 8px 10px; }
.task-form .channel-btn { width: auto; margin: 0; }
.task-form-actions { display: flex; gap: 8px; margin-left: auto; }
.task-form-actions .auth-submit-btn { width: auto; padding-left: 28px; padding-right: 28px; }
.task-form .auth-error:empty { display: none; }
.task-groups { display: flex; flex-direction: column; gap: 18px; max-width: 820px; }
.task-group { display: flex; flex-direction: column; gap: 8px; }
.task-group-title { font-size: 0.9rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; }
.task-group-title span { font-size: 0.75rem; font-weight: 700; color: var(--color-text-muted); background: var(--color-surface-hover); border-radius: 999px; padding: 1px 8px; }
.task-group-title.overdue { color: var(--color-danger, #dc2626); }
.task-done-group summary { cursor: pointer; list-style: none; }
.task-done-group summary::-webkit-details-marker { display: none; }
.task-done-group summary::after { content: '▾'; color: var(--color-text-muted); font-size: 0.8rem; }
.task-done-group[open] summary::after { content: '▴'; }
.task-item {
  display: flex; align-items: flex-start; gap: 12px; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 12px 14px; box-shadow: var(--shadow-card);
}
.task-item.overdue { border-left: 4px solid var(--color-danger, #dc2626); }
.task-item.today { border-left: 4px solid #f59e0b; }
.task-item.editing { border-color: var(--color-primary); }
.task-check {
  flex-shrink: 0; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--color-border);
  background: var(--color-surface); color: #fff; font-size: 0.8rem; font-weight: 800; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: border-color 150ms ease, background 150ms ease;
}
.task-check:hover { border-color: var(--color-success); }
.task-check.checked { background: var(--color-success); border-color: var(--color-success); }
.task-body {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; background: none; border: 0; padding: 0;
  text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.task-title { font-weight: 700; font-size: 0.92rem; overflow-wrap: anywhere; }
.task-body:hover .task-title { color: var(--color-primary); }
.task-meta { font-size: 0.78rem; color: var(--color-text-muted); }
.task-item.overdue .task-meta { color: var(--color-danger, #dc2626); font-weight: 600; }
.task-notes {
  font-size: 0.82rem; color: var(--color-text-secondary); white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.task-item.done { opacity: 0.65; }
.task-item.done .task-title { text-decoration: line-through; }
@media (max-width: 640px) {
  .task-form-actions { margin-left: 0; width: 100%; }
  .task-form-actions .auth-submit-btn { flex: 1; }
}

/* ── Panel Asistanı (js/assistant.js): sağ alt köşe yardım penceresi ── */
.assistant-root { position: fixed; right: 20px; bottom: 20px; z-index: 35; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.assistant-root[hidden] { display: none; }
.assistant-fab {
  border: none; border-radius: 999px; padding: 12px 18px; font: inherit; font-weight: 700; font-size: 0.92rem; cursor: pointer;
  background: var(--color-primary); color: #fff; box-shadow: 0 8px 24px rgba(3, 105, 161, 0.35);
}
.assistant-fab:hover { background: var(--color-primary-hover); }
.assistant-root.open .assistant-fab { display: none; }
.assistant-panel {
  width: 380px; max-width: calc(100vw - 32px); height: min(600px, calc(100vh - 40px)); display: flex; flex-direction: column;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18); overflow: hidden;
}
.assistant-panel[hidden] { display: none; }
.assistant-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--color-border); }
.assistant-head strong { display: block; font-size: 0.95rem; }
.assistant-quota { display: block; font-size: 0.75rem; color: var(--color-text-muted); }
.assistant-head-actions { display: flex; gap: 4px; }
.assistant-icon-btn { border: none; background: transparent; color: var(--color-text-secondary); font-size: 1.05rem; width: 32px; height: 32px; border-radius: var(--radius-sm); cursor: pointer; }
.assistant-icon-btn:hover { background: var(--color-surface-hover); color: var(--color-text); }
.assistant-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.assistant-msg { max-width: 88%; padding: 9px 12px; border-radius: var(--radius-md); font-size: 0.88rem; line-height: 1.5; overflow-wrap: anywhere; }
.assistant-msg.assistant { align-self: flex-start; background: var(--color-surface-alt); color: var(--color-text); border-bottom-left-radius: 4px; }
.assistant-msg.user { align-self: flex-end; background: var(--color-primary); color: #fff; border-bottom-right-radius: 4px; }
.assistant-msg p + p, .assistant-msg p + ul, .assistant-msg p + ol, .assistant-msg ul + p, .assistant-msg ol + p { margin-top: 6px; }
.assistant-msg ul, .assistant-msg ol { padding-left: 18px; }
.assistant-msg li + li { margin-top: 3px; }
.assistant-msg a { color: var(--color-primary); }
.assistant-msg code { background: rgba(15, 23, 42, 0.07); border-radius: 4px; padding: 1px 4px; font-size: 0.82rem; }
.assistant-code { margin-top: 6px; background: #0f172a; border-radius: var(--radius-sm); padding: 8px; }
.assistant-code pre { color: #e2e8f0; font-size: 0.78rem; white-space: pre-wrap; word-break: break-all; }
.assistant-copy { margin-top: 6px; border: none; border-radius: 6px; padding: 4px 10px; font: inherit; font-size: 0.75rem; cursor: pointer; background: #334155; color: #fff; }
.assistant-notice { align-self: center; font-size: 0.75rem; color: var(--color-text-muted); background: var(--color-surface-alt); border-radius: 999px; padding: 3px 10px; text-align: center; }
.assistant-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.assistant-chip { border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-secondary); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 0.8rem; cursor: pointer; }
.assistant-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.assistant-approval { border: 1.5px solid var(--color-primary); border-radius: var(--radius-md); padding: 12px; font-size: 0.86rem; background: var(--color-surface); }
.assistant-approval p { margin-top: 4px; color: var(--color-text-secondary); }
.assistant-approval-preview { margin-top: 8px; max-height: 140px; overflow-y: auto; white-space: pre-wrap; font-size: 0.8rem; background: var(--color-surface-alt); border-radius: var(--radius-sm); padding: 8px; }
.assistant-approval-actions { display: flex; gap: 8px; margin-top: 10px; }
.assistant-approval-actions .channel-btn { width: auto; flex: 1; margin: 0; }
.assistant-typing { display: flex; gap: 4px; padding: 12px 14px; }
.assistant-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--color-text-muted); animation: assistant-dot 1.2s infinite ease-in-out; }
.assistant-typing span:nth-child(2) { animation-delay: 0.15s; }
.assistant-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes assistant-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.assistant-error { color: var(--color-danger); font-size: 0.8rem; padding: 0 14px; }
.assistant-error:empty { display: none; }
.assistant-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--color-border); }
.assistant-form textarea {
  flex: 1; resize: none; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 9px 11px; font: inherit; font-size: 0.88rem;
  color: var(--color-text); background: var(--color-surface); min-height: 40px; max-height: 120px; line-height: 1.4; overflow-y: hidden;
}
.assistant-form textarea:focus { outline: none; border-color: var(--color-primary); }
.assistant-send { border: none; border-radius: var(--radius-md); width: 40px; height: 40px; background: var(--color-primary); color: #fff; font-size: 1rem; cursor: pointer; flex-shrink: 0; }
.assistant-send:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 640px) {
  .assistant-root { right: 12px; bottom: 12px; }
  .assistant-root.open { inset: 0; right: 0; bottom: 0; z-index: 70; }
  .assistant-root.open .assistant-panel { width: 100%; max-width: none; height: 100%; border-radius: 0; border: none; }
  .assistant-fab { padding: 11px 15px; }
}
