:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-alt: #eef3f7;
  --line: #d6dee6;
  --text: #17212b;
  --muted: #667789;
  --accent: #166a68;
  --accent-dark: #0f4e4c;
  --danger: #a33a32;
  --warning: #9a6812;
  --success: #24734b;
  --shadow: 0 12px 32px rgba(28, 43, 58, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.sidebar {
  background: #12202a;
  color: #eef6f7;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #dcefeb;
  color: #12202a;
  font-weight: 800;
}

.brand small,
.topbar p,
.empty-state p,
article p {
  color: var(--muted);
}

.brand small {
  color: #a8bdc7;
  display: block;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.secondary-action,
.primary-action,
.icon-button {
  border: 0;
  border-radius: 8px;
}

.nav-item {
  color: #d7e5e9;
  background: transparent;
  text-align: left;
  padding: 12px;
}

.nav-item.active {
  background: #263844;
  color: #ffffff;
}

.secondary-action,
.primary-action {
  padding: 10px 14px;
  font-weight: 650;
}

.secondary-action {
  background: #dfe7ed;
  color: #17212b;
}

.sidebar .secondary-action {
  margin-top: auto;
  background: #e9f4f2;
}

.primary-action {
  background: var(--accent);
  color: #ffffff;
}

.primary-action:hover {
  background: var(--accent-dark);
}

.app-shell {
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.stat strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.inbox-layout {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 16px;
  min-height: 620px;
}

.ticket-list-panel,
.ticket-detail-panel,
.settings-grid article,
.crm-column {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px;
}

.ticket-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  max-height: 690px;
  overflow: auto;
}

.ticket-card {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 8px;
}

.ticket-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 106, 104, 0.15);
}

.ticket-card header,
.ticket-meta,
.detail-header,
.detail-actions,
.opportunity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ticket-card strong {
  overflow-wrap: anywhere;
}

.ticket-meta {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: #344555;
  font-size: 12px;
  font-weight: 650;
}

.badge.ai_allowed {
  background: #ddefe5;
  color: var(--success);
}

.badge.ai_suggestion_only {
  background: #fff2d8;
  color: var(--warning);
}

.badge.human_required {
  background: #f8dfdd;
  color: var(--danger);
}

.ticket-detail-panel {
  min-width: 0;
  overflow: hidden;
}

.empty-state {
  min-height: 420px;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
}

.detail-content {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 620px;
}

.detail-header,
.detail-actions,
.reply-box {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-actions {
  align-items: end;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

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

.field span {
  color: var(--muted);
  font-size: 12px;
}

.messages {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  max-height: 420px;
}

.message {
  max-width: 76%;
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.35;
}

.message.inbound {
  background: var(--surface-alt);
  align-self: flex-start;
}

.message.outbound {
  background: #dcefeb;
  align-self: flex-end;
}

.message.internal {
  background: #fff2d8;
  align-self: center;
}

.message small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}

.reply-box {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  display: grid;
  gap: 10px;
}

.reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.crm-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.bot-builder {
  display: grid;
  gap: 14px;
}

.bot-toolbar,
.bot-inspector,
.bot-canvas {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.bot-toolbar {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.bot-toolbar p {
  color: var(--muted);
  margin-top: 4px;
}

.bot-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  min-height: 620px;
}

.bot-canvas {
  position: relative;
  min-height: 620px;
  overflow: auto;
  background:
    linear-gradient(#edf2f6 1px, transparent 1px),
    linear-gradient(90deg, #edf2f6 1px, transparent 1px),
    #fbfcfd;
  background-size: 24px 24px;
}

.bot-node {
  position: absolute;
  width: 230px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 8px;
  text-align: left;
  box-shadow: 0 10px 24px rgba(28, 43, 58, 0.09);
}

.bot-node.active {
  border-color: var(--accent);
  border-left-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(22, 106, 104, 0.16);
}

.bot-node.control {
  border-left-color: #455a73;
}

.bot-node.ai_agent {
  border-left-color: #7a5c17;
}

.bot-node.human_service {
  border-left-color: var(--danger);
}

.bot-node strong,
.bot-node span {
  overflow-wrap: anywhere;
}

.bot-edge {
  position: absolute;
  height: 2px;
  background: #9aabb9;
  transform-origin: left center;
}

.bot-inspector {
  padding: 16px;
  overflow: auto;
}

.inspector-section {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.inspector-section:last-child {
  border-bottom: 0;
}

.inspector-section h3 {
  margin: 0;
  font-size: 14px;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-column {
  min-height: 260px;
}

.crm-column h2 {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.opportunity-list {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.opportunity-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

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

.settings-grid article,
.channel-config,
.connection-form {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.channel-config {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  gap: 16px;
}

.section-title {
  display: grid;
  gap: 4px;
}

.section-title p {
  color: var(--muted);
}

.connection-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.connection-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.connection-form h3 {
  margin: 0;
  font-size: 15px;
}

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

.checkbox-field {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.checkbox-field input {
  width: auto;
}

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

.budgets-shell {
  display: grid;
  gap: 16px;
}

.budget-admin-grid,
.budget-lists-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.budget-list-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  gap: 12px;
  align-content: start;
}

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

.compact-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #ffffff;
}

.compact-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.compact-row span {
  color: var(--muted);
  font-size: 13px;
}

.budget-history-row .secondary-action {
  text-decoration: none;
  white-space: nowrap;
}

.connection-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.connection-card header,
.connection-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.connection-details {
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

dialog {
  border: 0;
  border-radius: 8px;
  width: min(520px, calc(100vw - 28px));
  box-shadow: 0 24px 70px rgba(18, 32, 42, 0.28);
}

dialog::backdrop {
  background: rgba(18, 32, 42, 0.46);
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-button {
  width: 36px;
  height: 36px;
  font-size: 24px;
  background: var(--surface-alt);
}

@media (max-width: 1080px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    flex-direction: row;
    align-items: center;
  }

  .nav {
    display: flex;
  }

  .sidebar .secondary-action {
    margin-left: auto;
    margin-top: 0;
  }

  .stats-grid,
  .settings-grid,
  .connection-layout,
  .budget-admin-grid,
  .budget-lists-grid,
  .crm-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .bot-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .sidebar,
  .topbar,
  .detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    overflow-x: auto;
  }

  .stats-grid,
  .settings-grid,
  .connection-layout,
  .budget-admin-grid,
  .budget-lists-grid,
  .crm-board,
  .detail-actions {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 92%;
  }
}

/* CRM reference polish: Helena/Datacrazy-inspired operational shell */
body {
  grid-template-columns: 1fr;
  grid-template-rows: 68px 1fr;
  background: #f7f8fb;
}

.sidebar {
  min-height: 68px;
  padding: 0 26px;
  flex-direction: row;
  align-items: center;
  gap: 28px;
  background: #ffffff;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(25, 39, 52, 0.04);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: #eef4ff;
  color: #315cf6;
}

.brand small {
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item {
  color: #344555;
  text-align: center;
  padding: 11px 14px;
  font-weight: 750;
}

.nav-item.active {
  background: #eef4ff;
  color: #315cf6;
}

.sidebar .secondary-action {
  margin-left: auto;
  margin-top: 0;
  background: #eef4ff;
  color: #315cf6;
}

.app-shell {
  padding: 22px 26px;
}

.inbox-layout {
  grid-template-columns: 360px minmax(0, 1fr) 330px;
  gap: 0;
  min-height: calc(100vh - 190px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.ticket-list-panel,
.ticket-detail-panel,
.lead-profile-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ticket-list-panel,
.ticket-detail-panel {
  border-right: 1px solid var(--line);
}

.panel-header small {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.ticket-list {
  max-height: calc(100vh - 250px);
  padding: 0;
  gap: 0;
}

.ticket-card {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 14px;
}

.ticket-card.active {
  background: #eef4ff;
  border-color: var(--line);
  box-shadow: inset 3px 0 0 #315cf6;
}

.detail-content {
  min-height: calc(100vh - 190px);
}

.detail-actions {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  background: #fbfcfd;
}

.messages {
  max-height: calc(100vh - 430px);
}

.message.outbound {
  background: #3b82f6;
  color: #ffffff;
}

.message.outbound small {
  color: rgba(255, 255, 255, 0.82);
}

.lead-profile-panel {
  display: grid;
  align-content: start;
  background: #ffffff;
}

.profile-header,
.profile-section {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.profile-header {
  display: grid;
  gap: 10px;
}

.profile-person {
  display: flex;
  gap: 10px;
  align-items: center;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #315cf6;
  font-weight: 800;
}

.profile-actions,
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-field {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
}

.profile-field span:first-child {
  color: var(--muted);
}

.profile-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.settings-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
}

.settings-menu {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 6px;
  align-content: start;
  box-shadow: var(--shadow);
}

.settings-menu strong {
  padding: 10px 10px 14px;
  font-size: 18px;
}

.settings-menu-item {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 650;
}

.settings-menu-item.active,
.settings-menu-item.active-soft {
  background: #eef4ff;
  color: #315cf6;
}

.settings-content {
  min-width: 0;
}

.bot-list-card,
.placeholder-page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.bot-list-card {
  overflow: hidden;
}

.bot-table {
  padding: 0 16px 16px;
}

.bot-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1fr 1.5fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.bot-table-head {
  color: var(--muted);
  font-weight: 800;
  background: #f4f7fb;
}

.placeholder-page {
  padding: 28px;
  display: grid;
  gap: 8px;
}

.connection-card {
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(28, 43, 58, 0.06);
}

.connection-card header {
  justify-content: flex-start;
}

.connection-card header::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  flex: 0 0 auto;
}

.bot-workspace,
.bot-canvas {
  min-height: 660px;
}

.bot-toolbar {
  box-shadow: var(--shadow);
}

@media (max-width: 1180px) {
  .inbox-layout {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .lead-profile-panel {
    display: none;
  }
}

@media (max-width: 900px) {
  .sidebar {
    overflow-x: auto;
  }

  .settings-shell {
    grid-template-columns: 1fr;
  }

  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .ticket-list-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .bot-table-row {
    grid-template-columns: 1fr;
  }
}

/* Inbox UIX closer to Helena/Datacrazy conversation consoles */
body[data-view="inbox"] .topbar,
body[data-view="inbox"] .stats-grid {
  display: none;
}

body[data-view="inbox"] .app-shell {
  padding: 0;
}

body[data-view="inbox"] .sidebar {
  display: none;
}

body[data-view="inbox"] {
  grid-template-rows: 1fr;
}

.inbox-product-shell {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 100vh;
  background: #f3f6fa;
}

.module-rail {
  background: #ffffff;
  border-right: 1px solid #dfe6ef;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 22px;
}

.rail-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #111827;
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0;
}

.rail-nav {
  display: grid;
  gap: 12px;
}

.rail-bottom {
  margin-top: auto;
}

.rail-item {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: transparent;
  color: #111827;
  font-size: 20px;
}

.rail-item.active {
  background: #eaf2ff;
  color: #2f6fed;
}

body[data-view="inbox"] .inbox-layout {
  grid-template-columns: 490px minmax(560px, 1fr) 370px;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.notification-strip {
  height: 42px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: #2454dc;
  color: #ffffff;
  font-weight: 800;
}

.notification-strip::before {
  content: "i";
  width: 23px;
  height: 23px;
  margin-right: 10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.inbox-tabs,
.search-row,
.status-row,
.queue-summary,
.queue-counters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #dfe6ef;
  background: #ffffff;
}

.inbox-tabs {
  height: 68px;
}

.tab-button,
.status-chip {
  border: 0;
  background: transparent;
  color: #65758b;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 750;
}

.tab-button.active {
  background: #d9e1ec;
  color: #17212b;
}

.status-chip.active {
  background: #5a46f0;
  color: #ffffff;
}

.tab-icon {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  margin-left: auto;
  background: transparent;
  color: #65758b;
  font-size: 22px;
}

.tab-icon + .tab-icon {
  margin-left: 0;
}

.search-row input {
  height: 42px;
  border: 0;
  background: #f5f7fa;
}

.status-row select {
  margin-left: auto;
  max-width: 176px;
  height: 38px;
  padding: 6px 10px;
}

.queue-summary {
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 0;
}

.queue-summary strong {
  font-size: 18px;
}

.queue-summary span {
  color: #65758b;
  font-size: 13px;
}

.queue-counters {
  padding-top: 0;
}

.queue-counters span {
  min-width: 58px;
  height: 34px;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #65758b;
  background: #ffffff;
  font-weight: 800;
}

body[data-view="inbox"] .ticket-list {
  max-height: calc(100vh - 338px);
  overflow: auto;
  background: #ffffff;
}

body[data-view="inbox"] .ticket-card {
  min-height: 92px;
  padding: 16px 18px;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  grid-template-areas:
    "avatar title time"
    "avatar preview badge";
  align-items: center;
  gap: 4px 12px;
}

body[data-view="inbox"] .ticket-card::before {
  content: attr(data-initials);
  grid-area: avatar;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e7f7ed;
  color: #159447;
  font-weight: 900;
}

body[data-view="inbox"] .ticket-card header {
  grid-area: title;
  min-width: 0;
}

body[data-view="inbox"] .ticket-card header strong {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-view="inbox"] .ticket-card header .badge {
  display: none;
}

body[data-view="inbox"] .ticket-card > span {
  grid-area: preview;
  color: #65758b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-view="inbox"] .ticket-meta {
  grid-area: time;
  align-self: start;
  justify-content: end;
}

body[data-view="inbox"] .ticket-meta span:nth-child(1),
body[data-view="inbox"] .ticket-meta span:nth-child(2) {
  display: none;
}

body[data-view="inbox"] .ticket-meta span:nth-child(3) {
  font-size: 12px;
  color: #65758b;
}

.quick-start-form {
  height: 88px;
  padding: 14px;
  display: grid;
  grid-template-columns: 116px 1fr 118px;
  gap: 10px;
  align-items: center;
  border-top: 1px solid #dfe6ef;
  background: #ffffff;
}

.quick-start-form select,
.quick-start-form input,
.quick-start-form button {
  height: 48px;
  border-radius: 10px;
}

.quick-start-form button {
  border: 1px solid #dfe6ef;
  background: #ffffff;
  color: #5a46f0;
  font-weight: 800;
}

body[data-view="inbox"] .detail-header {
  min-height: 66px;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  border-bottom: 1px solid #dfe6ef;
}

body[data-view="inbox"] .detail-header h2 {
  font-size: 18px;
}

body[data-view="inbox"] .detail-header p {
  color: #65758b;
}

body[data-view="inbox"] .detail-header::after {
  content: "Finalizar";
  border: 1px solid #2f6fed;
  color: #2f6fed;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 800;
}

body[data-view="inbox"] .detail-actions {
  display: none;
}

body[data-view="inbox"] .messages {
  max-height: calc(100vh - 142px);
  padding: 26px 24px;
  background: #ffffff;
}

body[data-view="inbox"] .message {
  font-size: 15px;
  border-radius: 8px;
  box-shadow: none;
}

body[data-view="inbox"] .message.inbound {
  background: #edf1f5;
}

body[data-view="inbox"] .message.outbound {
  background: #3b82f6;
  color: #ffffff;
}

body[data-view="inbox"] .reply-box {
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #ffffff;
}

body[data-view="inbox"] .reply-box textarea {
  min-height: 44px;
  height: 44px;
  border-radius: 999px;
  resize: none;
}

body[data-view="inbox"] .reply-actions {
  align-items: center;
}

body[data-view="inbox"] .reply-actions .secondary-action {
  display: none;
}

.inbox-empty {
  min-height: 100vh;
  color: #65758b;
}

.empty-bubble {
  width: 118px;
  height: 78px;
  border: 5px solid #65758b;
  border-radius: 50%;
  margin: 0 auto 24px;
  position: relative;
}

.empty-bubble::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -20px;
  width: 28px;
  height: 28px;
  border-left: 5px solid #65758b;
  border-bottom: 5px solid #65758b;
  transform: skew(-22deg);
}

body[data-view="inbox"] .lead-profile-panel {
  border-left: 1px solid #dfe6ef;
}

body[data-view="inbox"] .profile-header {
  padding: 12px 16px;
}

body[data-view="inbox"] .profile-actions .secondary-action {
  background: #eef4ff;
  color: #2f6fed;
  padding: 7px 10px;
}

body[data-view="inbox"] .profile-section {
  padding: 14px 16px;
}

body[data-view="inbox"] .profile-field {
  grid-template-columns: 116px 1fr;
}

@media (max-width: 1280px) {
  body[data-view="inbox"] .inbox-layout {
    grid-template-columns: 410px minmax(0, 1fr);
  }

  body[data-view="inbox"] .lead-profile-panel {
    display: none;
  }
}

@media (max-width: 860px) {
  .inbox-product-shell {
    grid-template-columns: 1fr;
  }

  .module-rail {
    display: none;
  }

  body[data-view="inbox"] .inbox-layout {
    grid-template-columns: 1fr;
  }
}
