/* Heptakipte — Operasyon Merkezi
   Simple, neutral, calm business tool. White surface, one clear accent color,
   one typeface (Inter) doing every job. Nothing technical or decorative —
   legible numbers and short, plain labels so a busy clinic/salon owner can
   read this at a glance between customers. */

:root {
  --bg: #ffffff;
  --bg-subtle: #f8f9fb;
  --surface: #ffffff;
  --surface-alt: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d7dae0;
  --text: #14161a;
  --text-secondary: #52565f;
  --text-muted: #8a8f99;
  --accent: #4338ca;
  --accent-strong: #3730a3;
  --accent-subtle: #eef1fd;
  --accent-border: #c7cffa;
  --success: #0f8a5f;
  --success-subtle: #e7f7f0;
  --alert: #d1451f;
  --alert-subtle: #fdeee9;
  --shadow-sm: 0 1px 2px rgba(20, 22, 26, 0.04);
  --shadow-md: 0 8px 24px rgba(20, 22, 26, 0.07);
  --shadow-lg: 0 24px 56px rgba(20, 22, 26, 0.14);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 11px;
  --radius-sm: 8px;
  --sidebar: 258px;
  --font: "Inter", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.45;
  letter-spacing: -0.006em;
  overflow-x: hidden;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
::selection { background: var(--accent-subtle); color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { display: block; }

.ambient { display: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; position: relative; z-index: 1; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 24px 18px 18px;
  border-right: 1px solid var(--border);
  background: var(--bg-subtle);
  overflow: hidden;
  z-index: 30;
}

.brand-block { display: flex; gap: 12px; align-items: center; padding: 4px 6px 26px; }
.brand-mark {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-md);
  color: #fff;
  background: var(--accent);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.brand-name { color: var(--text); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.brand-name span { color: var(--accent); }
.brand-caption { margin-top: 3px; color: var(--text-muted); font-size: 11px; }

.main-nav { position: relative; }
.nav-label { padding: 0 12px 9px; color: var(--text-muted); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.nav-label-spaced { margin-top: 26px; }
.nav-item {
  width: 100%;
  height: 46px;
  margin: 3px 0;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 11px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: transparent;
  text-align: left;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: 140ms ease;
}
.nav-item:hover { color: var(--text); background: var(--surface-alt); }
.nav-item.active { color: var(--accent-strong); background: var(--accent-subtle); border-color: var(--accent-border); font-weight: 600; }
.nav-glyph { display: grid; place-items: center; width: 22px; height: 22px; color: var(--text-muted); }
.nav-glyph svg { width: 19px; height: 19px; }
.nav-item.active .nav-glyph { color: var(--accent); }
.nav-count { min-width: 22px; height: 21px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; color: var(--text-secondary); background: var(--surface-alt); font-size: 11px; font-weight: 600; }
.nav-count.alert { color: #fff; background: var(--alert); }

.sidebar-foot {
  margin-top: auto;
  padding: 13px;
  display: grid;
  grid-template-columns: 36px 1fr 8px;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.bot-orbit { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius-sm); position: relative; color: var(--accent); background: var(--accent-subtle); }
.bot-orbit-core { display: grid; place-items: center; }
.bot-orbit-core svg { width: 18px; height: 18px; }
.orbit-dot { position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--surface); }
.bot-foot-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bot-foot-copy strong { color: var(--text); font-size: 11.5px; font-weight: 600; }
.bot-foot-copy span { overflow: hidden; color: var(--text-muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-subtle); }

.workspace { min-width: 0; grid-column: 2; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 76px;
  padding: 0 clamp(22px, 3vw, 46px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.workspace-eyebrow { margin-bottom: 4px; color: var(--text-muted); font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; }
.workspace-eyebrow span { color: var(--accent); }
.workspace-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search-trigger {
  width: min(300px, 24vw);
  height: 40px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 19px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: var(--bg-subtle);
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}
.search-trigger svg { width: 16px; height: 16px; }
.search-trigger:hover { border-color: var(--border-strong); background: var(--surface-alt); }
kbd { padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: 5px; color: var(--text-muted); background: var(--surface); font-size: 10px; box-shadow: none; }
.sync-pill { height: 32px; padding: 0 11px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--success-subtle); border-radius: 999px; color: var(--success); background: var(--success-subtle); font-size: 11px; font-weight: 600; }
.sync-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.icon-button, .avatar-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); background: var(--bg-subtle); cursor: pointer; }
.icon-button svg { width: 17px; height: 17px; }
.icon-button:hover, .avatar-button:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-alt); }
.notification-button { position: relative; }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--alert); box-shadow: 0 0 0 2px var(--bg); }
.avatar-button { border-color: var(--accent-border); color: var(--accent); background: var(--accent-subtle); font-size: 11px; font-weight: 700; }
.mobile-menu { display: none; }

.view-container { width: 100%; max-width: 1600px; margin: 0 auto; padding: 32px clamp(22px, 3vw, 46px) 60px; }
.loading-state { min-height: calc(100vh - 170px); display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--text-muted); }
.loading-orbit { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--accent-border); border-radius: var(--radius-md); background: var(--accent-subtle); animation: breathe 1.8s ease-in-out infinite; color: var(--accent); }
.loading-orbit svg { width: 22px; height: 22px; }
@keyframes breathe { 50% { box-shadow: 0 0 0 10px var(--accent-subtle); } }

.page-head { margin-bottom: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-kicker { margin-bottom: 9px; color: var(--accent); font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.page-title { margin: 0; color: var(--text); font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; }
.page-subtitle { max-width: 620px; margin: 12px 0 0; color: var(--text-secondary); font-size: 14.5px; line-height: 1.55; }
.page-actions { display: flex; gap: 10px; }
.button { min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text); background: var(--surface); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: 140ms ease; box-shadow: var(--shadow-sm); }
.button:hover { border-color: var(--text-muted); background: var(--surface-alt); }
.button.primary { border-color: var(--accent); color: #fff; background: var(--accent); }
.button.primary:hover { background: var(--accent-strong); }
.button.terracotta { border-color: var(--accent-border); color: var(--accent); background: var(--accent-subtle); }
.button.icon-only { width: 42px; padding: 0; }
.button.icon-only svg { width: 16px; height: 16px; }

/* ---- Overview ---- */
.hero-grid { margin-bottom: 18px; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.72fr); gap: 16px; }
.hero-card {
  padding: clamp(26px, 2.8vw, 38px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.hero-overline { margin-bottom: 15px; display: flex; align-items: center; gap: 9px; color: var(--accent); font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.hero-overline::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero-title { max-width: 660px; margin: 0; font-size: clamp(26px, 3.2vw, 38px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.hero-title em { color: var(--accent); font-style: normal; }
.hero-text { max-width: 580px; margin: 16px 0 0; color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; }

.shift-strip { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.shift-strip-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.shift-strip-title { color: var(--text-secondary); font-size: 12.5px; font-weight: 600; }
.shift-strip-title strong { color: var(--text); }
.shift-strip-legend { display: flex; gap: 14px; color: var(--text-muted); font-size: 11.5px; }
.shift-strip-legend span { display: inline-flex; align-items: center; gap: 6px; }
.shift-strip-legend i { width: 7px; height: 7px; border-radius: 50%; }
.shift-track { position: relative; height: 38px; border-radius: var(--radius-sm); background: var(--bg-subtle); }
.shift-hour { position: absolute; top: 100%; margin-top: 7px; transform: translateX(-50%); color: var(--text-muted); font-size: 10.5px; }
.shift-tick { position: absolute; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--text-muted); opacity: 0.8; }
.shift-tick.appt { top: 7px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 1px; background: var(--success); transform: rotate(45deg); }
.shift-tick.handoff { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.shift-now { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--accent); }
.shift-now i { position: absolute; top: -3px; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); transform: translateX(-50%); box-shadow: 0 0 0 3px var(--accent-subtle); }

.pulse-card { padding: 24px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-md); }
.pulse-head { display: flex; align-items: center; justify-content: space-between; }
.card-label { color: var(--text-muted); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.pulse-badge { padding: 5px 9px; border: 1px solid var(--success-subtle); border-radius: 999px; color: var(--success); background: var(--success-subtle); font-size: 10.5px; font-weight: 600; }
.pulse-number { margin-top: auto; color: var(--text); font-size: 56px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.pulse-number small { margin-left: 4px; color: var(--accent); font-size: 21px; }
.pulse-copy { margin: 6px 0 18px; color: var(--text-secondary); font-size: 12.5px; line-height: 1.5; }
.micro-bars { display: grid; gap: 10px; }
.micro-bar-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; color: var(--text-secondary); font-size: 11.5px; font-weight: 500; }
.micro-bar-row span:last-child { color: var(--text); font-weight: 700; }
.micro-bar-track { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; }
.micro-bar-fill { height: 100%; border-radius: inherit; background: var(--accent); }

.metric-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric-card { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); transition: 140ms ease; }
.metric-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); color: var(--accent); background: var(--accent-subtle); }
.metric-icon svg { width: 17px; height: 17px; }
.metric-trend { color: var(--success); font-size: 11.5px; font-weight: 600; }
.metric-value { margin-top: 16px; color: var(--text); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.metric-name { margin-top: 4px; color: var(--text-secondary); font-size: 12.5px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.72fr); gap: 16px; }
.stack { display: grid; gap: 16px; align-content: start; }
.panel { border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-head { min-height: 68px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); }
.panel-title { margin: 0; font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.panel-subtitle { margin-top: 4px; color: var(--text-muted); font-size: 11.5px; }
.panel-link { border: 0; color: var(--accent); background: transparent; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.panel-body { padding: 20px 22px; }

.pipeline-list { display: grid; gap: 19px; }
.pipeline-row { display: grid; grid-template-columns: 140px 1fr 34px; gap: 12px; align-items: center; }
.pipeline-name { color: var(--text-secondary); font-size: 12.5px; }
.pipeline-track { height: 7px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; }
.pipeline-fill { height: 100%; border-radius: inherit; background: var(--text-muted); }
.pipeline-row:nth-child(2) .pipeline-fill, .pipeline-row:nth-child(5) .pipeline-fill { background: var(--accent); }
.pipeline-row:nth-child(3) .pipeline-fill { background: var(--success); }
.pipeline-count { color: var(--text); font-size: 13px; font-weight: 700; text-align: right; }

.table-wrap { width: 100%; overflow-x: auto; }
.conversation-table { width: 100%; border-collapse: collapse; }
.conversation-table th { padding: 11px 22px; color: var(--text-muted); font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.conversation-table td { padding: 15px 22px; border-top: 1px solid var(--border); vertical-align: middle; }
.conversation-table tr { cursor: pointer; transition: background 130ms; }
.conversation-table tbody tr:hover { background: var(--bg-subtle); }
.contact-cell { display: flex; align-items: center; gap: 12px; }
.contact-avatar { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); background: var(--bg-subtle); font-size: 11.5px; font-weight: 700; }
.contact-avatar.alt { color: var(--accent); background: var(--accent-subtle); border-color: var(--accent-border); }
.contact-name { font-size: 13.5px; font-weight: 600; }
.contact-preview { max-width: 280px; margin-top: 3px; overflow: hidden; color: var(--text-muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-secondary); background: var(--bg-subtle); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.status-pill.converted { color: var(--success); background: var(--success-subtle); border-color: var(--success-subtle); }
.status-pill.handoff { color: var(--accent); background: var(--accent-subtle); border-color: var(--accent-border); }
.time-cell { color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }

.agenda-list { display: grid; gap: 2px; }
.agenda-item { padding: 14px 0; display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--border); }
.agenda-item:last-child { border-bottom: 0; }
.agenda-time { color: var(--accent); font-size: 13px; font-weight: 700; }
.agenda-copy strong { display: block; font-size: 13px; font-weight: 600; }
.agenda-copy span { display: block; margin-top: 3px; color: var(--text-muted); font-size: 11.5px; }
.agenda-duration { color: var(--text-muted); font-size: 11px; }

.insight-card { padding: 24px; border-color: var(--accent-border); background: linear-gradient(160deg, var(--accent-subtle), var(--surface) 65%); }
.insight-label { color: var(--accent); font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.insight-title { max-width: 280px; margin: 15px 0 9px; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.insight-text { max-width: 300px; margin: 0; color: var(--text-secondary); font-size: 12.5px; line-height: 1.55; }
.insight-action { margin-top: 20px; }

/* ---- Inbox ---- */
.inbox-layout { height: calc(100dvh - 156px); min-height: 620px; display: grid; grid-template-columns: 320px minmax(400px, 1fr) 310px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.inbox-layout > * { min-height: 0; height: 100%; }
.thread-pane, .context-pane { min-width: 0; min-height: 0; overflow: hidden; }
.thread-pane { border-right: 1px solid var(--border); background: var(--bg-subtle); }
.context-pane { border-left: 1px solid var(--border); background: var(--bg-subtle); }
.pane-head { height: 74px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.pane-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.pane-head p { margin: 3px 0 0; color: var(--text-muted); font-size: 11.5px; }
.thread-filter { margin: 13px 15px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.thread-filter button { height: 30px; border: 0; border-radius: 7px; color: var(--text-secondary); background: transparent; font-size: 11px; font-weight: 600; cursor: pointer; }
.thread-filter button.active { color: #fff; background: var(--accent); }
.thread-list { height: calc(100% - 136px); overflow: auto; }
.thread-item { width: 100%; padding: 14px 16px; display: grid; grid-template-columns: 40px 1fr auto; gap: 11px; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; cursor: pointer; }
.thread-item:hover, .thread-item.active { background: var(--surface-alt); }
.thread-item.active { box-shadow: inset 2px 0 var(--accent); }
.thread-meta { min-width: 0; }
.thread-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.thread-name { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.thread-time { color: var(--text-muted); font-size: 10.5px; }
.thread-preview { margin-top: 5px; overflow: hidden; color: var(--text-muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.thread-channel { margin-top: 8px; display: flex; align-items: center; gap: 5px; color: var(--success); font-size: 10.5px; }
.unread-dot { width: 7px; height: 7px; margin-top: 8px; border-radius: 50%; background: var(--accent); }

.chat-pane { min-width: 0; min-height: 0; height: 100%; display: grid; grid-template-rows: 74px minmax(0, 1fr) auto; overflow: hidden; background: var(--surface); }
.chat-head { padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.chat-contact { display: flex; align-items: center; gap: 12px; }
.chat-contact-copy strong { display: block; font-size: 14px; font-weight: 600; }
.chat-contact-copy span { display: flex; align-items: center; margin-top: 3px; color: var(--text-muted); font-size: 11.5px; }
.chat-head-actions { display: flex; gap: 8px; }
.chat-scroll { min-height: 0; padding: 24px clamp(18px, 3vw, 36px); overflow: auto; overscroll-behavior: contain; background: var(--bg-subtle); }
.chat-day { margin: 4px 0 22px; display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 11px; }
.chat-day::before, .chat-day::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.message { max-width: min(76%, 560px); margin: 10px 0; }
.message.inbound { margin-right: auto; }
.message.outbound { margin-left: auto; }
.message-bubble { padding: 13px 16px; border-radius: 5px 14px 14px 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); font-size: 14px; line-height: 1.55; white-space: pre-wrap; box-shadow: var(--shadow-sm); }
.message.outbound .message-bubble { border-radius: 14px 5px 14px 14px; color: #fff; background: var(--accent); border-color: var(--accent); }
.trace-trigger { width: fit-content; margin-top: 5px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 10px; font-weight: 600; cursor: pointer; padding: 2px 0; }
.message.outbound .trace-trigger { margin-left: auto; }
.trace-trigger:hover { color: var(--accent); }
.message-time { margin: 6px 4px 0; color: var(--text-muted); font-size: 10.5px; }
.message.outbound .message-time { text-align: right; }
.ai-note { width: fit-content; margin: 18px auto; padding: 8px 13px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--accent-border); border-radius: 999px; color: var(--accent); background: var(--accent-subtle); font-size: 11px; font-weight: 600; }

.trace-dialog { width: min(720px, calc(100vw - 32px)); max-height: min(860px, calc(100vh - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 22px; color: var(--text); background: var(--surface); box-shadow: 0 30px 90px rgba(30, 28, 26, .2); }
.trace-dialog::backdrop { background: rgba(38, 34, 31, .35); backdrop-filter: blur(5px); }
.trace-dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); }
.trace-dialog-head h2 { margin: 4px 0 0; font-size: 21px; letter-spacing: -.03em; }
.trace-kicker { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.trace-dialog-body { padding: 24px 26px 28px; overflow: auto; }
.trace-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.trace-summary-grid > div { min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
.trace-summary-grid span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.trace-summary-grid strong { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-size: 12px; white-space: nowrap; }
.trace-section { margin-top: 23px; }
.trace-section h3 { margin: 0 0 10px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.trace-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.trace-chips span { padding: 7px 10px; border: 1px solid #cfe0d1; border-radius: 999px; color: #48634c; background: #f3f8f3; font-size: 10px; font-weight: 600; }
.trace-policy-list { display: grid; gap: 7px; margin: 0; padding-left: 19px; color: var(--text-soft); font-size: 12px; line-height: 1.5; }
.trace-timeline { display: grid; }
.trace-step { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 0 0 18px; }
.trace-step:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 12px; bottom: 2px; width: 1px; background: var(--border); }
.trace-step-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 2px solid var(--surface); border-radius: 50%; background: #859b88; box-shadow: 0 0 0 1px #afc3b2; }
.trace-step-dot.policy { background: var(--accent); box-shadow: 0 0 0 1px var(--accent-border); }
.trace-step-dot.failed { background: #b6534d; box-shadow: 0 0 0 1px #e3bab7; }
.trace-step-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.trace-step-top strong { font-size: 12px; }
.trace-step-top span { flex: 0 0 auto; color: var(--muted); font-size: 9px; font-weight: 700; }
.trace-step p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.trace-empty { padding: 18px; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); font-size: 12px; }
.trace-privacy { margin-top: 8px; padding: 12px 14px; border: 1px solid var(--accent-border); border-radius: 12px; color: var(--muted); background: var(--accent-subtle); font-size: 10px; line-height: 1.55; }
@media (max-width: 700px) { .trace-summary-grid { grid-template-columns: repeat(2, 1fr); } .trace-dialog-body { padding: 18px; } .trace-dialog-head { padding: 19px; } }
@media (max-width: 760px) { .briefing-fields { grid-template-columns: 1fr; } .briefing-actions > span { width: 100%; margin-left: 0; } }
.ai-mode-banner { margin: 0 auto 18px; width: min(640px, calc(100% - 24px)); padding: 13px 16px; display: grid; gap: 5px; border: 1px solid var(--accent-border); border-radius: var(--radius-md); color: var(--text); background: var(--accent-subtle); }
.ai-mode-banner strong { color: var(--accent-strong); font-size: 11.5px; }
.ai-mode-banner span { color: var(--text-secondary); font-size: 11.5px; line-height: 1.5; }
.pending-message { opacity: 0.62; }
.typing-note { width: fit-content; margin: 16px auto; padding: 9px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-secondary); background: var(--surface); font-size: 11px; box-shadow: var(--shadow-sm); }
.typing-dots { display: inline-flex; align-items: center; gap: 4px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: typing-bounce 1s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: 120ms; }
.typing-dots i:nth-child(3) { animation-delay: 240ms; }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.35; } 30% { transform: translateY(-3px); opacity: 1; } }
.chat-composer { position: relative; z-index: 2; min-width: 0; margin: 0 18px 18px; padding: 8px 8px 8px 15px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: end; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); }
.composer-spark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: var(--accent-subtle); font-size: 14px; font-weight: 700; }
.chat-composer textarea { min-height: 30px; max-height: 120px; padding: 6px 2px 4px; resize: none; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 14px; line-height: 1.45; }
.chat-composer textarea::placeholder { color: var(--text-muted); }
.send-button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 9px; color: #fff; background: var(--accent); cursor: pointer; }
.send-button svg { width: 18px; height: 18px; }
.send-button:hover { background: var(--accent-strong); }
.send-button:disabled { opacity: 0.4; cursor: wait; }
.empty-chat { height: 100%; padding: 44px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-chat-orbit { width: 68px; height: 68px; display: grid; place-items: center; border: 1px solid var(--accent-border); border-radius: var(--radius-md); color: var(--accent); background: var(--accent-subtle); }
.empty-chat-orbit svg { width: 30px; height: 30px; }
.empty-chat h3 { margin: 24px 0 9px; font-size: 21px; font-weight: 700; }
.empty-chat p { max-width: 360px; margin: 0 0 20px; color: var(--text-secondary); font-size: 13px; line-height: 1.55; }

.context-scroll { height: calc(100% - 74px); padding: 20px; overflow: auto; }
.profile-card { text-align: center; }
.profile-avatar { width: 64px; height: 64px; margin: 2px auto 13px; display: grid; place-items: center; border: 1px solid var(--accent-border); border-radius: var(--radius-md); color: var(--accent); background: var(--accent-subtle); font-size: 20px; font-weight: 700; }
.profile-card h3 { margin: 0; font-size: 15px; font-weight: 700; }
.profile-card p { margin: 5px 0 14px; color: var(--text-muted); font-size: 11.5px; }
.profile-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.context-section { margin-top: 24px; padding-top: 19px; border-top: 1px solid var(--border); }
.context-title { margin-bottom: 13px; color: var(--text-muted); font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.detail-list { display: grid; gap: 13px; }
.detail-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.detail-row span { color: var(--text-muted); font-size: 11.5px; }
.detail-row strong { max-width: 160px; font-size: 11.5px; font-weight: 600; text-align: right; }
.next-action { padding: 14px; border: 1px solid var(--accent-border); border-radius: var(--radius-md); background: var(--accent-subtle); }
.next-action strong { display: block; color: var(--accent-strong); font-size: 10.5px; }
.next-action p { margin: 7px 0 0; color: var(--text-secondary); font-size: 11.5px; line-height: 1.5; }

/* ---- Lead merkezi ---- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 13px; overflow-x: auto; padding-bottom: 12px; }
.kanban-column { min-height: 540px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-subtle); }
.kanban-head { padding: 4px 4px 14px; display: flex; align-items: center; justify-content: space-between; }
.kanban-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.kanban-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.kanban-column:nth-child(3) .kanban-dot { background: var(--success); }
.kanban-column:nth-child(4) .kanban-dot { background: var(--accent); }
.kanban-count { color: var(--text-muted); font-size: 11px; }
.lead-card { margin-bottom: 10px; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; transition: 140ms ease; box-shadow: var(--shadow-sm); }
.lead-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-md); }
.lead-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lead-card h4 { margin: 0; font-size: 12.5px; font-weight: 600; }
.lead-card-time { color: var(--text-muted); font-size: 10.5px; }
.lead-card-service { margin: 10px 0; color: var(--text-secondary); font-size: 11.5px; line-height: 1.45; }
.lead-card-foot { padding-top: 10px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); }
.lead-source { color: var(--success); font-size: 10.5px; }
.lead-intent { padding: 4px 8px; border-radius: 6px; color: var(--accent); background: var(--accent-subtle); font-size: 10px; font-weight: 700; }

/* ---- Randevular ---- */
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) 340px; gap: 16px; }
.calendar-card { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-sm); }
.calendar-toolbar { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; }
.calendar-toolbar h3 { margin: 0; font-size: 18px; font-weight: 700; }
.calendar-week { display: grid; grid-template-columns: 60px repeat(5, minmax(100px, 1fr)); }
.calendar-day { height: 56px; padding: 9px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); color: var(--text-muted); font-size: 10.5px; text-align: center; }
.calendar-day strong { display: block; margin-top: 5px; color: var(--text); font-size: 16px; font-weight: 700; }
.calendar-time { height: 72px; padding: 9px 10px 0 0; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 10.5px; text-align: right; }
.calendar-slot { min-height: 72px; padding: 5px; border-top: 1px solid var(--border); border-left: 1px solid var(--border); position: relative; }
.appointment-block { min-height: 56px; padding: 9px; border-left: 3px solid var(--accent); border-radius: 6px; color: var(--accent-strong); background: var(--accent-subtle); font-size: 10.5px; line-height: 1.4; }
.appointment-block strong { display: block; margin-bottom: 3px; font-size: 11.5px; font-weight: 700; }
.appointment-block.alt { border-left-color: var(--success); background: var(--success-subtle); color: var(--success); }

/* ---- Akışlar / İnsan devri / Ayarlar ---- */
.automation-grid, .handoff-grid, .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.flow-card, .handoff-card, .setting-card { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.flow-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.flow-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-sm); color: var(--accent); background: var(--accent-subtle); }
.flow-icon svg { width: 20px; height: 20px; }
.flow-card h3, .setting-card h3 { margin: 16px 0 6px; font-size: 15.5px; font-weight: 700; }
.flow-card p, .setting-card p { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.briefing-settings { margin-top: 18px; }
.briefing-form { display: grid; gap: 18px; }
.briefing-switch { display: flex; align-items: center; gap: 9px; width: fit-content; color: var(--text); font-size: 12px; font-weight: 700; }
.briefing-switch input { width: 17px; height: 17px; accent-color: var(--accent); }
.briefing-fields { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(120px, .6fr) minmax(180px, 1fr); gap: 12px; }
.briefing-fields label { display: grid; gap: 7px; }
.briefing-fields label > span, .briefing-days > span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.briefing-fields input { min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--surface); font: inherit; font-size: 12px; outline: none; }
.briefing-fields input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-subtle); }
.briefing-fields input:disabled { color: var(--muted); background: var(--surface-soft); }
.briefing-days { display: grid; gap: 9px; }
.briefing-days > div { display: flex; flex-wrap: wrap; gap: 7px; }
.briefing-days label input { position: absolute; opacity: 0; pointer-events: none; }
.briefing-days label span { display: grid; place-items: center; min-width: 42px; height: 34px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); background: var(--surface); font-size: 10px; font-weight: 700; cursor: pointer; }
.briefing-days label input:checked + span { border-color: var(--accent-border); color: var(--accent); background: var(--accent-subtle); }
.briefing-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.briefing-actions > span { margin-left: auto; color: var(--muted); font-size: 10px; }
.toggle { width: 40px; height: 22px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg-subtle); cursor: pointer; }
.toggle::after { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: 140ms ease; }
.toggle.on { border-color: var(--accent); background: var(--accent); }
.toggle.on::after { transform: translateX(17px); }
.flow-stats { margin-top: 18px; padding-top: 16px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); }
.flow-stat strong { display: block; font-size: 20px; font-weight: 700; }
.flow-stat span { color: var(--text-muted); font-size: 10.5px; }
.handoff-card { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: start; }
.handoff-priority { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--accent-border); border-radius: var(--radius-sm); color: var(--accent); background: var(--accent-subtle); font-size: 14px; font-weight: 700; }
.handoff-card h3 { margin: 2px 0 6px; font-size: 14px; font-weight: 700; }
.handoff-card p { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.handoff-meta { margin-top: 11px; display: flex; gap: 9px; color: var(--text-muted); font-size: 10.5px; }
.priority-tag { padding: 5px 9px; border: 1px solid var(--alert-subtle); border-radius: 999px; color: var(--alert); background: var(--alert-subtle); font-size: 10px; font-weight: 700; }

.empty-state { padding: 50px 20px; color: var(--text-muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--text); font-size: 18px; font-weight: 700; }
.empty-state span { font-size: 13px; }

.command-dialog { width: min(620px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; color: var(--text); }
.command-dialog::backdrop { background: rgba(20, 22, 26, 0.4); backdrop-filter: blur(4px); }
.command-head { height: 62px; padding: 0 18px; display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--border); }
.command-head > span { color: var(--text-muted); }
.command-head > span svg { width: 18px; height: 18px; }
.command-head input { border: 0; outline: 0; color: var(--text); background: transparent; font-size: 14.5px; }
.command-head input::placeholder { color: var(--text-muted); }
.command-results { max-height: 420px; padding: 9px; overflow: auto; }
.command-result { width: 100%; padding: 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; cursor: pointer; color: var(--text); }
.command-result:hover { background: var(--bg-subtle); }
.command-result strong { display: block; font-size: 12.5px; font-weight: 600; }
.command-result span { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10.5px; }
.command-foot { height: 42px; padding: 0 16px; display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 10.5px; }
.command-foot span:last-child { margin-left: auto; }
.command-foot i { padding: 2px 5px; border: 1px solid var(--border-strong); border-radius: 4px; font-style: normal; }
.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 9px; }
.toast { min-width: 260px; padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); background: var(--surface); box-shadow: var(--shadow-lg); font-size: 12.5px; animation: toast-in 200ms ease; }
.toast strong { color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.mobile-scrim { display: none; }

@media (max-width: 1180px) {
  :root { --sidebar: 224px; }
  .inbox-layout { grid-template-columns: 280px 1fr; }
  .context-pane { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid > .stack:last-child { grid-template-columns: 1fr 1fr; }
  .calendar-layout { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  :root { --sidebar: 258px; }
  .app-shell { display: block; }
  .sidebar { transform: translateX(-105%); transition: 200ms ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .mobile-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(20, 22, 26, 0.35); backdrop-filter: blur(3px); }
  .mobile-scrim.show { display: block; }
  .workspace { width: 100%; }
  .mobile-menu { display: grid; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .search-trigger { width: 42px; grid-template-columns: 1fr; place-items: center; }
  .search-trigger span:nth-child(2), .search-trigger kbd, .sync-pill { display: none; }
  .inbox-layout { grid-template-columns: 260px 1fr; }
  .automation-grid, .handoff-grid, .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar { height: 66px; padding: 0 16px; }
  .workspace-title { font-size: 13px; }
  .workspace-eyebrow { font-size: 8px; }
  .notification-button { display: none; }
  .view-container { padding: 22px 16px 40px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-title { font-size: 30px; }
  .hero-card { padding: 24px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { padding: 16px; }
  .metric-value { font-size: 25px; }
  .dashboard-grid > .stack:last-child { grid-template-columns: 1fr; }
  .conversation-table th:nth-child(2), .conversation-table td:nth-child(2), .conversation-table th:nth-child(3), .conversation-table td:nth-child(3) { display: none; }
  .conversation-table th, .conversation-table td { padding-left: 16px; padding-right: 16px; }
  .inbox-layout { height: auto; min-height: calc(100dvh - 120px); display: block; }
  .inbox-layout > * { height: auto; }
  .thread-pane { border-right: 0; }
  .thread-list { height: 360px; }
  .chat-pane { height: max(560px, calc(100dvh - 90px)); min-height: 560px; border-top: 1px solid var(--border); }
  .calendar-card { padding: 16px; overflow-x: auto; }
  .calendar-week { min-width: 680px; }
  .kanban { margin-right: -16px; }
  .toast-stack { right: 12px; bottom: 12px; left: 12px; }
  .toast { min-width: 0; }
  .shift-hour:nth-child(odd) { display: none; }
  .briefing-fields { grid-template-columns: 1fr; }
  .briefing-actions { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .briefing-actions .button { width: 100%; min-width: 0; height: auto; min-height: 40px; padding: 10px 12px; white-space: normal; }
  .briefing-actions > span { width: 100%; margin-left: 0; line-height: 1.45; }
}
