:root {
  color-scheme: light;
  --ink: #0c3542;
  --muted: #607a82;
  --line: #d6e7e9;
  --paper: #f2f8f8;
  --white: #ffffff;
  --forest: #07566d;
  --forest-2: #06465c;
  --mint: #2bc985;
  --mint-soft: #e5f8f0;
  --amber: #21b9a6;
  --red: #ca5b4c;
  --blue: #168db8;
  --gold: #6ce0b0;
  --gold-deep: #087b9e;
  --shadow: 0 10px 30px rgba(4, 77, 97, 0.065);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 118px; }
body { margin: 0; color: var(--ink); background:
  radial-gradient(circle at 92% 2%, rgba(43,201,133,.11), transparent 24%),
  radial-gradient(circle at 72% 0%, rgba(22,141,184,.08), transparent 28%),
  var(--paper); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); transition: grid-template-columns .24s ease; }
.sidebar { position: sticky; top: 0; z-index: 40; height: 100vh; padding: 24px 18px 18px; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; color: white; scrollbar-width: none; background-color: #043e55; background-image:
  linear-gradient(90deg, rgba(2,42,59,.24) 0%, rgba(2,51,68,.08) 58%, rgba(3,61,76,.18) 100%),
  url("/static/assets/sidebar-bg-uhd.jpg?v=20260811.1");
  background-position: center, 70% center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: 8px 0 30px rgba(4,63,82,.12); transition: width .24s ease, padding .24s ease, transform .24s ease; }
.sidebar > * { position: relative; z-index: 1; }
.sidebar-head { display: flex; align-items: center; gap: 8px; }
.brand { min-width: 0; display: flex; gap: 12px; align-items: center; color: white; text-decoration: none; margin: 0 6px 22px; }
.brand-mark { width: 54px; height: 54px; flex: 0 0 auto; overflow: visible; display: grid; place-items: center; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 3px 8px rgba(0,35,51,.28)); }
.brand-copy { min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { color: #fff; font-size: 17px; letter-spacing: .025em; white-space: nowrap; }
.brand small { margin-top: 4px; color: var(--gold); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.sidebar-close { display: none; margin-left: auto; border: 0; color: white; background: transparent; font-size: 30px; cursor: pointer; }
.sidebar-collapse { width: 100%; margin: 0 0 16px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 11px; color: rgba(255,255,255,.78); background: rgba(255,255,255,.07); font-size: 12px; cursor: pointer; }
.sidebar-collapse > span:first-child { color: var(--gold); font-size: 21px; line-height: 1; transition: transform .2s ease; }
.sidebar nav { display: grid; gap: 7px; }
.nav-link { display: flex; gap: 11px; align-items: center; padding: 10px 11px; border: 1px solid transparent; border-radius: 11px; color: rgba(255,255,255,.78); text-decoration: none; font-size: 14px; transition: .18s ease; }
.nav-link:hover { color: white; background: rgba(255,255,255,.08); }
.nav-link.active { color: #043f52; border-color: rgba(255,255,255,.65); background: linear-gradient(105deg, #eafbf4, #d9f5f1); box-shadow: 0 8px 22px rgba(1,45,58,.16); }
.nav-icon { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 7px; color: transparent; font-size: 0; text-align: center; }
.nav-icon::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #67e3b0; box-shadow: 0 0 0 3px rgba(103,227,176,.12); }
.nav-link.active .nav-icon { border-color: rgba(5,108,132,.25); background: rgba(255,255,255,.72); }
.nav-link.active .nav-icon::after { background: #0d93af; box-shadow: 0 0 0 3px rgba(13,147,175,.12); }
.sidebar-utility-panel { margin: 0 0 13px; padding: 6px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5px; border: 1px solid rgba(255,255,255,.18); border-radius: 14px; background: rgba(0,48,64,.2); }
.sidebar-utility-panel > * { width: 100%; min-width: 0; min-height: 34px; margin: 0; }
.sidebar-utility-panel .sidebar-collapse { grid-column: 1; grid-row: 1; padding: 6px 8px; justify-content: center; gap: 6px; border-radius: 9px; }
.sidebar-utility-panel .sidebar-collapse > span:first-child { font-size: 18px; }
.sidebar-utility-panel .language-switcher { grid-column: 2; grid-row: 1; padding: 6px 24px 6px 8px; color: white; border: 1px solid rgba(255,255,255,.13); border-radius: 9px; background-color: rgba(255,255,255,.08); }
.sidebar-utility-panel .language-switcher option { color: var(--ink); background: white; }
.sidebar-utility-panel .user-button { display: none !important; }
.sidebar-utility-panel #logout-button { grid-column: 1; grid-row: 2; color: white; border-radius: 9px; background: rgba(255,255,255,.1); }
.sidebar-utility-panel .alert-toggle { grid-column: 2; grid-row: 2; max-width: none; padding-inline: 7px; color: #d9fff0 !important; border-radius: 9px; background: rgba(43,201,133,.14) !important; }
.sidebar-utility-panel .install-app-button { grid-column: 1 / -1; grid-row: 4; padding: 7px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; color: #fff; background: rgba(255,255,255,.1); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.sidebar-utility-panel .mode-pill { grid-column: 1; grid-row: 3; justify-content: center; color: #d9fff0; border-color: rgba(43,201,133,.25); border-radius: 9px; background: rgba(43,201,133,.1); }
.sidebar-utility-panel .primary-button { grid-column: 2; grid-row: 3; padding-inline: 7px; border-radius: 9px; box-shadow: none; }
.sidebar-note { margin-top: 8px; padding: 10px; display: flex; gap: 10px; border: 1px solid rgba(255,255,255,.17); border-radius: 12px; background: rgba(0,48,64,.18); }
.sidebar-note strong { display: block; font-size: 14px; }
.sidebar-note p { margin: 5px 0 0; color: rgba(255,255,255,.53); font-size: 12px; line-height: 1.55; }
.live-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 3px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(188,240,113,.1); }
.sidebar-backdrop { display: none; }
body.sidebar-collapsed .app-shell { grid-template-columns: 80px minmax(0, 1fr); }
body.sidebar-collapsed .sidebar { padding-inline: 14px; }
body.sidebar-collapsed .brand { justify-content: center; margin-inline: 0; }
body.sidebar-collapsed .brand-mark { width: 54px; height: 54px; }
body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .sidebar-collapse .nav-label,
body.sidebar-collapsed .nav-link .nav-label,
body.sidebar-collapsed .sidebar-note { display: none; }
body.sidebar-collapsed .sidebar-utility-panel { grid-template-columns: 1fr; padding: 0; border-color: transparent; background: transparent; }
body.sidebar-collapsed .sidebar-utility-panel > :not(.sidebar-collapse) { display: none !important; }
body.sidebar-collapsed .sidebar-utility-panel .sidebar-collapse { grid-column: 1; width: 100%; padding-inline: 8px; }
body.sidebar-collapsed .sidebar-collapse,
body.sidebar-collapsed .nav-link { justify-content: center; padding-inline: 8px; }
body.sidebar-collapsed .sidebar-collapse > span:first-child { transform: rotate(180deg); }
body.sidebar-collapsed .nav-icon { width: 24px; }

main { min-width: 0; }
.topbar { min-height: 68px; padding: 10px; display: none; grid-template-columns: 1fr; align-items: center; gap: 16px; background:
  linear-gradient(115deg, rgba(255,255,255,.98) 0 70%, rgba(235,250,248,.96) 100%);
  border-bottom: 1px solid var(--line); box-shadow: 0 5px 20px rgba(4,77,97,.04); backdrop-filter: blur(15px); position: sticky; top: 0; z-index: 5; }
.topbar-title { min-width: 0; }
.topbar h1 { max-width: 720px; margin: 4px 0 0; font-size: clamp(19px, 1.55vw, 24px); letter-spacing: -.028em; line-height: 1.12; }
.eyebrow { margin: 0; color: var(--gold-deep); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.menu-button { display: none; width: 42px; height: 42px; flex: 0 0 auto; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; }
.menu-button span { height: 2px; display: block; margin: 4px 0; border-radius: 999px; background: var(--forest); }
.top-actions { min-width: 0; display: flex; justify-content: flex-start; align-items: center; gap: 8px; }
.top-action-group { min-height: 46px; padding: 4px; display: flex; align-items: center; gap: 3px; border: 1px solid rgba(185,217,222,.8); border-radius: 14px; background: rgba(255,255,255,.72); box-shadow: 0 6px 18px rgba(4,77,97,.045); }
.top-action-group > * { min-height: 36px; }
.top-actions #refresh-button, .top-actions #logout-button { flex: 0 0 auto; white-space: nowrap; }
.language-switcher { width: auto; min-width: 104px; padding: 7px 28px 7px 10px; border: 0; border-radius: 10px; color: var(--ink); background-color: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
html[lang="ru"] .nav-link, html[lang="kk"] .nav-link { font-size: 13px; line-height: 1.25; }
html[lang="ru"] .topbar h1, html[lang="kk"] .topbar h1 { font-size: clamp(17px, 1.4vw, 21px); line-height: 1.12; }
html[lang="ru"] .topbar .eyebrow, html[lang="kk"] .topbar .eyebrow { font-size: 10px; }
html[lang="ru"] [id], html[lang="kk"] [id] { scroll-margin-top: 170px; }
.user-button { max-width: 150px; overflow: hidden; padding: 7px 10px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; font-size: 12px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.mode-pill, .subtle-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #bfe5dc; border-radius: 999px; color: #176d75; background: #effbf8; font-size: 12px; font-weight: 800; white-space: nowrap; }
.mode-pill { cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.mode-pill:hover { border-color: #83d7c5; background: #e3f8f2; transform: translateY(-1px); }
.mode-pill:focus-visible { outline: 3px solid rgba(43,201,133,.25); outline-offset: 2px; }
.mode-pill:disabled { cursor: wait; opacity: .72; transform: none; }
.mode-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.primary-button, .small-button, .icon-button, .text-button { border: 0; cursor: pointer; transition: .18s ease; }
.primary-button { padding: 8px 13px; border-radius: 10px; color: white; background: linear-gradient(115deg, #087b9e, #14a9af 62%, #2bc985); font-weight: 800; font-size: 12px; box-shadow: 0 7px 18px rgba(7,110,137,.15); }
.primary-button:hover { background: linear-gradient(115deg, #066b8a, #0c979f 62%, #20b879); transform: translateY(-1px); }
.icon-button { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); }
.icon-button:hover { border-color: #aab8ae; }
.small-button { padding: 7px 9px; border: 0; border-radius: 9px; color: #145b69; background: #edf7f7; font-size: 12px; font-weight: 800; }
.alert-toggle { max-width: 170px; min-height: 36px; overflow: hidden; border-color: transparent !important; color: #08755f !important; background: #edfbf4 !important; text-overflow: ellipsis; white-space: nowrap; }
.text-button { padding: 5px; color: var(--forest-2); background: transparent; text-decoration: none; font-size: 13px; font-weight: 800; }

.content { width: 100%; max-width: none; margin: 0; padding: 10px 10px 24px; }
.content > .hero-grid, .content > .flow-card, .main-grid > .panel, .customer-portal-panel { display: none; }
.content[data-workspace="overview"] { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: start; }
.content[data-workspace="overview"] > .hero-grid { grid-column: 1 / -1; grid-row: 1; display: grid; }
.content[data-workspace="overview"] > .flow-card { grid-column: 1 / -1; grid-row: 3; display: block; }
.content[data-workspace="overview"] > .main-grid { display: contents; }
.content[data-workspace="overview"] #leads,
.content[data-workspace="overview"] #operations,
.content[data-workspace="overview"] #messages,
.content[data-workspace="overview"] section[aria-labelledby="funnel-title"] { display: block; margin-top: 0; }
.content[data-workspace="overview"] #leads { grid-column: 1 / 9; grid-row: 2; }
.content[data-workspace="overview"] section[aria-labelledby="funnel-title"] { grid-column: 9 / -1; grid-row: 2; }
.content[data-workspace="overview"] #operations { grid-column: 1 / 9; grid-row: 4; }
.content[data-workspace="overview"] #messages { grid-column: 9 / -1; grid-row: 4; }
.content[data-workspace="operations"] #operations,
.content[data-workspace="leads"] #leads,
.content[data-workspace="orders"] #orders,
.content[data-workspace="campaigns"] #campaigns,
.content[data-workspace="messages"] #messages,
.content[data-workspace="inbox"] #inbox,
.content[data-workspace="support-agents"] #support-agents,
.content[data-workspace="reply-library"] #reply-library,
.content[data-workspace="integrations"] #integrations,
.content[data-workspace="backups"] #backups,
.content[data-workspace="users"] #users,
.content[data-workspace="customer-portal"] #customer-portal { display: block; margin-top: 0; }
.content[data-workspace]:not([data-workspace="overview"]) .main-grid { display: block; }
.content[data-workspace="customer-portal"] .main-grid { display: none; }
.content[data-workspace="inbox"] { height: 100dvh; min-height: 640px; padding: 10px; overflow: hidden; }
.content[data-workspace="inbox"] .main-grid { height: 100%; min-height: 0; }
.hero-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-height: 142px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.94); box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(4,77,97,.09); }
.accent-card { color: white; border-color: #087894; background: linear-gradient(145deg, #07566d, #087b9e 60%, #21b9a6); }
.metric-heading { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; font-weight: 750; }
.accent-card .metric-heading { color: rgba(255,255,255,.68); }
.metric-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; color: var(--forest); background: var(--mint-soft); font-size: 14px; }
.metric-value { display: block; margin-top: 12px; font-size: clamp(26px, 2.35vw, 34px); letter-spacing: -.045em; line-height: 1; }
.metric-value.is-status { margin-top: 18px; font-size: clamp(18px, 1.65vw, 23px); letter-spacing: -.02em; line-height: 1.15; }
.metric-card p { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.accent-card p { color: rgba(255,255,255,.58); }
.accent-card p b { color: var(--mint); }

.flow-card, .panel { margin-top: 17px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.02em; }
.section-heading.compact { align-items: flex-start; }
.flow-track { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 25px; }
.flow-step { min-width: 0; display: flex; gap: 10px; align-items: center; }
.flow-step > div { min-width: 0; }
.flow-number { width: 33px; height: 33px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--forest); background: var(--mint-soft); font-size: 12px; font-weight: 900; }
.flow-step strong, .flow-step small { display: block; }
.flow-step strong { font-size: 14px; }
.flow-step small { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: normal; }
.flow-arrow { color: #b3bdb6; }

.content[data-workspace="overview"] .panel,
.content[data-workspace="overview"] .flow-card { margin-top: 0; }
.content[data-workspace="overview"] #leads,
.content[data-workspace="overview"] #operations { min-height: 100%; }
.content[data-workspace="overview"] section[aria-labelledby="funnel-title"],
.content[data-workspace="overview"] #messages { min-height: 100%; background: linear-gradient(155deg, #ffffff, #f8fcfc); }
.content[data-workspace="overview"] #messages .message-list { max-height: 350px; overflow-y: auto; padding-right: 3px; }
.content[data-workspace="overview"] #operations .operations-grid { grid-template-columns: minmax(0, 1.05fr) minmax(260px, .8fr); }

.main-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, .8fr); gap: 0 17px; align-items: start; }
.panel { min-width: 0; }
.wide-panel { grid-row: span 1; }
.full-panel { grid-column: 1 / -1; }
.health-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; color: #47633e; background: #edf8e4; font-size: 12px; font-weight: 800; }
.health-pill i { width: 7px; height: 7px; border-radius: 50%; background: #69a943; }
.health-pill.attention { color: #8c493d; background: #fff0ed; }
.health-pill.attention i { background: var(--red); }
.operations-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .8fr); gap: 18px; margin-top: 18px; }
.queue-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.queue-stats article { padding: 12px; border: 1px solid #e6ebe7; border-radius: 12px; background: #fafbf9; }
.queue-stats span, .queue-stats strong { display: block; }
.queue-stats span { color: var(--muted); font-size: 11px; }
.queue-stats strong { margin-top: 5px; font-size: 20px; letter-spacing: -.03em; }
.alert-list { margin-top: 10px; display: grid; gap: 8px; }
.alert-item { padding: 10px 12px; display: grid; grid-template-columns: 8px 1fr; gap: 10px; border: 1px solid #e6ebe7; border-radius: 11px; }
.alert-item i { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: var(--amber); }
.alert-item.critical i { background: var(--red); }
.alert-item strong, .alert-item small { display: block; }
.alert-item strong { font-size: 12px; }
.alert-item small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.all-clear { padding: 11px 12px; border-radius: 11px; color: #45633d; background: #f1f9e9; font-size: 11px; }
.readiness-card { padding: 14px; border-radius: 15px; color: white; background: var(--forest); }
.readiness-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.readiness-head strong, .readiness-head small { display: block; }
.readiness-head strong { font-size: 13px; }
.readiness-head small { margin-top: 4px; color: rgba(255,255,255,.55); font-size: 11px; }
.readiness-head > span { color: var(--mint); font-size: 21px; font-weight: 900; letter-spacing: -.04em; }
.readiness-track { height: 5px; overflow: hidden; margin-top: 12px; border-radius: 999px; background: rgba(255,255,255,.13); }
.readiness-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--mint); transition: width .3s ease; }
.readiness-steps { margin-top: 12px; display: grid; gap: 6px; }
.readiness-step { display: grid; grid-template-columns: 17px 1fr auto; gap: 7px; align-items: center; padding: 7px 8px; border-radius: 9px; background: rgba(255,255,255,.055); }
.readiness-step i { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 6px; color: var(--forest); background: var(--mint); font-style: normal; font-size: 10px; font-weight: 900; }
.readiness-step.pending i { color: rgba(255,255,255,.5); background: rgba(255,255,255,.11); }
.readiness-step span { font-size: 11px; }
.readiness-step small { color: rgba(255,255,255,.45); font-size: 10px; }
.table-wrap { overflow-x: auto; margin-top: 17px; }
.lead-workbench-toolbar { margin-top: 16px; padding: 10px; display: grid; grid-template-columns: minmax(260px, 1.7fr) repeat(3, minmax(145px, .72fr)) auto; gap: 8px; align-items: end; border: 1px solid #cfe5e7; border-radius: 14px; background: linear-gradient(120deg, #f8fcfc, #eefaf7); }
.lead-workbench-toolbar label { min-width: 0; display: grid; gap: 5px; }
.lead-workbench-toolbar label > span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .03em; }
.lead-workbench-toolbar input, .lead-workbench-toolbar select { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid #c8dde0; border-radius: 10px; color: var(--ink); background: white; font-size: 12px; outline: 0; }
.lead-workbench-toolbar input:focus, .lead-workbench-toolbar select:focus { border-color: #31bba3; box-shadow: 0 0 0 3px rgba(43,201,133,.12); }
.lead-workbench-toolbar .lead-filter-clear { min-height: 38px; padding-inline: 12px; white-space: nowrap; }
.lead-workbench-summary { min-height: 32px; padding: 8px 3px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.lead-workbench-summary strong { color: var(--ink); font-size: 12px; }
.lead-heading-actions { display: flex; align-items: center; gap: 7px; }
.content[data-workspace="overview"] .lead-workbench-toolbar,
.content[data-workspace="overview"] .lead-workbench-summary { display: none; }
.order-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.order-summary span { padding: 8px 10px; border-radius: 10px; background: var(--mint-soft); color: var(--muted); font-size: 12px; }
.order-summary strong { margin-left: 4px; color: var(--forest); }
.order-workbench { padding: 0; overflow: hidden; border-color: #c9dfe2; }
.order-workbench-heading { min-height: 84px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, #fff 0 70%, #eaf9f6 100%); }
.order-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.order-metric-grid { padding: 14px 18px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; background: #f4fafa; }
.order-metric-grid article { min-width: 0; padding: 13px 14px; display: grid; gap: 6px; border: 1px solid #d4e7e8; border-radius: 13px; background: white; box-shadow: 0 6px 16px rgba(4,77,97,.035); }
.order-metric-grid small { color: var(--muted); font-size: 10px; font-weight: 800; }
.order-metric-grid strong { overflow: hidden; color: #06465a; font-size: clamp(19px, 2vw, 28px); letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.order-metric-grid span { color: #7c9297; font-size: 9px; }
.order-revenue-card { border-color: #aee2d4 !important; background: linear-gradient(145deg, #effcf7, #fff) !important; }
.order-workbench-toolbar { margin: 14px 18px 0; padding: 10px; display: grid; grid-template-columns: minmax(250px, 1.7fr) repeat(3, minmax(135px, .72fr)) auto; gap: 8px; align-items: end; border: 1px solid #cfe5e7; border-radius: 14px; background: linear-gradient(120deg, #f8fcfc, #eefaf7); }
.order-workbench-toolbar label { display: grid; gap: 5px; color: #60767b; font-size: 10px; font-weight: 850; }
.order-workbench-toolbar input, .order-workbench-toolbar select { min-height: 38px; padding: 8px 10px; border-color: #c8dde0; font-size: 12px; }
.order-filter-clear { min-height: 38px; }
.order-workbench-summary { margin: 10px 18px 0; padding: 9px 11px; display: flex; justify-content: space-between; gap: 12px; border-radius: 10px; color: #60767b; background: #edf7f6; font-size: 10px; }
.order-workbench-summary strong { color: #075c70; }
.order-table-wrap { padding: 8px 18px 18px; }
.order-number-button { padding: 0; border: 0; color: #087b9e; background: transparent; font: inherit; font-weight: 900; cursor: pointer; }
.order-number-button:hover { text-decoration: underline; }
.order-row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.order-customer-phone, .order-currency-code { margin-top: 3px; display: block; color: #849397; font-size: 9px; }
.stage-tag.order-paid, .stage-tag.order-fulfilled { color: #08755f; background: #e7f8ef; }
.stage-tag.order-cancelled, .stage-tag.order-refunded { color: #99443a; background: #fff0ed; }
.stage-tag.order-confirmed { color: #176d75; background: #e9f7f8; }
.order-editor-dialog, .order-detail-dialog { width: min(760px, calc(100vw - 30px)); }
.order-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.order-editor-dialog label { display: grid; gap: 5px; color: #53686c; font-size: 11px; font-weight: 800; }
.order-editor-note { margin: 0; padding: 10px 12px; border-radius: 11px; color: #566f73; background: #edf7f6; font-size: 10px; line-height: 1.55; }
.order-detail-content { display: grid; gap: 12px; }
.order-detail-hero { padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 14px; background: linear-gradient(135deg, #edf9f7, #f8fcfc); }
.order-detail-hero div { display: grid; gap: 4px; }.order-detail-hero small { color: var(--muted); font-size: 10px; }.order-detail-hero strong { color: #06465a; font-size: 28px; }
.order-detail-list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.order-detail-list div { padding: 9px 0; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf1f1; font-size: 11px; }.order-detail-list dt { color: var(--muted); }.order-detail-list dd { margin: 0; max-width: 68%; overflow: hidden; font-weight: 800; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.order-detail-items { padding: 13px; border: 1px solid var(--line); border-radius: 13px; }.order-detail-items h3 { margin: 0 0 8px; font-size: 13px; }.order-detail-items > div { padding: 7px 0; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #edf1f1; font-size: 11px; }
.order-print-sheet { display: none; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 10px; color: #8a958d; border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
td { padding: 13px 10px; border-bottom: 1px solid #edf0ed; font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.customer-cell { display: flex; gap: 10px; align-items: center; }
.avatar { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--forest); background: #eef2ed; font-size: 12px; font-weight: 900; }
.customer-cell strong, .customer-cell small { display: block; }
.customer-cell small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.source-tag, .stage-tag { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #f0f3ef; color: #5e6a62; font-size: 11px; font-weight: 750; white-space: nowrap; }
.stage-qualified, .stage-appointment, .stage-proposal, .stage-won { color: var(--forest); background: var(--mint-soft); }
.score-cell { display: flex; gap: 7px; align-items: center; }
.score-ring { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--forest) calc(var(--score) * 1%), #e9ede9 0); position: relative; }
.score-ring::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: white; }
.score-ring span { position: relative; z-index: 1; font-size: 10px; font-weight: 900; }
.loading-cell { padding: 34px; color: var(--muted); text-align: center; }

.funnel-list { margin-top: 20px; display: grid; gap: 12px; }
.funnel-row { display: grid; grid-template-columns: 68px 1fr 26px; gap: 9px; align-items: center; font-size: 12px; }
.funnel-row strong { font-size: 12px; text-align: right; }
.bar-track { height: 7px; overflow: hidden; border-radius: 999px; background: #edf1ed; }
.bar-fill { height: 100%; min-width: 4px; border-radius: inherit; background: var(--forest-2); }

.action-list, .message-list { margin-top: 16px; display: grid; gap: 9px; }
.default-reply-form { margin-top: 16px; padding: 16px; display: grid; gap: 13px; border: 1px solid #cce5e3; border-radius: 15px; background: linear-gradient(135deg, #f8fcfc, #eefaf7); }
.default-reply-settings-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 12px; align-items: end; }
.default-reply-settings-row > label:not(.default-reply-toggle), .default-reply-language-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.default-reply-toggle { min-height: 48px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.default-reply-toggle input { width: 18px; height: 18px; accent-color: #0a9d85; }
.default-reply-toggle strong, .default-reply-toggle small { display: block; }
.default-reply-toggle strong { font-size: 13px; }
.default-reply-toggle small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.default-reply-language-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.default-reply-language-grid textarea { min-height: 86px; resize: vertical; line-height: 1.55; }
.default-reply-sequence-heading, .default-reply-entry header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.default-reply-sequence-heading > div, .default-reply-entry header > div:first-child { display: grid; gap: 3px; }
.default-reply-sequence-heading small, .default-reply-entry header small { color: var(--muted); font-size: 11px; }
.default-reply-entry-list { display: grid; gap: 12px; }
.default-reply-entry { padding: 13px; border: 1px solid #c8e1df; border-radius: 14px; background: rgba(255,255,255,.82); box-shadow: 0 8px 22px rgba(6,64,74,.05); }
.default-reply-entry header { margin-bottom: 11px; }
.default-reply-order { color: #086f80; font-weight: 850; }
.default-reply-entry-actions { display: flex; align-items: center; gap: 6px; }
.default-reply-entry-actions label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 750; }
.default-reply-entry-actions input { accent-color: #0a9d85; }
.default-reply-entry-actions .icon-button { width: 31px; height: 31px; min-width: 31px; padding: 0; border-radius: 9px; }
.default-reply-entry-actions .danger { color: #a33e34; }

@media (max-width: 1100px) {
  .campaign-policy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .campaign-safety-banner { grid-template-columns: 1fr; gap: 3px; }
}

@media (max-width: 700px) {
  .content[data-workspace="campaigns"] #campaigns { padding: 12px; }
  .campaign-control-heading, .campaign-actions-heading, .campaign-toolbar { align-items: stretch; flex-direction: column; }
  .campaign-heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .campaign-control-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .campaign-policy-grid, .campaign-toolbar-filters { grid-template-columns: 1fr; }
  .campaign-actions-heading select { width: 100%; }
  .campaign-action-item { grid-template-columns: 28px minmax(0, 1fr); }
  .campaign-decision-buttons { grid-column: 2; }
}
.default-reply-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.default-reply-footer small { color: #167669; font-weight: 750; }
.default-reply-safety { margin: 0; padding-top: 10px; border-top: 1px solid #d9ebe8; color: var(--muted); font-size: 11px; line-height: 1.5; }
.content[data-workspace="overview"] .default-reply-form { display: none; }
.action-item, .message-item { padding: 11px 12px; border: 1px solid #e7ece8; border-radius: 12px; background: #fafbf9; }
.action-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.action-symbol { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--forest); background: var(--mint-soft); font-size: 13px; font-weight: 900; }
.action-item strong, .message-item strong { display: block; font-size: 12px; }
.action-item p, .message-item p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.content[data-workspace="campaigns"] #campaigns { padding: 18px; }
.campaign-control-heading { align-items: flex-start; }
.campaign-control-heading .muted { margin: 5px 0 0; font-size: 12px; }
.campaign-heading-actions { display: flex; gap: 8px; }
.campaign-safety-banner { margin-top: 14px; padding: 11px 13px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border-radius: 13px; font-size: 11px; }
.campaign-safety-banner.safe-lock { color: #075f61; border: 1px solid #a5ded3; background: linear-gradient(110deg, #e9fbf7, #f4fcfb); }
.campaign-safety-banner.live-write { color: #7d4211; border: 1px solid #f1c27a; background: #fff7e8; }
.campaign-safety-banner strong { font-size: 12px; }
.campaign-safety-banner small { opacity: .75; }
.campaign-control-summary { margin-top: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.campaign-control-summary article { padding: 12px 13px; border: 1px solid #d8e7e7; border-radius: 13px; background: linear-gradient(150deg, #fff, #f6fbfb); }
.campaign-control-summary span, .campaign-control-summary strong { display: block; }
.campaign-control-summary span { color: var(--muted); font-size: 10px; font-weight: 800; }
.campaign-control-summary strong { margin-top: 6px; color: #063e4c; font-size: 22px; letter-spacing: -.03em; }
.campaign-policy-form { margin-top: 12px; padding: 13px; border: 1px solid #d8e7e7; border-radius: 14px; background: #fbfdfd; }
.campaign-policy-title, .campaign-actions-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.campaign-policy-title > div, .campaign-actions-heading > div { display: grid; gap: 3px; }
.campaign-policy-title small, .campaign-actions-heading small { color: var(--muted); font-size: 10px; }
.campaign-policy-grid { margin-top: 10px; display: grid; grid-template-columns: 1.15fr repeat(4, minmax(105px, 1fr)) auto; gap: 8px; align-items: end; }
.campaign-policy-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 800; }
.campaign-policy-grid input, .campaign-policy-grid select { min-width: 0; }
.campaign-toolbar { margin-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.campaign-toolbar-filters { display: grid; grid-template-columns: 125px 125px minmax(220px, 1fr); gap: 7px; flex: 1; }
.campaign-toolbar > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.campaign-table-wrap { margin-top: 8px; max-height: 420px; }
.campaign-table-wrap td:first-child strong, .campaign-table-wrap td:first-child small { display: block; }
.campaign-table-wrap td:first-child small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.campaign-row-controls { display: grid; grid-template-columns: repeat(2, minmax(45px, 1fr)); gap: 4px; min-width: 118px; }
.campaign-row-controls button { padding: 5px 6px; border: 1px solid #cfe2e2; border-radius: 7px; color: #0a6471; background: #f1f9f8; font-size: 9px; font-weight: 800; }
.campaign-actions-heading { margin-top: 16px; padding-top: 13px; border-top: 1px solid #dbe8e7; }
.campaign-actions-heading select { width: 170px; }
.campaign-action-item { grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; }
.campaign-action-copy > div { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.campaign-action-copy small { color: #72817d; font-size: 9px; }
.campaign-action-status { padding: 3px 6px; border-radius: 99px; color: #54625f; background: #e9efed; font-size: 9px; font-weight: 800; }
.campaign-action-status.status-pending { color: #8a5700; background: #fff0cf; }
.campaign-action-status.status-applied { color: #08765c; background: #dcf6ec; }
.campaign-action-status.status-apply_failed { color: #9d3027; background: #fde6e3; }
.campaign-decision-buttons { display: flex; gap: 5px; }
.campaign-decision-buttons .approve { color: white; background: #087c72; }
.message-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.message-head span { color: #929c95; font-size: 10px; }
.direction { color: var(--forest-2); }
.direction.outbound { color: var(--blue); }
.channel-badge { display: inline-flex; align-items: center; width: max-content; padding: 2px 6px; border-radius: 999px; color: #fff !important; background: #667085; font-size: 9px !important; font-weight: 850; letter-spacing: .02em; vertical-align: middle; }
.channel-whatsapp { background: #128c5e; }
.channel-instagram { background: linear-gradient(120deg, #833ab4, #e1306c, #f77737); }
.channel-facebook { background: #1877f2; }
.channel-threads { background: #161616; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.6; }

.content[data-workspace="inbox"] #inbox.inbox-panel { height: 100%; min-height: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; border-color: #c9dfe2; background: #fff; box-shadow: 0 18px 44px rgba(4,77,97,.08); }
.inbox-panel > .section-heading { min-height: 82px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, #fff 0 72%, #edf9f7 100%); }
.inbox-panel > .section-heading h2 { font-size: 20px; }
.inbox-filters, .chat-controls, .reply-actions { display: flex; align-items: center; gap: 8px; }
.inbox-filters { padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.86); }
.inbox-filters select { min-height: 36px; border: 0; background-color: transparent; font-size: 12px; }
.inbox-filters .small-button { min-height: 36px; padding-inline: 12px; background: #eaf7f5; }
.inbox-filters select, .chat-controls input, .chat-controls select { width: auto; min-width: 105px; padding: 8px 9px; }
.inbox-panel > .section-heading { flex: 0 0 auto; }
.inbox-layout { flex: 1 1 0; height: 0; min-height: 0; margin-top: 0; display: grid; grid-template-columns: 286px minmax(430px, 1fr) 320px; overflow: hidden; border: 0; border-radius: 0; background: #f7fbfb; }
.inbox-layout > * { min-height: 0; }
.conversation-list { height: 100%; min-height: 0; max-height: none; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; border-right: 1px solid var(--line); background: #fbfdfd; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #86b9c1 transparent; -webkit-overflow-scrolling: touch; }
.conversation-list-head, .customer-context-head { position: sticky; top: 0; z-index: 2; min-height: 62px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.conversation-list-head strong, .conversation-list-head small, .customer-context-head strong, .customer-context-head small { display: block; }
.conversation-list-head strong, .customer-context-head strong { font-size: 13px; }
.conversation-list-head small, .customer-context-head small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.conversation-list-head > span, .customer-context-head > span { min-width: 28px; height: 28px; padding: 0 8px; display: grid; place-items: center; border-radius: 9px; color: #08755f; background: var(--mint-soft); font-size: 11px; font-weight: 900; }
.conversation-item { position: relative; width: 100%; padding: 14px 13px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; border: 0; border-bottom: 1px solid #e8f0f0; color: inherit; background: transparent; text-align: left; cursor: pointer; transition: background .16s ease, box-shadow .16s ease; }
.conversation-item::before { content: ""; position: absolute; inset: 7px auto 7px 0; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.conversation-item:hover { background: #f1f9f8; }
.conversation-item.active { background: linear-gradient(100deg, #e3f7f2, #effafa); box-shadow: inset -1px 0 #b9e0d8; }
.conversation-item.active::before { background: #14a98f; }
.conversation-avatar { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #dceaea; border-radius: 12px; color: #08627a; background: linear-gradient(145deg, #f1f8f8, #e3f0f0); font-size: 12px; font-weight: 900; }
.conversation-copy { min-width: 0; display: grid; gap: 3px; }
.conversation-copy strong, .conversation-copy small, .conversation-copy em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { display: flex; align-items: center; gap: 5px; font-size: 12px; }.conversation-copy small { color: #607a82; font-size: 11px; }.conversation-copy em { color: #86999e; font-size: 10px; font-style: normal; }
.unread-badge { min-width: 21px; height: 21px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; color: white; background: linear-gradient(135deg, #087b9e, #20b879); box-shadow: 0 4px 10px rgba(7,123,158,.2); font-size: 10px; }
.inbox-empty { padding: 20px; }
.chat-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #f3f8f8; }
.chat-empty { min-height: 520px; display: grid; place-items: center; padding: 30px; color: var(--muted); font-size: 13px; text-align: center; }
.chat-active { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-header { min-height: 76px; padding: 13px 16px; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(360px, auto); align-items: center; gap: 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.chat-header strong, .chat-header small { display: block; }.chat-header strong { font-size: 15px; }.chat-header small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.chat-identity { min-width: 0; display: flex; align-items: center; gap: 9px; }
.chat-identity > span { min-width: 0; }
.chat-back-button { display: none; width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 12px; color: #07566d; background: #eef8f7; font-size: 28px; line-height: 1; cursor: pointer; }
.chat-controls { display: grid; grid-template-columns: minmax(90px,1fr) minmax(150px,1.2fr) 105px auto; }
.chat-controls input, .chat-controls select { min-width: 0; height: 36px; padding: 7px 8px; font-size: 11px; }
.chat-messages { flex: 1 1 0; height: 0; min-height: 0; padding: 24px clamp(18px, 3vw, 34px); display: flex; flex-direction: column; gap: 13px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; background: radial-gradient(circle at 16px 16px, rgba(8,123,158,.035) 1px, transparent 1.5px) 0 0 / 32px 32px, linear-gradient(180deg,#f7fbfb,#f1f7f6); scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #86b9c1 transparent; -webkit-overflow-scrolling: touch; }
.chat-image-frame { width: min(310px, 68vw); min-height: 120px; margin: 0 0 7px; padding: 0; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(16,57,35,.12); border-radius: 13px; color: var(--muted); background: rgba(255,255,255,.7); cursor: zoom-in; }
.chat-image-frame img { width: 100%; max-height: 360px; display: block; object-fit: contain; background: #edf2ed; }
.chat-image-frame.media-error { min-height: 82px; padding: 14px; cursor: default; }
.chat-image-loading, .chat-image-frame.media-error span { font-size: 11px; font-weight: 750; }
.image-viewer { width: min(1100px, calc(100vw - 28px)); max-width: none; max-height: calc(100vh - 28px); padding: 44px 14px 14px; overflow: auto; border-radius: 16px; background: #111a14; }
.image-viewer::backdrop { background: rgba(4,12,7,.82); backdrop-filter: blur(6px); }
.image-viewer img { width: auto; max-width: 100%; max-height: calc(100vh - 110px); margin: auto; display: block; object-fit: contain; }
.image-viewer p { margin: 10px 10px 0; color: white; font-size: 13px; line-height: 1.5; text-align: center; }
.image-viewer-close { position: absolute; top: 8px; right: 10px; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: white; background: rgba(255,255,255,.1); font-size: 24px; cursor: pointer; }
.chat-bubble { max-width: 72%; padding: 11px 13px; border: 1px solid #e1ecec; border-radius: 16px 16px 16px 5px; background: white; box-shadow: 0 5px 16px rgba(4,77,97,.055); }
.chat-bubble.outbound { align-self: flex-end; border-color: #c4e9db; border-radius: 16px 16px 5px; background: linear-gradient(145deg, #e5f8ef, #d9f2e8); }
.chat-bubble p { margin: 0; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.chat-bubble footer { margin-top: 7px; padding-top: 6px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(96,122,130,.1); color: #7d9298; font-size: 9px; }
.reply-composer { flex: 0 0 auto; margin-top: auto; padding: 13px 16px 14px; border-top: 1px solid var(--line); background: rgba(255,255,255,.98); box-shadow: 0 -8px 25px rgba(4,77,97,.035); }
.reply-composer textarea { min-height: 78px; padding: 12px 13px; border-radius: 13px; background: #fbfdfd; line-height: 1.55; }
.reply-actions { margin-top: 9px; justify-content: space-between; }.reply-actions span { font-size: 10px; }.window-active { color: #08755f; }.window-closed { color: var(--red); }
.customer-context { height: 100%; min-height: 0; max-height: none; padding: 0 13px 16px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; border-left: 1px solid var(--line); background: #f8fbfb; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #86b9c1 transparent; -webkit-overflow-scrolling: touch; }
.conversation-list::-webkit-scrollbar, .chat-messages::-webkit-scrollbar, .customer-context::-webkit-scrollbar { width: 8px; }
.conversation-list::-webkit-scrollbar-thumb, .chat-messages::-webkit-scrollbar-thumb, .customer-context::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: #86b9c1; background-clip: padding-box; }
.customer-context-head { margin: 0 -13px 13px; }
.context-card { padding: 14px; margin-bottom: 11px; border: 1px solid #d7e7e8; border-radius: 14px; background: #fff; box-shadow: 0 6px 18px rgba(4,77,97,.04); }.context-card h3 { margin: 5px 0 12px; font-size: 15px; }.context-card p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.context-card-action-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.context-card-action-head h3 { margin-bottom: 10px; }
.context-create-order { flex: 0 0 auto; color: #fff; background: linear-gradient(135deg, #087b9e, #18a98f); box-shadow: 0 7px 16px rgba(8,123,158,.15); }
.context-create-order:hover { background: linear-gradient(135deg, #076d8b, #13977f); }
.context-card dl { margin: 0; }.context-card dl div { padding: 6px 0; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid #edf0ed; font-size: 11px; }.context-card dt { color: var(--muted); }.context-card dd { margin: 0; font-weight: 800; }
.patient-profile-card { border-color: #cfded4; background: #fbfdfb; }
.patient-profile-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.patient-profile-card-head h3 { margin-bottom: 8px; }.patient-profile-card-head .small-button { flex: 0 0 auto; }
.patient-summary { margin-top: 10px; padding-top: 9px; border-top: 1px solid #e6eee8; }.patient-summary strong { color: var(--forest); font-size: 11px; }.patient-summary p { max-height: 84px; margin: 5px 0 0; overflow: auto; white-space: pre-wrap; }
.patient-record-count { margin-top: 10px; padding: 8px 9px; border-radius: 9px; color: #52635a; background: #edf4ef; font-size: 10px; line-height: 1.5; }
.patient-profile-dialog { width: min(780px, calc(100vw - 28px)); max-width: none; max-height: calc(100vh - 28px); overflow-y: auto; }
.patient-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.patient-privacy-note { margin: 0; padding: 10px 12px; border: 1px solid #eed3a8; border-radius: 11px; color: #765018; background: #fff8e9; font-size: 11px; line-height: 1.55; }
.context-order { padding: 8px 0; display: grid; gap: 3px; border-bottom: 1px solid #edf0ed; }.context-order strong { font-size: 11px; }.context-order span { color: var(--muted); font-size: 10px; }

.support-agent-heading, .support-agent-actions { display: flex; align-items: center; gap: 9px; }
.support-agent-summary { margin-top: 17px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.support-agent-summary article { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafbf9; }
.support-agent-summary span, .support-agent-summary strong { display: block; }.support-agent-summary span { color: var(--muted); font-size: 11px; }.support-agent-summary strong { margin-top: 4px; font-size: 16px; }
.operator-identity-note { margin-top: 10px; padding: 11px 13px; display: grid; grid-template-columns: auto 1fr; gap: 9px; border: 1px solid #d7e1f2; border-radius: 12px; color: #4e607b; background: #f3f7fd; font-size: 11px; line-height: 1.55; }
.operator-identity-note strong { color: #355173; }
.support-agent-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.support-agent-card { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; }
.support-agent-inactive { opacity: .68; }
.support-agent-card-head { display: grid; grid-template-columns: 36px 1fr auto; gap: 9px; align-items: center; }
.support-agent-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--forest); background: var(--mint-soft); font-size: 12px; font-weight: 900; }
.support-agent-card h3 { margin: 0; font-size: 13px; }.support-agent-card-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.agent-status { padding: 5px 7px; border-radius: 999px; color: #45633d; background: #edf8e4; font-size: 10px; font-weight: 850; }.agent-status.inactive { color: #7d625e; background: #f3edeb; }
.support-agent-card dl { margin: 12px 0 0; }.support-agent-card dl div { padding: 6px 0; display: flex; justify-content: space-between; gap: 9px; border-bottom: 1px solid #e9eeea; font-size: 10px; }.support-agent-card dt { color: var(--muted); }.support-agent-card dd { margin: 0; max-width: 65%; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.support-agent-metrics { margin-top: 10px; display: flex; gap: 6px; }.support-agent-metrics span { flex: 1; padding: 7px; border-radius: 9px; color: var(--muted); background: #edf2ed; font-size: 10px; text-align: center; }.support-agent-metrics b { color: var(--forest); }
.support-agent-card footer { margin-top: 10px; display: flex; justify-content: flex-end; gap: 6px; }
.support-agent-dialog { width: min(680px, calc(100vw - 28px)); max-width: none; max-height: calc(100vh - 28px); overflow-y: auto; }
.support-agent-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.reply-library-panel { overflow: hidden; }
.reply-library-heading { padding-bottom: 4px; }
.reply-library-heading-actions { display: flex; align-items: center; gap: 9px; }
.medical-review-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; color: #70491a; background: #fff3dd; font-size: 12px; font-weight: 850; white-space: nowrap; }
.medical-review-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.reply-library-summary { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.reply-library-summary.unified-reply-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reply-library-summary article { padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fafbf9; }
.reply-library-summary span, .reply-library-summary strong { display: block; }
.reply-library-summary span { color: var(--muted); font-size: 11px; }
.reply-library-summary strong { margin-top: 5px; font-size: 16px; }
.reply-library-summary .emergency-stat { border-color: #f1cbc4; background: #fff6f4; }
.reply-library-summary .emergency-stat strong { color: #a64034; }
#reply-library-emergency-label::before { content: attr(data-label); }
.medical-guardrails { margin-top: 10px; padding: 11px 13px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; border-radius: 12px; color: #45604e; background: #eef6eb; font-size: 11px; }
.medical-guardrails strong { margin-right: 3px; color: var(--forest); }
.medical-guardrails span::before { content: "✓"; margin-right: 4px; color: #5d963c; font-weight: 900; }
.reply-management-note { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.reply-library-toolbar { margin-top: 15px; display: grid; grid-template-columns: minmax(220px, 1fr) 170px 150px auto; gap: 9px; align-items: end; }
.reply-library-toolbar label { gap: 5px; }
.reply-library-toolbar .small-button { min-height: 35px; }
.reply-library-grid { margin-top: 15px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.reply-card { min-width: 0; padding: 15px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; }
.reply-card-emergency { border-color: #e9b8af; background: #fff9f7; box-shadow: inset 3px 0 #cf5c4c; }
.reply-card-disabled { opacity: .68; filter: grayscale(.25); }
.reply-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.reply-card-head h3 { margin: 5px 0 0; font-size: 14px; }
.reply-category { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.urgency-badge { flex: 0 0 auto; padding: 5px 7px; border-radius: 999px; color: #566259; background: #edf1ed; font-size: 10px; font-weight: 850; }
.urgency-immediate { color: #963e33; background: #fde4df; }
.urgency-week { color: #765018; background: #fff0d4; }
.reply-text { flex: 1; margin: 12px 0; color: #34423a; font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.keyword-list { display: flex; flex-wrap: wrap; gap: 5px; }
.keyword-list span { padding: 4px 6px; border-radius: 7px; color: #657169; background: #edf1ed; font-size: 10px; }
.reply-card footer { margin-top: 13px; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #e6ebe7; }
.reply-card footer > span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.reply-card-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.copy-reply-button { flex: 0 0 auto; }
.danger-button { color: #9a4035; border-color: #edc8c1; background: #fff8f6; }
.reply-library-sources { margin-top: 14px; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 7px 12px; align-items: center; border-top: 1px solid var(--line); }
.reply-library-sources strong { font-size: 11px; }
.reply-library-sources a { color: var(--forest-2); font-size: 11px; text-decoration: none; }
.reply-library-empty, .reply-library-error { grid-column: 1 / -1; padding: 28px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); font-size: 12px; text-align: center; }
.reply-library-error { color: #963e33; border-color: #e9b8af; background: #fff7f5; }
.default-reply-library-section { margin-top: 15px; padding: 14px; border: 1px solid #bfe0dc; border-radius: 15px; background: linear-gradient(145deg, #f2fbf9, #fbfdfd); }
.default-reply-library-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.default-reply-library-heading h3, .default-reply-library-heading p { margin: 0; }
.default-reply-library-heading small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.default-reply-library-section .default-reply-form { margin-top: 12px; padding: 0; border: 0; background: transparent; }

.reply-editor-dialog { width: min(760px, calc(100vw - 28px)); max-width: none; max-height: calc(100vh - 28px); overflow-y: auto; }
.reply-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reply-language-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 11px; background: #eef2ed; }
.reply-language-tab { flex: 1; padding: 8px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.reply-language-tab.active { color: white; background: var(--forest); }
.enabled-toggle { display: flex; grid-template-columns: none; align-items: center; gap: 8px; }
.enabled-toggle input { width: 16px; height: 16px; accent-color: var(--forest); }
.reply-editor-warning { padding: 10px 12px; border: 1px solid #eed3a8; border-radius: 11px; color: #765018; background: #fff8e9; font-size: 11px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.simulator-panel form { margin-top: 16px; display: grid; gap: 11px; }
label { display: grid; gap: 6px; color: #4f5d54; font-size: 12px; font-weight: 750; }
input, textarea, select { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: white; font-size: 13px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #25b79a; box-shadow: 0 0 0 3px rgba(37,183,154,.13); }
.form-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.simulation-result { margin-top: 13px; padding: 12px; border: 1px solid #cfe7ad; border-radius: 12px; background: #f3fae8; font-size: 12px; line-height: 1.55; }
.simulation-result strong { display: block; margin-bottom: 4px; }
.hidden { display: none !important; }

.integration-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.integration-card { padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.integration-card-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.integration-card strong { font-size: 12px; }
.integration-card p { min-height: 30px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.integration-backfill { width: 100%; margin-top: 10px; }
.integration-backfill:disabled { cursor: not-allowed; opacity: .48; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(230,162,57,.12); }
.status-ready { background: #69a943; box-shadow: 0 0 0 4px rgba(105,169,67,.12); }
.status-rules_fallback { background: var(--blue); box-shadow: 0 0 0 4px rgba(93,126,196,.12); }
.status-needs_configuration { background: var(--red); box-shadow: 0 0 0 4px rgba(202,91,76,.12); }
.status-needs_permissions { background: #df8b2d; box-shadow: 0 0 0 4px rgba(223,139,45,.14); }
.status-not_supported { background: #7b8494; box-shadow: 0 0 0 4px rgba(123,132,148,.14); }

dialog { width: min(430px, calc(100vw - 30px)); padding: 22px; border: 0; border-radius: 18px; box-shadow: 0 28px 90px rgba(15,35,24,.3); }
dialog::backdrop { background: rgba(13,31,21,.44); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-heading h2 { margin: 4px 0 0; font-size: 21px; }
dialog form { display: grid; gap: 15px; }
.full-button { width: 100%; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 360px; padding: 12px 15px; border-radius: 12px; color: white; background: var(--forest); box-shadow: 0 14px 40px rgba(21,63,45,.25); font-size: 13px; }
.toast.error { background: #923f34; }
.token-error { margin: 0; padding: 10px 12px; border-radius: 10px; color: #7b241c; background: #fff0ed; font-size: 14px; line-height: 1.5; }
.login-dialog { width: min(470px, calc(100vw - 28px)); }
.lead-export-dialog { width: min(680px, calc(100vw - 28px)); max-width: none; max-height: calc(100vh - 28px); overflow-y: auto; }
.lead-export-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lead-export-fields { margin: 0; padding: 13px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; border: 1px solid var(--line); border-radius: 13px; }
.lead-export-fields legend { padding: 0 6px; color: var(--ink); font-size: 12px; font-weight: 850; }
.lead-export-fields label { min-width: 0; display: flex; grid-template-columns: none; align-items: center; gap: 7px; }
.lead-export-fields input { width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--forest); }
.lead-export-fields span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-export-private { padding: 10px 12px; border: 1px solid #eed3a8; border-radius: 11px; color: #765018; background: #fff8e9; line-height: 1.45; }
.lead-export-summary { padding: 10px 12px; border-radius: 11px; color: #145b69; background: #edf8f7; font-size: 12px; font-weight: 850; }
.backup-center-heading { align-items: flex-start; }
.backup-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.backup-status-grid { margin-top: 17px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.backup-status-grid article { padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, #fff, #f2faf8); }
.backup-status-grid small, .backup-status-grid strong { display: block; }
.backup-status-grid small { color: var(--muted); font-size: 10px; }
.backup-status-grid strong { margin-top: 6px; font-size: 13px; }
.backup-settings-form { margin-top: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.backup-schedule-card { padding: 15px; display: grid; gap: 11px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfd; }
.backup-schedule-card h3 { margin: 3px 0 0; font-size: 15px; }
.backup-schedule-card > p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.backup-schedule-grid { display: grid; grid-template-columns: 1fr 1fr 1fr .7fr; gap: 8px; }
.backup-settings-actions { grid-column: 1 / -1; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-radius: 12px; background: #edf8f7; }
.backup-settings-actions span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.backup-list-heading { margin-top: 20px; padding-top: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.backup-list-heading h3 { margin: 3px 0 0; font-size: 15px; }
.backup-list-heading > span { color: var(--muted); font-size: 10px; }
.backup-list { margin-top: 10px; display: grid; gap: 8px; }
.backup-item { padding: 11px 12px; display: grid; grid-template-columns: minmax(220px, 1.3fr) minmax(190px, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: white; }
.backup-item-main strong, .backup-item-main small { display: block; }
.backup-item-main strong { font-size: 12px; }
.backup-item-main small, .backup-item-meta { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.backup-type-badge { display: inline-flex; margin-right: 6px; padding: 3px 6px; border-radius: 999px; color: #11677a; background: #e7f7f5; font-size: 9px; font-weight: 900; }
.backup-type-system { color: #765018; background: #fff1d8; }
.backup-item-actions { display: flex; justify-content: flex-end; gap: 6px; }
.backup-empty { padding: 24px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.backup-restore-dialog { width: min(620px, calc(100vw - 28px)); max-width: none; }
.backup-restore-preview { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f7fbfb; font-size: 11px; line-height: 1.65; }
.backup-restore-preview strong { display: block; margin-bottom: 4px; font-size: 13px; }
.danger-primary { background: linear-gradient(115deg, #8f3d34, #c45b4d); }
.login-brand { padding-bottom: 14px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.login-brand img { width: 62px; height: 62px; object-fit: contain; border: 1px solid var(--line); border-radius: 16px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 20px; letter-spacing: .04em; }
.login-brand small { margin-top: 4px; color: var(--gold-deep); font-size: 11px; letter-spacing: .14em; }
.user-admin-layout { margin-top: 18px; display: grid; grid-template-columns: minmax(250px,.7fr) minmax(0,1.3fr); gap: 18px; }
.user-settings-column { display: grid; align-content: start; gap: 14px; }
.user-create-form { padding: 17px; display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 15px; background: #f8fcfc; }
.user-create-form h3 { margin: 0; font-size: 16px; }
.security-settings-form { border-color: #b9dfdc; background: linear-gradient(145deg,#fbffff,#eef9f7); }
.password-policy-note { margin: -2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.password-change-status { margin: 0; padding: 10px 11px; border-radius: 10px; font-size: 12px; font-weight: 750; line-height: 1.5; }
.password-change-status.success { color: #245c35; background: #eaf7e8; }
.password-change-status.error { color: #7b241c; background: #fff0ed; }
.user-list { display: grid; align-content: start; gap: 9px; }
.user-row { padding: 13px 15px; display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: white; }
.user-row strong, .user-row small { display: block; }
.user-row small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.user-role { align-self: start; padding: 5px 8px; border-radius: 999px; color: var(--forest); background: var(--mint-soft); font-size: 11px; font-weight: 850; }
.user-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.password-reset-button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--forest); background: white; font-size: 10px; font-weight: 850; cursor: pointer; }
.customer-portal-content { margin-top: 20px; display: grid; gap: 15px; }
.customer-portal-heading-actions { display: flex; align-items: center; gap: 9px; }
.customer-profile-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.customer-profile-grid article { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fbfaf6; }
.customer-profile-grid small, .customer-profile-grid strong { display: block; }
.customer-profile-grid small { color: var(--muted); font-size: 11px; }
.customer-profile-grid strong { margin-top: 6px; font-size: 15px; }
.customer-section { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.customer-section h3 { margin: 0 0 12px; font-size: 16px; }
.customer-record { padding: 10px 0; border-top: 1px solid #eee8dc; font-size: 12px; line-height: 1.55; }
.customer-record:first-of-type { border-top: 0; }
.customer-record > strong:first-child, .customer-record > span:last-child { display: block; }
.customer-record > strong:first-child { margin-bottom: 3px; }
.customer-record > span:last-child { color: var(--muted); }
.customer-order-workbench { padding: 0; overflow: hidden; }
.customer-order-title { padding: 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: linear-gradient(125deg,#f7fcfc,#effaf7); }
.customer-order-title small { display: block; margin-bottom: 3px; color: var(--gold-deep); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.customer-order-title h3 { margin: 0; }
.customer-order-title > strong { padding: 6px 10px; border-radius: 999px; color: var(--forest); background: var(--mint-soft); font-size: 11px; }
.customer-order-toolbar { padding: 13px 17px; display: grid; grid-template-columns: minmax(220px,1.4fr) minmax(135px,.55fr) minmax(135px,.55fr) auto; gap: 9px; align-items: end; border-bottom: 1px solid var(--line); background: #fbfdfc; }
.customer-order-toolbar label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 850; }
.customer-order-toolbar input, .customer-order-toolbar select { min-width: 0; }
.customer-order-list { padding: 14px 17px 17px; display: grid; gap: 10px; background: #f8fbfa; }
.customer-order-card { padding: 14px 15px; border: 1px solid #d6e7e4; border-radius: 14px; background: white; box-shadow: 0 8px 24px rgba(7,86,109,.05); }
.customer-order-card-main, .customer-order-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.customer-order-card-main small, .customer-order-card-main strong, .customer-order-card-footer small, .customer-order-card-footer strong { display: block; }
.customer-order-card-main small, .customer-order-card-footer small { color: var(--muted); font-size: 10px; }
.customer-order-card-main strong { margin-top: 3px; font-size: 13px; }
.customer-order-card p { margin: 11px 0; padding: 9px 11px; border-radius: 9px; color: #50686c; background: #f4f8f7; font-size: 11px; line-height: 1.5; }
.customer-order-card-footer > div:first-child > strong { margin-bottom: 3px; color: var(--forest); font-size: 17px; }
.customer-order-actions { display: flex; gap: 7px; }
.customer-order-empty { padding: 28px 15px; border: 1px dashed #bfd7d3; border-radius: 13px; color: var(--muted); background: white; text-align: center; font-size: 12px; }
.customer-order-dialog { width: min(640px,calc(100vw - 30px)); }
.customer-order-dialog form { display: grid; gap: 13px; }
.customer-order-total-preview { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #b9ded8; border-radius: 12px; color: var(--forest); background: #effaf7; }
.customer-order-total-preview span { font-size: 11px; font-weight: 800; }
.customer-order-total-preview strong { font-size: 20px; }
.alert-toggle { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--forest); background: white; font-size: 11px; font-weight: 850; cursor: pointer; }
.alert-toggle.enabled { border-color: #9fcf80; background: #eff9df; }
.incoming-alert { position: fixed; top: 22px; right: 22px; z-index: 30; width: min(430px, calc(100vw - 28px)); padding: 15px; display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: center; border: 1px solid #b9daa2; border-radius: 16px; color: var(--ink); background: white; box-shadow: 0 20px 70px rgba(15,45,27,.25); animation: incoming-pop .25s ease-out; }
.incoming-alert-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--forest); background: var(--mint-soft); font-size: 19px; }
.incoming-alert-copy { min-width: 0; }.incoming-alert-copy small, .incoming-alert-copy strong { display: block; }.incoming-alert-copy small { color: var(--forest-2); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }.incoming-alert-copy strong { margin-top: 3px; font-size: 13px; }.incoming-alert-copy p { max-width: 260px; margin: 4px 0 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.incoming-alert-open { padding: 9px 10px; border: 0; border-radius: 10px; color: white; background: var(--forest); font-size: 11px; font-weight: 850; cursor: pointer; }.incoming-alert-close { position: absolute; top: 4px; right: 7px; border: 0; color: var(--muted); background: transparent; font-size: 18px; cursor: pointer; }
@keyframes incoming-pop { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 1420px) {
  .topbar { grid-template-columns: 1fr; gap: 10px; }
  .top-actions { align-items: center; flex-direction: row; gap: 6px; }
  .top-action-group { min-height: 42px; justify-content: flex-end; }
  .top-action-group > * { min-height: 32px; }
  .alert-toggle { max-width: 220px; }
  .chat-header { grid-template-columns: 1fr; align-items: start; }
  .chat-controls { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1120px) {
  .order-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-workbench-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }.order-search-field { grid-column: 1 / -1; }.order-filter-clear { width: 100%; }
  .topbar { grid-template-columns: 1fr; }
  .content[data-workspace="overview"] { grid-template-columns: 1fr; }
  .content[data-workspace="overview"] > .hero-grid,
  .content[data-workspace="overview"] #leads,
  .content[data-workspace="overview"] section[aria-labelledby="funnel-title"],
  .content[data-workspace="overview"] > .flow-card,
  .content[data-workspace="overview"] #operations,
  .content[data-workspace="overview"] #messages { grid-column: 1; }
  .content[data-workspace="overview"] > .hero-grid { grid-row: 1; }
  .content[data-workspace="overview"] #leads { grid-row: 2; }
  .content[data-workspace="overview"] section[aria-labelledby="funnel-title"] { grid-row: 3; }
  .content[data-workspace="overview"] > .flow-card { grid-row: 4; }
  .content[data-workspace="overview"] #operations { grid-row: 5; }
  .content[data-workspace="overview"] #messages { grid-row: 6; }
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
  .flow-track { grid-template-columns: 1fr; gap: 8px; }
  .flow-arrow { transform: rotate(90deg); justify-self: center; }
  .integration-grid { grid-template-columns: repeat(3, 1fr); }
  .operations-grid { grid-template-columns: 1fr; }
  .lead-workbench-toolbar { grid-template-columns: minmax(230px, 1.5fr) repeat(2, minmax(140px, 1fr)); }
  .lead-workbench-toolbar .lead-search-field { grid-column: span 2; }
  .content[data-workspace="inbox"] { height: auto; min-height: 0; overflow: visible; }
  .content[data-workspace="inbox"] .main-grid { height: auto; }
  .content[data-workspace="inbox"] #inbox.inbox-panel { height: auto; }
  .inbox-layout { flex: 0 0 auto; height: auto; grid-template-columns: 240px 1fr; overflow: visible; }.conversation-list { height: 760px; max-height: 760px; }.chat-pane, .chat-active { height: 760px; }.customer-context { grid-column: 1 / -1; height: auto; max-height: 520px; border-top: 1px solid var(--line); border-left: 0; }
  .chat-header { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .order-workbench-heading { align-items: flex-start; flex-direction: column; }.order-heading-actions { width: 100%; justify-content: flex-start; }
  [id] { scroll-margin-top: 18px; }
  .app-shell { grid-template-columns: 1fr; }
  body.sidebar-collapsed .app-shell { grid-template-columns: 1fr; }
  .sidebar,
  body.sidebar-collapsed .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 320px); height: 100dvh; padding: 22px 18px; transform: translateX(-105%); overflow-y: auto; }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-head { align-items: flex-start; }
  .brand,
  body.sidebar-collapsed .brand { justify-content: flex-start; margin: 0 0 24px; }
  body.sidebar-collapsed .brand-copy { display: block; }
  .brand-mark,
  body.sidebar-collapsed .brand-mark { width: 58px; height: 58px; }
  .sidebar-close { display: block; }
  .sidebar-collapse { display: none; }
  .sidebar nav { display: grid; overflow: visible; }
  .nav-link,
  body.sidebar-collapsed .nav-link { justify-content: flex-start; padding: 12px 13px; }
  body.sidebar-collapsed .nav-link .nav-label { display: inline; }
  body.sidebar-collapsed .sidebar-utility-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 6px; border-color: rgba(255,255,255,.18); background: rgba(0,48,64,.2); }
  body.sidebar-collapsed .sidebar-utility-panel .language-switcher { display: block !important; grid-column: 1; grid-row: 1; }
  body.sidebar-collapsed .sidebar-utility-panel #logout-button:not(.hidden) { display: block !important; grid-column: 2; grid-row: 1; }
  body.sidebar-collapsed .sidebar-utility-panel .alert-toggle { display: block !important; grid-column: 1 / -1; grid-row: 2; }
  body.sidebar-collapsed .sidebar-utility-panel .mode-pill { display: inline-flex !important; grid-column: 1; grid-row: 3; }
  body.sidebar-collapsed .sidebar-utility-panel .primary-button { display: block !important; grid-column: 2; grid-row: 3; }
  body.sidebar-collapsed .sidebar-utility-panel .install-app-button:not(.hidden) { display: block !important; grid-column: 1 / -1; grid-row: 4; }
  .sidebar-utility-panel { margin: 0 0 18px; }
  .sidebar-note { display: flex; margin-top: 28px; }
  .sidebar-utility-panel + nav + .sidebar-note { margin-top: 8px; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; display: block; border: 0; opacity: 0; pointer-events: none; background: rgba(10,9,6,.56); backdrop-filter: blur(2px); transition: opacity .2s ease; }
  body.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .menu-button { display: block; }
  .topbar { position: sticky; display: flex; flex-wrap: wrap; padding-block: 16px; justify-content: flex-start; }
  .top-actions { flex: 1 1 calc(100% - 58px); margin-left: 0; flex-direction: row; }
  .top-action-group { flex: 1 1 auto; justify-content: flex-start; }
  .operation-actions { justify-content: flex-end; }
  .main-grid { grid-template-columns: 1fr; }
  .full-panel { grid-column: auto; }
  .queue-stats { grid-template-columns: repeat(5, minmax(85px, 1fr)); overflow-x: auto; }
  .inbox-panel > .section-heading { align-items: flex-start; flex-direction: column; }
  .inbox-filters { width: 100%; }
  .inbox-filters select { flex: 1 1 auto; min-width: 0; }
  .inbox-layout { min-height: 0; grid-template-columns: 1fr; }.conversation-list { height: 320px; max-height: 320px; border-right: 0; }.chat-pane, .chat-active { height: 680px; min-height: 0; }.chat-controls { width: 100%; grid-template-columns: 1fr 1fr; }.customer-context { grid-column: auto; max-height: 520px; }
  .reply-library-toolbar { grid-template-columns: 1fr 1fr; }
  .default-reply-settings-row { grid-template-columns: 1fr; }
  .lead-workbench-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-workbench-toolbar .lead-search-field { grid-column: 1 / -1; }
  .lead-workbench-toolbar .lead-filter-clear { grid-column: 1 / -1; }
  .support-agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-admin-layout { grid-template-columns: 1fr; }
  .backup-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backup-settings-form { grid-template-columns: 1fr; }
  .backup-settings-actions { grid-column: auto; }
  .backup-item { grid-template-columns: 1fr auto; }
  .backup-item-meta { grid-column: 1; }
}

@media (max-width: 600px) {
  .order-workbench-heading { align-items: stretch; }.order-heading-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }.order-heading-actions .primary-button { grid-column: 1 / -1; }
  .order-metric-grid { padding: 11px; grid-template-columns: repeat(2, minmax(0, 1fr)); }.order-metric-grid article { padding: 11px; }.order-revenue-card { grid-column: 1 / -1; }
  .order-workbench-toolbar { margin: 11px 11px 0; grid-template-columns: 1fr; }.order-search-field { grid-column: auto; }.order-workbench-summary { margin-inline: 11px; display: grid; }.order-table-wrap { padding-inline: 11px; }
  .order-editor-grid, .order-detail-list { grid-template-columns: 1fr; }
  .customer-portal-heading { align-items: stretch; }
  .customer-portal-heading-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .customer-order-toolbar { grid-template-columns: 1fr; }
  .customer-order-card-footer { align-items: stretch; flex-direction: column; }
  .customer-order-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .topbar { align-items: center; flex-direction: row; flex-wrap: wrap; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)); gap: 12px; }
  .topbar-title { flex: 1 1 calc(100% - 58px); }
  .topbar h1 { font-size: 20px; }
  .topbar .eyebrow { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions { width: 100%; margin-left: 0; display: grid; grid-template-columns: 1fr; gap: 7px; }
  .top-action-group { width: 100%; min-width: 0; justify-content: flex-start; }
  .account-actions .language-switcher { flex: 1 1 90px; min-width: 0; }
  .account-actions #token-button { flex: 1 1 auto; min-width: 0; }
  .operation-actions #alert-toggle { flex: 1 1 auto; max-width: none; min-width: 0; }
  .top-actions .mode-pill { display: none; }
  .top-actions #refresh-button { margin-left: auto; white-space: nowrap; }
  .content { padding: 8px 8px 20px; }
  .content[data-workspace="inbox"] { height: calc(100dvh - 58px); min-height: 540px; padding: 6px max(6px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); overflow: hidden; }
  .content[data-workspace="inbox"] .main-grid, .content[data-workspace="inbox"] #inbox.inbox-panel { height: 100%; min-height: 0; }
  .content[data-workspace="inbox"] .inbox-layout { height: 100%; min-height: 0; overflow: hidden; }
  .inbox-panel > .section-heading { min-height: 0; padding: 16px; }
  .inbox-panel > .section-heading h2 { font-size: 18px; }
  .inbox-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .inbox-filters .small-button { grid-column: 1 / -1; }
  .conversation-list { height: 100%; max-height: none; }
  .chat-pane, .chat-active { height: 100%; min-height: 0; }
  .chat-back-button { display: grid; place-items: center; }
  body.mobile-conversation-open .conversation-list { display: none; }
  body:not(.mobile-conversation-open) .chat-pane,
  body:not(.mobile-conversation-open) .customer-context { display: none; }
  body.mobile-conversation-open .customer-context { display: none; }
  .chat-header { padding: 14px; }
  .chat-controls { grid-template-columns: 1fr; }
  .chat-messages { min-height: 0; padding: 18px 14px; }
  .chat-bubble { max-width: 88%; }
  .reply-composer { padding-inline: 12px; }
  .hero-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 130px; }
  .flow-card, .panel { padding: 17px; border-radius: 16px; }
  .lead-workbench-toolbar { padding: 8px; grid-template-columns: 1fr; }
  .lead-workbench-toolbar .lead-search-field,
  .lead-workbench-toolbar .lead-filter-clear { grid-column: auto; }
  .lead-workbench-summary { align-items: flex-start; flex-direction: column; gap: 3px; }
  .lead-heading-actions { width: 100%; }
  .lead-heading-actions > * { flex: 1; }
  .lead-export-options, .lead-export-fields { grid-template-columns: 1fr; }
  .backup-center-heading, .backup-list-heading { align-items: flex-start; flex-direction: column; }
  .backup-heading-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .backup-heading-actions #backup-reload { grid-column: 1 / -1; }
  .backup-status-grid, .backup-schedule-grid { grid-template-columns: 1fr; }
  .backup-settings-actions { align-items: flex-start; flex-direction: column; }
  .backup-settings-actions .primary-button { width: 100%; }
  .backup-item { grid-template-columns: 1fr; }
  .backup-item-meta, .backup-item-actions { grid-column: auto; }
  .backup-item-actions > * { flex: 1; }
  .integration-grid { grid-template-columns: 1fr; }
  .reply-library-summary, .reply-library-summary.unified-reply-summary, .reply-library-grid, .reply-library-toolbar { grid-template-columns: 1fr; }
  .default-reply-language-grid { grid-template-columns: 1fr; }
  .default-reply-footer { align-items: stretch; flex-direction: column; }
  .support-agent-summary, .support-agent-grid, .support-agent-form-grid, .patient-profile-grid { grid-template-columns: 1fr; }
  .customer-profile-grid { grid-template-columns: 1fr; }
  .support-agent-heading { align-items: flex-start; flex-direction: column; }
  .reply-library-heading { align-items: flex-start; flex-direction: column; }
  .reply-library-heading-actions { width: 100%; flex-wrap: wrap; }
  .default-reply-library-heading { align-items: stretch; flex-direction: column; }
  .reply-editor-grid { grid-template-columns: 1fr; }
  .reply-card footer { align-items: flex-start; flex-direction: column; }
  .reply-card-actions { width: 100%; justify-content: flex-start; }
  .section-heading { align-items: flex-start; }
  .alert-toggle { flex: 1 1 100%; order: 3; }.incoming-alert { top: 10px; right: 14px; grid-template-columns: 34px 1fr; }.incoming-alert-open { grid-column: 1 / -1; }.incoming-alert-copy p { max-width: 230px; }
  th:nth-child(2), td:nth-child(2), th:nth-child(5), td:nth-child(5) { display: none; }
}

@media (display-mode: standalone) and (max-width: 600px) {
  body { overscroll-behavior-y: none; }
  .content[data-workspace="inbox"] { height: calc(100dvh - 52px); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

@page { size: A4 portrait; margin: 12mm; }
@media print {
  html, body { width: 210mm; min-height: 297mm; margin: 0 !important; padding: 0 !important; color: #102f38 !important; background: #fff !important; }
  body > *:not(.order-print-sheet) { display: none !important; }
  .order-print-sheet { width: 100%; min-height: 270mm; display: flex !important; flex-direction: column; font-family: Inter, Arial, "Helvetica Neue", sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-order-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
  .print-order-brand { display: flex; align-items: center; gap: 12px; }.print-order-brand img { width: 58px; height: 58px; object-fit: contain; border: 1px solid #d5e4e5; border-radius: 13px; }.print-order-brand div { display: grid; gap: 4px; }.print-order-brand strong { color: #075a70; font-size: 22px; letter-spacing: .03em; }.print-order-brand span { color: #658087; font-size: 9px; letter-spacing: .09em; }
  .print-order-title { text-align: right; }.print-order-title h1 { margin: 0; color: #063f50; font-size: 24px; }.print-order-title span { color: #2b9a8d; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
  .print-order-rule { height: 4px; margin: 14px 0 18px; border-radius: 999px; background: linear-gradient(90deg, #067b9e, #20bd94); }
  .print-order-meta { display: grid; grid-template-columns: 1.3fr 1fr .8fr .55fr; gap: 8px; }.print-order-meta div { padding: 10px; display: grid; gap: 5px; border: 1px solid #d8e7e8; border-radius: 9px; background: #f6fbfa; }.print-order-meta small, .print-order-customer small, .print-order-source small { color: #71868b; font-size: 7.5px; font-weight: 800; letter-spacing: .04em; }.print-order-meta strong { font-size: 10px; }
  .print-order-customer { margin-top: 16px; }.print-order-customer h2, .print-order-detail h2 { margin: 0 0 8px; color: #087b91; font-size: 10px; letter-spacing: .08em; }.print-order-customer > div { padding: 11px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; border: 1px solid #d8e7e8; border-radius: 9px; }.print-order-customer span, .print-order-source span { display: grid; gap: 5px; }.print-order-customer strong, .print-order-source strong { font-size: 10px; }
  .print-order-table { margin-top: 18px; border-collapse: separate; border-spacing: 0; border: 1px solid #cddfe1; border-radius: 9px; overflow: hidden; }.print-order-table th { padding: 9px 8px; color: #fff; border: 0; background: #086981; font-size: 7px; letter-spacing: .03em; }.print-order-table td { padding: 10px 8px; border-bottom: 1px solid #e2ebec; font-size: 9px; }.print-order-table tbody tr:last-child td { border-bottom: 0; }.print-order-table th:nth-child(1), .print-order-table td:nth-child(1) { width: 8%; text-align: center; }.print-order-table th:nth-child(3), .print-order-table td:nth-child(3) { width: 10%; text-align: center; }.print-order-table th:nth-child(4), .print-order-table td:nth-child(4), .print-order-table th:nth-child(5), .print-order-table td:nth-child(5) { width: 18%; text-align: right; }
  .print-order-total { display: flex; justify-content: flex-end; }.print-order-total div { width: 43%; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; color: #fff; border-radius: 0 0 9px 9px; background: #063f50; }.print-order-total span { font-size: 8px; font-weight: 800; }.print-order-total strong { font-size: 16px; }
  .print-order-source { margin-top: 16px; padding: 11px 12px; display: grid; grid-template-columns: .7fr 1.3fr; gap: 20px; border-radius: 9px; background: #f2f8f7; }
  .print-order-signatures { margin-top: 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }.print-order-signatures div { height: 45px; display: flex; align-items: flex-end; border-bottom: 1px solid #8ca1a6; }.print-order-signatures span { padding-bottom: 5px; color: #71868b; font-size: 8px; }
  .print-order-footer { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; color: #789096; border-top: 1px solid #dce7e8; font-size: 7.5px; }
}
