:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-alt: #f8faf9;
  --surface-strong: #eef3f0;
  --text: #15221d;
  --text-soft: #3f4d47;
  --muted: #718078;
  --line: #e1e8e4;
  --line-strong: #ccd8d2;
  --green: #087a55;
  --green-dark: #056343;
  --green-bright: #19ad77;
  --green-soft: #e8f7f0;
  --nav: #10201a;
  --nav-soft: #192c24;
  --nav-text: #d8e5df;
  --nav-muted: #8fa39a;
  --blue: #3867d6;
  --blue-soft: #edf2ff;
  --amber: #a76008;
  --amber-soft: #fff5df;
  --red: #c43d4b;
  --red-soft: #fff0f2;
  --violet: #7557c8;
  --violet-soft: #f1edff;
  --shadow-sm: 0 1px 2px rgba(13, 35, 26, .05);
  --shadow-md: 0 12px 32px rgba(20, 45, 35, .10);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar: 244px;
  --topbar: 68px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.icon { width: 18px; height: 18px; display: inline-grid; flex: 0 0 auto; place-items: center; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.app-shell { min-height: 100vh; }

.sidebar {
  background: var(--nav);
  color: var(--nav-text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  left: 0;
  padding: 0 12px 14px;
  position: fixed;
  top: 0;
  width: var(--sidebar);
  z-index: 30;
}
.brand { align-items: center; display: flex; gap: 10px; height: var(--topbar); padding: 0 8px; }
.brand-mark { align-items: center; background: var(--green-bright); border-radius: 11px; display: flex; height: 34px; justify-content: center; width: 34px; }
.brand-mark svg { fill: none; height: 23px; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.6; width: 23px; }
.brand > div:last-child { align-items: baseline; display: flex; gap: 4px; font-size: 17px; letter-spacing: -.2px; }
.brand strong { color: #fff; font-weight: 800; letter-spacing: .5px; }
.brand span { color: #b7c9c1; font-weight: 500; }

.workspace-switcher { align-items: center; background: var(--nav-soft); border: 1px solid #294037; border-radius: 11px; color: var(--nav-text); cursor: pointer; display: flex; gap: 9px; min-height: 54px; padding: 8px 10px; text-align: left; width: 100%; }
.workspace-switcher:hover { border-color: #3a574b; }
.number-avatar { align-items: center; background: var(--green); border-radius: 9px; color: white; display: flex; font-size: 10px; font-weight: 750; height: 32px; justify-content: center; letter-spacing: .4px; width: 32px; }
.workspace-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.workspace-copy strong { color: #f4faf7; font-size: 13px; font-weight: 650; }
.workspace-copy small { color: var(--nav-muted); font-size: 11px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-groups { flex: 1; overflow-y: auto; padding: 11px 0; scrollbar-width: none; }
.nav-groups::-webkit-scrollbar { display: none; }
.nav-groups section + section { margin-top: 13px; }
.nav-label { color: #71887e; font-size: 10px; font-weight: 700; letter-spacing: .12em; margin: 0 10px 5px; text-transform: uppercase; }
.nav-groups a { align-items: center; border-radius: 9px; color: #b9c9c2; display: flex; font-size: 13px; font-weight: 520; gap: 11px; min-height: 38px; padding: 8px 10px; transition: background .16s, color .16s; }
.nav-groups a:hover { background: rgba(255,255,255,.045); color: #eff7f3; }
.nav-groups a.active { background: rgba(36,188,126,.14); color: #7ce0b6; }
.nav-groups a.active .icon { color: #48c791; }
.nav-count { background: #2c4038; border-radius: 9px; color: #d7e4de; font-size: 10px; font-weight: 700; margin-left: auto; min-width: 20px; padding: 2px 6px; text-align: center; }
.nav-groups a.active .nav-count { background: var(--green); color: white; }

.setup-card { background: #172a22; border: 1px solid #294138; border-radius: 11px; margin: 6px 0 10px; padding: 11px; }
.setup-card > div:first-child { color: #aebfb8; display: flex; font-size: 11px; justify-content: space-between; }
.setup-card strong { color: #e7f3ed; font-weight: 650; }
.progress-track { background: #2a4037; border-radius: 4px; height: 4px; margin: 9px 0; overflow: hidden; }
.progress-track span { background: var(--green-bright); border-radius: inherit; display: block; height: 100%; width: 50%; }
.setup-card a { color: #65d6a7; font-size: 11px; font-weight: 600; }
.sidebar-profile { align-items: center; border-top: 1px solid #24372f; display: flex; gap: 9px; padding: 12px 4px 0; }
.sidebar-profile > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.sidebar-profile strong { color: #e8f1ed; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile small { color: var(--nav-muted); font-size: 10px; margin-top: 2px; text-transform: capitalize; }

.main-area { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { align-items: center; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; height: var(--topbar); justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); }
.page-identity { display: flex; flex-direction: column; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.page-identity h1 { font-size: 18px; letter-spacing: -.35px; line-height: 1.25; margin: 2px 0 0; }
.topbar-actions { align-items: center; display: flex; gap: 8px; }
.command-search { align-items: center; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 9px; color: var(--muted); cursor: pointer; display: flex; gap: 8px; height: 36px; min-width: 210px; padding: 0 9px; }
.command-search span:nth-child(2) { flex: 1; text-align: left; }
kbd { background: white; border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow-sm); color: #87948e; font-family: inherit; font-size: 10px; padding: 2px 5px; }
.demo-pill { align-items: center; background: var(--green-soft); border: 1px solid #cdebdc; border-radius: 20px; color: var(--green-dark); display: flex; font-size: 11px; font-weight: 650; gap: 6px; height: 28px; padding: 0 10px; }
.demo-pill > span { background: var(--green-bright); border-radius: 50%; height: 6px; width: 6px; }
.icon-button { align-items: center; background: transparent; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; display: inline-flex; height: 34px; justify-content: center; padding: 0; width: 34px; }
.icon-button:hover { background: var(--surface-strong); color: var(--text); }
.notification-button { position: relative; }
.notification-button i { background: var(--red); border: 2px solid white; border-radius: 50%; height: 7px; position: absolute; right: 6px; top: 5px; width: 7px; }
.mobile-menu { display: none; }
.page-content { min-height: calc(100vh - var(--topbar)); padding: 24px 26px 36px; }
.page-content.inbox-page { padding: 0; }

.avatar { align-items: center; border-radius: 10px; display: inline-flex; flex: 0 0 auto; font-size: 11px; font-weight: 750; height: 34px; justify-content: center; letter-spacing: .02em; text-transform: uppercase; width: 34px; }
.avatar-lg { border-radius: 14px; font-size: 15px; height: 48px; width: 48px; }
.avatar-violet { background: var(--violet-soft); color: var(--violet); }
.avatar-emerald { background: var(--green-soft); color: var(--green); }
.avatar-blue { background: var(--blue-soft); color: var(--blue); }
.avatar-amber { background: var(--amber-soft); color: var(--amber); }
.loading-state, .empty-state { align-items: center; color: var(--muted); display: flex; flex-direction: column; gap: 12px; justify-content: center; min-height: 320px; text-align: center; }
.spinner { animation: spin .8s linear infinite; border: 2px solid var(--line); border-radius: 50%; border-top-color: var(--green); height: 24px; width: 24px; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn { align-items: center; background: white; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text-soft); cursor: pointer; display: inline-flex; font-size: 12px; font-weight: 650; gap: 7px; height: 36px; justify-content: center; padding: 0 13px; }
.btn:hover { background: var(--surface-alt); border-color: #b8c7bf; }
.btn-primary { background: var(--green); border-color: var(--green); color: white; }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-soft { background: var(--green-soft); border-color: transparent; color: var(--green-dark); }
.btn-danger { background: var(--red-soft); border-color: transparent; color: var(--red); }
.btn-sm { height: 30px; padding: 0 10px; }
.btn-icon { padding: 0; width: 36px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { color: var(--text-soft); font-size: 11px; font-weight: 650; }
.input, .select, .textarea { background: white; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); outline: none; padding: 9px 11px; width: 100%; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,122,85,.1); }
.textarea { min-height: 88px; resize: vertical; }
.search-field { align-items: center; display: flex; position: relative; }
.search-field .icon { color: var(--muted); left: 10px; position: absolute; }
.search-field .input { padding-left: 35px; }
.subtle { color: var(--muted); }
.mobile-backdrop { display: none; }

.page-head { align-items: flex-end; display: flex; gap: 18px; justify-content: space-between; margin-bottom: 20px; }
.page-head h2 { font-size: 24px; letter-spacing: -.65px; margin: 0 0 5px; }
.page-head p { color: var(--muted); line-height: 1.55; margin: 0; max-width: 660px; }
.page-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; min-height: 52px; padding: 12px 16px; }
.card-header h3 { font-size: 14px; letter-spacing: -.15px; margin: 0; }
.card-header p { color: var(--muted); font-size: 11px; margin: 3px 0 0; }
.card-body { padding: 16px; }
.setup-banner { align-items: center; background: linear-gradient(118deg,#10291f 0%,#0d4534 100%); border: 0; color: white; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 18px; overflow: hidden; padding: 18px 20px; position: relative; }
.setup-banner::after { border: 22px solid rgba(46,215,146,.11); border-radius: 50%; content: ''; height: 160px; position: absolute; right: 70px; top: -80px; width: 160px; }
.setup-banner > div { align-items: center; display: flex; gap: 13px; position: relative; z-index: 1; }
.setup-icon { align-items: center; background: rgba(66,216,153,.15); border: 1px solid rgba(126,232,188,.22); border-radius: 12px; color: #7de7bb; display: flex; height: 42px; justify-content: center; width: 42px; }
.setup-banner h3 { font-size: 14px; margin: 0 0 4px; }
.setup-banner p { color: #b8cec5; font-size: 11px; margin: 0; }
.setup-banner .btn { background: #ecfff7; border-color: transparent; color: #075d41; position: relative; z-index: 1; }

.metrics-grid { display: grid; gap: 12px; grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 18px; }
.metric-card { min-height: 118px; padding: 15px; }
.metric-top { align-items: center; color: var(--muted); display: flex; font-size: 11px; font-weight: 600; justify-content: space-between; }
.metric-icon { align-items: center; background: var(--surface-strong); border-radius: 9px; color: var(--text-soft); display: flex; height: 30px; justify-content: center; width: 30px; }
.metric-value { font-size: 25px; font-weight: 720; letter-spacing: -.8px; margin: 12px 0 4px; }
.metric-context { color: var(--muted); font-size: 10px; }
.delta-up { color: var(--green); font-weight: 650; }
.delta-warn { color: var(--amber); font-weight: 650; }

.dashboard-grid { display: grid; gap: 14px; grid-template-columns: minmax(0,1.55fr) minmax(290px,.85fr); }
.dashboard-stack { display: grid; gap: 14px; }
.chart-area { align-items: end; display: grid; gap: 12px; grid-template-columns: repeat(7,1fr); height: 185px; padding: 28px 6px 2px; }
.bar-day { align-items: center; display: flex; flex-direction: column; gap: 7px; height: 100%; justify-content: flex-end; }
.bar-pair { align-items: flex-end; display: flex; gap: 4px; height: calc(100% - 20px); justify-content: center; width: 100%; }
.bar-pair i { background: #d7e6df; border-radius: 5px 5px 2px 2px; display: block; min-height: 6px; transition: height .35s; width: min(20px,35%); }
.bar-pair i:first-child { background: var(--green); }
.bar-day small { color: var(--muted); font-size: 10px; }
.chart-legend { align-items: center; color: var(--muted); display: flex; font-size: 10px; gap: 13px; }
.chart-legend span { align-items: center; display: flex; gap: 5px; }
.chart-legend i { background: var(--green); border-radius: 2px; height: 7px; width: 7px; }
.chart-legend span:last-child i { background: #d7e6df; }

.queue-list { display: flex; flex-direction: column; }
.queue-row { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 10px; padding: 11px 0; }
.queue-row:first-child { padding-top: 0; }
.queue-row:last-child { border-bottom: 0; padding-bottom: 0; }
.queue-row > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.queue-row strong { font-size: 12px; font-weight: 650; }
.queue-row small { color: var(--muted); font-size: 10px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-row time { color: var(--muted); font-size: 10px; }
.queue-row .unread { align-items: center; background: var(--green); border-radius: 50%; color: white; display: flex; font-size: 9px; font-weight: 700; height: 18px; justify-content: center; width: 18px; }

.agent-list { display: flex; flex-direction: column; gap: 13px; }
.agent-row { align-items: center; display: grid; gap: 9px; grid-template-columns: auto 1fr auto; }
.agent-copy { display: flex; flex-direction: column; min-width: 0; }
.agent-copy strong { font-size: 11px; }
.agent-copy small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.workload { text-align: right; }
.workload strong { display: block; font-size: 11px; }
.workload small { color: var(--muted); font-size: 9px; }
.presence { border: 2px solid white; border-radius: 50%; height: 9px; margin: -8px 0 0 -8px; width: 9px; z-index: 1; }
.presence.online { background: var(--green-bright); }
.presence.busy { background: #eea52f; }
.presence.offline { background: #aab5b0; }

.quick-grid { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.quick-action { align-items: center; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; display: flex; gap: 9px; min-height: 50px; padding: 9px; text-align: left; }
.quick-action:hover { background: var(--green-soft); border-color: #cde7da; }
.quick-action .metric-icon { background: white; color: var(--green); }
.quick-action span:last-child { display: flex; flex-direction: column; }
.quick-action strong { font-size: 10px; }
.quick-action small { color: var(--muted); font-size: 9px; margin-top: 2px; }

.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { border-collapse: collapse; min-width: 720px; width: 100%; }
.data-table th { background: var(--surface-alt); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 10px 15px; text-align: left; text-transform: uppercase; }
.data-table td { border-top: 1px solid var(--line); color: var(--text-soft); font-size: 11px; padding: 12px 15px; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfcfb; }
.person-cell { align-items: center; display: flex; gap: 10px; }
.person-cell > span:last-child { display: flex; flex-direction: column; }
.person-cell strong { color: var(--text); font-size: 12px; }
.person-cell small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.badge { align-items: center; background: var(--surface-strong); border-radius: 12px; color: var(--text-soft); display: inline-flex; font-size: 9px; font-weight: 650; gap: 5px; min-height: 21px; padding: 3px 8px; text-transform: capitalize; }
.badge::before { background: currentColor; border-radius: 50%; content: ''; height: 5px; opacity: .8; width: 5px; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { background: var(--surface-strong); border-radius: 6px; color: var(--text-soft); display: inline-block; font-size: 9px; padding: 3px 6px; }

.resource-grid { display: grid; gap: 13px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.resource-card { display: flex; flex-direction: column; min-height: 184px; padding: 16px; }
.resource-card-top { align-items: flex-start; display: flex; gap: 11px; justify-content: space-between; }
.resource-icon { align-items: center; background: var(--green-soft); border-radius: 10px; color: var(--green); display: flex; height: 36px; justify-content: center; width: 36px; }
.resource-card h3 { font-size: 13px; margin: 13px 0 5px; }
.resource-card p { color: var(--muted); font-size: 10px; line-height: 1.55; margin: 0; }
.resource-meta { align-items: center; border-top: 1px solid var(--line); display: flex; font-size: 10px; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.resource-meta span { color: var(--muted); }
.resource-metrics { display: grid; gap: 9px; grid-template-columns: repeat(4,1fr); margin-top: 15px; }
.resource-metrics div { display: flex; flex-direction: column; }
.resource-metrics strong { font-size: 13px; }
.resource-metrics small { color: var(--muted); font-size: 9px; margin-top: 2px; }

.inbox-layout { background: white; display: grid; grid-template-columns: 326px minmax(390px,1fr) 282px; height: calc(100vh - var(--topbar)); overflow: hidden; }
.conversation-panel { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.conversation-toolbar { border-bottom: 1px solid var(--line); padding: 13px; }
.conversation-toolbar-top { align-items: center; display: flex; gap: 8px; margin-bottom: 10px; }
.conversation-toolbar-top .search-field { flex: 1; }
.conversation-toolbar-top .input { background: var(--surface-alt); height: 34px; }
.inbox-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.inbox-tabs::-webkit-scrollbar { display: none; }
.inbox-tab { background: transparent; border: 0; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 650; padding: 6px 8px; white-space: nowrap; }
.inbox-tab:hover { background: var(--surface-strong); }
.inbox-tab.active { background: var(--green-soft); color: var(--green-dark); }
.list-summary { align-items: center; color: var(--muted); display: flex; font-size: 9px; justify-content: space-between; padding: 9px 13px 7px; text-transform: uppercase; letter-spacing: .05em; }
.conversation-list { flex: 1; overflow-y: auto; }
.conversation-item { background: transparent; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; display: block; padding: 12px 13px; text-align: left; width: 100%; }
.conversation-item:hover { background: var(--surface-alt); }
.conversation-item.active { background: #edf8f3; box-shadow: inset 3px 0 var(--green); }
.conversation-item-top { align-items: center; display: flex; gap: 9px; }
.conversation-name { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.conversation-name strong { font-size: 12px; font-weight: 670; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-name small { align-items: center; color: var(--muted); display: flex; font-size: 9px; gap: 4px; margin-top: 2px; }
.wa-dot { background: var(--green-bright); border-radius: 50%; height: 5px; width: 5px; }
.conversation-time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.conversation-preview { align-items: center; display: flex; gap: 8px; margin: 8px 0 7px 43px; }
.conversation-preview p { color: var(--muted); flex: 1; font-size: 10px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-dot { align-items: center; background: var(--green); border-radius: 9px; color: white; display: flex; font-size: 8px; font-weight: 750; height: 17px; justify-content: center; min-width: 17px; padding: 0 5px; }
.conversation-bottom { align-items: center; display: flex; gap: 5px; margin-left: 43px; }
.priority-mark { align-items: center; color: var(--red); display: flex; font-size: 8px; font-weight: 700; gap: 3px; text-transform: uppercase; }
.priority-mark.high { color: var(--amber); }
.mini-assignee { margin-left: auto; }
.mini-assignee .avatar { border-radius: 6px; font-size: 7px; height: 19px; width: 19px; }
.sla { background: var(--amber-soft); border-radius: 5px; color: var(--amber); font-size: 8px; font-weight: 650; padding: 3px 5px; }
.sla.overdue { background: var(--red-soft); color: var(--red); }

.thread-panel { background: #f7faf8; display: flex; flex-direction: column; min-width: 0; position: relative; }
.thread-header { align-items: center; background: white; border-bottom: 1px solid var(--line); display: grid; gap: 8px 11px; grid-template-columns: auto minmax(90px,1fr); min-height: 82px; padding: 10px 15px; }
.thread-person { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.thread-person strong { font-size: 13px; }
.thread-person small { align-items: center; color: var(--muted); display: flex; font-size: 9px; gap: 5px; margin-top: 3px; }
.thread-actions { align-items: center; display: flex; gap: 5px; grid-column: 1 / -1; justify-content: flex-end; padding-left: 45px; }
.thread-action-select { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 8px; color: var(--text-soft); font-size: 10px; height: 32px; max-width: 125px; padding: 0 8px; }
.mobile-back-to-list { display: none; }
.messages { display: flex; flex: 1; flex-direction: column; gap: 9px; overflow-y: auto; padding: 18px 22px; }
.date-divider { align-items: center; color: var(--muted); display: flex; font-size: 9px; gap: 8px; justify-content: center; margin: 4px 0 8px; }
.date-divider::before, .date-divider::after { background: var(--line); content: ''; height: 1px; width: 50px; }
.message-row { align-items: flex-end; display: flex; gap: 7px; max-width: min(72%,520px); }
.message-row.outbound { align-self: flex-end; flex-direction: row-reverse; }
.message-bubble { background: white; border: 1px solid var(--line); border-radius: 4px 13px 13px 13px; box-shadow: var(--shadow-sm); color: var(--text-soft); font-size: 11px; line-height: 1.55; padding: 9px 11px 7px; }
.outbound .message-bubble { background: #dff5e9; border-color: #caebdc; border-radius: 13px 4px 13px 13px; }
.message-meta { align-items: center; color: var(--muted); display: flex; font-size: 8px; gap: 5px; justify-content: flex-end; margin-top: 4px; }
.message-status { color: var(--blue); font-size: 10px; font-weight: 700; }
.typing-indicator { align-items: center; align-self: flex-start; background: white; border: 1px solid var(--line); border-radius: 4px 12px 12px; display: none; gap: 4px; padding: 11px 13px; }
.typing-indicator.show { display: flex; }
.typing-indicator i { animation: typing 1.2s infinite; background: #8ea098; border-radius: 50%; height: 5px; width: 5px; }
.typing-indicator i:nth-child(2) { animation-delay: .16s; }
.typing-indicator i:nth-child(3) { animation-delay: .32s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-3px); } }

.composer-wrap { background: white; border-top: 1px solid var(--line); padding: 10px 14px 12px; }
.service-window { align-items: center; color: var(--muted); display: flex; font-size: 9px; gap: 5px; margin-bottom: 7px; }
.service-window .icon { color: var(--green); height: 13px; width: 13px; }
.service-window.closed { color: var(--amber); }
.composer-tabs { display: flex; gap: 4px; margin-bottom: 7px; }
.composer-tab { background: transparent; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer; font-size: 9px; font-weight: 650; padding: 4px 7px; }
.composer-tab.active { background: var(--surface-strong); color: var(--text); }
.composer { align-items: flex-end; background: var(--surface-alt); border: 1px solid var(--line-strong); border-radius: 11px; display: flex; gap: 5px; padding: 6px; }
.composer:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,122,85,.08); }
.composer textarea { background: transparent; border: 0; flex: 1; line-height: 1.45; max-height: 110px; min-height: 34px; outline: 0; padding: 8px 5px; resize: none; }
.composer .btn-primary { height: 34px; padding: 0; width: 36px; }
.composer-number { align-items: center; color: var(--muted); display: flex; font-size: 8px; justify-content: space-between; margin-top: 6px; }
.composer-number strong { color: var(--text-soft); font-weight: 600; }

.context-panel { background: white; border-left: 1px solid var(--line); min-width: 0; overflow-y: auto; }
.context-heading { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; min-height: 52px; padding: 10px 14px; }
.context-heading strong { font-size: 11px; }
.contact-summary { align-items: center; display: flex; flex-direction: column; padding: 20px 14px 15px; text-align: center; }
.contact-summary h3 { font-size: 14px; margin: 9px 0 3px; }
.contact-summary p { color: var(--muted); font-size: 10px; margin: 0; }
.contact-actions { display: flex; gap: 7px; margin-top: 12px; }
.context-section { border-top: 1px solid var(--line); padding: 13px 14px; }
.context-section-title { align-items: center; display: flex; font-size: 9px; font-weight: 750; justify-content: space-between; letter-spacing: .05em; margin-bottom: 10px; text-transform: uppercase; }
.context-section-title button { background: none; border: 0; color: var(--green); cursor: pointer; font-size: 9px; }
.detail-list { display: flex; flex-direction: column; gap: 9px; }
.detail-row { align-items: center; display: grid; gap: 8px; grid-template-columns: 18px 1fr; }
.detail-row .icon { color: var(--muted); height: 14px; width: 14px; }
.detail-row span:last-child { display: flex; flex-direction: column; min-width: 0; }
.detail-row small { color: var(--muted); font-size: 8px; }
.detail-row strong { color: var(--text-soft); font-size: 10px; font-weight: 550; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.note-item { background: var(--amber-soft); border-radius: 8px; color: #68420d; font-size: 9px; line-height: 1.45; padding: 9px; }
.note-item small { color: #9b722f; display: block; margin-top: 5px; }

.number-list, .settings-list { display: flex; flex-direction: column; gap: 11px; }
.number-card { align-items: center; display: grid; gap: 14px; grid-template-columns: auto minmax(180px,1fr) repeat(3,minmax(100px,.45fr)) auto; padding: 15px; }
.number-logo { align-items: center; background: var(--green-soft); border-radius: 12px; color: var(--green); display: flex; height: 43px; justify-content: center; width: 43px; }
.number-main { display: flex; flex-direction: column; }
.number-main strong { font-size: 13px; }
.number-main span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.number-stat { display: flex; flex-direction: column; }
.number-stat small { color: var(--muted); font-size: 9px; }
.number-stat strong { font-size: 10px; margin-top: 4px; }
.settings-grid { display: grid; gap: 14px; grid-template-columns: minmax(0,1fr) minmax(300px,.65fr); }
.setting-row { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 12px; justify-content: space-between; padding: 13px 0; }
.setting-row:first-child { padding-top: 0; }
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-copy { display: flex; flex-direction: column; }
.setting-copy strong { font-size: 11px; }
.setting-copy small { color: var(--muted); font-size: 9px; line-height: 1.45; margin-top: 3px; }
.toggle { cursor: pointer; display: inline-flex; }
.toggle input { opacity: 0; position: absolute; }
.toggle span { background: #ccd6d1; border-radius: 18px; display: block; height: 22px; padding: 3px; transition: background .2s; width: 38px; }
.toggle span::after { background: white; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.18); content: ''; display: block; height: 16px; transition: transform .2s; width: 16px; }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(16px); }

.modal { background: transparent; border: 0; max-width: min(92vw,520px); padding: 0; width: 100%; }
.modal::backdrop { background: rgba(10,24,18,.52); backdrop-filter: blur(2px); }
.modal-shell { background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); overflow: hidden; }
.modal-header { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 16px 18px; }
.modal-header h2 { font-size: 17px; margin: 3px 0 0; }
.modal-body { display: grid; gap: 13px; padding: 18px; }
.modal-footer { align-items: center; background: var(--surface-alt); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; }
.setup-steps { display: flex; flex-direction: column; gap: 12px; }
.setup-step { align-items: flex-start; display: grid; gap: 10px; grid-template-columns: 28px 1fr; }
.step-number { align-items: center; background: var(--green-soft); border-radius: 9px; color: var(--green); display: flex; font-size: 10px; font-weight: 750; height: 28px; justify-content: center; width: 28px; }
.setup-step strong { display: block; font-size: 11px; margin-top: 2px; }
.setup-step p { color: var(--muted); font-size: 9px; line-height: 1.5; margin: 3px 0 0; }
.toast-region { bottom: 18px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; position: fixed; right: 18px; z-index: 80; }
.toast { align-items: center; animation: toast-in .2s ease-out; background: #14251e; border: 1px solid #294038; border-radius: 10px; box-shadow: var(--shadow-md); color: #edf6f2; display: flex; font-size: 11px; gap: 9px; max-width: 360px; padding: 11px 13px; }
.toast.error { background: #3c171c; border-color: #6d2932; }
.toast .icon { color: #5ed59f; }
.toast.error .icon { color: #ff8f9d; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1180px) {
  .inbox-layout { grid-template-columns: 310px minmax(390px,1fr); }
  .context-panel { display: none; }
  .metrics-grid { grid-template-columns: repeat(2,1fr); }
  .resource-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 920px) {
  :root { --sidebar: 218px; }
  .dashboard-grid, .settings-grid { grid-template-columns: 1fr; }
  .number-card { grid-template-columns: auto 1fr auto; }
  .number-stat { display: none; }
  .command-search { min-width: 36px; width: 36px; }
  .command-search span:nth-child(2), .command-search kbd { display: none; }
  .topbar { padding: 0 18px; }
  .page-content { padding: 20px 18px 30px; }
}

@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; width: 250px; }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .mobile-backdrop { background: rgba(9,25,18,.45); display: block; inset: 0; opacity: 0; pointer-events: none; position: fixed; transition: opacity .2s; z-index: 25; }
  .app-shell.nav-open .mobile-backdrop { opacity: 1; pointer-events: auto; }
  .main-area { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .topbar { gap: 8px; padding: 0 12px; }
  .page-identity { flex: 1; }
  .topbar-actions .demo-pill, .topbar-actions > .icon-button:first-of-type { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .metrics-grid, .resource-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .inbox-layout { display: block; position: relative; }
  .conversation-panel { height: 100%; width: 100%; }
  .thread-panel { display: none; height: 100%; inset: 0; position: absolute; }
  .inbox-layout.thread-open .conversation-panel { display: none; }
  .inbox-layout.thread-open .thread-panel { display: flex; }
  .mobile-back-to-list { display: inline-flex; }
  .thread-header { grid-template-columns: auto auto minmax(0,1fr); }
  .thread-actions { grid-column: 2 / -1; padding-left: 0; }
  .thread-action-select { max-width: 105px; }
  .messages { padding: 16px 12px; }
  .message-row { max-width: 86%; }
  .modal { max-width: calc(100vw - 20px); }
}

@media (max-width: 480px) {
  .page-content { padding: 16px 12px 24px; }
  .metrics-grid { gap: 8px; }
  .metric-card { min-height: 104px; }
  .setup-banner { align-items: flex-start; flex-direction: column; }
  .setup-banner > div { align-items: flex-start; }
  .setup-banner .btn { width: 100%; }
  .topbar-actions { gap: 2px; }
  .page-identity .eyebrow { display: none; }
  .page-identity h1 { font-size: 16px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .resource-metrics { grid-template-columns: repeat(2,1fr); }
  .number-card { gap: 10px; padding: 12px; }
}
body.is-booting { visibility: hidden; }
[hidden] { display: none !important; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 15%, #d7f8e8 0, transparent 34%), radial-gradient(circle at 85% 90%, #ece5ff 0, transparent 30%), #f6f8f7; }
.login-card { width: min(100%, 420px); padding: 38px; border: 1px solid #dfe7e3; border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 24px 70px rgba(16,32,26,.13); display: grid; gap: 16px; }
.login-card h1 { margin: 2px 0 -8px; font-size: 30px; color: #10201a; }
.login-card > p { margin: 0 0 5px; color: #66756e; line-height: 1.55; }
.login-card label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; color: #33463e; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 19px; color: #33463e; }
.login-brand strong { color: #10201a; }
.login-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: white; background: #1b8354; font-weight: 800; }
.login-submit { width: 100%; justify-content: center; min-height: 44px; margin-top: 5px; }
.login-error { min-height: 18px; color: #b42318; font-size: 12px; font-weight: 650; }
.login-card > small { color: #829088; text-align: center; }
@media (max-width: 520px) { .login-screen { padding: 14px; } .login-card { padding: 26px 22px; border-radius: 18px; } }
