:root {
  --bg: #070b14;
  --surface: #0c1322;
  --surface-2: #121c31;
  --surface-hover: #182540;
  --border: rgba(148, 197, 255, 0.1);
  --border-strong: rgba(148, 197, 255, 0.18);
  --text: #f3f7ff;
  --text-secondary: #94a8c4;
  --muted: #647996;
  --accent: #0ea5e9;
  --accent-soft: rgba(14, 165, 233, 0.14);
  --gold: #eab308;
  --gold-soft: rgba(234, 179, 8, 0.12);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.12);
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(14, 165, 233, 0.14) 0%, transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(16, 185, 129, 0.1) 0%, transparent 38%),
    radial-gradient(circle at 50% 90%, rgba(139, 92, 246, 0.1) 0%, transparent 45%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(20, 184, 166, 0.28);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.brand-title { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 18px 10px 8px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn.active {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}
.nav-btn.active svg { color: var(--accent); }

.nav-badge {
  margin-left: auto;
  background: var(--surface-hover);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
}
.nav-badge-warn { background: var(--gold-soft); color: var(--gold); }

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.mode-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.mode-pill.live .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.footer-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-full { width: 100%; }
.btn-primary { background: var(--accent); color: #042f2e; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-del {
  background: var(--danger-soft);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

/* Main Content */
.main-content {
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.topbar-left { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.topbar h1 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.topbar-divider { color: var(--muted); }
.subtitle { font-size: 12px; color: var(--text-secondary); }
.topbar-actions { display: flex; gap: 8px; }

.tab-panel { display: none; flex-direction: column; gap: 18px; }
.tab-panel.active { display: flex; }

/* Cards & KPI */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}

.card-header h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.card-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.pill {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
}
.pill-warn { color: var(--gold); background: var(--gold-soft); border-color: rgba(234, 179, 8, 0.25); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.15s;
}
.kpi-card:hover { border-color: var(--border-strong); }
.kpi-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin: 8px 0 4px; }
.kpi-sub { font-size: 12px; color: var(--muted); }

.charts-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; }
.svg-chart-wrap { width: 100%; height: 220px; }

.category-list { display: flex; flex-direction: column; gap: 14px; }
.cat-row { display: flex; flex-direction: column; gap: 6px; }
.cat-top { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--text-secondary); }
.cat-top strong { color: var(--text); font-weight: 500; }
.progress-track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--accent); }

/* Table */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.data-table .num { text-align: right; }

/* DM Layout */
.dm-layout { display: grid; grid-template-columns: 330px 1fr; gap: 16px; min-height: 560px; }
.dm-sidebar { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.dm-filters { display: flex; gap: 5px; flex-wrap: wrap; }

.filter-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
.filter-chip.active { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }

.conv-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; max-height: 500px; }
.conv-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
}
.conv-item:hover { background: var(--surface-2); }
.conv-item.active { background: var(--surface-2); border-color: var(--border-strong); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.conv-info { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 500; gap: 6px; }
.conv-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.status-pill { font-size: 10px; font-weight: 500; padding: 2px 7px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); }

.dm-thread { display: flex; flex-direction: column; }
.thread-empty { margin: auto; text-align: center; color: var(--muted); font-size: 13px; }
.thread-active { display: flex; flex-direction: column; height: 100%; gap: 12px; }
.thread-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
}
.thread-user-info { display: flex; align-items: center; gap: 10px; }
.thread-user-info h3 { font-size: 14px; font-weight: 600; }
.crm-controls { display: flex; gap: 8px; }

select, input[type="text"], input[type="password"], input[type="date"], input[type="number"] {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}
select:focus, input:focus { border-color: var(--accent); }

.dm-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dm-search-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
}
.conv-item.unread .conv-preview { color: var(--text); font-weight: 600; }
.conv-item.unread .avatar { box-shadow: 0 0 0 2px #e1306c, 0 0 0 4px rgba(131, 58, 180, 0.35); }
.conv-sent-tag { color: #34d399; font-weight: 600; margin-right: 3px; }
.conv-item.is-replied .conv-preview { color: #94a3b8; }

.conv-list::-webkit-scrollbar,
.messages-body::-webkit-scrollbar { width: 6px; }
.conv-list::-webkit-scrollbar-track,
.messages-body::-webkit-scrollbar-track { background: transparent; }
.conv-list::-webkit-scrollbar-thumb,
.messages-body::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.22); border-radius: 999px; }
.conv-list::-webkit-scrollbar-thumb:hover,
.messages-body::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.4); }

.messages-body {
  flex: 1;
  min-height: 400px;
  max-height: 500px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
  background: rgba(8, 13, 24, 0.52);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.msg-date-sep {
  align-self: center;
  font-size: 11px;
  color: var(--muted);
  margin: 12px 0 8px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}
.msg-row.me { justify-content: flex-end; }
.msg-row.customer { justify-content: flex-start; }
.msg-row.group-gap { margin-top: 10px; }

.msg-stack {
  display: flex;
  flex-direction: column;
  max-width: 66%;
}
.msg-row.me .msg-stack { align-items: flex-end; }
.msg-row.customer .msg-stack { align-items: flex-start; }

.msg-mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.msg-mini-avatar.spacer { visibility: hidden; }

.msg-bubble {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13.5px;
  line-height: 1.38;
  word-break: break-word;
}
.msg-text { white-space: pre-wrap; margin: 0; }
.msg-bubble.customer {
  background: #222b3c;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text);
}
.msg-bubble.me {
  background: linear-gradient(135deg, #3797f0, #6c47ff);
  border: none;
  color: #ffffff;
}
.msg-row.customer.has-next .msg-bubble { border-bottom-left-radius: 6px; }
.msg-row.customer.has-prev .msg-bubble { border-top-left-radius: 6px; }
.msg-row.me.has-next .msg-bubble { border-bottom-right-radius: 6px; }
.msg-row.me.has-prev .msg-bubble { border-top-right-radius: 6px; }

.msg-time { font-size: 10px; color: var(--muted); margin: 3px 6px 2px; }

.reply-form { display: flex; gap: 8px; align-items: center; }
.reply-form input { flex: 1; border-radius: 999px !important; padding: 10px 16px !important; }

/* Sleek Instagram Comments Workspace */
.comments-shell { display: flex; flex-direction: column; gap: 14px; }
.comments-meta-actions { display: flex; align-items: center; gap: 8px; }
.comments-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.comments-feed { display: flex; flex-direction: column; gap: 8px; }
.comment-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.comment-item:hover { border-color: var(--border-strong); background: rgba(15, 23, 42, 0.72); }
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.comment-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.comment-author-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment-author { font-size: 13px; font-weight: 600; color: var(--text); }
.comment-time { font-size: 11px; color: var(--muted); }
.comment-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}
.comment-status-dot.pending { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.comment-status-dot.replied { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.comment-post-chip {
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comment-body { font-size: 13.5px; line-height: 1.45; color: var(--text); word-break: break-word; }
.comment-actions { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.comment-reply-drawer { margin-top: 6px; }
.comment-replied-box {
  margin-top: 4px;
  padding: 8px 12px;
  border-left: 2px solid var(--accent);
  background: rgba(20, 184, 166, 0.06);
  border-radius: 0 8px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.comment-replied-text { font-size: 12.5px; color: var(--text-secondary); }

.quick-replies { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-replies button {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.quick-replies button:hover { color: var(--text); border-color: var(--border-strong); }

.reply-form { display: flex; gap: 8px; }
.reply-form input { flex: 1; }

/* Planning & Approvals */
.planning-grid, .settings-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.inline-form { display: grid; grid-template-columns: 1.8fr 1fr 1.1fr 1fr auto; gap: 8px; margin-bottom: 14px; }
.goal-form { grid-template-columns: 1.6fr 0.7fr 0.7fr 1fr auto; }

.plan-list, .goals-list { display: flex; flex-direction: column; gap: 8px; }
.plan-item, .goal-item, .approval-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.approval-card { flex-direction: column; align-items: stretch; gap: 10px; }
.approval-card.pending { border-color: rgba(234, 179, 8, 0.4); }
.approval-actions { display: flex; gap: 8px; }
.approval-edit { width: 100%; }

.plan-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.plan-actions { display: flex; gap: 8px; align-items: center; }

.goal-item { flex-direction: column; align-items: stretch; }
.goal-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.goal-controls { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-secondary); }
.goal-controls input { width: 72px; padding: 4px 7px; }

/* Settings */
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.settings-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.mobile-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
.mobile-url { display: inline-block; margin-top: 4px; font-size: 15px; color: var(--accent); font-weight: 600; }

.alert { padding: 10px 12px; border-radius: 8px; font-size: 12px; background: var(--accent-soft); border: 1px solid rgba(20, 184, 166, 0.3); }
.alert-error { background: var(--danger-soft); border-color: rgba(244, 63, 94, 0.3); color: #fecdd3; }

.guide-list { padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 12px; line-height: 1.55; color: var(--text-secondary); }
.guide-list strong { color: var(--text); }

/* Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #131e33 0%, #070a11 75%);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
}
.login-emblem {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(20, 184, 166, 0.3);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.login-card h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.login-sub { font-size: 12px; color: var(--text-secondary); margin: 6px 0 18px; }
.pin-input-wrap input { width: 100%; text-align: center; font-size: 18px; letter-spacing: 6px; margin-bottom: 12px; }
.login-hint { font-size: 11px; color: var(--muted); margin-top: 12px; }

.muted { color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 21, 34, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 500;
  padding: 7px 4px env(safe-area-inset-bottom, 7px);
}
.mobile-nav button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}
.mobile-nav button span { font-size: 10px; font-weight: 500; }
.mobile-nav button.active { color: var(--accent); }

@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
  .main-content { padding: 16px 14px 78px; }
  .charts-grid, .dm-layout, .planning-grid, .settings-grid, .form-row-2 { grid-template-columns: 1fr; }
  .inline-form, .goal-form { grid-template-columns: 1fr; }
}

/* Strategy Analysis Card */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 16px;
  align-items: start;
}
.analysis-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.analysis-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.analysis-stat strong { color: var(--accent); font-weight: 600; }
.analysis-recs {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.analysis-recs li { margin-left: 16px; }
@media (max-width: 1024px) {
  .analysis-grid { grid-template-columns: 1fr; }
}

/* Deep Analysis & Idea Generator */
.ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 12px;
}
.idea-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.idea-card:hover { border-color: var(--border-strong); }
.idea-title { font-size: 13px; font-weight: 600; line-height: 1.4; }
.idea-why { font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.idea-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Tekne Hizmetleri Brand Logo (Transparent Dark Mode) */
.brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.brand-logo-box {
  width: 100%;
  background: transparent;
  padding: 2px 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.brand-logo-box img {
  width: 100%;
  height: auto;
  max-height: 44px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 10px rgba(56, 189, 248, 0.25));
}
.login-logo-box {
  max-width: 240px;
  margin: 0 auto 14px;
  justify-content: center;
}

/* Vibrant Color Accents */
.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.28);
}
.nav-btn.active {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.18), rgba(37, 99, 235, 0.08));
  border-color: rgba(56, 189, 248, 0.35);
  color: #ffffff;
}
.kpi-card {
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--accent);
}
.kpi-card.kpi-cyan { border-top-color: #38bdf8; background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, var(--surface) 60%); }
.kpi-card.kpi-cyan .kpi-value { color: #7dd3fc; }
.kpi-card.kpi-green { border-top-color: #10b981; background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, var(--surface) 60%); }
.kpi-card.kpi-green .kpi-value { color: #6ee7b7; }
.kpi-card.kpi-amber { border-top-color: #f59e0b; background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, var(--surface) 60%); }
.kpi-card.kpi-amber .kpi-value { color: #fcd34d; }
.kpi-card.kpi-violet { border-top-color: #a855f7; background: linear-gradient(180deg, rgba(168, 85, 247, 0.08) 0%, var(--surface) 60%); }
.kpi-card.kpi-violet .kpi-value { color: #d8b4fe; }


/* Stories & Past Media Gallery */
.stories-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.story-card {
  flex: 0 0 150px;
  background: var(--bg);
  border: 2px solid #0ea5e9;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s;
}
.story-card:hover { transform: translateY(-2px); }
.story-thumb {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}
.story-meta {
  padding: 8px 10px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
}

.media-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.media-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.media-card:hover { border-color: var(--border-strong); }
.media-thumb {
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}
.media-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  justify-content: space-between;
}
.media-title { font-size: 13px; font-weight: 500; line-height: 1.4; }
.media-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Engagement Rate Badges & Media Detail Modal */
.media-card { position: relative; }
.eng-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  z-index: 2;
}
.eng-high { background: rgba(16, 185, 129, 0.92); color: #022c22; }
.eng-good { background: rgba(14, 165, 233, 0.92); color: #082f49; }
.eng-mid { background: rgba(245, 158, 11, 0.92); color: #451a03; }
.eng-low { background: rgba(244, 63, 94, 0.9); color: #fff; }

.media-card.tier-high { border-color: rgba(16, 185, 129, 0.45); }
.media-card.tier-good { border-color: rgba(14, 165, 233, 0.4); }

.media-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 6px;
  text-align: center;
}
.media-mini-stats div span { display: block; font-size: 10px; color: var(--muted); }
.media-mini-stats div strong { font-size: 12px; color: var(--text); }

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 18, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 950;
  padding: 18px;
}
.modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.modal-hero {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 14px;
  background: var(--bg);
}
.modal-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.views-badge {
  position: absolute;
  top: 158px;
  left: 10px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(7, 11, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  backdrop-filter: blur(6px);
  z-index: 2;
}

/* Momentum Banner (Yükseliş / Düşüş) */
.momentum-banner {
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
}
.momentum-banner.up {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.16), rgba(14, 165, 233, 0.08));
  border-color: rgba(16, 185, 129, 0.4);
}
.momentum-banner.down {
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.16), rgba(245, 158, 11, 0.08));
  border-color: rgba(244, 63, 94, 0.4);
}
.momentum-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.momentum-banner.up .momentum-title { color: #6ee7b7; }
.momentum-banner.down .momentum-title { color: #fda4af; }
.momentum-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* Interactive Floating Chart Tooltip */
.chart-tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(10, 16, 30, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
  z-index: 1200;
  min-width: 170px;
}
.chart-tooltip strong { color: #7dd3fc; display: block; margin-bottom: 2px; }

/* Plan Category Bar */
.plan-cat-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.cat-add-form { display: flex; gap: 6px; align-items: center; }
.cat-add-form input[type="text"] { width: 150px; padding: 6px 9px; font-size: 12px; }
.cat-add-form input[type="color"] { width: 32px; height: 30px; padding: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }

/* Workshop CRM Bar inside DM Thread */
.workshop-crm-bar {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.workshop-crm-bar input { padding: 6px 9px; font-size: 12px; }
@media (max-width: 1024px) {
  .workshop-crm-bar { grid-template-columns: 1fr; }
}

/* Mobile Header & Slide-in Drawer */
html, body { overflow-x: hidden; max-width: 100%; }
.mobile-header { display: none; }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 18, 0.72);
  backdrop-filter: blur(4px);
  z-index: 800;
}

@media (max-width: 1024px) {
  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    margin: -16px -14px 4px;
    background: rgba(12, 19, 34, 0.96);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 400;
    backdrop-filter: blur(10px);
  }
  .mobile-header-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
  }
  .sidebar {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 265px;
    z-index: 900;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.6);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .topbar { padding-bottom: 12px; gap: 10px; }
  .topbar h1 { font-size: 17px; }
  .topbar-actions { display: none; }
  .card { padding: 14px; }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi-card { padding: 12px; }
  .kpi-value { font-size: 21px; }
  .ideas-grid, .media-grid { grid-template-columns: minmax(0, 1fr); }
  .media-toolbar { width: 100%; }
  .media-toolbar input, .media-toolbar select, .media-toolbar button { width: 100%; }
  .conv-list { max-height: 240px; }
  .messages-body { min-height: 240px; max-height: 320px; }
  .msg-bubble { max-width: 88%; }
  .cat-add-form { width: 100%; }
  .cat-add-form input[type="text"] { flex: 1; }
  .plan-item { flex-direction: column; align-items: flex-start; }
  .plan-actions { width: 100%; justify-content: space-between; }
  .modal-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Prevent CSS Grid Blowout on Mobile */
.main-content, .tab-panel, .card, .charts-grid > *, .analysis-grid > *, .category-list, .approval-card, .mobile-box, .analysis-recs, .dm-layout > *, .dm-sidebar, .conv-item, .conv-info {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pill { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .mobile-header { margin: -16px -14px 4px; width: calc(100% + 28px); }
}

/* Strategy Assistant Executive Studio */
.assistant-shell { display: flex; flex-direction: column; gap: 14px; }
.assistant-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.assistant-hero-left { display: flex; align-items: center; gap: 12px; }
.assistant-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.25), rgba(56, 189, 248, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.assistant-hero-actions { display: flex; align-items: center; gap: 8px; }
.assistant-chips { margin: 0; }
.assistant-chat-body {
  min-height: 420px;
  max-height: 560px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: rgba(8, 13, 24, 0.55);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.assistant-chat-body::-webkit-scrollbar { width: 6px; }
.assistant-chat-body::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.22); border-radius: 999px; }

.ai-row { display: flex; gap: 10px; align-items: flex-start; width: 100%; }
.ai-row.user { justify-content: flex-end; }
.ai-row.assistant { justify-content: flex-start; }
.ai-row-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(20, 184, 166, 0.16);
  border: 1px solid rgba(20, 184, 166, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.ai-msg {
  max-width: 82%;
  padding: 13px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
}
.ai-msg.user {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: #ffffff;
  border-bottom-right-radius: 5px;
}
.ai-msg.user .msg-time { color: rgba(255, 255, 255, 0.72); text-align: right; }
.ai-msg.assistant {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-top-left-radius: 5px;
}
.ai-msg h3 { font-size: 14.5px; margin-bottom: 8px; color: #5eead4; font-weight: 600; }
.ai-msg ul { padding-left: 18px; margin: 6px 0; }
.ai-ideas-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.ai-ideas-row .idea-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
@media (max-width: 1024px) {
  .ai-msg { max-width: 94%; }
  .assistant-chat-body { max-height: 440px; padding: 12px; }
}

/* Digital Follower Odometer & Milestone Gauge */
.follower-counter-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 2px 2px;
}
.odometer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.odometer-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.odometer-digit {
  width: 34px;
  height: 46px;
  border-radius: 9px;
  background: linear-gradient(180deg, #162033 0%, #0b1220 50%, #111a2e 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 12px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #f8fafc;
  position: relative;
}
.odometer-digit::after {
  content: '';
  position: absolute;
  left: 3px;
  right: 3px;
  top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, 0.45);
}
.odometer-sep {
  font-size: 22px;
  font-weight: 800;
  color: var(--muted);
  margin: 0 1px;
  align-self: flex-end;
  padding-bottom: 6px;
}
.odometer-deltas {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.delta-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.delta-badge.neutral {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  border-color: var(--border);
}
.delta-badge.lost {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}
.milestone-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.milestone-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}
.milestone-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  overflow: hidden;
}
.milestone-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  transition: width 0.5s ease;
}
.follower-days-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.follower-day-chip {
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 9px;
}

/* Minimal Approval Queue & Daily Reminders */
.approvals-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 16px;
  align-items: start;
}
.approvals-minimal-list { display: flex; flex-direction: column; gap: 10px; }
.app-row {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-row.pending { border-left: 3px solid #f59e0b; background: rgba(245, 158, 11, 0.04); }
.app-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.app-row-title { font-size: 13px; font-weight: 600; color: var(--text); }
.app-row-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.app-row-edit {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.reminders-list { display: flex; flex-direction: column; gap: 8px; }
.rem-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
}
.rem-item.done { opacity: 0.55; }
.rem-title { font-size: 13px; font-weight: 600; color: var(--text); }
.rem-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.rem-actions { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 1024px) {
  .approvals-layout { grid-template-columns: 1fr; }
}
