:root {
  --bg-main: #061826;
  --bg-sidebar: #07131f;
  --bg-surface: #0d2638;
  --bg-surface-hover: #12344b;
  --bg-card: #0f2a3d;
  --bg-elevated: #132f44;
  --border: #24475c;
  --border-soft: rgba(159, 180, 199, 0.16);
  --primary: #2f8cff;
  --primary-hover: #4da0ff;
  --success: #00c853;
  --warning: #ffc400;
  --danger: #ff4d6d;
  --purple: #8b6cff;
  --teal: #00b8a9;
  --text-main: #eaf4ff;
  --text-secondary: #9fb4c7;
  --text-muted: #6f8494;
  --link: #1e9bff;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  font-family: Inter, system-ui, Arial, sans-serif;
  color: var(--text-main);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 14px;
}

body {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

.app-shell.expanded {
  grid-template-columns: 68px 1fr;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
}

.brand {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-height: 58px;
  padding: 8px 4px 6px;
  border-bottom: 1px solid var(--border-soft);
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(47, 140, 255, 0.55);
  border-radius: 6px;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), transparent 32%), rgba(15, 42, 61, 0.95);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}

.brand-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.brand-copy {
  display: block;
  min-width: 0;
  text-align: center;
}

.expanded .brand-copy {
  display: block;
}

.brand-name {
  display: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-meta {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.05;
}

.nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow: auto;
  padding: 6px 0 10px;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-rows: 30px auto;
  justify-items: center;
  align-items: center;
  gap: 3px;
  width: 100%;
  min-height: 64px;
  padding: 7px 3px 6px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: center;
}

.nav-item::before {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: transparent;
  content: "";
}

.nav-item:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-main);
}

.nav-item.active {
  border-color: transparent;
  background: rgba(47, 140, 255, 0.2);
  color: var(--text-main);
}

.nav-item.active::before {
  background: #0aa7ff;
  box-shadow: 0 0 14px rgba(10, 167, 255, 0.65);
}

.nav-icon,
.search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.nav-icon svg,
.icon-button svg,
.btn svg,
.search-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.45;
}

.nav-icon {
  justify-self: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: #8fa5b8;
}

.nav-item.active .nav-icon {
  color: #f5fbff;
  filter: drop-shadow(0 0 8px rgba(47, 140, 255, 0.42));
}

.nav-label {
  display: block;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.1;
  white-space: normal;
}

.nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
}

.nav-badge {
  justify-content: center;
  min-width: 20px;
  padding: 1px 5px;
  border: 1px solid rgba(255, 77, 109, 0.38);
  border-radius: 999px;
  background: rgba(255, 77, 109, 0.14);
  color: #ffd7df;
  font-size: 10px;
}

.workspace {
  display: grid;
  grid-template-rows: 58px 1fr;
  min-width: 0;
  min-height: 0;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 24, 38, 0.94);
}

.deals-topbar {
  grid-template-columns: minmax(180px, 260px) minmax(260px, 1fr) auto;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-title h1 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
  font-size: 20px;
  line-height: 1.2;
  white-space: nowrap;
}

.top-meta {
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.search {
  position: relative;
  min-width: 160px;
  max-width: 520px;
}

.search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 0 14px 0 42px;
}

.search input:focus {
  border-color: rgba(47, 140, 255, 0.7);
}

.search-icon {
  position: absolute;
  top: 12px;
  left: 14px;
  color: var(--text-muted);
}

.btn,
.icon-button,
.segmented button,
.chip,
.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-main);
}

.btn {
  padding: 0 14px;
  font-weight: 700;
}

.ui-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(77, 160, 255, 0.22);
  border-top-color: #4da0ff;
  border-radius: 50%;
  animation: ui-spin 0.8s linear infinite;
}

.ui-spinner.tiny {
  width: 14px;
  height: 14px;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 24px;
  flex: 0 0 46px;
  align-items: center;
  border: 1px solid rgba(111, 151, 179, 0.55);
  border-radius: 999px;
  background: rgba(8, 24, 38, 0.95);
  padding: 2px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.toggle-switch span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #c9d8e5;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
  transition: transform 0.16s ease, background 0.16s ease;
}

.toggle-switch.on {
  border-color: rgba(0, 216, 123, 0.85);
  background: rgba(0, 216, 123, 0.18);
}

.toggle-switch.on span {
  background: #00d87b;
  transform: translateX(20px);
}

.btn.is-loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid rgba(77, 160, 255, 0.22);
  border-top-color: #4da0ff;
  border-radius: 50%;
  animation: ui-spin 0.8s linear infinite;
}

@keyframes ui-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn.primary {
  border-color: rgba(47, 140, 255, 0.7);
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-hover);
}

.btn.ghost,
.icon-button {
  background: transparent;
}

.btn.danger {
  border-color: rgba(255, 77, 109, 0.42);
  background: rgba(255, 77, 109, 0.13);
  color: #ffd7df;
}

.btn.task-submit-button {
  border-color: rgba(0, 200, 83, 0.9);
  background: #00c853;
  color: #03190c;
  font-weight: 900;
  box-shadow: 0 0 0 2px rgba(0, 200, 83, 0.16);
}

.btn.task-submit-button:hover {
  background: #2dff86;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.content {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(13, 38, 56, 0.5), transparent 250px),
    var(--bg-main);
}

.view {
  min-width: 0;
  min-height: 100%;
  padding: 18px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.metrics {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.grid.two {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.card,
.metric-card,
.table-wrap,
.kanban-column,
.modal-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 42, 61, 0.88);
}

.panel,
.table-wrap {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.panel-title {
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-main);
}

.panel-body {
  padding: 14px;
}

.metric-card {
  min-height: 132px;
  padding: 16px;
}

.metric-label {
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 10px;
  color: var(--text-main);
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.metric-delta {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 12px;
}

.metric-delta.good {
  color: #89f2b0;
}

.metric-delta.bad {
  color: #ffc2cc;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(140px, 2fr) auto;
  align-items: center;
  gap: 12px;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--teal));
}

.dashboard-amo {
  min-height: 100%;
  padding: 24px 18px 42px;
  background:
    linear-gradient(135deg, #2f9ec1 0%, #0c8ca8 44%, #0757ad 100%);
}

.dashboard-head,
.dashboard-pipeline,
.dashboard-widget-grid {
  width: min(1280px, 100%);
  margin-inline: auto;
}

.dashboard-head {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 8px 0 20px;
  text-align: center;
}

.dashboard-brandline {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.95);
}

.dashboard-head h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

.dashboard-subline {
  color: rgba(235, 248, 255, 0.8);
  font-size: 13px;
}

.dashboard-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dashboard-controls button,
.dashboard-manager-select {
  min-height: 36px;
  border: 1px solid rgba(229, 246, 255, 0.55);
  border-radius: 999px;
  background: rgba(13, 38, 56, 0.14);
  color: #fff;
}

.dashboard-controls button {
  padding: 0 18px;
}

.dashboard-controls button.active,
.dashboard-controls button:hover,
.dashboard-manager-select:focus-within {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.82);
}

.dashboard-manager-select {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 16px;
}

.dashboard-manager-select span {
  font-weight: 800;
}

.dashboard-manager-select select {
  min-width: 170px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-weight: 700;
}

.dashboard-manager-select option {
  color: #0d2638;
}

.dashboard-setup svg {
  width: 16px;
  height: 16px;
}

.dashboard-pipeline {
  display: grid;
  grid-template-columns: 150px repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(10, 47, 71, 0.42);
}

.dashboard-new-leads,
.dashboard-stage-card {
  min-height: 86px;
  border: 1px solid rgba(223, 244, 255, 0.56);
  border-radius: 8px;
  background: rgba(13, 38, 56, 0.56);
  color: #fff;
}

.dashboard-new-leads {
  display: grid;
  place-items: center;
  align-content: center;
}

.dashboard-new-leads strong {
  font-size: 34px;
  line-height: 1;
}

.dashboard-new-leads span,
.dashboard-stage-card em {
  color: rgba(235, 248, 255, 0.78);
  font-size: 12px;
  font-style: normal;
}

.dashboard-stage-card {
  display: grid;
  gap: 7px;
  align-content: center;
  padding: 12px;
  text-align: center;
}

.dashboard-stage-card span {
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-stage-card i {
  display: block;
  height: 3px;
  min-width: 18px;
  border-radius: 999px;
  background: var(--stage-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--stage-color), transparent 45%);
}

.dashboard-stage-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.9);
}

.dashboard-widget-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-widget {
  min-height: 176px;
  border: 1px solid rgba(31, 111, 153, 0.75);
  border-radius: 8px;
  background: rgba(8, 31, 48, 0.92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.widget-small {
  grid-column: span 2;
}

.widget-wide {
  grid-column: span 3;
}

.widget-large {
  grid-column: span 4;
  min-height: 250px;
}

.dashboard-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 4px;
}

.dashboard-widget-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.widget-config-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
}

.widget-config-button:hover {
  border-color: var(--border);
  color: #fff;
}

.widget-config-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.widget-number,
.widget-chart-summary,
.widget-list-summary {
  display: grid;
  gap: 2px;
  padding: 2px 14px 10px;
}

.widget-number strong,
.widget-chart-summary strong,
.widget-list-summary strong {
  color: #8b6cff;
  font-size: 42px;
  line-height: 1;
}

.widget-number strong.good {
  color: #00d879;
}

.widget-number strong.bad {
  color: #ff6a80;
}

.widget-number span,
.widget-chart-summary span,
.widget-list-summary span,
.widget-number em {
  color: var(--text-secondary);
  font-size: 12px;
  font-style: normal;
}

.widget-number em.good {
  color: #00d879;
}

.widget-number em.bad {
  color: #ff8fa0;
}

.widget-bars,
.widget-row-list {
  display: grid;
  gap: 4px;
  padding: 0 14px 14px;
}

.widget-bar-row,
.widget-row {
  display: grid;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(159, 180, 199, 0.12);
  background: transparent;
  color: var(--text-main);
  text-align: left;
}

.widget-bar-row {
  grid-template-columns: minmax(90px, 1fr) minmax(80px, 1.6fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0;
}

.widget-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 30px;
  padding: 4px 0;
}

.widget-bar-row:hover,
.widget-row:hover {
  color: #fff;
}

.widget-bar-row i {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.widget-bar-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #ffdf68;
}

.widget-bar-row em,
.widget-row strong {
  color: #00d879;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.widget-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget-empty {
  padding: 18px 14px;
  color: var(--text-muted);
  font-size: 12px;
}

.widget-timeline {
  display: grid;
  gap: 8px;
  padding-bottom: 8px;
}

.mini-line-chart {
  width: calc(100% - 28px);
  height: 128px;
  margin: 6px 14px 0;
  border-bottom: 1px solid rgba(235, 248, 255, 0.28);
}

.mini-line-chart polyline {
  fill: none;
  stroke: #8b6cff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.widget-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(3, 17, 27, 0.58);
}

.widget-modal {
  width: min(680px, calc(100vw - 28px));
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #143247;
  box-shadow: var(--shadow);
  padding: 24px;
}

.widget-modal header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.widget-modal h2 {
  margin: 0;
  font-size: 20px;
}

.widget-config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.widget-config-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 150px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 12px;
  background: rgba(13, 38, 56, 0.48);
  color: var(--text-main);
  text-align: center;
}

.widget-config-card input {
  position: absolute;
  opacity: 0;
}

.widget-config-card.active,
.widget-config-card:has(input:checked) {
  border-color: rgba(47, 140, 255, 0.95);
  box-shadow: inset 0 0 0 1px rgba(47, 140, 255, 0.38);
}

.widget-config-card span {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 8px;
  background: #eaf4ff;
  color: #2f8cff;
}

.widget-config-card svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
}

.widget-config-card strong {
  font-size: 14px;
}

.widget-config-card em {
  color: var(--text-secondary);
  font-size: 12px;
  font-style: normal;
}

.widget-delete {
  margin-top: 18px;
  border: 0;
  background: transparent;
  color: #ff8fa0;
}

.kanban-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.deals-view {
  padding: 0;
}

.deals-topline {
  display: grid;
  grid-template-columns: minmax(150px, 240px) minmax(220px, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 38, 56, 0.82);
}

.pipeline-name {
  overflow: hidden;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-summary {
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.pipeline-summary strong {
  color: var(--text-main);
}

.compact-search {
  max-width: none;
}

.compact-search input {
  height: 36px;
  border-color: transparent;
  background: rgba(7, 19, 31, 0.45);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 30px;
  padding: 0 10px;
  color: var(--text-secondary);
  font-size: 12px;
}

.chip.hot {
  border-color: rgba(255, 196, 0, 0.45);
  background: rgba(255, 196, 0, 0.12);
  color: #ffe58a;
}

.chip.good {
  border-color: rgba(0, 200, 83, 0.38);
  background: rgba(0, 200, 83, 0.12);
  color: #9af4b6;
}

.chip.warn {
  border-color: rgba(255, 77, 109, 0.38);
  background: rgba(255, 77, 109, 0.13);
  color: #ffc2cc;
}

.kanban-shell {
  position: relative;
  min-height: calc(100vh - 58px);
  overflow: visible;
  background: #092031;
  padding-bottom: 52px;
}

.kanban-board {
  display: grid;
  grid-auto-columns: minmax(320px, 340px);
  grid-auto-flow: column;
  gap: 10px;
  min-height: calc(100vh - 58px);
  overflow-x: auto;
  padding: 0 14px 18px;
  background: #092031;
  scroll-behavior: smooth;
  scrollbar-color: rgba(77, 160, 255, 0.58) rgba(18, 52, 75, 0.42);
  scrollbar-width: thin;
}

.kanban-board::-webkit-scrollbar {
  height: 10px;
}

.kanban-board::-webkit-scrollbar-track {
  background: rgba(18, 52, 75, 0.42);
}

.kanban-board::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(77, 160, 255, 0.58);
}

.kanban-mini-scroll {
  position: sticky;
  bottom: 12px;
  z-index: 12;
  width: 238px;
  height: 34px;
  margin: -46px 22px 12px auto;
  border: 1px solid rgba(77, 160, 255, 0.24);
  border-radius: 5px;
  background: rgba(13, 39, 58, 0.92);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  cursor: grab;
  overflow: hidden;
  touch-action: none;
}

.kanban-mini-scroll:active {
  cursor: grabbing;
}

.kanban-mini-scroll.disabled {
  display: none;
}

.kanban-mini-track {
  position: absolute;
  inset: 7px 8px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(77, 160, 255, 0.09) 0,
      rgba(77, 160, 255, 0.09) 16px,
      rgba(77, 160, 255, 0.16) 17px,
      rgba(77, 160, 255, 0.16) 19px
    );
}

.kanban-mini-thumb {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 7px;
  min-width: 34px;
  border: 1px solid rgba(207, 231, 255, 0.2);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(77, 160, 255, 0.55), rgba(47, 140, 255, 0.26));
  box-shadow: 0 0 12px rgba(77, 160, 255, 0.24);
  transition: width 120ms ease, transform 80ms linear;
}

.deal-tools {
  position: sticky;
  left: 0;
  z-index: 6;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #092031;
}

.deal-tool-row,
.deal-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.deal-filter-row {
  flex-wrap: wrap;
}

.deal-tool-count {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 12px;
}

.deal-view-toggle {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(7, 19, 31, 0.38);
}

.deal-view-toggle button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 0 12px;
}

.deal-view-toggle button.active {
  background: rgba(47, 140, 255, 0.28);
  color: var(--text-main);
}

.deal-filter {
  display: grid;
  gap: 3px;
  min-width: 150px;
}

.deal-filter span {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.deal-filter select {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #0d2638;
  color: var(--text-main);
  padding: 0 9px;
}

.deals-menu {
  position: absolute;
  top: 48px;
  left: 12px;
  z-index: 10;
  display: grid;
  min-width: 250px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #12344b;
  box-shadow: var(--shadow);
  padding: 6px;
}

.deals-menu button {
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-main);
  padding: 0 10px;
  text-align: left;
}

.deals-menu button:hover {
  background: rgba(47, 140, 255, 0.14);
}

.hidden-file-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.attachment-control {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-button,
.attachment-clear {
  min-height: 34px;
}

.attachment-button svg {
  width: 15px;
  height: 15px;
}

.attachment-preview-list {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.attachment-preview {
  display: inline-grid;
  max-width: 240px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(111, 151, 179, 0.24);
  border-radius: 7px;
  background: rgba(47, 140, 255, 0.1);
  color: var(--text-main);
  padding: 6px 9px;
  font-size: 12px;
}

.attachment-preview strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview em {
  color: var(--text-secondary);
  font-style: normal;
}

.deals-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 158px);
  overflow: hidden;
  background: #092031;
  padding: 10px 12px 16px;
}

.mass-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 4px 4px 0 0;
  background: rgba(18, 52, 75, 0.82);
  padding: 8px 10px;
  color: var(--text-secondary);
}

.row-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  place-items: center;
  border: 1px solid rgba(207, 231, 255, 0.58);
  border-radius: 5px;
  background: rgba(207, 231, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(7, 22, 35, 0.3);
  cursor: pointer;
}

input[type="checkbox"]::before {
  content: "";
  width: 9px;
  height: 6px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.55);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

input[type="checkbox"]:checked {
  border-color: rgba(47, 140, 255, 0.9);
  background: linear-gradient(135deg, #2f8cff, #17c7d1);
  box-shadow: 0 0 0 2px rgba(47, 140, 255, 0.14);
}

input[type="checkbox"]:checked::before {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(207, 231, 255, 0.85);
  outline-offset: 2px;
}

.deals-table-wrap {
  min-height: 0;
  overflow: auto;
  border-radius: 0 0 4px 4px;
}

.deals-table th,
.deals-table td {
  vertical-align: middle;
}

.deal-row-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 260px;
}

.deal-row-main strong,
.deal-row-main em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-row-main em {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 12px;
  font-style: normal;
}

.deal-list-avatar {
  width: 28px;
  height: 28px;
}

.table-button {
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(47, 140, 255, 0.12);
  color: var(--text-main);
  padding: 0 10px;
}

.table-button.danger {
  border-color: rgba(255, 77, 109, 0.42);
  background: rgba(255, 77, 109, 0.12);
  color: #ffd7df;
}

.log-table-wrap {
  max-height: 520px;
  overflow: auto;
}

.automation-panel {
  min-width: 0;
}

.automation-builder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
  padding: 14px;
}

.automation-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.automation-step.wide {
  grid-column: 1 / -1;
}

.automation-step strong {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(77, 160, 255, 0.2);
  color: #ffffff;
}

.task-type-admin,
.vk-integration-panel {
  min-width: 0;
}

.task-type-form,
.vk-integration-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
  padding: 14px;
}

.compact-input {
  min-width: 130px;
  height: 32px;
  padding: 0 8px;
}

.compact-color {
  width: 58px;
  min-width: 58px;
  height: 32px;
  padding: 2px;
}

.compact-number {
  width: 64px;
  height: 32px;
  padding: 0 8px;
}

.compact-textarea {
  min-width: 220px;
  min-height: 48px;
  resize: vertical;
}

.compact-check {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.table-wrap .field-input,
.table-wrap .field-select,
.task-type-table .field-input,
.task-type-table .field-select,
.automation-table .field-input,
.automation-table .field-select,
.automation-builder .field-input,
.automation-builder .field-select {
  border-color: rgba(77, 160, 255, 0.58);
  background: #0b2a40;
  color: #f2fbff;
}

.table-wrap .field-input::placeholder,
.task-type-table .field-input::placeholder,
.automation-table .field-input::placeholder,
.automation-builder .field-input::placeholder {
  color: rgba(210, 232, 248, 0.62);
}

.table-wrap .field-select option,
.task-type-table .field-select option,
.automation-table .field-select option,
.automation-builder .field-select option {
  background: #0b2235;
  color: #f2fbff;
}

.task-type-table .compact-color,
.task-type-form input[type="color"] {
  min-width: 72px;
  padding: 3px;
  background: #0b2a40;
}

.task-type-table input[type="color"]::-webkit-color-swatch,
.task-type-form input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(232, 245, 255, 0.7);
  border-radius: 4px;
}

.task-type-table input[type="checkbox"],
.automation-table input[type="checkbox"] {
  accent-color: #4da0ff;
}

.task-type-table .table-button,
.automation-table .table-button {
  color: #f5fbff;
  border-color: rgba(77, 160, 255, 0.55);
  background: rgba(28, 111, 196, 0.18);
}

.task-type-table .table-button.danger,
.automation-table .table-button.danger {
  color: #ffd9e3;
  border-color: rgba(255, 93, 133, 0.55);
  background: rgba(255, 93, 133, 0.12);
}

.notification-card.unread {
  border-color: rgba(77, 160, 255, 0.48);
  background: rgba(24, 76, 119, 0.36);
}

.notification-card.read {
  opacity: 0.72;
}

.collapsible-panel {
  overflow: hidden;
}

.collapsible-panel > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.collapsible-panel > summary::-webkit-details-marker {
  display: none;
}

.collapsible-arrow {
  min-width: 82px;
  border: 1px solid rgba(105, 149, 181, 0.35);
  border-radius: 999px;
  color: #cce8ff;
  background: rgba(77, 160, 255, 0.12);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.collapsible-panel[open] .collapsible-arrow {
  color: #ffffff;
  background: rgba(77, 160, 255, 0.26);
}

.collapsible-panel[open] .collapsible-arrow::before {
  content: "Скрыть";
}

.collapsible-panel[open] .collapsible-arrow {
  font-size: 0;
}

.collapsible-panel[open] .collapsible-arrow::before {
  font-size: 12px;
}

.lists-view {
  align-content: start;
  min-height: 0;
}

.lists-view .grid.two,
.lists-view .catalog-grid {
  align-items: start;
}

.lists-view .lists-collapsible:not([open]) {
  align-self: start;
  min-height: 0;
}

.lists-view .lists-collapsible:not([open]) .panel-header {
  border-bottom: 0;
}

.settings-compact-row {
  align-items: start;
}

.settings-collapsible:not([open]) {
  align-self: start;
  min-height: 0;
}

.settings-collapsible:not([open]) .panel-header {
  border-bottom: 0;
}

.inline-collapsible {
  margin: 0 14px 14px;
  border: 1px solid rgba(105, 149, 181, 0.24);
  border-radius: 8px;
  background: rgba(6, 24, 38, 0.25);
  overflow: hidden;
}

.inline-collapsible > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  color: #eaf6ff;
  font-weight: 900;
  list-style: none;
}

.inline-collapsible > summary::-webkit-details-marker {
  display: none;
}

.inline-collapsible .table-wrap,
.inline-collapsible .catalog-editor-list {
  border-top: 1px solid rgba(105, 149, 181, 0.22);
}

.catalog-admin-panel {
  min-width: 0;
}

.catalog-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
}

.catalog-editor {
  display: grid;
  min-width: 0;
  gap: 12px;
  border: 1px solid rgba(111, 151, 179, 0.18);
  border-radius: 8px;
  background: rgba(7, 28, 45, 0.28);
  padding: 12px;
}

.catalog-editor header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-main);
}

.catalog-editor header span {
  color: var(--text-secondary);
  font-size: 12px;
}

.catalog-editor-list {
  display: grid;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
  padding-right: 3px;
}

.catalog-editor-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
}

.catalog-editor-row.new {
  border-top: 1px dashed rgba(111, 151, 179, 0.28);
  padding-top: 9px;
}

@media (max-width: 980px) {
  .catalog-admin-grid {
    grid-template-columns: 1fr;
  }
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.automation-due-cell {
  display: flex;
  gap: 6px;
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.vk-callback-box {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.vk-integration-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
}

.vk-integration-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 42, 61, 0.72);
  padding: 14px;
}

.vk-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.social-channel-tile.compact {
  display: inline-flex;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
}

.social-channel-tile.compact img {
  width: 34px;
  height: 34px;
}

.vk-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.vk-log-box {
  max-height: 280px;
  overflow: auto;
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
}

.automation-step label,
.weekly-report {
  display: grid;
  gap: 8px;
}

.automation-table {
  max-height: 280px;
  overflow: auto;
  border-width: 0;
  border-radius: 0 0 8px 8px;
}

.automation-table table {
  min-width: 1360px;
}

.automation-table th:nth-child(1),
.automation-table td:nth-child(1) {
  min-width: 190px;
}

.automation-table th:nth-child(2),
.automation-table td:nth-child(2),
.automation-table th:nth-child(3),
.automation-table td:nth-child(3),
.automation-table th:nth-child(6),
.automation-table td:nth-child(6),
.automation-table th:nth-child(7),
.automation-table td:nth-child(7) {
  min-width: 160px;
}

.automation-table th:nth-child(4),
.automation-table td:nth-child(4) {
  min-width: 250px;
}

.automation-table th:nth-child(8),
.automation-table td:nth-child(8) {
  min-width: 150px;
}

.automation-table .compact-input,
.automation-table .compact-textarea {
  width: 100%;
}

.weekly-report pre {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  border: 1px solid rgba(105, 149, 181, 0.32);
  border-radius: 6px;
  background: rgba(6, 24, 38, 0.55);
  color: #eaf6ff;
  padding: 12px;
  white-space: pre-wrap;
}

.tasks-view {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  height: calc(100vh - 58px);
  overflow: hidden;
  padding: 0 12px 14px;
  background: #092031;
}

.tasks-amo-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tasks-view-tabs {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #12344b;
}

.tasks-view-tabs button {
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--text-main);
  padding: 0 13px;
  font-weight: 800;
}

.tasks-view-tabs button.active {
  background: rgba(47, 140, 255, 0.28);
}

.tasks-counter {
  justify-self: end;
  color: var(--text-secondary);
  font-size: 12px;
}

.tasks-table-shell {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #12344b;
}

.tasks-amo-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.tasks-amo-table th,
.tasks-amo-table td {
  height: 40px;
  border-bottom: 1px solid rgba(111, 151, 179, 0.18);
  padding: 0 12px;
  color: var(--text-main);
  text-align: left;
  white-space: nowrap;
}

.tasks-amo-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #15374f;
  color: #8facbf;
  font-size: 11px;
  text-transform: uppercase;
}

.tasks-amo-table tr:hover td {
  background: rgba(47, 140, 255, 0.08);
}

.task-check {
  width: 34px;
  text-align: center;
}

.task-date,
.task-object-link {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.task-object-link {
  color: #ff6d7f;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.danger-text,
.task-row-overdue td {
  color: #ff6d7f;
}

.task-row-completed td {
  color: var(--text-secondary);
}

.task-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

.task-type-pill i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.task-complete-button {
  min-height: 30px;
  border: 1px solid rgba(105, 149, 181, 0.45);
  border-radius: 4px;
  background: rgba(9, 32, 49, 0.8);
  color: var(--text-main);
  padding: 0 14px;
  font-weight: 800;
}

.task-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(3, 13, 21, 0.58);
}

.task-modal {
  width: min(720px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12344b;
  box-shadow: var(--shadow);
}

.task-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(111, 151, 179, 0.18);
  padding: 18px 20px;
}

.task-modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.task-modal-head span {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.task-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px 20px 20px;
}

.task-form-wide,
.task-modal-actions {
  grid-column: 1 / -1;
}

.task-form textarea {
  min-height: 86px;
  resize: vertical;
}

.task-modal-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.task-attachments {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.quick-task-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 2px;
}

.quick-task-types button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid rgba(105, 149, 181, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #eef8ff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.quick-task-types button:hover {
  border-color: rgba(77, 160, 255, 0.8);
  background: rgba(77, 160, 255, 0.16);
}

.quick-task-types i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.delivery-modal {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.delivery-form {
  display: grid;
  gap: 16px;
  padding: 18px 20px 20px;
}

.delivery-mode-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 12px 20px 0;
}

.delivery-mode-tabs button {
  min-height: 34px;
  border: 1px solid rgba(105, 149, 181, 0.35);
  border-radius: 5px;
  background: rgba(6, 24, 38, 0.42);
  color: var(--text-secondary);
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
}

.delivery-mode-tabs button.active {
  border-color: rgba(47, 140, 255, 0.72);
  background: rgba(47, 140, 255, 0.18);
  color: var(--text);
}

.delivery-carriers {
  margin: 0 20px;
  border: 1px solid rgba(105, 149, 181, 0.28);
  border-radius: 5px;
  background: rgba(8, 30, 48, 0.38);
  color: #cfe7ff;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
}

.delivery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.delivery-model-control {
  margin-bottom: 2px;
}

.delivery-model-control em {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-style: normal;
}

.delivery-text-field textarea {
  min-height: 150px;
  resize: vertical;
}

.delivery-hint {
  border: 1px solid rgba(105, 149, 181, 0.26);
  border-radius: 5px;
  background: rgba(8, 30, 48, 0.45);
  color: var(--text-secondary);
  padding: 10px 12px;
  font-size: 12px;
}

.delivery-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.delivery-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(105, 149, 181, 0.35);
  border-radius: 5px;
  background: rgba(6, 24, 38, 0.42);
  color: var(--text-secondary);
  padding: 0 10px;
  font-size: 12px;
}

.delivery-results {
  display: grid;
  gap: 12px;
}

.delivery-best,
.delivery-result-card,
.delivery-event-best,
.delivery-event-row {
  border: 1px solid rgba(105, 149, 181, 0.34);
  border-radius: 6px;
  background: rgba(8, 30, 48, 0.58);
}

.delivery-best {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
}

.delivery-best span,
.delivery-event-best span,
.delivery-result-card span,
.delivery-result-price span,
.delivery-event-row em {
  color: var(--text-secondary);
  font-size: 12px;
}

.delivery-best strong,
.delivery-result-price strong {
  font-size: 18px;
}

.delivery-loading {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.delivery-spinner {
  border-color: rgba(77, 160, 255, 0.22);
  border-top-color: #4da0ff;
}

.delivery-result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.delivery-result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
}

.delivery-result-card.best {
  border-color: rgba(0, 200, 83, 0.68);
  box-shadow: inset 3px 0 0 rgba(0, 200, 83, 0.8);
}

.delivery-result-card.failed {
  border-color: rgba(255, 77, 109, 0.45);
}

.delivery-result-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.delivery-result-price {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.delivery-error,
.delivery-error-box {
  color: var(--danger);
}

.delivery-error-box {
  border: 1px solid rgba(255, 77, 109, 0.42);
  border-radius: 5px;
  background: rgba(255, 77, 109, 0.08);
  padding: 10px 12px;
}

.delivery-quote-open {
  justify-content: center;
  margin-top: 8px;
  color: var(--link);
}

.delivery-event {
  border-color: rgba(47, 140, 255, 0.48);
}

.delivery-event-best {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px;
}

.delivery-event-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.delivery-event-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  font-size: 12px;
}

.delivery-event-row.failed {
  border-color: rgba(255, 77, 109, 0.38);
}

.delivery-event-row.failed em,
.delivery-result-card.failed span {
  color: #ff9aac;
}

.kanban-column {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: calc(100vh - 58px);
  overflow: visible;
}

.column-head {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 48px;
  border-top: 0;
  border-bottom: 2px solid var(--primary);
  background: #092031;
  padding: 10px 4px 7px;
  text-align: center;
}

.column-title {
  display: block;
  overflow: hidden;
  font-weight: 800;
  font-size: 12px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.column-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
}

.cards {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  min-height: 300px;
  padding: 6px 0 10px;
}

.deal-card {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(93, 127, 153, 0.62);
  border-radius: 4px;
  background: #12344b;
  padding: 8px;
  box-shadow: none;
}

.deal-card:hover {
  border-color: rgba(47, 140, 255, 0.45);
  background: var(--bg-surface-hover);
}

.deal-card:hover,
.deal-card:focus-within {
  padding-right: 42px;
}

.deal-card.dragging {
  opacity: 0.6;
  transform: rotate(1deg);
}

.deal-edge-actions {
  position: absolute;
  top: -1px;
  right: -1px;
  bottom: -1px;
  z-index: 3;
  display: flex;
  width: 38px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(93, 127, 153, 0.7);
  border-left-color: rgba(138, 172, 198, 0.28);
  border-radius: 0 4px 4px 0;
  background: #30495b;
  box-shadow: -8px 0 14px rgba(0, 0, 0, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.deal-card:hover .deal-edge-actions,
.deal-card:focus-within .deal-edge-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.deal-edge-action {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.deal-edge-action:hover,
.deal-edge-action:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.deal-edge-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.deal-edge-delete {
  color: #ff6277;
}

.deal-edge-accept {
  color: #35e67e;
}

.deal-edge-action svg,
.btn svg,
.icon-button svg,
.nav-icon svg {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28));
}

.deal-edge-action:hover svg,
.btn:hover svg,
.icon-button:hover svg {
  color: #ffffff;
}

.deal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.deal-name {
  margin: 0;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.25;
}

.deal-price {
  white-space: nowrap;
  color: var(--text-secondary);
  font-weight: 800;
}

.deal-contact,
.deal-preview,
.muted {
  color: var(--text-secondary);
}

.deal-preview {
  margin-top: 9px;
  line-height: 1.35;
}

.deal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.deal-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 11px;
}

.deal-card-row > span,
.deal-contact {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-link {
  margin-top: 2px;
  overflow: hidden;
  color: #1e9bff;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-source-top {
  color: #8fb0c8;
  font-size: 11px;
  font-weight: 700;
}

.deal-product-line {
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-date,
.deal-days {
  flex: 0 0 auto;
  color: #7fa0b8;
  font-size: 11px;
}

.deal-muted-row {
  margin-top: 5px;
  font-size: 11px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  color: var(--text-secondary);
}

.source-badge img {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

.source-badge span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preferred-channel-badge {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  gap: 5px;
  border: 1px solid rgba(0, 209, 143, 0.42);
  border-radius: 999px;
  background: rgba(0, 209, 143, 0.12);
  color: #c8fff0;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
}

.preferred-channel-badge img,
.preferred-channel-badge svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  object-fit: cover;
}

.preferred-channel-badge svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.preferred-channel-badge span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amo-priority-channel {
  justify-content: flex-end;
}

.amo-contact-priority {
  margin-top: 5px;
}

.deal-muted-row span:last-child {
  flex: 0 0 auto;
}

.deal-card-messenger {
  padding: 7px;
}

.deal-messenger-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.deal-messenger-main {
  min-width: 0;
}

.deal-avatar {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.deal-message-preview {
  margin-top: 7px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.deal-loss-reason {
  margin-top: 6px;
  border-left: 2px solid var(--danger);
  color: #ffc2cc;
  font-size: 11px;
  line-height: 1.3;
  padding-left: 7px;
}

.task-warn {
  color: #ffc400;
  font-weight: 800;
}

.task-ok {
  color: #9af4b6;
  font-weight: 800;
}

.deal-phone-wrap,
.phone-line strong {
  position: relative;
  min-width: 0;
}

.phone-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #cfe7ff;
  padding: 0;
  text-overflow: ellipsis;
  text-decoration: underline;
  vertical-align: bottom;
  white-space: nowrap;
}

.phone-region-badge {
  display: inline-flex;
  justify-content: center;
  max-width: none;
  min-width: 0;
  overflow: visible;
  border-radius: 4px;
  background: #c9a544;
  color: #fff;
  padding: 3px 10px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.load-more-deals {
  min-height: 34px;
  border: 1px solid rgba(93, 127, 153, 0.48);
  border-radius: 4px;
  background: rgba(47, 140, 255, 0.12);
  color: #cfe7ff;
  font-weight: 800;
}

.load-more-deals:hover {
  border-color: rgba(47, 140, 255, 0.65);
  background: rgba(47, 140, 255, 0.2);
}

.phone-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 5px);
  left: 0;
  display: grid;
  min-width: 230px;
  border: 1px solid #40627b;
  border-radius: 4px;
  background: #112f45;
  box-shadow: var(--shadow);
  padding: 6px;
}

.phone-menu button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text-main);
  padding: 8px 10px;
  text-align: left;
}

.phone-menu button:hover {
  background: rgba(47, 140, 255, 0.16);
}

.phone-menu-empty {
  padding: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.phone-account-menu {
  position: absolute;
  top: 0;
  left: calc(100% + 8px);
  display: grid;
  width: 270px;
  border: 1px solid #40627b;
  border-radius: 4px;
  background: #112f45;
  box-shadow: var(--shadow);
  padding: 8px;
}

.phone-account-title {
  padding: 7px 9px 9px;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 900;
}

.phone-account-menu button {
  display: grid;
  min-height: 34px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #cfe7ff;
}

.phone-account-menu button:hover {
  border-color: rgba(47, 140, 255, 0.45);
  background: rgba(47, 140, 255, 0.2);
}

.phone-account-menu p {
  margin: 8px 9px 4px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.deal-task-info-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  align-items: center;
  min-height: 58px;
  border-top: 1px solid rgba(105, 149, 181, 0.28);
  border-bottom: 1px solid rgba(105, 149, 181, 0.28);
  background: rgba(18, 52, 75, 0.68);
}

.deal-task-info-bar div {
  display: grid;
  gap: 4px;
  min-width: 0;
  border-right: 1px solid rgba(105, 149, 181, 0.18);
  padding: 8px 18px;
}

.deal-task-info-bar div:last-child {
  border-right: 0;
  justify-items: end;
}

.deal-task-info-bar span {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-task-info-bar strong {
  overflow: hidden;
  color: #cfe7ff;
  font-size: 20px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-task-info-bar strong.good {
  color: #00d177;
}

.deal-task-info-bar strong.warn {
  color: #ffc845;
}

.deal-task-info-bar strong.danger {
  color: #ff4f9a;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--border-soft);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--text-secondary);
  font-size: 12px;
}

.status.overdue,
.status.error {
  border-color: rgba(255, 77, 109, 0.45);
  background: rgba(255, 77, 109, 0.13);
  color: #ffc2cc;
}

.status.completed,
.status.active,
.status.ok {
  border-color: rgba(0, 200, 83, 0.38);
  background: rgba(0, 200, 83, 0.12);
  color: #9af4b6;
}

.status.warning,
.status.pending_manager {
  border-color: rgba(255, 196, 0, 0.42);
  background: rgba(255, 196, 0, 0.12);
  color: #ffe58a;
}

.inbox-grid,
.integration-grid,
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 14px;
}

.card {
  padding: 14px;
}

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

.card-title {
  font-weight: 800;
}

.card-subtitle {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.btn.is-loading {
  cursor: wait;
  opacity: 0.82;
}

.social-account-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 14px;
}

.social-account-form {
  align-content: start;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(9, 32, 49, 0.36);
  padding: 12px;
}

.social-setup-note {
  align-self: stretch;
  border: 1px solid rgba(77, 160, 255, 0.26);
  border-radius: 8px;
  background: rgba(77, 160, 255, 0.08);
  color: var(--text-secondary);
  line-height: 1.4;
  padding: 10px 12px;
}

.social-account-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-content: start;
  gap: 10px;
}

.social-account-card {
  min-width: 0;
}

.social-account-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.social-account-title img {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.social-auth-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid rgba(47, 140, 255, 0.22);
  border-radius: 8px;
  background: rgba(9, 32, 49, 0.34);
  padding: 10px;
}

.social-auth-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.social-auth-hint,
.social-auth-note {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.social-auth-note {
  margin-top: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(9, 32, 49, 0.28);
  padding: 9px 10px;
}

.social-auth-note.good {
  border-color: rgba(0, 200, 83, 0.3);
  color: #7dffb2;
}

.social-qr-image {
  width: min(220px, 100%);
  max-height: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  padding: 8px;
}

.mini-check {
  font-size: 12px;
}

.system-log-panel .table td:nth-child(4),
.system-log-panel .table td:nth-child(5) {
  max-width: 420px;
  white-space: normal;
}

.error-center-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
  padding: 14px;
}

.error-center-grid h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-main);
}

.integration-entry-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.25fr) minmax(300px, 0.75fr);
  gap: 14px;
}

.integration-entry-card {
  display: grid;
  align-content: space-between;
  min-height: 260px;
  border: 1px solid rgba(47, 140, 255, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47, 140, 255, 0.18), rgba(0, 184, 169, 0.08)),
    var(--bg-panel);
  box-shadow: var(--shadow);
  padding: 22px;
}

.integration-entry-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.integration-entry-card p {
  max-width: 580px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.integration-entry-icons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.integration-entry-icons img {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: #fff;
  object-fit: cover;
}

.integration-entry-stats,
.social-setup-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.integration-entry-stats span,
.social-setup-metrics span {
  display: grid;
  min-width: 118px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(9, 32, 49, 0.42);
  color: var(--text-secondary);
  padding: 10px 12px;
}

.integration-entry-stats strong,
.social-setup-metrics strong {
  color: var(--text-main);
  font-size: 22px;
}

.ai-integration-card {
  min-height: 260px;
}

.ai-integration-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ai-integration-meta {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(105, 149, 181, 0.32);
  border-radius: 8px;
  background: rgba(9, 32, 49, 0.44);
  padding: 10px 12px;
}

.ai-integration-meta span,
.bridge-health-note {
  color: var(--text-secondary);
  font-size: 12px;
}

.ai-integration-meta strong {
  overflow: hidden;
  color: #dceeff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-integration-meta em {
  color: #ff8ea0;
  font-size: 12px;
}

.bridge-health-panel .panel-body {
  display: grid;
  gap: 10px;
}

.bridge-health-row {
  display: grid;
  grid-template-columns: 92px auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(105, 149, 181, 0.28);
  border-radius: 8px;
  background: rgba(9, 32, 49, 0.4);
  padding: 10px;
}

.bridge-health-row em {
  overflow: hidden;
  color: var(--text-secondary);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-social-list {
  display: grid;
  gap: 8px;
}

.compact-social-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-soft);
  padding: 8px 0;
}

.compact-social-row img {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  object-fit: cover;
}

.compact-social-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-setup-view {
  display: grid;
  gap: 14px;
}

.social-setup-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-height: 220px;
  border: 1px solid rgba(47, 140, 255, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47, 140, 255, 0.26), rgba(0, 200, 83, 0.08)),
    #0d2a40;
  box-shadow: var(--shadow);
  padding: 24px;
}

.social-setup-hero h2 {
  margin: 22px 0 8px;
  font-size: 28px;
}

.social-setup-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.social-channel-ribbon {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

.social-channel-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
  padding: 10px;
}

.social-channel-tile img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff;
  object-fit: cover;
}

.social-setup-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(300px, 0.9fr);
  gap: 14px;
}

.social-setup-card {
  min-width: 0;
}

.bridge-flow {
  display: grid;
  gap: 10px;
}

.bridge-flow div {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(9, 32, 49, 0.28);
  padding: 10px;
}

.bridge-flow strong {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(47, 140, 255, 0.22);
  color: #d8ecff;
}

.bridge-flow span {
  color: var(--text-secondary);
  line-height: 1.35;
}

.message-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(360px, 1fr) minmax(280px, 340px);
  gap: 12px;
  min-height: calc(100vh - 110px);
}

.conversation-list,
.thread,
.entity-panel {
  min-height: 0;
}

.conversation-list .panel-body,
.thread .panel-body,
.entity-panel .panel-body {
  overflow: auto;
}

.conversation-item {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
  padding: 10px;
  text-align: left;
}

.conversation-item:hover,
.conversation-item.active {
  border-color: rgba(47, 140, 255, 0.42);
  background: rgba(47, 140, 255, 0.12);
}

.avatar-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(47, 140, 255, 0.38);
  border-radius: 50%;
  background: rgba(47, 140, 255, 0.16);
  color: #d8ecff;
  font-size: 12px;
  font-weight: 800;
}

img.avatar {
  display: block;
  object-fit: cover;
}

.lead-avatar-wrap {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
}

.channel-icon {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 24px;
  height: 24px;
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}

.lead-card {
  border-radius: 4px;
}

.lead-card-plain {
  padding: 10px;
}

.lead-plain-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-main);
  font-size: 12px;
}

.lead-plain-top span,
.lead-channel {
  color: var(--text-secondary);
  font-size: 12px;
}

.lead-data {
  margin-top: 8px;
}

.lead-data .split-line {
  padding: 4px 0;
  font-size: 12px;
}

.lead-message {
  margin: 10px 0 0;
  color: var(--text-main);
  line-height: 1.35;
}

.last-message {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border-radius: 999px;
  background: rgba(47, 140, 255, 0.26);
  color: #e6f3ff;
  padding: 4px 9px 4px 5px;
  font-size: 12px;
  line-height: 1.3;
}

.last-message span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.last-message strong {
  color: #ffffff;
  font-weight: 900;
}

.last-message-avatar {
  display: grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: #335c82;
  font-size: 9px;
  font-weight: 900;
}

.lead-last-message {
  margin-top: 10px;
}

.deal-last-message {
  margin-top: 8px;
  background: rgba(47, 140, 255, 0.3);
}

.lead-card-messenger {
  background: #12344b;
}

.messenger-lead-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
}

.lead-from {
  color: var(--text-main);
  font-size: 12px;
  font-weight: 800;
}

.lead-product {
  margin-top: 2px;
  color: #1e9bff;
  font-size: 14px;
  font-weight: 800;
}

.imbox-workspace {
  display: grid;
  grid-template-columns: minmax(330px, 420px) minmax(560px, 1fr);
  gap: 0;
  height: calc(100vh - 58px);
  padding: 0;
  overflow: hidden;
  background: #092031;
}

.imbox-list-panel,
.imbox-thread-panel {
  min-height: 0;
  border-right: 1px solid var(--border);
}

.imbox-list-panel {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  background: #12344b;
}

.imbox-list-head {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  min-width: 0;
  border-bottom: 1px solid rgba(111, 151, 179, 0.2);
  padding: 0 12px;
  color: var(--text-secondary);
}

.imbox-list-head span {
  margin-left: auto;
  font-size: 12px;
}

.imbox-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 0;
  cursor: pointer;
}

.imbox-filter.active,
.imbox-filter:hover {
  color: var(--text-main);
}

.imbox-filter svg {
  width: 18px;
  height: 18px;
}

.imbox-popover {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 190px;
  padding: 8px;
  border: 1px solid rgba(77, 140, 190, 0.38);
  border-radius: 6px;
  background: #102f43;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
}

.imbox-filter-menu {
  left: 10px;
}

.imbox-actions-menu {
  right: 10px;
}

.imbox-popover button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-main);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.imbox-popover button:hover,
.imbox-popover button.active {
  background: rgba(47, 140, 255, 0.18);
  color: #fff;
}

.imbox-list {
  min-height: 0;
  overflow: auto;
}

.imbox-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: 72px;
  border: 0;
  border-bottom: 1px solid rgba(111, 151, 179, 0.16);
  background: transparent;
  color: var(--text-main);
  padding: 10px 12px;
  text-align: left;
}

.imbox-list-item:hover {
  background: rgba(47, 140, 255, 0.08);
}

.imbox-list-item.active {
  background: rgba(47, 140, 255, 0.36);
}

.imbox-avatar {
  width: 34px;
  height: 34px;
}

.imbox-item-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.imbox-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.imbox-code {
  border-radius: 3px;
  background: #36c978;
  color: #eafff2;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
}

.imbox-item-top time {
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.imbox-list-item strong,
.imbox-list-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imbox-list-item strong {
  color: var(--text-main);
  font-size: 13px;
  font-style: normal;
}

.imbox-list-item em {
  color: var(--text-secondary);
  font-size: 12px;
  font-style: normal;
}

.imbox-item-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: #79a0bb;
  font-size: 11px;
}

.imbox-item-tags b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 77, 109, 0.16);
  color: #ffd7df;
  font-size: 10px;
}

.imbox-thread-panel {
  min-width: 0;
  background: #092031;
}

.imbox-thread {
  display: grid;
  grid-template-rows: 58px 52px minmax(0, 1fr) auto;
  height: 100%;
  min-width: 0;
}

.imbox-thread-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: #063035;
  padding: 0 18px;
}

.imbox-thread-head h2 {
  margin: 0;
  overflow: hidden;
  color: var(--text-main);
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imbox-thread-head span,
.imbox-stage-line span {
  color: var(--text-secondary);
  font-size: 12px;
}

.imbox-stage-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(111, 151, 179, 0.18);
  padding: 0 20px;
  background: rgba(6, 48, 53, 0.45);
}

.imbox-stage-line strong {
  display: block;
}

.imbox-feed {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 0;
  overflow: auto;
  padding: 18px 18px 28px;
}

.imbox-message-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid rgba(105, 149, 181, 0.48);
  border-radius: 6px;
  background: rgba(18, 52, 75, 0.72);
  padding: 24px 16px 18px;
  width: fit-content;
  max-width: min(760px, 78%);
  overflow-wrap: anywhere;
}

.imbox-message-card::before,
.imbox-message-card::after {
  content: "";
  position: absolute;
  right: 6px;
  left: 6px;
  height: 4px;
  border: 1px solid rgba(105, 149, 181, 0.45);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.imbox-message-card::before {
  top: -7px;
}

.imbox-message-card::after {
  top: -12px;
  right: 12px;
  left: 12px;
}

.imbox-message-card.outgoing {
  grid-template-columns: minmax(0, 1fr) auto;
  justify-self: end;
}

.imbox-message-card.compact {
  margin-left: 0;
}

.imbox-message-avatar {
  align-self: center;
}

.imbox-message-body {
  min-width: 0;
  width: fit-content;
  max-width: 100%;
}

.imbox-message-meta {
  margin-bottom: 6px;
  color: #7fa0b8;
  font-size: 12px;
}

.imbox-message-card p {
  margin: 5px 0;
  color: var(--text-main);
  line-height: 1.42;
}

.imbox-message-card.outgoing .imbox-message-body {
  justify-self: end;
  max-width: min(620px, 100%);
  border-radius: 6px;
  background: rgba(47, 110, 190, 0.72);
  padding: 12px 14px;
}

.imbox-message-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  color: #66e08e;
  font-size: 12px;
}

.imbox-system-line {
  justify-self: center;
  color: var(--text-secondary);
  font-size: 12px;
}

.imbox-system-line strong {
  border-radius: 3px;
  background: rgba(47, 140, 255, 0.18);
  color: #cfe7ff;
  padding: 1px 6px;
}

.imbox-composer {
  border-top: 1px solid var(--border);
  background: #092031;
  padding: 12px 14px 14px;
}

.imbox-task-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border: 1px solid rgba(105, 149, 181, 0.45);
  border-radius: 4px;
  margin-bottom: 8px;
  padding: 8px 12px;
  color: var(--text-secondary);
}

.imbox-task-strip svg {
  width: 22px;
  height: 22px;
}

.imbox-task-strip strong {
  display: block;
  color: var(--text-main);
}

.chat-task-body {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.chat-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-task-manager-select {
  min-width: 120px;
  height: 30px;
  border: 1px solid rgba(77, 160, 255, 0.45);
  border-radius: 6px;
  background: #0b2233;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
}

.chat-task-create {
  width: fit-content;
  min-height: 32px;
  border: 1px solid rgba(255, 196, 0, 0.8);
  border-radius: 7px;
  background: #ffc400;
  color: #061826;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  padding: 0 12px;
  box-shadow: 0 0 0 2px rgba(255, 196, 0, 0.14);
}

.chat-task-create:hover {
  background: #ffdf68;
}

.chat-task-create.compact {
  margin-top: 2px;
}

.imbox-task-strip em,
.imbox-task-strip small {
  display: block;
  color: var(--text-muted);
  font-style: normal;
  font-size: 12px;
}

.imbox-composer .amo-chat-input {
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-top: 0;
}

.imbox-composer .amo-chat-input strong {
  align-self: center;
  color: #66e08e;
  font-size: 12px;
  white-space: nowrap;
}

.bubble-list {
  display: grid;
  gap: 10px;
}

.chat-thread {
  align-content: start;
  background:
    linear-gradient(180deg, rgba(7, 25, 38, 0.36), rgba(7, 25, 38, 0.06));
}

.message-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  animation: message-pop 160ms ease-out;
}

.message-row.out {
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
}

.message-row.note {
  display: flex;
  justify-content: center;
}

.message-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(640px, 72%);
  min-width: 0;
  width: fit-content;
}

.message-row.out .message-stack {
  align-items: flex-end;
  justify-self: end;
}

.message-row.in .message-stack {
  align-items: flex-start;
  justify-self: start;
}

.message-author {
  color: var(--text-secondary);
  font-size: 11px;
}

.message-author.client {
  color: #7fa0b8;
}

.message-avatar {
  align-self: end;
}

.thread-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bubble {
  max-width: 100%;
  width: fit-content;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.045);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bubble.out {
  align-self: flex-end;
  border-color: rgba(47, 140, 255, 0.38);
  background: rgba(47, 140, 255, 0.16);
}

.bubble.note {
  justify-self: center;
  max-width: 92%;
  border-color: rgba(255, 196, 0, 0.3);
  background: rgba(255, 196, 0, 0.08);
  color: #ffe58a;
}

.message-stack .bubble,
.message-row.note .bubble {
  max-width: 100%;
}

.bubble.in {
  border-color: rgba(111, 151, 179, 0.28);
  background: #14364e;
}

.bubble-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  color: #9db8cc;
  font-size: 11px;
  line-height: 1.25;
}

.bubble-head strong {
  flex: 0 0 auto;
  color: #cfe7ff;
  font-size: 11px;
  font-weight: 800;
}

.bubble-head.out strong {
  color: #d9ecff;
}

.delivery-status.failed {
  color: var(--danger);
}

.message-error {
  margin-top: 6px;
  color: #ff8aa5;
  font-size: 11px;
  line-height: 1.35;
}

.bubble-meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
}

@keyframes message-pop {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.attachment {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  border: 1px solid rgba(111, 151, 179, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  padding: 8px;
  text-decoration: none;
}

.attachment.voice {
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
}

.attachment.voice.playable audio {
  width: min(360px, 100%);
  height: 34px;
  margin-top: 6px;
  accent-color: #4da0ff;
}

.attachment-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
}

.voice-track {
  width: 100%;
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}

.voice-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #9bd1ff;
}

.attachment.media {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.attachment.media img {
  display: block;
  width: 220px;
  max-width: 100%;
  height: 120px;
  object-fit: cover;
}

.attachment.media video {
  display: block;
  width: min(360px, 100%);
  max-height: 240px;
  border-radius: 6px 6px 0 0;
  background: #061826;
  outline: none;
}

.attachment.media span,
.attachment.media em {
  padding: 0 8px 8px;
  font-style: normal;
}

.attachment.file {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.attachment.file span,
.attachment.voice em {
  color: var(--text-secondary);
  font-size: 12px;
}

.composer {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid var(--border-soft);
}

.composer textarea,
.field-input,
.field-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 10px 12px;
}

.composer textarea {
  min-height: 86px;
  resize: vertical;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.wide {
  grid-column: 1 / -1;
}

.field label {
  color: var(--text-secondary);
  font-size: 12px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--text-secondary);
  font-size: 12px;
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 0;
  padding: 0 12px;
}

.segmented button.active {
  background: rgba(47, 140, 255, 0.22);
  color: #fff;
}

.side-panel {
  position: fixed;
  inset: 0 0 0 68px;
  z-index: 20;
  display: none;
  background: #092031;
}

.side-panel.open {
  display: block;
}

.modal-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(1180px, 96vw);
  height: 100vh;
  border-radius: 0;
  box-shadow: var(--shadow);
}

.amo-card {
  display: grid;
  grid-template-columns: minmax(280px, var(--deal-info-width, 360px)) 8px minmax(430px, 1fr);
  grid-template-rows: 1fr;
  width: 100%;
  height: 100vh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #092031;
  box-shadow: none;
}

.amo-resizer {
  position: relative;
  z-index: 2;
  cursor: col-resize;
  background:
    linear-gradient(90deg, transparent, rgba(111, 151, 179, 0.35), transparent);
}

.amo-resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 54px;
  border-radius: 999px;
  background: rgba(159, 180, 199, 0.5);
  transform: translate(-50%, -50%);
}

.amo-resizer:hover,
.amo-resizer:active {
  background: rgba(47, 140, 255, 0.18);
}

.amo-left,
.amo-center,
.amo-widgets,
.amo-ai-panel {
  min-width: 0;
  min-height: 0;
}

.amo-left {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) 58px;
  border-right: 1px solid var(--border);
  background: #12344b;
}

.amo-left-head {
  padding: 16px 20px 12px 24px;
  border-bottom: 1px solid rgba(111, 151, 179, 0.18);
  background: linear-gradient(180deg, rgba(0, 77, 86, 0.24), rgba(18, 52, 75, 0));
}

.amo-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.amo-back,
.amo-more,
.amo-close,
.amo-widget-row,
.amo-widget-link,
.amo-add-row {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.amo-back {
  width: 20px;
  height: 26px;
  padding: 0;
  color: var(--text-main);
  font-size: 26px;
  line-height: 1;
}

.amo-title-main {
  min-width: 0;
}

.amo-title {
  display: -webkit-box;
  overflow: hidden;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  padding: 0;
  text-align: left;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.amo-title:hover,
.amo-edit-value:hover,
.amo-mini-edit:hover,
.amo-remove-field:hover,
.amo-add-field:hover {
  color: #fff;
}

.amo-subtitle,
.amo-account-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.amo-tag {
  min-height: 22px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  color: #d4e8f8;
  padding: 3px 7px;
}

.amo-account-line {
  justify-content: space-between;
  margin-top: 16px;
}

.amo-account-line strong {
  color: var(--text-main);
}

.amo-stage-meter {
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.amo-stage-meter span {
  display: block;
  width: 28%;
  height: 100%;
  border-radius: inherit;
  background: #e5f1ff;
}

.amo-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 14px 8px 24px;
  border-bottom: 1px solid rgba(111, 151, 179, 0.18);
  background: rgba(5, 32, 39, 0.28);
}

.amo-tabs button,
.amo-stage-buttons button {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid rgba(105, 149, 181, 0.45);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  padding: 0 12px;
}

.amo-tabs button.active,
.amo-stage-buttons button.active {
  border-color: rgba(0, 200, 83, 0.58);
  background: rgba(0, 200, 83, 0.12);
  color: #9af4b6;
}

.amo-left-scroll {
  min-height: 0;
  overflow: auto;
  padding: 14px 24px 18px;
}

.amo-section,
.amo-contact-card {
  border-bottom: 1px solid rgba(111, 151, 179, 0.18);
  padding-bottom: 14px;
}

.amo-tab-panel {
  display: grid;
  gap: 10px;
}

.amo-contact-card,
.amo-stage-section {
  margin-top: 18px;
}

.amo-field {
  display: grid;
  grid-template-columns: minmax(96px, 0.88fr) minmax(110px, 1.12fr);
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border-bottom: 1px solid rgba(111, 151, 179, 0.14);
}

.amo-field span {
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amo-field strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-main);
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amo-phone-field strong {
  display: grid;
  justify-items: stretch;
  gap: 4px;
  overflow: visible;
  white-space: normal;
}

.amo-phone-field .phone-region-badge {
  font-size: 12px;
  line-height: 1.2;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  text-align: center;
}

.product-model-field strong {
  display: grid;
  gap: 5px;
  overflow: visible;
  white-space: normal;
}

.amo-model-select {
  width: 100%;
  min-height: 30px;
  border: 1px solid rgba(105, 149, 181, 0.45);
  border-radius: 5px;
  background: rgba(7, 28, 45, 0.78);
  color: var(--text-main);
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.product-model-field em {
  color: var(--text-secondary);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  text-align: right;
}

.product-addon-field {
  position: relative;
}

.product-addon-field strong {
  overflow: visible;
  white-space: normal;
}

.amo-multi-select-trigger {
  display: grid;
  width: 100%;
  gap: 2px;
  border: 1px solid rgba(105, 149, 181, 0.45);
  border-radius: 5px;
  background: rgba(7, 28, 45, 0.78);
  color: var(--text-main);
  padding: 7px 9px;
  text-align: left;
}

.amo-multi-select-trigger span {
  color: #ffffff;
  white-space: normal;
}

.amo-multi-select-trigger em {
  color: var(--text-secondary);
  font-size: 11px;
  font-style: normal;
}

.amo-multi-select-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 5px);
  right: 0;
  display: grid;
  width: min(410px, 88vw);
  max-height: 360px;
  border: 1px solid rgba(77, 160, 255, 0.55);
  border-radius: 6px;
  background: #102f45;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.amo-multi-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid rgba(111, 151, 179, 0.24);
  padding: 9px 10px;
}

.amo-multi-search svg {
  width: 16px;
  height: 16px;
  color: #9ec9e9;
}

.amo-multi-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-main);
  font: inherit;
}

.amo-multi-options {
  overflow: auto;
  max-height: 275px;
}

.amo-multi-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--text-main);
  cursor: pointer;
}

.amo-multi-option:hover {
  background: rgba(77, 160, 255, 0.12);
}

.amo-multi-option input,
.compact-check input {
  width: 18px;
  height: 18px;
  accent-color: #4da0ff;
}

.amo-multi-option span {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: normal;
}

.amo-multi-option.muted {
  border-bottom: 1px solid rgba(111, 151, 179, 0.18);
  color: var(--text-secondary);
}

.amo-tab-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  min-height: 46px;
  border: 1px solid rgba(111, 151, 179, 0.18);
  border-radius: 6px;
  background: rgba(9, 32, 49, 0.52);
  padding: 8px 10px;
}

.amo-tab-row strong,
.amo-tab-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amo-tab-row strong {
  color: var(--text-main);
}

.amo-tab-row span {
  grid-column: 1;
  color: var(--text-secondary);
  font-size: 12px;
}

.amo-inline-action {
  grid-row: 1 / span 2;
  grid-column: 2;
  min-height: 28px;
  border: 1px solid rgba(47, 140, 255, 0.42);
  border-radius: 5px;
  background: rgba(47, 140, 255, 0.1);
  color: var(--text-main);
  padding: 0 10px;
  font-weight: 800;
}

.amo-template-button {
  width: 100%;
  border: 1px solid rgba(111, 151, 179, 0.26);
  border-radius: 6px;
  background: rgba(9, 32, 49, 0.58);
  color: var(--text-main);
  padding: 10px 12px;
  text-align: left;
  line-height: 1.35;
}

.amo-template-button span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
}

.amo-template-button strong {
  display: block;
  color: var(--text-main);
  font-weight: 800;
  white-space: normal;
}

.amo-template-button:hover {
  border-color: rgba(47, 140, 255, 0.5);
  background: rgba(47, 140, 255, 0.1);
}

.quick-reply-list {
  display: grid;
  gap: 8px;
}

.quick-reply-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
}

.quick-reply-delete {
  width: 34px;
  border: 1px solid rgba(255, 109, 127, 0.34);
  border-radius: 6px;
  background: rgba(255, 109, 127, 0.08);
  color: #ff7b8b;
  font-weight: 900;
}

.quick-reply-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.amo-add-field.danger {
  color: #ff6d7f;
}

.amo-section-title.small {
  margin-top: 12px;
  font-size: 12px;
}

.amo-editable-field strong {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow: visible;
}

.amo-edit-value {
  min-width: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--text-main);
  padding: 0;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amo-edit-combo {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.amo-mini-edit,
.amo-remove-field {
  flex: 0 0 auto;
  border: 1px solid rgba(105, 149, 181, 0.36);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 800;
}

.amo-remove-field {
  width: 24px;
  padding: 2px 0;
}

.amo-add-field {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-bottom: 1px solid rgba(111, 151, 179, 0.14);
  background: transparent;
  color: #4da6ff;
  text-align: left;
}

.empty-value {
  color: var(--text-muted);
}

.amo-phone-field.amo-editable-field strong {
  position: relative;
  display: grid;
  justify-items: stretch;
  gap: 5px;
  overflow: visible;
  white-space: normal;
}

.amo-phone-stack {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 0;
}

.amo-phone-field .amo-edit-combo {
  display: flex;
  width: 100%;
  justify-content: flex-end;
  min-width: 0;
}

.amo-phone-field .phone-line {
  min-width: 0;
  max-width: 100%;
}

.amo-phone-field .phone-link {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
}

.amo-phone-field .phone-menu {
  right: 0;
  left: auto;
}

.amo-contact-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.amo-contact-head strong {
  display: block;
  overflow: hidden;
  color: var(--text-main);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amo-contact-head span:last-child {
  color: var(--text-secondary);
  font-size: 12px;
}

.amo-add-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 50px;
  border-bottom: 1px solid rgba(111, 151, 179, 0.18);
  color: var(--text-secondary);
  text-align: left;
}

.amo-add-row:hover,
.amo-widget-link:hover,
.amo-widget-row:hover {
  color: var(--text-main);
}

.amo-section-title {
  margin-bottom: 10px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.amo-stage-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.amo-stage-history {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.amo-stage-history-row {
  border: 1px solid rgba(105, 149, 181, 0.28);
  border-radius: 4px;
  background: rgba(7, 19, 31, 0.24);
  padding: 8px 10px;
}

.amo-stage-history-row strong,
.amo-stage-history-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amo-stage-history-row strong {
  color: var(--text-main);
  font-size: 12px;
}

.amo-stage-history-row span,
.stage-history-empty {
  color: var(--text-secondary);
  font-size: 11px;
}

.amo-deal-tasks {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.amo-deal-task {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(105, 149, 181, 0.28);
  border-radius: 4px;
  background: rgba(7, 19, 31, 0.24);
  padding: 8px 10px;
}

.amo-deal-task.overdue {
  border-color: rgba(255, 77, 109, 0.35);
}

.amo-deal-task strong,
.amo-deal-task span,
.amo-deal-task em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amo-deal-task strong {
  color: var(--text-main);
  font-size: 12px;
}

.amo-deal-task span,
.amo-deal-task em {
  color: var(--text-secondary);
  font-size: 11px;
  font-style: normal;
}

.amo-bottom-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  border-top: 1px solid var(--border);
  background: #061420;
}

.amo-bottom-actions button {
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 800;
}

.amo-accept {
  color: #65ec83 !important;
}

.amo-decline {
  border-left: 1px solid var(--border) !important;
  color: #ff6d7f !important;
}

.amo-center {
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr) auto;
  background: #092031;
}

.amo-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.amo-search svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.amo-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-main);
  outline: 0;
}

.amo-feed {
  position: relative;
  min-height: 0;
  overflow: auto;
  padding: 22px 48px;
}

.amo-date-separator {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin: -8px 0 14px;
}

.amo-date-separator span {
  border: 1px solid rgba(105, 149, 181, 0.45);
  border-radius: 999px;
  background: #12344b;
  color: var(--text-secondary);
  padding: 2px 14px;
  font-size: 12px;
}

.amo-timeline {
  display: grid;
  gap: 9px;
  max-width: 740px;
  margin: 0 auto;
}

.deal-feed-task {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid rgba(93, 127, 153, 0.55);
  border-radius: 6px;
  background: rgba(18, 52, 75, 0.7);
  padding: 12px;
}

.deal-feed-task.overdue {
  border-color: rgba(255, 77, 109, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.15);
}

.deal-feed-task.completed {
  border-color: rgba(0, 200, 83, 0.55);
}

.deal-feed-task-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(122, 201, 67, 0.9);
  border-radius: 999px;
  color: #7ac943;
}

.deal-feed-task.overdue .deal-feed-task-icon {
  border-color: rgba(255, 77, 109, 0.95);
  color: var(--danger);
}

.deal-feed-task.completed .deal-feed-task-icon {
  border-color: rgba(0, 200, 83, 0.95);
  color: var(--success);
}

.deal-feed-task-icon svg {
  width: 17px;
  height: 17px;
}

.deal-feed-task-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.deal-feed-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 12px;
}

.deal-feed-task.overdue .deal-feed-task-meta span {
  color: #ff6d9a;
  font-weight: 800;
}

.deal-feed-task-meta em {
  font-style: normal;
}

.deal-feed-task-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--text-main);
}

.deal-feed-task-title i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.deal-feed-task-title strong {
  color: #f6fbff;
}

.deal-feed-task.completed .deal-feed-task-title {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(255, 255, 255, 0.6);
}

.deal-feed-task-result {
  color: #f6fbff;
  font-weight: 800;
  line-height: 1.45;
}

.deal-feed-task-complete {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 8px;
}

.deal-feed-task-complete .btn {
  min-height: 38px;
}

.amo-event {
  border: 1px solid rgba(93, 127, 153, 0.45);
  border-radius: 8px;
  background: rgba(18, 52, 75, 0.7);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
  padding: 11px 12px;
}

.amo-event.loss {
  border-color: rgba(255, 77, 109, 0.45);
  background: rgba(255, 77, 109, 0.08);
}

.amo-event.manager-action {
  border-color: rgba(47, 140, 255, 0.34);
  background: rgba(47, 140, 255, 0.08);
}

.amo-event-title {
  color: #93abc0;
  font-weight: 800;
}

.amo-event-body {
  margin-top: 3px;
}

.amo-event-meta {
  margin-top: 3px;
  color: var(--text-muted);
}

.amo-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--text-muted);
}

.amo-composer {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
  background: #092031;
}

.amo-ai-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-left: 1px solid var(--border);
  background: #0d2a3d;
}

.amo-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
}

.amo-ai-head div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.amo-ai-head strong {
  color: var(--text-main);
  font-size: 14px;
}

.amo-ai-head span {
  color: var(--text-secondary);
  font-size: 12px;
}

.amo-ai-body {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.amo-ai-source,
.amo-ai-suggestion,
.amo-ai-attachments,
.amo-ai-decision,
.amo-ai-empty,
.amo-ai-loading,
.amo-ai-error {
  border: 1px solid rgba(105, 149, 181, 0.35);
  border-radius: 8px;
  background: rgba(9, 32, 49, 0.62);
  padding: 10px;
}

.amo-ai-source span,
.amo-ai-decision span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
}

.amo-ai-source p,
.amo-ai-suggestion p {
  margin: 0;
  color: #dceeff;
  font-size: 13px;
  line-height: 1.45;
}

.ai-request-button {
  width: 100%;
}

.amo-ai-suggestions {
  display: grid;
  gap: 8px;
}

.amo-ai-suggestion div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.amo-ai-suggestion .btn {
  min-height: 32px;
  padding: 0 10px;
}

.amo-ai-attachments {
  display: grid;
  gap: 8px;
}

.amo-ai-attachments strong,
.amo-ai-decision strong {
  color: var(--text-main);
}

.amo-ai-attachments a {
  display: grid;
  gap: 2px;
  border-top: 1px solid rgba(105, 149, 181, 0.22);
  color: var(--accent);
  padding-top: 8px;
  text-decoration: none;
}

.amo-ai-attachments em,
.amo-ai-empty,
.amo-ai-loading {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.amo-ai-error {
  border-color: rgba(255, 77, 109, 0.62);
  color: #ff8ea0;
  font-size: 12px;
}

.amo-task-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 196, 0, 0.35);
  border-radius: 4px;
  background: #fff2b3;
  color: #5a4b00;
  padding: 4px 12px;
  font-size: 12px;
}

.amo-task-hint button {
  border: 0;
  background: transparent;
  color: #386b9f;
  padding: 0;
  text-decoration: underline;
}

.messenger-compose-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 8px;
  border: 1px solid rgba(47, 140, 255, 0.46);
  border-radius: 4px;
  background: rgba(47, 140, 255, 0.12);
  padding: 8px 10px;
}

.messenger-compose-badge div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.messenger-compose-badge strong {
  color: #cfe7ff;
  font-size: 13px;
}

.messenger-compose-badge span {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messenger-compose-badge button {
  display: grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(105, 149, 181, 0.45);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-weight: 900;
}

.messenger-compose-badge button:hover {
  border-color: rgba(255, 109, 127, 0.55);
  color: #ff9ba7;
}

.amo-chat-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-top: -8px;
  border: 1px solid rgba(105, 149, 181, 0.45);
  border-radius: 4px;
  padding: 10px 12px;
}

.amo-chat-input span {
  color: #4da6ff;
  font-size: 13px;
  white-space: nowrap;
}

.amo-chat-input textarea {
  min-height: 44px;
  border: 0;
  resize: vertical;
  background: transparent;
  color: var(--text-main);
  outline: 0;
}

.amo-chat-input > strong,
.chat-account-select {
  grid-column: 2;
  justify-self: end;
}

.amo-chat-input > strong {
  color: var(--accent-green);
  white-space: nowrap;
}

.chat-account-select {
  max-width: 260px;
  border: 1px solid rgba(77, 140, 190, 0.45);
  border-radius: 5px;
  background: rgba(4, 20, 31, 0.68);
  color: var(--accent-green);
  font: inherit;
  font-weight: 800;
  padding: 5px 8px;
  outline: none;
}

.chat-account-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(47, 140, 255, 0.18);
}

.amo-chat-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.amo-chat-actions span {
  margin-right: auto;
  color: var(--text-secondary);
  font-size: 12px;
}

.note-type-select {
  width: auto;
  min-width: 136px;
  min-height: 38px;
  border-radius: 4px;
  padding: 0 9px;
}

.amo-widgets {
  border-left: 1px solid var(--border);
  background: #12344b;
  padding: 20px 20px 0;
}

.amo-widgets-title {
  color: var(--text-main);
  font-size: 20px;
  font-weight: 900;
}

.amo-widget-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  margin-top: 16px;
  border-bottom: 1px solid rgba(111, 151, 179, 0.18);
  text-align: left;
}

.amo-widget-row strong {
  overflow: hidden;
  color: var(--text-main);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amo-whatsapp {
  color: #22c55e;
}

.amo-widget-link {
  margin-top: 12px;
  color: #1e9bff;
  padding: 0;
}

.amo-widget-micro {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(111, 151, 179, 0.18);
  padding: 14px 0;
}

.amo-widget-micro span {
  color: var(--text-secondary);
}

.amo-widget-micro strong {
  color: var(--text-main);
}

.split-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}

.split-line span:first-child {
  color: var(--text-secondary);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: none;
  max-width: 360px;
  border: 1px solid rgba(47, 140, 255, 0.45);
  border-radius: 8px;
  background: #102d42;
  box-shadow: var(--shadow);
  color: var(--text-main);
  padding: 12px 14px;
}

.toast.show {
  display: block;
}

.auth-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(13, 38, 56, 0.78), rgba(6, 24, 38, 0.98)),
    var(--bg-main);
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 42, 61, 0.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-brand {
  height: 76px;
}

.login-brand .brand-copy {
  display: block;
}

.login-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.login-form h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.login-form p,
.login-note {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.field span {
  color: var(--text-secondary);
  font-size: 12px;
}

.empty {
  display: grid;
  min-height: 140px;
  place-items: center;
  color: var(--text-muted);
  text-align: center;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

@media (max-width: 1180px) {
  .grid.metrics,
  .grid.three,
  .inbox-grid,
  .integration-grid,
  .integration-entry-grid,
  .social-account-layout,
  .social-setup-grid,
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .widget-small,
  .widget-wide,
  .widget-large {
    grid-column: span 1;
  }

  .message-layout,
  .amo-card {
    grid-template-columns: minmax(280px, var(--deal-info-width, 320px)) 8px minmax(0, 1fr);
  }

  .entity-panel,
  .amo-widgets,
  .amo-ai-panel,
  .deal-detail .detail-col:last-child {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .app-shell,
  .app-shell.expanded {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 15;
    min-height: auto;
    border-right: 0;
  }

  .brand {
    height: 58px;
  }

  .brand-copy,
  .expanded .brand-copy {
    display: block;
  }

  .nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
  }

  .nav-item {
    grid-template-columns: none;
    grid-template-rows: 26px auto;
    width: auto;
    min-width: 58px;
  }

  .nav-label,
  .expanded .nav-label {
    display: block;
  }

  .nav-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    display: inline-flex;
  }

  .workspace {
    grid-template-rows: auto 1fr;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: stretch;
  }

  .social-setup-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .search {
    max-width: none;
  }

  .grid.metrics,
  .grid.two,
  .grid.three,
  .inbox-grid,
  .integration-grid,
  .social-account-layout,
  .social-account-list,
  .integration-entry-grid,
  .social-channel-ribbon,
  .social-setup-grid,
  .catalog-grid,
  .dashboard-widget-grid,
  .delivery-grid,
  .delivery-result-list,
  .message-layout,
  .amo-card,
  .deal-detail,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-amo {
    padding: 16px 10px 28px;
  }

  .dashboard-head h2 {
    font-size: 26px;
  }

  .dashboard-pipeline {
    grid-template-columns: 1fr;
  }

  .dashboard-controls {
    justify-content: stretch;
  }

  .dashboard-controls button,
  .dashboard-manager-select {
    flex: 1 1 135px;
  }

  .deal-task-info-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deal-task-info-bar div:last-child {
    justify-items: start;
  }

  .deal-feed-task-complete {
    grid-template-columns: 1fr;
  }

  .widget-small,
  .widget-wide,
  .widget-large {
    grid-column: span 1;
  }

  .widget-config-grid,
  .widget-modal header {
    grid-template-columns: 1fr;
  }

  .metric-value {
    font-size: 36px;
  }

  .view {
    padding: 12px;
  }

  .modal-panel {
    width: 100vw;
  }

  .side-panel {
    inset: 0;
  }

  .amo-card {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .amo-resizer {
    display: none;
  }

  .amo-left {
    min-height: 680px;
  }

  .amo-center {
    min-height: 680px;
  }

  .amo-feed {
    padding: 18px 16px;
  }

  .amo-chat-input {
    grid-template-columns: 1fr;
  }

  .amo-chat-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .amo-widgets {
    display: block;
    border-top: 1px solid var(--border);
    border-left: 0;
    padding-bottom: 24px;
  }

  .detail-col {
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }
}

/* CRM assistant, catalog and automation studio */
.amo-card {
  grid-template-columns: minmax(280px, var(--deal-info-width, 360px)) 8px minmax(430px, 1fr) minmax(300px, 360px);
}

.imbox-workspace {
  grid-template-columns: minmax(300px, 390px) minmax(520px, 1fr) minmax(300px, 360px);
}

.amo-title-actions,
.imbox-thread-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.danger-icon {
  color: #ff8ea0;
}

.danger-icon:hover {
  background: rgba(255, 77, 109, 0.16);
  color: #ffd7df;
}

.ai-panel-tabs {
  justify-content: stretch;
  padding: 8px;
}

.ai-panel-tabs button {
  flex: 1;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 800;
  cursor: pointer;
}

.ai-panel-tabs button.active {
  border-color: rgba(77, 160, 255, 0.45);
  background: rgba(47, 140, 255, 0.18);
  color: #fff;
}

.catalog-media-toolbar {
  display: grid;
  gap: 6px;
}

.catalog-media-toolbar span {
  color: var(--text-secondary);
  font-size: 12px;
}

.catalog-media-grid {
  display: grid;
  gap: 10px;
}

.catalog-media-card {
  display: grid;
  gap: 8px;
  overflow: hidden;
  border: 1px solid rgba(105, 149, 181, 0.35);
  border-radius: 10px;
  background: rgba(9, 32, 49, 0.72);
  padding: 8px;
}

.catalog-media-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 7px;
  object-fit: cover;
  background: #061826;
}

.catalog-media-card div {
  display: grid;
  gap: 2px;
}

.catalog-media-card strong {
  color: var(--text-main);
  font-size: 13px;
}

.catalog-media-card span {
  color: var(--text-secondary);
  font-size: 11px;
}

.automation-studio {
  display: grid;
  gap: 16px;
  padding-bottom: 18px;
  background: transparent;
}

.automation-studio-head {
  align-items: flex-start;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(47, 140, 255, 0.16), rgba(0, 214, 163, 0.08));
  padding: 18px;
}

.automation-studio-head p {
  max-width: 720px;
  margin: 5px 0 0;
  color: var(--text-secondary);
}

.automation-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.automation-preset-card,
.automation-rule-builder,
.automation-rule-card {
  border: 1px solid rgba(105, 149, 181, 0.35);
  border-radius: 12px;
  background: #0d2a3d;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.automation-preset-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
}

.automation-preset-card header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.automation-preset-card header > div:not(.automation-preset-icon) {
  display: grid;
  gap: 3px;
}

.automation-preset-card header span,
.automation-preset-foot span {
  color: var(--text-secondary);
  font-size: 12px;
}

.automation-preset-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: rgba(47, 140, 255, 0.22);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.avito-preset .automation-preset-icon {
  background: rgba(0, 214, 163, 0.18);
  color: #8fffe0;
}

.automation-switch input {
  display: none;
}

.automation-switch i {
  display: block;
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #27475c;
  cursor: pointer;
}

.automation-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #a8bfd0;
  transition: .18s ease;
}

.automation-switch input:checked + i {
  background: #1687ff;
}

.automation-switch input:checked + i::after {
  left: 23px;
  background: #fff;
}

.automation-preset-route,
.automation-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.automation-preset-route {
  border: 1px dashed rgba(105, 149, 181, 0.35);
  border-radius: 9px;
  padding: 10px;
  color: var(--text-secondary);
}

.automation-preset-route .field-input {
  width: 78px;
}

.automation-preset-card textarea {
  min-height: 150px;
  margin-top: 7px;
  resize: vertical;
}

.automation-preset-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.automation-rule-builder {
  padding: 16px;
}

.automation-rule-builder > header {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
}

.automation-rule-builder > header span {
  color: var(--text-secondary);
  font-size: 12px;
}

.automation-flow {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: stretch;
  gap: 10px;
}

.automation-node {
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid rgba(105, 149, 181, 0.35);
  border-radius: 10px;
  background: rgba(9, 32, 49, 0.62);
  padding: 12px;
}

.automation-node > span {
  color: #78b9ff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.automation-node.wide {
  grid-column: 1 / span 3;
}

.automation-arrow {
  display: grid;
  place-items: center;
  color: #78b9ff;
  font-size: 22px;
}

.automation-create-button {
  align-self: end;
  min-height: 44px;
}

.automation-rule-list {
  display: grid;
  gap: 10px;
}

.automation-rule-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) minmax(230px, 320px);
  gap: 14px;
  padding: 14px;
}

.automation-rule-status,
.automation-rule-main,
.automation-rule-side {
  display: grid;
  align-content: start;
  gap: 9px;
}

.automation-rule-status i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #526c7e;
}

.automation-rule-status i.on {
  background: #00d6a3;
  box-shadow: 0 0 0 5px rgba(0, 214, 163, 0.12);
}

.automation-rule-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

@media (max-width: 1320px) {
  .imbox-workspace {
    grid-template-columns: minmax(300px, 360px) minmax(480px, 1fr) minmax(280px, 320px);
  }
  .automation-presets {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .amo-card,
  .imbox-workspace {
    grid-template-columns: minmax(280px, var(--deal-info-width, 320px)) 8px minmax(0, 1fr);
  }
  .imbox-workspace {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  }
  .amo-ai-panel {
    display: none;
  }
  .automation-flow,
  .automation-rule-card {
    grid-template-columns: 1fr;
  }
  .automation-arrow {
    transform: rotate(90deg);
  }
  .automation-node.wide {
    grid-column: auto;
  }
}

/* Codex integration administration */
.codex-admin-view {
  gap: 18px;
  padding-bottom: 48px;
}
.codex-admin-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(17, 24, 39, .98), rgba(35, 45, 62, .94));
  color: #fff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, .12);
}
.codex-back {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.72);
  padding: 0;
  margin-bottom: 16px;
  cursor: pointer;
  font: inherit;
}
.codex-admin-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.codex-logo,
.codex-mini-brand span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: #fff;
  color: #111827;
  font-weight: 850;
  letter-spacing: -.04em;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.08);
}
.codex-admin-title-row h2 {
  margin: 0 0 5px;
  font-size: 28px;
  line-height: 1.08;
}
.codex-admin-title-row p {
  max-width: 700px;
  margin: 0;
  color: rgba(255,255,255,.72);
  line-height: 1.48;
}
.codex-hero-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.codex-hero-status .btn.ghost {
  color: #fff;
  border-color: rgba(255,255,255,.26);
  background: rgba(255,255,255,.08);
}
.codex-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 14px;
  background: var(--surface, #fff);
}
.codex-tabs button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  padding: 10px 15px;
  background: transparent;
  color: var(--muted, #687386);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}
.codex-tabs button:hover,
.codex-tabs button.active {
  background: #111827;
  color: #fff;
}
.codex-admin-content,
.codex-section-stack {
  display: grid;
  gap: 18px;
}
.codex-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid #f2d28d;
  background: #fff9e8;
  color: #76500a;
}
.codex-alert.error {
  border-color: #f3b8b8;
  background: #fff3f3;
  color: #8b2424;
}
.codex-alert.warning {
  margin-top: 12px;
}
.codex-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.codex-stat-card {
  display: grid;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 15px;
  background: var(--surface, #fff);
}
.codex-stat-card span,
.codex-stat-card em,
.codex-connection-summary span,
.codex-connection-summary em {
  color: var(--muted, #687386);
  font-style: normal;
  font-size: 12px;
}
.codex-stat-card strong {
  font-size: 24px;
  letter-spacing: -.03em;
}
.codex-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.codex-form-grid .field,
.codex-auth-body .field,
.codex-playground-grid .field,
.codex-instruction-field {
  display: grid;
  gap: 7px;
}
.codex-form-grid .field > span,
.codex-auth-body .field > span,
.codex-playground-grid .field > span,
.codex-instruction-field > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #687386);
}
.codex-playground-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.codex-playground-grid .wide,
.codex-test-placeholder,
.codex-test-result {
  grid-column: 1 / -1;
}
.codex-textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.52;
}
.codex-test-placeholder {
  padding: 24px;
  border: 1px dashed var(--border, #d9e0e9);
  border-radius: 12px;
  text-align: center;
  color: var(--muted, #687386);
  background: rgba(247,249,252,.7);
}
.codex-test-result {
  padding: 18px;
  border: 1px solid #bae0c5;
  border-radius: 14px;
  background: #f5fff8;
}
.codex-test-result-head,
.codex-current-file,
.codex-connection-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.codex-test-message {
  margin-top: 14px;
  white-space: pre-wrap;
  line-height: 1.58;
}
.codex-connection-summary {
  padding: 19px 22px;
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 15px;
  background: var(--surface, #fff);
}
.codex-connection-summary > div:first-child {
  display: grid;
  gap: 5px;
}
.codex-connection-summary strong {
  font-size: 20px;
}
.codex-auth-grid {
  align-items: stretch;
}
.codex-auth-grid .panel {
  min-height: 100%;
}
.codex-auth-body {
  display: grid;
  align-content: start;
  gap: 14px;
}
.codex-device-box {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 18px;
  border: 1px solid #c7d8f5;
  border-radius: 14px;
  background: #f4f8ff;
}
.codex-device-box > span,
.codex-device-box > em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}
.codex-device-box > strong {
  font-size: 30px;
  letter-spacing: .08em;
}
.codex-device-box pre {
  width: 100%;
  max-height: 170px;
  overflow: auto;
  margin: 0;
  padding: 11px;
  border-radius: 10px;
  background: #172033;
  color: #dbeafe;
  white-space: pre-wrap;
  font-size: 11px;
}
.codex-server-details {
  display: grid;
  gap: 3px;
}
.codex-security-note {
  margin-top: 12px;
  padding: 13px 15px;
  border-radius: 11px;
  background: #f5f7fa;
  color: var(--muted, #687386);
  line-height: 1.45;
}
.codex-instruction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.codex-instruction-field em {
  color: var(--muted, #687386);
  font-size: 11px;
  font-style: normal;
}
.codex-version-list,
.codex-knowledge-list {
  display: grid;
  gap: 9px;
}
.codex-version-card,
.codex-knowledge-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 12px;
  background: var(--surface, #fff);
}
.codex-version-card.active {
  border-color: #9bd0aa;
  background: #f4fff7;
}
.codex-version-card > div:first-child,
.codex-knowledge-main {
  display: grid;
  min-width: 0;
  gap: 3px;
  flex: 1;
}
.codex-version-card span,
.codex-version-card em,
.codex-knowledge-main span,
.codex-knowledge-main em {
  color: var(--muted, #687386);
  font-size: 11px;
  font-style: normal;
}
.codex-current-file {
  padding: 13px 16px;
  border-radius: 11px;
  background: #f5f7fa;
  color: var(--muted, #687386);
  font-size: 12px;
}
.codex-knowledge-add-grid {
  align-items: stretch;
}
.codex-knowledge-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: #eef2f7;
  color: #374151;
  font-size: 11px;
  font-weight: 800;
}
.codex-knowledge-card.disabled {
  opacity: .58;
  background: #f7f8fa;
}
.codex-knowledge-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.codex-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.codex-check-card,
.codex-number-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 12px;
  background: var(--surface, #fff);
  cursor: pointer;
}
.codex-check-card:has(input:checked) {
  border-color: #9bc9aa;
  background: #f5fff8;
}
.codex-check-card input {
  width: 18px;
  height: 18px;
  accent-color: #18864b;
}
.codex-check-card span,
.codex-number-card span {
  display: grid;
  gap: 3px;
  flex: 1;
}
.codex-check-card em,
.codex-number-card em {
  color: var(--muted, #687386);
  font-size: 11px;
  font-style: normal;
}
.codex-number-card input {
  width: 82px;
  padding: 8px;
  border: 1px solid var(--border, #d9e0e9);
  border-radius: 9px;
}
.codex-log-table code {
  display: block;
  max-width: 560px;
  overflow: hidden;
  color: #536071;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.codex-mini-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.codex-mini-brand span {
  width: 34px;
  height: 34px;
  border: 1px solid #dce2ea;
  border-radius: 10px;
  font-size: 12px;
}
.codex-mini-brand em {
  color: var(--muted, #687386);
  font-style: normal;
  font-weight: 700;
}
.codex-open-button {
  width: 100%;
  justify-content: center;
  margin-top: 15px;
}
@media (max-width: 1180px) {
  .codex-stat-grid,
  .codex-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .codex-admin-hero,
  .codex-connection-summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .codex-admin-title-row {
    align-items: flex-start;
  }
  .codex-admin-title-row h2 {
    font-size: 23px;
  }
  .codex-stat-grid,
  .codex-form-grid,
  .codex-playground-grid,
  .codex-instruction-grid,
  .codex-permission-grid {
    grid-template-columns: 1fr;
  }
  .codex-test-placeholder,
  .codex-test-result,
  .codex-playground-grid .wide {
    grid-column: auto;
  }
  .codex-version-card,
  .codex-knowledge-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .codex-knowledge-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
.codex-knowledge-scopes {
  display: flex;
  gap: 5px;
  margin-top: 5px;
}
.codex-knowledge-scopes .table-button.active {
  border-color: #9bc9aa;
  background: #edf9f1;
  color: #176a39;
}

/* AI Studio */
.ai-studio-view {
  display: grid;
  align-content: start;
  gap: 14px;
}
.ai-studio-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(76, 152, 255, 0.34);
  border-radius: 14px;
  background:
    radial-gradient(circle at 88% 20%, rgba(139, 108, 255, 0.24), transparent 34%),
    linear-gradient(135deg, rgba(20, 55, 80, 0.96), rgba(10, 31, 48, 0.96));
  box-shadow: var(--shadow);
}
.ai-studio-hero h2 {
  margin: 5px 0 8px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1;
}
.ai-studio-hero p,
.ai-studio-history-head p {
  max-width: 720px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
}
.ai-studio-eyebrow {
  color: #86bfff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.ai-studio-hero-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.ai-studio-hero-stats > span {
  display: grid;
  min-width: 96px;
  padding: 10px 13px;
  border: 1px solid rgba(159, 180, 199, 0.18);
  border-radius: 10px;
  background: rgba(6, 24, 38, 0.48);
  color: var(--text-secondary);
  font-size: 11px;
  text-align: center;
}
.ai-studio-hero-stats strong {
  color: var(--text-main);
  font-size: 20px;
}
.ai-studio-tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10, 31, 48, 0.8);
}
.ai-studio-tabs button {
  min-width: 112px;
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 800;
}
.ai-studio-tabs button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 22px rgba(47, 140, 255, 0.28);
}
.ai-studio-workbench {
  display: grid;
  grid-template-columns: minmax(430px, 0.96fr) minmax(420px, 1.04fr);
  gap: 14px;
  align-items: start;
}
.ai-studio-editor,
.ai-studio-result-panel {
  border-radius: 12px;
}
.ai-studio-form {
  display: grid;
  gap: 14px;
}
.ai-studio-three-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.field-textarea.ai-studio-prompt {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 13px;
  line-height: 1.55;
}
.field-textarea.ai-studio-prompt:focus,
.ai-studio-form .field-input:focus,
.ai-studio-form .field-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 140, 255, 0.12);
}
.ai-studio-form .field-help {
  color: var(--text-muted);
  font-size: 11px;
}
.ai-studio-style-grid {
  gap: 10px;
}

.hidden-file-input {
  display: none;
}
.ai-studio-upload-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ai-studio-reference-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.ai-studio-reference-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.ai-studio-reference-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(5, 20, 32, 0.48);
}
.ai-studio-reference-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #06131f;
}
.ai-studio-reference-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  color: var(--text-secondary);
  font-size: 11px;
}
.ai-studio-reference-card figcaption span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-studio-source-section {
  margin-top: 14px;
}
.ai-studio-source-section .section-caption {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}
.empty.soft {
  border: 1px dashed var(--border-soft);
  border-radius: 10px;
  padding: 14px;
  color: var(--text-muted);
  background: rgba(5, 20, 32, 0.28);
}
.ai-studio-options {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(6, 24, 38, 0.36);
}
.ai-studio-options .check-line {
  min-height: auto;
}
.ai-studio-options input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}
.ai-studio-generate {
  justify-content: center;
  min-height: 46px;
  font-weight: 900;
}
.ai-studio-result-panel {
  min-height: 510px;
}
.ai-studio-result-panel.featured {
  position: sticky;
  top: 0;
}
.ai-studio-result-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 500px;
  padding: 28px;
  color: var(--text-muted);
  text-align: center;
}
.ai-studio-result-empty > svg {
  width: 46px;
  height: 46px;
  color: #7eb7ff;
}
.ai-studio-result-empty strong {
  color: var(--text-main);
  font-size: 18px;
}
.ai-studio-result-empty span {
  max-width: 420px;
  line-height: 1.5;
}
.ai-studio-result-empty.error-state strong {
  color: #ffd7df;
}
.ai-studio-text-output {
  min-height: 330px;
  max-height: 610px;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(5, 20, 32, 0.52);
  color: #f0f7ff;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-studio-prompt-details {
  margin-top: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  color: var(--text-secondary);
}
.ai-studio-prompt-details summary {
  padding: 11px 13px;
  cursor: pointer;
  font-weight: 800;
}
.ai-studio-prompt-details > div {
  padding: 0 13px 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.ai-studio-result-panel .card-actions {
  margin-top: 13px;
  flex-wrap: wrap;
}
.ai-studio-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ai-studio-image-grid.single {
  grid-template-columns: 1fr;
}
.ai-studio-image-card {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(5, 20, 32, 0.5);
}
.ai-studio-image-card > a {
  display: block;
  aspect-ratio: 1 / 1;
  background: #06131f;
}
.ai-studio-image-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ai-studio-image-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
  color: var(--text-secondary);
  font-size: 11px;
}
.ai-studio-image-card figcaption span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-studio-image-card .btn.compact {
  min-height: 30px;
  padding: 0 8px;
  font-size: 11px;
}
.ai-studio-history {
  display: grid;
  gap: 14px;
}
.ai-studio-history-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.ai-studio-history-head h3 {
  margin: 0 0 5px;
  font-size: 20px;
}
.ai-studio-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.ai-studio-history-grid .ai-studio-result-panel {
  min-height: 0;
}
.ai-studio-history-grid .ai-studio-text-output {
  min-height: 160px;
  max-height: 300px;
}
@media (max-width: 1180px) {
  .ai-studio-workbench {
    grid-template-columns: 1fr;
  }
  .ai-studio-result-panel.featured {
    position: static;
  }
  .ai-studio-result-panel,
  .ai-studio-result-empty {
    min-height: 360px;
  }
}
@media (max-width: 820px) {
  .ai-studio-hero,
  .ai-studio-history-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .ai-studio-hero-stats {
    justify-content: flex-start;
  }
  .ai-studio-three-fields,
  .ai-studio-history-grid,
  .ai-studio-style-grid,
  .ai-studio-image-grid,
  .ai-studio-reference-grid {
    grid-template-columns: 1fr;
  }
  .ai-studio-tabs {
    width: 100%;
  }
  .ai-studio-tabs button {
    flex: 1;
    min-width: 0;
  }
}
@media (max-width: 520px) {
  .ai-studio-view {
    padding: 10px;
  }
  .ai-studio-hero {
    padding: 18px;
  }
  .ai-studio-hero-stats > span {
    min-width: 82px;
  }
  .ai-studio-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}
.codex-entry-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
}
.codex-entry-actions .codex-open-button {
  margin-top: 0;
}
@media (max-width: 620px) {
  .codex-entry-actions { grid-template-columns: 1fr; }
}

/* Карточка ответов LeadForms / AveryForms */

.form-answers-event {
  padding: 0;
  overflow: hidden;
  border-color: rgba(76, 150, 205, 0.52);
  background: rgba(10, 43, 65, 0.92);
}

.form-answers-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(93, 127, 153, 0.34);
}

.form-answers-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(105, 172, 220, 0.55);
  border-radius: 50%;
  color: #dbefff;
  font-size: 18px;
}

.form-answers-heading {
  min-width: 0;
}

.form-answers-source {
  color: #9eb7ca;
  font-size: 12px;
}

.form-answers-title {
  margin-top: 2px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

.form-answers-list {
  padding: 4px 15px;
}

.form-answer-row {
  padding: 11px 0;
  border-bottom: 1px solid rgba(93, 127, 153, 0.2);
}

.form-answer-row:last-child {
  border-bottom: 0;
}

.form-answer-question {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.form-answer-value {
  margin-top: 3px;
  color: #d9e8f2;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.form-answers-fallback {
  padding: 11px 0;
  color: #d9e8f2;
  white-space: pre-wrap;
}

.form-answers-extra {
  display: grid;
  gap: 8px;
  padding: 12px 15px;
  border-top: 1px solid rgba(93, 127, 153, 0.26);
  background: rgba(0, 0, 0, 0.08);
}

.form-answer-extra-row {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  gap: 10px;
  font-size: 12px;
}

.form-answer-extra-row strong {
  color: #9eb7ca;
}

.form-answer-extra-row span,
.form-answer-extra-row a {
  min-width: 0;
  color: #d9e8f2;
  overflow-wrap: anywhere;
}

.form-answer-extra-row a {
  text-decoration: underline;
}

.form-answers-footer {
  padding: 8px 15px;
  border-top: 1px solid rgba(93, 127, 153, 0.22);
  color: #8098aa;
  font-size: 11px;
}



/* Сворачивание ответов LeadForms / AveryForms */

details.form-answers-event {
  display: block;
}

.form-answers-event > .form-answers-header {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.form-answers-event > .form-answers-header::-webkit-details-marker {
  display: none;
}

.form-answers-event > .form-answers-header::after {
  content: "›";
  margin-left: auto;
  flex: 0 0 auto;
  color: #9eb7ca;
  font-size: 25px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.form-answers-event[open] > .form-answers-header::after {
  transform: rotate(90deg);
}

.form-answers-event > .form-answers-header:hover {
  background: rgba(255, 255, 255, 0.025);
}

