:root {
  color-scheme: light;
  --brand-bar-height: 68px;
  --bg: #f5f7f6;
  --panel: #ffffff;
  --line: #d9e1dd;
  --text: #17211d;
  --muted: #62726a;
  --brand: #177245;
  --brand-dark: #0d5934;
  --accent: #0f766e;
  --danger: #a43b3b;
  --incoming: #ffffff;
  --outgoing: #dff5e7;
  --chat-bg: #efeae2;
  --chat-pattern: url("data:image/svg+xml,%3Csvg width='180' height='180' viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23a6b7ad' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' opacity='.28'%3E%3Cpath d='M25 30c8-9 22-5 24 7 2 14-12 22-24 13l-10 3 3-10c-4-5-3-10 7-13Z'/%3E%3Cpath d='M42 39h10M32 39h4M37 34v10'/%3E%3Cpath d='M118 19h28v23h-28zM124 47h16M151 26l8-6M151 34l9 4'/%3E%3Cpath d='M78 79c0-9 7-16 16-16s16 7 16 16-7 16-16 16-16-7-16-16Z'/%3E%3Cpath d='M86 78h16M94 70v16'/%3E%3Cpath d='M21 117h34v25H21zM25 121l13 10 13-10'/%3E%3Cpath d='M128 123c9 0 16 7 16 16v12h-32v-12c0-9 7-16 16-16ZM121 116c0-4 3-7 7-7s7 3 7 7-3 7-7 7-7-3-7-7Z'/%3E%3Cpath d='M73 145l18-16 18 16M83 146v15h20v-15'/%3E%3Cpath d='M151 80c0 8-7 15-15 15h-11l-10 8 3-10c-5-3-8-8-8-13 0-8 7-15 15-15h11c8 0 15 7 15 15Z'/%3E%3Cpath d='M35 73l10 7-10 7M50 87h12'/%3E%3Cpath d='M154 158l8 8M162 158l-8 8'/%3E%3C/g%3E%3C/svg%3E");
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}




/* Broadcast wizard and campaign actions */
.broadcast-wizard-panel > .broadcast-wizard-steps,
.broadcast-wizard-panel > .broadcast-wizard-empty,
.broadcast-wizard-panel > .broadcast-wizard-actions {
  display: none;
}

.broadcast-wizard-live {
  display: grid;
  gap: 18px;
}

.broadcast-wizard-live-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 24px;
}

.broadcast-wizard-live-steps button {
  min-height: 38px;
  border: 1px solid #e7edf3;
  border-radius: 10px;
  background: #fbfcfe;
  color: #718096;
  font-size: 11px;
  font-weight: 700;
}

.broadcast-wizard-live-steps button.active {
  border-color: #cfe1fb;
  background: #eaf3ff;
  color: #1268e5;
}

.broadcast-wizard-live-steps b {
  margin-right: 4px;
}

.broadcast-wizard-form {
  min-height: 300px;
  padding: 0 24px;
}

.broadcast-step-content {
  display: grid;
  gap: 16px;
}

.broadcast-step-intro h3 {
  margin: 5px 0 4px;
  color: #172b45;
  font-size: 20px;
}

.broadcast-step-intro p:last-child {
  margin: 0;
  color: #718096;
  font-size: 13px;
}

.broadcast-field {
  display: grid;
  gap: 7px;
  color: #526277;
  font-size: 12px;
  font-weight: 700;
}

.broadcast-field input,
.broadcast-field select,
.broadcast-field textarea {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid #dfe7ef;
  border-radius: 10px;
  background: #fff;
  color: #172b45;
  font: inherit;
  font-weight: 500;
  outline: 0;
}

.broadcast-field textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.55;
}

.broadcast-field input:focus,
.broadcast-field select:focus,
.broadcast-field textarea:focus {
  border-color: #1268e5;
  box-shadow: 0 0 0 3px rgba(18, 104, 229, .1);
}

.broadcast-contact-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
}

.broadcast-contact-toolbar .broadcast-field {
  flex: 1;
}

.broadcast-contact-toolbar .secondary {
  min-height: 40px;
  white-space: nowrap;
}

.broadcast-contact-count {
  color: #718096;
  font-size: 12px;
  font-weight: 700;
}

.broadcast-import-summary {
  margin: -4px 0 0;
  color: #276749;
  font-size: 12px;
  line-height: 1.45;
}

.broadcast-contact-list {
  max-height: 230px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 2px;
}

.broadcast-contact-option {
  min-width: 0;
  padding: 10px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #e7edf3;
  border-radius: 10px;
  background: #fff;
  color: #172b45;
  cursor: pointer;
}

.broadcast-contact-option:has(input:checked) {
  border-color: #bcd7fa;
  background: #f1f7ff;
}

.broadcast-contact-option input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 18px;
  accent-color: #1268e5;
}

.broadcast-contact-option span {
  min-width: 0;
  display: grid;
  gap: 3px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.broadcast-contact-option small {
  color: #718096;
  font-size: 11px;
  font-weight: 500;
}

.broadcast-variable-grid,
.broadcast-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.broadcast-template-preview {
  padding: 14px;
  border: 1px solid #dce9f8;
  border-radius: 12px;
  background: #f6faff;
}

.broadcast-template-preview > span,
.broadcast-review-grid span {
  display: block;
  margin-bottom: 7px;
  color: #718096;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.broadcast-template-preview p {
  margin: 0;
  color: #2f435c;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.broadcast-schedule-options {
  display: grid;
  gap: 10px;
}

.broadcast-choice {
  min-height: 78px;
  padding: 13px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(180px, .9fr);
  align-items: center;
  gap: 10px;
  border: 1px solid #e7edf3;
  border-radius: 12px;
  cursor: pointer;
}

.broadcast-choice:has(input:checked) {
  border-color: #bcd7fa;
  background: #f6faff;
}

.broadcast-choice input {
  grid-column: 2;
  grid-row: 1;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 1.5px solid #8792a3;
  border-radius: 999px;
  background: #fff;
  box-shadow: none;
  cursor: pointer;
}

.broadcast-choice input:checked {
  border-color: #1268e5;
  background: radial-gradient(circle, #1268e5 0 47%, #fff 50% 100%);
}

.broadcast-choice span {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.broadcast-choice strong {
  color: #172b45;
  font-size: 13px;
}

.broadcast-choice small {
  color: #718096;
  font-size: 12px;
}

.broadcast-review-grid > div {
  min-width: 0;
  padding: 13px;
  border: 1px solid #e7edf3;
  border-radius: 10px;
}

.broadcast-review-grid strong {
  display: block;
  overflow: hidden;
  color: #172b45;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.broadcast-wizard-live-actions {
  padding: 14px 24px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.broadcast-wizard-action-group {
  display: flex;
  gap: 8px;
}

.broadcast-wizard-error {
  min-height: 18px;
  margin: 0;
  padding: 0 24px;
  color: #c24141;
  font-size: 12px;
  font-weight: 700;
}

.broadcast-action {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #d7e5f8;
  border-radius: 8px;
  background: #f6faff;
  color: #1268e5;
  font-size: 11px;
  font-weight: 800;
}

.broadcast-action:hover {
  background: #eaf3ff;
}

.broadcast-empty-row {
  padding: 36px !important;
  color: #718096;
  text-align: center !important;
}

@media (max-width: 760px) {
  .broadcast-summary-grid,
  .broadcast-contact-list,
  .broadcast-variable-grid,
  .broadcast-review-grid {
    grid-template-columns: 1fr 1fr;
  }

  .broadcast-wizard-live-steps {
    overflow-x: auto;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }
}

@media (max-width: 560px) {
  .broadcast-summary-grid,
  .broadcast-contact-list,
  .broadcast-variable-grid,
  .broadcast-review-grid {
    grid-template-columns: 1fr;
  }

  .broadcast-contact-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .broadcast-choice {
    grid-template-columns: minmax(0, 1fr) 28px minmax(120px, .9fr);
    padding-inline: 12px;
  }
}

/* Keep inbox controls compact in the sidebar header and on one filter row. */
.desk-view:not(.kanban-layout) > .sidebar {
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}

.desk-view:not(.kanban-layout) > .sidebar .sidebar-actions .archived-conversations {
  width: auto;
  min-height: 42px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 10px;
  gap: 6px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}

.desk-view:not(.kanban-layout) > .sidebar .sidebar-actions .archived-conversations svg {
  width: 18px;
  height: 18px;
}

.desk-view:not(.kanban-layout) > .sidebar .sidebar-actions .archived-count {
  margin-left: 0;
}

.desk-view:not(.kanban-layout) > .sidebar .filters {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.desk-view:not(.kanban-layout) > .sidebar .filters::-webkit-scrollbar {
  display: none;
}

.desk-view:not(.kanban-layout) > .sidebar .queue-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 560px) {
  .desk-view:not(.kanban-layout) > .sidebar .sidebar-actions .archived-conversations {
    position: relative;
    width: 38px;
    min-height: 38px;
    padding: 0;
    justify-content: center;
  }

  .desk-view:not(.kanban-layout) > .sidebar .sidebar-actions .archived-label {
    display: none;
  }

  .desk-view:not(.kanban-layout) > .sidebar .sidebar-actions .archived-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--inbox-accent);
    color: #fff;
    font-size: 9px;
    line-height: 1;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  background: var(--brand-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary,
.filter {
  background: #e9efec;
  color: var(--text);
}

.secondary:hover,
.filter:hover,
.filter.active {
  background: #cfe0d8;
}

.archived-conversations {
  width: calc(100% - 24px);
  min-height: 42px;
  margin: 0 12px 10px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  background: #f5f7f6;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.archived-conversations:hover,
.archived-conversations.active { background: #e4f1ea; color: var(--brand-dark); }
.archived-conversations svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.archived-count { margin-left: auto; color: var(--muted); }

.hidden {
  display: none !important;
}

.brand-bar {
  height: var(--brand-bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 10px rgba(20, 39, 54, 0.06);
}

.brand-mark {
  min-width: 0;
  display: flex;
  align-items: center;
}

.brand-mark img {
  display: block;
  width: auto;
  height: 52px;
  max-width: 220px;
  object-fit: contain;
}

.provider-badge {
  position: relative;
  min-width: 0;
  margin-left: 10px;
  padding: 8px 12px 8px 34px;
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #dbe5df;
  border-radius: 12px;
  background: #f7faf8;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.provider-badge::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14);
  transform: translateY(-50%);
}

.provider-badge[data-provider="evolution"] {
  position: relative;
  padding-left: 34px;
}

.provider-badge[data-provider="evolution"]::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14);
  transform: translateY(-50%);
}

.provider-badge[data-connection="connected"]::before {
  background: var(--provider-number-color, #16a34a);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--provider-number-color, #16a34a) 18%, transparent);
}

.provider-badge[data-connection="connecting"]::before,
.provider-badge[data-connection="checking"]::before {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.provider-badge[data-connection="disconnected"]::before,
.provider-badge[data-connection="error"]::before,
.provider-badge[data-connection="unconfigured"]::before {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
}

.provider-badge-icon {
  width: 28px;
  height: 28px;
  display: block;
  flex: 0 0 auto;
}

.provider-badge-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.provider-badge-details {
  max-width: 240px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.provider-badge-details {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.provider-badge-details:empty {
  display: none;
}

.provider-badge-label,
.provider-badge-value {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.provider-badge-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.provider-badge-value {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-session {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.brand-user {
  max-width: min(520px, 44vw);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.brand-logout {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: #eef5f1;
  color: var(--brand-dark);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-logout:hover {
  background: #d9eee3;
  color: var(--brand-dark);
}

.brand-logout svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #eef5f1;
  color: var(--brand-dark);
  font-weight: 800;
}

.theme-toggle:hover { background: #d9eee3; color: var(--brand-dark); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .theme-moon { display: none; }
.theme-dark .theme-toggle .theme-sun { display: none; }
.theme-dark .theme-toggle .theme-moon { display: block; }

.theme-dark {
  --bg: #09110f;
  --panel: #111b18;
  --line: #2a3934;
  --text: #edf5f1;
  --muted: #9aada5;
  --incoming: #182521;
  --outgoing: #104632;
  background: var(--bg);
  color: var(--text);
}

.theme-dark .brand-bar,
.theme-dark .sidebar,
.theme-dark .sidebar-header,
.theme-dark .conversation-pane,
.theme-dark .topbar,
.theme-dark .details-panel,
.theme-dark .composer,
.theme-dark .modal-panel,
.theme-dark .call-panel,
.theme-dark .attachment-menu,
.theme-dark .emoji-picker {
  background-color: var(--panel);
  color: var(--text);
  border-color: var(--line);
}

.theme-dark .messages { background-color: #0b1512; }
.theme-dark input,
.theme-dark textarea,
.theme-dark select { background-color: #15211e; color: var(--text); border-color: var(--line); }
.theme-dark input::placeholder,
.theme-dark textarea::placeholder { color: #74877f; }
.theme-dark .conversation-select:hover,
.theme-dark .conversation-item.active,
.theme-dark .filter,
.theme-dark .queue-tab,
.theme-dark .icon-button,
.theme-dark .composer-icon,
.theme-dark .theme-toggle,
.theme-dark .brand-logout { background: #1a2925; color: #c8d9d2; }
.theme-dark .conversation-item,
.theme-dark .team-member,
.theme-dark .details-card { border-color: var(--line); }
.theme-dark .provider-badge { background: #12211c; border-color: #2a3a34; box-shadow: none; }

.theme-dark .brand-mark img {
  position: relative;
  z-index: 2;
  height: 30px;
  max-width: 160px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
}

.theme-dark .brand-mark {
  position: relative;
  isolation: isolate;
  gap: 0;
  padding: 7px 10px;
}

.theme-dark .brand-mark::before {
  content: none;
}

.theme-dark .brand-mark::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -2px -8px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(ellipse at 44% 52%, rgba(75, 137, 255, .08) 0%, rgba(57, 113, 224, .035) 38%, rgba(57, 113, 224, 0) 74%);
}

.login-view {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(400px, 480px);
  justify-content: center;
  align-items: center;
  gap: clamp(48px, 6vw, 88px);
  padding: 32px;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 78% 18%, rgba(20, 184, 166, 0.18), transparent 28%),
    radial-gradient(circle at 8% 84%, rgba(23, 114, 69, 0.24), transparent 30%),
    linear-gradient(135deg, #071b19 0%, #0b2924 48%, #0d3830 100%);
}

.brand-flj .login-view {
  background:
    radial-gradient(circle at 18% 15%, rgba(0, 214, 190, .18), transparent 34%),
    radial-gradient(circle at 82% 85%, rgba(20, 111, 224, .18), transparent 30%),
    linear-gradient(135deg, #061d35 0%, #073f66 50%, #075b83 100%);
}

.brand-chamaon .login-view {
  background:
    radial-gradient(circle at 18% 15%, rgba(0, 209, 235, .2), transparent 34%),
    radial-gradient(circle at 82% 85%, rgba(11, 116, 231, .24), transparent 30%),
    linear-gradient(135deg, #081637 0%, #0c2d65 52%, #0b74e7 100%);
}

.brand-chamaon .login-kicker,
.brand-chamaon .login-copy h2 strong { color: #62ddfa; }
.brand-chamaon .login-copy > p:last-child { color: #c4d7f3; }
.brand-chamaon .login-ambient span { border-color: rgba(98, 221, 250, .2); }

.login-view::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to right, #000, transparent 80%);
}

.login-ambient { position: absolute; inset: 0; pointer-events: none; }
.login-copy, .login-panel { position: relative; z-index: 2; }

.login-copy { max-width: 620px; color: #fff; }
.login-kicker { display: flex; align-items: center; gap: 10px; color: #77e2c0; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.login-kicker span { width: 28px; height: 2px; background: currentColor; }
.login-copy h2 { margin: 24px 0 20px; font-size: clamp(42px, 5vw, 72px); line-height: 1.04; letter-spacing: -.045em; font-weight: 500; }
.login-copy h2 strong { color: #76e1bd; font-weight: 800; }
.login-copy > p:last-child { max-width: 540px; color: #b6cbc4; font-size: 18px; line-height: 1.7; }

.login-ambient span { position: absolute; border: 1px solid rgba(118,225,189,.16); border-radius: 50%; }
.login-ambient span:nth-child(1) { width: 520px; height: 520px; left: -250px; top: -180px; }
.login-ambient span:nth-child(2) { width: 720px; height: 720px; left: -350px; top: -280px; }
.login-ambient span:nth-child(3) { width: 360px; height: 360px; right: -180px; bottom: -170px; }

.login-panel {
  width: 100%;
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 24px;
  padding: clamp(28px, 4vw, 48px);
  display: grid;
  gap: 20px;
  box-shadow: 0 36px 100px rgba(0,0,0,.35);
  backdrop-filter: blur(18px);
}

.login-brand { min-height: 72px; display: flex; align-items: center; margin-bottom: 2px; }
.login-brand img { display: block; width: min(100%, 270px); height: auto; object-fit: contain; }
.brand-flj .login-brand { min-height: 112px; }
.brand-flj .login-brand img { width: 180px; max-height: 180px; }
.brand-flj .brand-mark img {
  height: 62px;
  max-width: 180px;
  transform: scale(1.28);
  transform-origin: left center;
}
.login-heading h1 { font-size: 34px; letter-spacing: -.035em; }
.login-heading > p:last-child { margin: 8px 0 0; color: var(--muted); }
.login-field > span:first-child { color: #33463e; font-weight: 700; }
.login-input-wrap { position: relative; display: block; }
.login-input-wrap svg { position: absolute; left: 15px; top: 50%; width: 19px; transform: translateY(-50%); fill: none; stroke: #81938b; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.login-input-wrap input { min-height: 52px; padding-left: 46px; border-radius: 12px; background: #f8faf9; }
.login-submit { min-height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 800; box-shadow: 0 10px 24px rgba(23,114,69,.22); }
.login-submit span { font-size: 20px; transition: transform .2s ease; }
.login-submit:hover span { transform: translateX(4px); }
.login-panel .form-error:empty { display: none; }
.password-help-button { min-height: auto; padding: 4px; background: transparent; color: var(--brand); font-size: 14px; font-weight: 800; box-shadow: none; }
.password-help-button:hover { background: transparent; color: var(--brand-dark); text-decoration: underline; }

.forgot-password-panel { width: min(500px, 100%); grid-template-rows: auto auto auto; border-radius: 18px; }
.forgot-password-body { padding: 24px; display: grid; gap: 18px; }
.forgot-password-body > p:first-child { margin: 0; color: var(--muted); line-height: 1.6; }
.forgot-password-body .form-error,
.forgot-password-body .form-success { margin: 0; }
.forgot-password-actions { padding: 16px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; }
.forgot-password-actions button { min-width: 130px; }

.app-toast-stack {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 100;
  width: min(390px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.app-toast {
  padding: 15px 18px 15px 48px;
  border: 1px solid #b8ddcc;
  border-radius: 12px;
  position: relative;
  background: #ffffff;
  color: #174c35;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  box-shadow: 0 18px 50px rgba(8, 57, 42, 0.2);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .22s ease, transform .22s ease;
}

.app-toast::before {
  content: "✓";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  background: #177245;
  color: #fff;
  font-size: 13px;
}

.app-toast.error {
  border-color: #fecaca;
  color: #7f1d1d;
}

.app-toast.error::before {
  content: "!";
  background: var(--danger);
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.force-password-modal { z-index: 90; background: rgba(3, 32, 27, .78); backdrop-filter: blur(7px); }
.force-password-panel { width: min(500px, 100%); grid-template-rows: auto auto auto; border-radius: 18px; }
.force-password-body { padding: 24px; display: grid; gap: 18px; }
.force-password-body > p:first-child { margin: 0; color: var(--muted); line-height: 1.6; }
.force-password-body .form-error { margin: 0; }
.force-password-actions { padding: 0 24px 24px; }
.force-password-actions button { width: 100%; min-height: 50px; border-radius: 12px; font-weight: 800; }
.password-input-wrap { position: relative; display: block; }
.password-input-wrap input { min-height: 52px; padding-right: 52px; border-radius: 12px; background: #f8faf9; }
.password-visibility { position: absolute; top: 50%; right: 8px; width: 38px; min-height: 38px; padding: 0; transform: translateY(-50%); display: grid; place-items: center; border-radius: 9px; background: transparent; color: #71827a; }
.password-visibility:hover { background: #e8f1ed; color: var(--brand-dark); }
.password-visibility svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-visibility.visible { color: var(--brand); background: #e8f6ef; }

@media (max-width: 1180px) {
  .login-view { grid-template-columns: minmax(0, 1fr); padding: 28px; }
  .login-copy { display: none; }
  .login-panel { max-width: 480px; justify-self: center; }
}

@media (max-width: 520px) {
  .login-view { min-height: 100dvh; padding: 14px; align-items: center; }
  .login-panel { padding: 24px 20px; border-radius: 20px; gap: 15px; }
  .login-brand { min-height: 60px; justify-content: center; }
  .login-brand img { width: min(100%, 240px); }
  .login-heading { text-align: center; }
  .login-heading .eyebrow { text-align: center; }
  .login-heading h1 { font-size: 30px; }
  .forgot-password-actions { flex-direction: column-reverse; }
  .forgot-password-actions button { width: 100%; }
}

@media (max-height: 680px) and (max-width: 1180px) {
  .login-view { align-items: start; }
  .login-panel { margin: 10px 0; }
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  margin: 0 0 4px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 36px;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

h3 {
  font-size: 15px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  min-height: 40px;
  padding: 10px 12px;
  outline: none;
}

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

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.form-error {
  color: var(--danger);
  min-height: 20px;
  margin: 0;
}

.desk-view {
  height: calc(100dvh - var(--brand-bar-height));
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr) 280px;
  overflow: hidden;
}

.desk-view.no-details {
  grid-template-columns: 390px minmax(0, 1fr);
}

.desk-view.no-details .details {
  display: none;
}

.sidebar,
.details {
  background: var(--panel);
  border-right: 1px solid var(--line);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
}

.details {
  border-right: 0;
  border-left: 1px solid var(--line);
  padding: 18px 12px 18px 18px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.sidebar-header,
.topbar {
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 12px;
}

.icon-button {
  width: 42px;
  min-height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef5f1;
  color: var(--brand-dark);
}

.icon-button:hover {
  background: #d9eee3;
  color: var(--brand-dark);
}

.icon-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conversation-search {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: var(--panel);
}

.conversation-search svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.conversation-search input {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: #eef3f0;
  padding: 8px 10px;
}

.conversation-search input:focus {
  box-shadow: none;
  background: #fff;
}

.filters {
  padding: 10px 12px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter {
  min-height: 28px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 11px;
  background: #f0f4f2;
  color: #52645b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter:hover {
  background: #e1ebe6;
  color: var(--brand-dark);
}

.filter.active {
  border-color: #b7d8c9;
  background: #dff3e9;
  color: var(--brand-dark);
}

.queue-tabs {
  padding: 0 12px 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.queue-tab {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.queue-tab:hover {
  background: #eef5f1;
  color: var(--brand-dark);
}

.queue-tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(23, 114, 69, 0.18);
}

.conversation-list {
  min-height: 0;
  height: auto;
  overflow: auto;
  scrollbar-gutter: stable;
}

.conversation-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 0;
  position: relative;
  text-align: left;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.conversation-select {
  min-width: 0;
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 14px 54px 14px 12px;
}

.conversation-select:hover {
  background: transparent;
  color: var(--text);
}

.conversation-summary {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.conversation-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  align-self: start;
  color: var(--avatar-fg);
  background: var(--avatar-bg);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  user-select: none;
  overflow: hidden;
}

.conversation-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-avatar {
  width: 46px;
  height: 46px;
  align-self: center;
  font-size: 16px;
}

.conversation-item:hover,
.conversation-item.active {
  background: #eef5f1;
}

.conversation-item.unread {
  background: #f0faf5;
  border-left: 4px solid var(--brand);
}

.conversation-item.unread .conversation-select {
  padding-left: 8px;
}

.conversation-item.unread .contact-name,
.conversation-item.unread .preview {
  font-weight: 800;
  color: var(--text);
}

.conversation-muted-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  font-size: 12px;
  vertical-align: middle;
}

.conversation-item.muted .conversation-muted-indicator {
  opacity: .78;
}

.conversation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.conversation-flags {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.conversation-menu-wrap {
  align-self: stretch;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18px;
  padding-right: 8px;
  position: relative;
}

.conversation-menu-toggle {
  width: 28px;
  min-height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: #52645b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.conversation-item:hover .conversation-menu-toggle,
.conversation-menu-toggle[aria-expanded="true"] {
  opacity: 1;
  pointer-events: auto;
  background: #e0ebe6;
}

.conversation-menu-toggle:hover {
  background: #d4e4dc;
  color: var(--brand-dark);
}

.conversation-menu-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.conversation-menu {
  position: absolute;
  top: 48px;
  right: 8px;
  z-index: 8;
  width: 150px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.16);
}

.conversation-menu-item {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 13px;
  font-weight: 400;
}

.conversation-menu-item:hover {
  background: #eef5f1;
  color: var(--brand-dark);
}

.conversation-menu-item.danger {
  color: var(--danger);
}

.conversation-menu-item.danger:hover {
  background: #f5eeee;
  color: var(--danger);
}

.conversation-menu-empty {
  display: block;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.unread-count {
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 3px rgba(23, 114, 69, 0.13);
}

.contact-name {
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.contact-company {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.badge {
  border-radius: 999px;
  color: var(--brand-dark);
  background: #d9eee3;
  padding: 3px 8px;
  font-size: 12px;
  white-space: nowrap;
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview,
.muted {
  color: var(--muted);
  font-size: 13px;
}

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

.conversation-summary > .muted {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.conversation-department {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  max-width: 100%;
  padding: 4px 9px;
  overflow: hidden;
  border: 1px solid hsl(var(--department-hue) 55% 75%);
  border-radius: 999px;
  background: hsl(var(--department-hue) 70% 93%);
  color: hsl(var(--department-hue) 65% 27%);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-dark .conversation-department {
  border-color: hsl(var(--department-hue) 35% 42%);
  background: hsl(var(--department-hue) 40% 23%);
  color: hsl(var(--department-hue) 80% 85%);
}

.conversation-pane {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.conversation-pane.idle {
  grid-template-rows: 1fr;
}

.conversation-pane.idle .topbar,
.conversation-pane.idle .composer {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mobile-back-button {
  display: none;
}

.topbar-action {
  min-height: 32px;
  border-radius: 999px;
  padding: 0 13px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.assign-action {
  background: #dff3e9;
  color: var(--brand-dark);
}

.assign-action:hover {
  background: #cfeadc;
  color: var(--brand-dark);
}

.close-action {
  background: var(--brand);
  color: #fff;
}

.close-action:hover {
  background: var(--brand-dark);
}

.voice-action {
  background: #edf8f2;
  color: var(--brand-dark);
  border-color: #cce8d9;
}

.voice-action:hover {
  background: #d9eee3;
  color: var(--brand-dark);
}

.call-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
}

.call-card {
  width: min(360px, calc(100vw - 44px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 16px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(23, 33, 29, 0.22);
}

.call-card h2 {
  margin-bottom: 4px;
}

.call-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.call-actions button {
  flex: 1;
}

.call-accept {
  background: var(--brand);
}

.call-end {
  background: var(--danger);
}

.call-end:hover {
  background: #842f2f;
}

#conversationTitle {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.conversation-heading {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.conversation-heading h2,
.conversation-heading p {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.messages {
  min-height: 0;
  padding: 22px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: var(--chat-bg);
  background-image: var(--chat-pattern);
  background-size: 180px 180px;
  background-repeat: repeat;
}

.empty-state {
  margin: auto;
  color: var(--muted);
  text-align: center;
}

.conversation-pane.idle .messages {
  display: block;
  padding: 26px;
}

.admin-dashboard {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.admin-dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.admin-dashboard-header h2 {
  margin: 2px 0 4px;
  font-size: 24px;
  line-height: 1.15;
}

.admin-dashboard-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-dashboard-period {
  min-width: 300px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(110px, 0.7fr);
  gap: 10px;
}

.admin-dashboard-period label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-dashboard-period select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

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

.admin-stat-card {
  min-height: 128px;
  border: 1px solid var(--line);
  border-top: 4px solid #64748b;
  border-radius: 8px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  text-align: left;
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.admin-stat-card:hover,
.admin-stat-card:focus-visible {
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(23, 33, 29, 0.13);
  transform: translateY(-1px);
}

.admin-stat-card.is-selected {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14), 0 16px 34px rgba(23, 33, 29, 0.12);
}

.admin-stat-card.total { border-top-color: #2563eb; }
.admin-stat-card.waiting { border-top-color: #d97706; }
.admin-stat-card.assigned { border-top-color: #16a34a; }
.admin-stat-card.closed { border-top-color: #64748b; }
.admin-stat-card.active { border-top-color: #0f766e; }
.admin-stat-card.unread { border-top-color: #dc2626; }
.admin-stat-card.archived { border-top-color: #475569; }
.admin-stat-card.internal { border-top-color: #7c3aed; }

.admin-stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-stat-card strong {
  color: var(--text);
  font-size: 34px;
  line-height: 1;
}

.admin-stat-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-dashboard-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.06);
}

.admin-dashboard-section h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.admin-dashboard-section p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-assignee-list {
  display: grid;
  gap: 8px;
}

.admin-assignee-row {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8faf9;
}

.admin-assignee-row span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 800;
}

.admin-assignee-row strong {
  color: var(--brand-dark);
  font-size: 18px;
}

.admin-dashboard-empty {
  padding: 10px 0;
}

.whatsapp-costs-panel {
  overflow: hidden;
}

.whatsapp-costs-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.whatsapp-costs-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.whatsapp-costs-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.whatsapp-costs-form input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
}

.whatsapp-costs-form button {
  min-height: 42px;
  white-space: nowrap;
}

.whatsapp-costs-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.whatsapp-cost-card {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  background: #f8faf9;
}

.whatsapp-cost-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.whatsapp-cost-card strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.whatsapp-costs-table-wrap {
  overflow-x: auto;
}

.whatsapp-costs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.whatsapp-costs-table th,
.whatsapp-costs-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
}

.whatsapp-costs-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.whatsapp-costs-table td {
  font-weight: 800;
}

.whatsapp-costs-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.whatsapp-costs-table .total-row td {
  border-bottom: 0;
  color: var(--brand-dark);
  font-weight: 950;
}

.whatsapp-costs-agent-section {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.whatsapp-costs-agent-section h4,
.whatsapp-costs-agent-section p {
  margin: 0;
}

.whatsapp-costs-agent-section h4 {
  color: var(--text);
  font-size: 16px;
}

.whatsapp-costs-agent-section p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.message {
  position: relative;
  max-width: min(620px, 78%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px 8px;
  background: var(--incoming);
  box-shadow: 0 4px 14px rgba(23, 33, 29, 0.05);
}


.message.has-media {
  max-width: min(500px, 82%);
}

.message.visual-media {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.message.out {
  align-self: flex-end;
  background: var(--outgoing);
}

.message.system {
  align-self: center;
  max-width: min(620px, 86%);
  border-style: dashed;
  background: #f5f8f6;
  color: var(--muted);
  box-shadow: none;
}

.message.system .message-text {
  color: var(--text);
}

.internal-note {
  display: grid;
  gap: 4px;
}

.internal-note-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.internal-note-text {
  font-size: 14px;
  font-weight: 700;
}

.message-actions {
  position: absolute;
  top: 8px;
  z-index: 7;
  display: grid;
  justify-items: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  transform: translateY(2px);
}

.message.in .message-actions {
  right: -10px;
}

.message.out .message-actions {
  left: -10px;
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.message-actions.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.message-actions-toggle {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: var(--panel);
  color: #52645b;
  box-shadow: 0 4px 14px rgba(23, 33, 29, 0.16);
  opacity: 0;
  pointer-events: none;
}

.message:hover .message-actions-toggle,
.message:focus-within .message-actions-toggle,
.message-actions.open .message-actions-toggle,
.message-actions-toggle[aria-expanded="true"] {
  opacity: 1;
  pointer-events: auto;
}

.message-actions-toggle:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #fff;
}

.message-actions-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-actions-menu {
  position: absolute;
  top: calc(100% + 6px);
  min-width: 176px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.18);
  display: grid;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.message.in .message-actions-menu {
  left: 0;
  right: auto;
  transform-origin: top left;
}

.message.out .message-actions-menu {
  right: 0;
  left: auto;
  transform-origin: top right;
}

.message-actions.open .message-actions-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.message-actions-menu::before {
  content: "";
  position: absolute;
  top: 10px;
  width: 10px;
  height: 10px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  transform: rotate(45deg);
}

.message.in .message-actions-menu::before {
  left: -5px;
}

.message.out .message-actions-menu::before {
  right: -5px;
}

.message-menu-item {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
}

.message-menu-item:hover {
  background: #eef5f1;
  color: var(--brand-dark);
}

.conversation-menu .conversation-menu-item,
.message-actions-menu .message-menu-item,
.message-actions-menu .message-menu-item span {
  font-weight: 400;
}

.message-menu-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reaction-bar {
  position: absolute;
  left: 8px;
  bottom: calc(100% + 6px);
  z-index: 5;
  width: min(340px, calc(100vw - 32px));
  max-height: 292px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(23, 33, 29, 0.18);
  display: grid;
  gap: 8px;
}

.message.out .reaction-bar {
  right: 8px;
  left: auto;
}

.message.in .reaction-bar {
  right: auto;
}

.message.reaction-below .reaction-bar {
  top: calc(100% + 6px);
  bottom: auto;
}

.reaction-favorites {
  display: grid;
  grid-template-columns: repeat(6, 34px);
  justify-content: center;
  gap: 4px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.reaction-grid {
  max-height: 216px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 2px;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.reaction-option {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
}

.reaction-option.favorite {
  font-size: 21px;
}

.reaction-option:hover {
  background: #eef5f1;
  transform: translateY(-1px);
}

.message-reaction {
  position: absolute;
  left: 10px;
  bottom: -12px;
  z-index: 2;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #fff;
  border: 1px solid rgba(23, 33, 29, 0.08);
  box-shadow: 0 2px 8px rgba(23, 33, 29, 0.16);
  font-size: 16px;
  line-height: 1;
}

.message.out .message-reaction,
.message.out .image-group .message-reaction {
  left: auto;
  right: 10px;
}

.message.out.visual-media {
  background: transparent;
  justify-items: end;
}

.message.in {
  align-self: flex-start;
}

.reply-quote {
  min-width: 0;
  margin: 0 0 6px;
  padding: 7px 9px;
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  display: grid;
  gap: 2px;
  background: rgba(255, 255, 255, 0.72);
}

button.reply-quote {
  width: 100%;
  min-height: 0;
  color: inherit;
  text-align: left;
}

.reply-quote-jump {
  cursor: pointer;
}

.reply-quote-jump:hover,
.reply-quote-jump:focus-visible {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 0 0 1px rgba(23, 114, 69, 0.16);
  outline: none;
}

.message.out .reply-quote {
  background: rgba(255, 255, 255, 0.58);
}

.message.out .reply-quote-jump:hover,
.message.out .reply-quote-jump:focus-visible {
  background: rgba(255, 255, 255, 0.84);
}

.reply-quote strong,
.reply-quote span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-quote strong {
  color: var(--brand-dark);
  font-size: 13px;
}

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

.message.jump-highlight {
  outline: 2px solid rgba(34, 197, 94, 0.88);
  outline-offset: 4px;
  animation: messageJumpPulse 1.8s ease;
}

@keyframes messageJumpPulse {
  0%,
  100% {
    box-shadow: 0 4px 14px rgba(23, 33, 29, 0.05);
  }

  35% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.18), 0 10px 24px rgba(23, 33, 29, 0.16);
  }
}

.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-link {
  color: #0f766e;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.message-link:hover {
  color: #0d9488;
}

.group-message .message-text {
  display: grid;
  gap: 4px;
}

.group-message-author {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.image-group .group-message-author {
  padding: 2px 6px 0;
}

.call-message-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.call-message-text::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.72);
}

.message.has-media .message-text {
  white-space: normal;
}

.shared-contact-message {
  display: grid;
  gap: 12px;
}

.shared-contact-text {
  display: grid;
  gap: 2px;
  white-space: normal;
}

.message.shared-contact {
  padding-bottom: 9px;
}

.message.shared-contact .message-text {
  white-space: normal;
}

.message.shared-contact .message-meta {
  margin-top: 7px;
}

.shared-contact-add {
  justify-self: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 18px;
  border: 1px solid #b8ddcc;
  background: #e8f6ef;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
}

.shared-contact-add:hover {
  background: #d8eee4;
  color: var(--brand-dark);
}

.shared-contact-add:disabled {
  opacity: 0.8;
  cursor: default;
}

.transfer-modal-panel {
  width: min(520px, 100%);
  border-radius: 12px;
}

.transfer-body {
  padding: 22px 24px 18px;
  display: grid;
  gap: 16px;
}

.transfer-body > p:first-child {
  margin: 0;
  line-height: 1.6;
}

.transfer-field {
  gap: 8px;
}

.transfer-field select {
  min-height: 44px;
  border-radius: 8px;
}

.transfer-preview {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.transfer-actions {
  padding: 0 24px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.transfer-actions button {
  min-width: 120px;
}

.message-media {
  margin: 0;
  display: grid;
}

.message.out .message-media {
  justify-items: end;
}

.message.out .media-preview {
  margin-left: auto;
  background: var(--outgoing);
}

.media-preview {
  min-height: 0;
  padding: 4px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--incoming);
  cursor: pointer;
  position: relative;
  display: block;
  width: min(420px, 100%);
  box-shadow: 0 1px 2px rgba(23, 33, 29, 0.2);
}

.media-preview:hover {
  background: var(--incoming);
  filter: brightness(0.96);
}

.media-preview img,
.media-preview video {
  display: block;
  width: 100%;
  max-height: min(560px, 64vh);
  border-radius: 5px;
  object-fit: contain;
  background: #0b1511;
}

.sticker-media {
  width: 180px;
  max-width: min(48vw, 220px);
}

.sticker-preview {
  width: 100%;
  min-height: 124px;
  padding: 8px;
  background: transparent;
  box-shadow: none;
}

.message.out .sticker-preview,
.sticker-preview:hover {
  background: transparent;
}

.sticker-preview img {
  max-height: 180px;
  background: transparent;
  object-fit: contain;
}

.image-group-message {
  max-width: min(430px, 82%);
}

.image-group {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: var(--outgoing);
  box-shadow: 0 1px 2px rgba(23, 33, 29, 0.18);
}

.message.in .image-group {
  background: var(--incoming);
}

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

.image-group-grid.count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.image-group-grid.count-3 .image-group-tile:first-child {
  grid-row: span 2;
}

.image-group-tile {
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  border-radius: 5px;
  box-shadow: none;
}

.image-group-tile img {
  height: 100%;
  max-height: none;
  border-radius: 5px;
  object-fit: cover;
}

.image-group-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: rgba(9, 20, 15, 0.62);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
}

.image-group-download {
  justify-self: start;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.image-group-download:hover {
  background: #fff;
  color: var(--brand-dark);
}

.image-group-download svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.image-group-meta {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  padding: 0 4px 2px;
}

.message-caption {
  padding: 8px 10px 9px;
}

.visual-media .message-caption {
  margin-top: -1px;
  border-radius: 0 0 8px 8px;
  background: var(--incoming);
}

.audio-message {
  --audio-progress: 0%;
  width: min(340px, 76vw);
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: var(--incoming);
}

.message.out .audio-message {
  background: var(--outgoing);
}

.audio-play {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #111c17;
  background: transparent;
}

.audio-play:hover {
  background: rgba(23, 33, 29, 0.08);
}

.audio-play svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.audio-pause-icon,
.audio-message.playing .audio-play-icon {
  display: none;
}

.audio-message.playing .audio-pause-icon {
  display: block;
}

.audio-track {
  min-width: 0;
  position: relative;
  display: grid;
  gap: 4px;
  padding-left: 17px;
}

.audio-waveform {
  height: 24px;
  display: flex;
  align-items: center;
  gap: 2px;
  color: #b9c8c0;
  overflow: hidden;
}

.audio-waveform span {
  width: 3px;
  min-width: 3px;
  border-radius: 999px;
  background: currentColor;
}

.audio-waveform::before {
  display: none;
}

.audio-track::before {
  content: "";
  position: absolute;
  top: 6px;
  left: clamp(0px, var(--audio-progress), calc(100% - 12px));
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #4fc3f7;
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.16);
  pointer-events: none;
  z-index: 2;
}

.audio-range {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.audio-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.audio-speed {
  min-width: 34px;
  min-height: 22px;
  padding: 0 5px;
  border: 1px solid rgba(71, 85, 105, .22);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.audio-speed:hover,
.audio-speed:focus-visible {
  border-color: rgba(37, 99, 235, .5);
  background: rgba(37, 99, 235, .1);
  color: #1d4ed8;
}

.audio-sent-at {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  white-space: nowrap;
}

.audio-message audio {
  display: none;
}

.document-media {
  min-width: min(340px, 76vw);
  border: 0;
  border-radius: 7px;
  padding: 10px 12px;
  background: rgba(223, 245, 231, 0.84);
  color: var(--text);
  text-decoration: none;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
}

.pending-media {
  min-width: min(300px, 76vw);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  background: #f4f8f6;
}

.pending-media span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.pending-media strong {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.retry-media-download {
  min-height: 32px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.message.in .document-media {
  background: #f4f8f6;
}

.document-icon {
  width: 32px;
  height: 38px;
  border-radius: 5px;
  display: grid;
  place-items: end center;
  padding-bottom: 6px;
  background: #3f73d8;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  position: relative;
}

.document-icon::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-top: 9px solid rgba(255, 255, 255, 0.76);
  border-left: 9px solid rgba(19, 45, 96, 0.24);
}

.document-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 500;
}

.document-download {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(13, 89, 52, 0.34);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: rgba(13, 89, 52, 0.54);
}

.document-download svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.play-indicator {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  pointer-events: none;
}

.play-indicator svg {
  width: 54px;
  height: 54px;
  padding: 12px;
  border-radius: 999px;
  background: rgba(15, 23, 20, 0.72);
  fill: currentColor;
}

.media-meta-overlay {
  position: absolute;
  right: 9px;
  bottom: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 18px);
  border-radius: 999px;
  padding: 3px 7px;
  color: #fff;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.58));
  font-size: 12px;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.message-checks {
  color: #7b8d84;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -3px;
  margin-left: 4px;
}

.message-checks.read {
  color: #34b7f1;
}

.message-checks.failed {
  border: 0;
  padding: 0;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--danger);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0;
  line-height: 1;
  vertical-align: middle;
}

.message-checks.failed:hover,
.message-checks.failed:focus-visible {
  filter: brightness(0.92);
}

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

.composer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  background: var(--panel);
  align-items: end;
}

.reply-preview {
  grid-column: 1 / -1;
  min-height: 54px;
  padding: 8px 10px 8px 12px;
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: #eef5f1;
}

.reply-preview-body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reply-preview-body strong,
.reply-preview-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-preview-body strong {
  color: var(--brand-dark);
  font-size: 13px;
}

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

.reply-preview-close {
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
}

.reply-preview-close:hover {
  background: #d9eee3;
  color: var(--text);
}

.reply-preview-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attachment-preview {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  background: #f4f8f6;
  border: 1px solid var(--line);
}

.attachment-preview-items {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.attachment-preview-item {
  min-width: 140px;
  max-width: 220px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.attachment-preview-item img,
.attachment-preview-file {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  object-fit: cover;
  background: #d9eee3;
}

.attachment-preview-file {
  display: grid;
  place-items: center;
  color: var(--brand-dark);
}

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

.attachment-preview-clear {
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
}

.attachment-preview-clear:hover {
  background: #d9eee3;
  color: var(--text);
}

.attachment-preview-clear svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.composer-icon {
  width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef5f1;
  color: var(--brand-dark);
}

.composer-icon:hover {
  background: #d9eee3;
  color: var(--brand-dark);
}

.template-button,
.file-request-button {
  min-height: 36px;
  width: auto;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0 12px;
  background: #eef5f1;
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 13px;
}

.template-button:disabled,
.template-button:disabled:hover,
.file-request-button:disabled,
.file-request-button:disabled:hover {
  background: #eef5f1;
  color: var(--brand-dark);
}

.template-button:not(:disabled):hover,
.file-request-button:not(:disabled):hover {
  background: #d9eee3;
}

.composer-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#sendButton {
  display: inline-grid;
  place-items: center;
}

#sendButton svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#sendButton.audio-mode {
  background: #eef5f1;
  color: #0c271b;
}

#sendButton.recording {
  background: #b64242;
  color: #fff;
}

#sendButton.recording:hover {
  background: #963737;
}

.cancel-audio-button {
  color: #a13c3c;
}

.cancel-audio-button:hover {
  background: #fbe7e7;
  color: #8b2525;
}

.attachment-menu {
  position: absolute;
  left: 12px;
  bottom: 62px;
  width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  gap: 2px;
  box-shadow: 0 14px 38px rgba(23, 33, 29, 0.16);
}

.attachment-menu button {
  min-height: 44px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  text-align: left;
  font-weight: 500;
}

.attachment-menu .mobile-attachment-action { display: none; }

.attachment-menu button:hover {
  background: #f3f7f5;
  color: var(--text);
}

.attachment-menu-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
}

.attachment-menu-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attachment-menu-icon.document {
  background: #6d5dfc;
}

.attachment-menu-icon.media {
  background: #1683f3;
}

.attachment-menu-icon.camera {
  background: #ff3c7d;
}

.attachment-menu-icon.contact {
  background: #0797d5;
}

.attachment-menu-icon.request {
  background: #0f766e;
}

.attachment-menu-icon.emoji {
  background: #f59e0b;
}

.attachment-menu-icon.sticker {
  background: #8b5cf6;
}

.emoji-picker {
  position: absolute;
  left: 60px;
  bottom: 62px;
  width: min(430px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 120px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  box-shadow: 0 14px 38px rgba(23, 33, 29, 0.16);
  overflow: hidden;
}

.emoji-search-row {
  display: flex;
}

.emoji-search-input {
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7faf8;
  color: var(--text);
  outline: none;
}

.emoji-search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 114, 69, 0.12);
}

.emoji-category-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 8px 0;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.emoji-category-nav::-webkit-scrollbar {
  height: 8px;
}

.emoji-category-nav::-webkit-scrollbar-track {
  background: transparent;
}

.emoji-category-nav::-webkit-scrollbar-thumb {
  background: rgba(123, 138, 131, 0.42);
  border-radius: 999px;
}

.emoji-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7faf8;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.emoji-category-chip.active,
.emoji-category-chip:hover {
  background: #eef7f1;
  border-color: rgba(23, 114, 69, 0.28);
}

.emoji-sections {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding-right: 10px;
  scrollbar-gutter: stable;
}

.emoji-sections::-webkit-scrollbar {
  width: 10px;
}

.emoji-sections::-webkit-scrollbar-track {
  background: transparent;
}

.emoji-sections::-webkit-scrollbar-thumb {
  background: rgba(123, 138, 131, 0.36);
  border-radius: 999px;
}

.emoji-section {
  display: grid;
  gap: 8px;
}

.emoji-section-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  background: linear-gradient(180deg, #fff 75%, rgba(255, 255, 255, 0));
}

.emoji-section-icon {
  font-size: 18px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.emoji-option {
  min-height: 34px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 20px;
}

.emoji-option:hover {
  background: #eef5f1;
}

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

.agent-box,
.team-member {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 4px;
  background: #fbfcfb;
}

.team-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
}

.team-member {
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.team-member-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.team-member-body strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-dot {
  width: 11px;
  height: 11px;
  margin-top: 5px;
  border-radius: 999px;
  background: #7b8a83;
  box-shadow: 0 0 0 4px rgba(123, 138, 131, 0.2);
}

.team-member.online .presence-dot {
  background: #00a63e;
  box-shadow: 0 0 0 4px rgba(0, 166, 62, 0.2), 0 0 0 8px rgba(0, 166, 62, 0.08);
}

.presence-text {
  color: var(--muted);
  font-size: 12px;
}

.team-member.online .presence-text {
  color: var(--brand-dark);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  padding: 24px;
  background: rgba(23, 33, 29, 0.42);
  display: grid;
  place-items: center;
}

#shareContactModal {
  z-index: 70;
}

#transferModal {
  z-index: 50;
}

#templateModal {
  z-index: 60;
}

.modal-panel {
  width: min(560px, 100%);
  max-height: min(720px, calc(100dvh - 48px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(23, 33, 29, 0.18);
}

.group-members-panel {
  width: min(520px, 100%);
  max-height: min(700px, calc(100dvh - 48px));
  grid-template-rows: auto minmax(0, 1fr);
}

#groupMembersModal {
  z-index: 40;
}

.group-members-body {
  padding: 16px 18px 20px;
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow: auto;
}

.group-members-count {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.group-members-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.group-member-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.group-member-item strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.group-member-subtitle {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  word-break: break-all;
}

.new-conversation-panel {
  height: min(720px, calc(100dvh - 48px));
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 0;
}

.share-contact-panel {
  width: min(520px, 100%);
  height: min(680px, calc(100dvh - 48px));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
}

.conversation-history-panel {
  width: min(620px, 100%);
  max-height: min(720px, calc(100dvh - 48px));
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
}

.conversation-history-summary {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.conversation-history-count {
  margin: 0;
  padding: 16px 18px 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.conversation-history-body {
  min-height: 0;
  overflow-y: auto;
  padding: 0;
  display: block;
  background-color: var(--chat-bg);
  background-image: var(--chat-pattern);
  background-size: 180px 180px;
  background-repeat: repeat;
}

.conversation-history-list {
  display: grid;
  gap: 0;
  padding: 16px 18px 20px;
  min-height: 100%;
  align-content: start;
  background: transparent;
}

.conversation-history-thread {
  display: grid;
  gap: 12px;
}

.conversation-history-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.conversation-history-thread-time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.conversation-history-messages {
  min-height: auto;
  overflow: visible;
  padding: 0;
  background: transparent;
  background-image: none;
  background-size: auto;
  border-radius: 0;
}

.conversation-history-messages .message-actions,
.conversation-history-messages .reaction-bar,
.conversation-history-messages .message-menu {
  display: none !important;
}

.conversation-history-messages .message {
  cursor: default;
}

.conversation-history-divider {
  border-top: 1px dashed var(--line);
  margin: 18px 4px;
  padding-top: 14px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  justify-items: center;
}

.conversation-history-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  background: #edf4ef;
  color: var(--brand-dark);
}

.inline-history-entry {
  width: min(420px, 100%);
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0 auto 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.inline-history-load {
  border: 1px solid #bfd5ff;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--primary);
  min-height: 34px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
}

.inline-history-load:hover:not(:disabled) {
  background: #dceaff;
}

.inline-history-load:disabled {
  cursor: progress;
  opacity: 0.75;
}

.inline-history-error {
  color: var(--danger);
}

.inline-history-empty {
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  min-height: 34px;
  align-content: center;
  padding: 0 16px;
}

.inline-history-thread {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.inline-history-divider,
.inline-history-current-divider {
  width: min(460px, 100%);
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.inline-history-divider {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin-top: 4px;
}

.inline-history-divider span {
  border-radius: 999px;
  padding: 3px 9px;
  background: #edf4ef;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
}

.inline-history-current-divider {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin: 10px auto 12px;
}

.inline-history-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inline-history-messages .message-actions,
.inline-history-messages .reaction-bar,
.inline-history-messages .message-menu,
.inline-history-messages .image-group-download {
  display: none !important;
}

.inline-history-messages .message {
  cursor: default;
  opacity: 0.92;
}

.theme-dark .conversation-history-summary {
  background: #111b18;
  border-bottom-color: #2a3a34;
}

.theme-dark .conversation-history-body {
  background-color: #08110f;
}

.theme-dark .inline-history-load {
  background: #13223b;
  border-color: #28446f;
  color: #d6e6ff;
}

.theme-dark .inline-history-load:hover:not(:disabled) {
  background: #1a2b49;
}

.theme-dark .inline-history-empty {
  background: rgba(17, 27, 24, 0.72);
}

.theme-dark .inline-history-divider span {
  background: #173125;
  color: #9ad8b7;
}

.add-contact-panel {
  width: min(560px, 100%);
  grid-template-rows: auto minmax(0, 1fr);
}

.add-contact-form {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  display: grid;
  gap: 16px;
}

.add-contact-avatar-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  background: #fbfcfb;
}

.add-contact-avatar-preview {
  width: 82px;
  height: 82px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #e8f1ed;
  color: var(--brand-dark);
  font-size: 22px;
  font-weight: 800;
  border: 1px solid var(--line);
}

.add-contact-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.add-contact-avatar-actions {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.add-contact-avatar-actions > span {
  color: var(--text);
  font-weight: 800;
}

.add-contact-avatar-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.add-contact-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.add-contact-fields label {
  min-width: 0;
  color: var(--text);
  font-weight: 800;
}

.add-contact-fields label input {
  margin-top: 7px;
}

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

.add-contact-form .form-error {
  margin: 0;
}

.add-contact-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.contact-conflict-panel {
  width: min(460px, 100%);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.contact-conflict-body {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.contact-conflict-body p {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.45;
}

.contact-conflict-details {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}

.contact-conflict-details div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
}

.contact-conflict-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-conflict-details dd {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.contact-conflict-actions {
  padding: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

.messaging-access-panel {
  width: min(520px, 100%);
  grid-template-rows: auto 1fr auto;
}

#messagingAccessModal {
  z-index: 100;
}

.messaging-access-body {
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.messaging-access-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff3d8;
  color: #9a6500;
}

.messaging-access-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.messaging-access-copy {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.messaging-access-copy h2,
.messaging-access-copy p {
  margin: 0;
}

.messaging-access-copy h2 {
  color: var(--text);
  font-size: 20px;
}

.messaging-access-copy p:not(.eyebrow):not(.muted) {
  color: var(--text);
  line-height: 1.5;
}

.messaging-access-copy .muted {
  line-height: 1.5;
}

.messaging-access-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

.messaging-access-app-link {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.messaging-access-app-link:hover {
  background: var(--brand-dark);
}

.share-contact-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.share-contact-search input {
  width: 100%;
}

.share-contact-list {
  min-height: 0;
  overflow-y: auto;
  padding: 8px 12px;
}

.share-contact-option {
  min-height: 64px;
  padding: 7px 8px;
  border-radius: 9px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.share-contact-option:hover {
  background: #eef5f1;
}

.share-contact-option input {
  width: 19px;
  height: 19px;
  accent-color: var(--brand);
}

.share-contact-avatar {
  width: 44px;
  height: 44px;
  font-size: 13px;
}

.share-contact-option > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.share-contact-option strong,
.share-contact-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-contact-option small {
  color: var(--muted);
}

.share-contact-actions {
  min-height: 66px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.edit-contact-panel {
  width: min(440px, 100%);
  grid-template-rows: auto minmax(0, 1fr);
}

.file-request-confirm-panel {
  width: min(430px, 100%);
  grid-template-rows: auto auto;
}

.merge-previous-panel {
  width: min(520px, 100%);
  grid-template-rows: auto auto auto auto;
}

.file-request-confirm-body {
  padding: 22px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.merge-previous-body {
  padding: 22px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.file-request-confirm-body h2 {
  margin: 3px 0 8px;
  font-size: 22px;
  line-height: 1.2;
}

.merge-previous-body h2 {
  margin: 3px 0 8px;
  font-size: 22px;
  line-height: 1.2;
}

.file-request-confirm-body .muted {
  margin: 0;
  line-height: 1.5;
}

.merge-previous-body .muted {
  margin: 0;
  line-height: 1.5;
}

.file-request-confirm-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #e4f4ec;
  color: var(--brand-dark);
}

.merge-previous-icon {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8f1ff;
  color: #1d4ed8;
}

.file-request-confirm-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.merge-previous-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.merge-previous-summary {
  padding: 0 22px 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.merge-previous-card {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  gap: 4px;
}

.merge-previous-card span,
.merge-previous-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.merge-previous-card strong {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.merge-previous-error {
  min-height: 18px;
  margin: 0;
  padding: 0 22px 16px;
}

.file-request-confirm-actions {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfb;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.merge-previous-actions {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfb;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.template-modal-panel {
  width: min(620px, 100%);
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.camera-modal-panel {
  width: min(720px, 100%);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.camera-capture {
  min-height: 0;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.camera-capture video {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(62vh, 520px);
  border-radius: 8px;
  background: #101815;
  object-fit: contain;
}

.camera-capture .form-error {
  margin: 0;
}

.camera-actions {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fbfcfb;
}

.template-form {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #fbfcfb;
}

.template-form-body {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.template-variable-fields {
  display: grid;
  gap: 14px;
}

.template-form-footer {
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  background: var(--panel);
  display: grid;
  gap: 8px;
}

.template-form-body label {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
}

.template-form-body label input,
.template-form-body label select,
.template-form-body label textarea {
  margin-top: 7px;
}

.template-preview {
  min-height: 112px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
  box-shadow: inset 0 0 0 1px rgba(23, 33, 29, 0.02);
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(9, 13, 12, 0.94);
  display: grid;
  grid-template-rows: auto 1fr;
}

.media-viewer-toolbar {
  min-height: 64px;
  padding: 12px 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.media-viewer-action {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.media-viewer-action:hover {
  background: rgba(255, 255, 255, 0.22);
}

.media-viewer-action svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.media-viewer-stage {
  min-height: 0;
  padding: 0 18px 24px;
  display: grid;
  place-items: center;
  position: relative;
}

.media-viewer-content {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 100px);
  object-fit: contain;
}

.media-viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 42px;
  line-height: 1;
  transform: translateY(-50%);
}

.media-viewer-nav:hover {
  background: rgba(255, 255, 255, 0.24);
}

.media-viewer-prev {
  left: 24px;
}

.media-viewer-next {
  right: 24px;
}

.media-viewer-count {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 2;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

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

.contact-search {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.contact-mode-tabs {
  padding: 12px 12px 0;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.contact-mode-tab {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: #eef5f1;
  color: var(--text);
  font-weight: 800;
}

.contact-mode-tab:hover,
.contact-mode-tab.active {
  background: #d9eee3;
  color: var(--brand-dark);
}

.quick-contact-form {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.quick-contact-form .form-error {
  grid-column: 1 / -1;
}

.edit-contact-form {
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.edit-contact-avatar-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  background: #fbfcfb;
}

.edit-contact-avatar-preview {
  width: 82px;
  height: 82px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #e8f1ed;
  color: var(--brand-dark);
  font-size: 22px;
  font-weight: 800;
  border: 1px solid var(--line);
}

.edit-contact-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.edit-contact-avatar-actions {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.edit-contact-avatar-actions > span {
  color: var(--text);
  font-weight: 800;
}

.edit-contact-avatar-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.edit-contact-form label {
  color: var(--text);
  font-weight: 800;
}

.edit-contact-form label input {
  margin-top: 7px;
}

.edit-contact-form .form-error {
  margin: 0;
}

.edit-contact-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.contact-picker {
  min-height: 0;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: var(--brand) #e6ece9;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.contact-picker::-webkit-scrollbar {
  width: 12px;
}

.contact-picker::-webkit-scrollbar-track {
  background: #e6ece9;
  border-radius: 999px;
}

.contact-picker::-webkit-scrollbar-thumb {
  background: var(--brand);
  border: 3px solid #e6ece9;
  border-radius: 999px;
}

.empty-contact-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
}

.contact-option {
  width: 100%;
  min-height: 56px;
  background: #fbfcfb;
  color: var(--text);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.contact-option:hover {
  background: #eef5f1;
}

.contact-option span:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.simulator {
  align-self: start;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

@media (max-width: 980px) {
  .desk-view {
    grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  }

  .details {
    display: none;
  }
}

@media (max-width: 860px) {
  .conversation-row {
    align-items: start;
  }

  .conversation-flags {
    max-width: 118px;
  }
}

@media (max-width: 720px) {
  :root {
    --brand-bar-height: 82px;
  }

  .brand-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "session";
    align-items: start;
    height: var(--brand-bar-height);
    padding: 6px 12px 9px;
    gap: 0;
  }

  .brand-mark img {
    height: 42px;
    max-width: 140px;
  }

  .brand-flj .brand-mark img {
    height: 46px;
    max-width: 140px;
    transform: scale(1.04);
  }

  .brand-mark {
    grid-area: brand;
    flex: 0 0 auto;
  }

  .provider-badge {
    display: none;
  }

  .provider-badge-icon {
    width: 22px;
    height: 22px;
  }

  .provider-badge-copy {
    gap: 0;
  }

  .provider-badge-label {
    display: none;
  }

  .provider-badge-value {
    display: none;
  }

  .brand-session {
    grid-area: session;
    flex: 1 0 100%;
    min-width: 0;
    margin-top: -9px;
    gap: 8px;
    justify-content: space-between;
  }

  .brand-user {
    flex: 1;
    max-width: none;
    font-size: 0.78rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    min-width: 0;
  }

  .theme-toggle {
    min-width: 36px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .theme-toggle span {
    display: none;
  }

  .brand-logout {
    min-height: 34px;
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .brand-logout-label {
    display: none;
  }

  .contact-search,
  .quick-contact-form {
    grid-template-columns: 1fr;
  }

  .add-contact-avatar-editor,
  .add-contact-fields {
    grid-template-columns: 1fr;
  }

  .add-contact-avatar-preview {
    justify-self: center;
  }

  .add-contact-avatar-actions {
    text-align: center;
  }

  .add-contact-avatar-actions > div,
  .add-contact-actions {
    justify-content: center;
  }

  .desk-view {
    height: calc(100dvh - var(--brand-bar-height));
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }

  .sidebar {
    height: 100%;
    min-height: 0;
  }

  .conversation-pane {
    display: none;
    height: 100%;
    min-height: 0;
  }

  .desk-view.conversation-open .sidebar {
    display: none;
  }

  .desk-view.conversation-open .conversation-pane {
    display: grid;
  }

  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 10px;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-actions button {
    flex: 1;
  }

  .mobile-back-button {
    min-width: 38px;
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #eef5f1;
    color: var(--brand-dark);
  }

  .mobile-back-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  #conversationTitle {
    min-width: 0;
  }

  .message {
    max-width: 92%;
  }

  .composer {
    position: relative;
    grid-template-columns: 42px 42px 42px minmax(0, 1fr) 48px 48px;
    grid-template-areas:
      "reply reply reply reply reply reply"
      "template template file file file file"
      "attach emoji sticker input cancel send";
    gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(217, 225, 221, 0.9);
    background: #f7faf8;
  }

  .reply-preview {
    grid-area: reply;
    min-height: 48px;
    border-radius: 14px;
    background: #ffffff;
  }

  .composer-icon {
    width: 42px;
    min-height: 42px;
    background: #eef5f1;
  }

  #attachButton {
    grid-area: attach;
  }

  #emojiButton {
    grid-area: emoji;
  }

  #stickerButton { grid-area: sticker; }

  .template-button {
    grid-area: template;
  }

  .file-request-button {
    grid-area: file;
  }

  .template-button,
  .file-request-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
    line-height: 1.1;
  }

  #messageInput {
    grid-area: input;
    min-height: 42px;
    border: 0;
    border-radius: 22px;
    background: #ffffff;
    padding: 10px 14px;
    box-shadow: 0 0 0 1px rgba(217, 225, 221, 0.9);
  }

  #messageInput:focus {
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.18);
  }

  #cancelAudioButton {
    grid-area: cancel;
    width: 48px;
    min-width: 48px;
    min-height: 42px;
    padding: 0;
    border-radius: 22px;
  }

  #sendButton {
    grid-area: send;
    width: 48px;
    min-width: 48px;
    min-height: 42px;
    padding: 0;
    border-radius: 22px;
    font-size: 0;
    display: grid;
    place-items: center;
  }

  #sendButton::before {
    content: none;
  }

  .attachment-menu {
    left: 10px;
    bottom: calc(60px + env(safe-area-inset-bottom));
  }

  .emoji-picker {
    left: 10px;
    bottom: calc(60px + env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
  }
}

/* Ajustes finais de contraste para o tema escuro. Mantidos no fim para
   prevalecer sobre as cores claras específicas dos componentes. */
.theme-dark .sidebar,
.theme-dark .sidebar-header,
.theme-dark .conversation-search,
.theme-dark .filters,
.theme-dark .queue-tabs,
.theme-dark .conversation-list {
  background: #0d1b18;
}

.theme-dark .conversation-search input,
.theme-dark .conversation-search input:focus {
  background: #142622;
  color: #e8f3ef;
  box-shadow: inset 0 0 0 1px #29433c;
}

.theme-dark .archived-conversations {
  background: #132521;
  color: #bfd1ca;
  box-shadow: inset 0 0 0 1px #294039;
}

.theme-dark .archived-conversations:hover,
.theme-dark .archived-conversations.active {
  background: #19352e;
  color: #eaf6f2;
}

.theme-dark .filter,
.theme-dark .queue-tab {
  border-color: #294039;
  background: #142622;
  color: #b6c9c1;
}

.theme-dark .filter:hover,
.theme-dark .queue-tab:hover {
  background: #1a352e;
  color: #f0f8f5;
}

.theme-dark .filter.active {
  border-color: color-mix(in srgb, var(--brand) 68%, #8fded1);
  background: color-mix(in srgb, var(--brand) 32%, #142622);
  color: #f4fbf9;
}

.theme-dark .queue-tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.theme-dark .conversation-item:hover {
  background: #142923;
}

.theme-dark .conversation-item.active {
  background: #193a32;
  box-shadow: inset 4px 0 0 var(--brand);
}

.theme-dark .conversation-item.unread {
  background: #112c25;
}

.theme-dark .message.system {
  background: #15211e;
  border-color: #31423c;
}

.theme-dark .transfer-preview {
  background: #14211e;
  border-color: #31423c;
  color: #dce7e1;
}

.theme-dark .conversation-item.active .muted,
.theme-dark .conversation-item.active .preview {
  color: #b8cdc5;
}

.theme-dark .conversation-select {
  background: #101b25;
  border-color: #233142;
  color: #f1f7fb;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.theme-dark .conversation-select:hover {
  background: #13202c;
}

.theme-dark .conversation-item.active .conversation-select {
  background: #173042;
  border-color: #3b82f6;
  box-shadow: inset 4px 0 0 #60a5fa, 0 12px 26px rgba(37, 99, 235, 0.16);
}

.theme-dark .conversation-item.unread .conversation-select {
  background: #112622;
  border-color: #25433d;
}

.theme-dark .contact-name,
.theme-dark .conversation-time,
.theme-dark .conversation-owner {
  color: #eef5fb;
}

.theme-dark .conversation-time,
.theme-dark .conversation-owner,
.theme-dark .contact-company,
.theme-dark .conversation-assignee {
  color: #b7c6d6;
}

.theme-dark .badge {
  background: #162733;
  color: #dbeafe;
  border: 1px solid #2d4661;
}

.theme-dark .unread-count {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12);
}

.theme-dark .conversation-status {
  background: #162733;
  color: #dbeafe;
  border-color: #2d4661;
}

.theme-dark .messages {
  background-color: #08110f;
}

.theme-dark .admin-dashboard-period select,
.theme-dark .admin-stat-card,
.theme-dark .admin-dashboard-section {
  background: rgba(15, 23, 20, 0.92);
  border-color: #2a3934;
}

.theme-dark .admin-stat-card strong,
.theme-dark .admin-dashboard-header h2,
.theme-dark .admin-dashboard-section h3,
.theme-dark .admin-assignee-row span {
  color: #eef7f3;
}

.theme-dark .admin-assignee-row {
  background: #111b18;
  border-color: #2a3934;
}

.theme-dark .admin-assignee-row strong {
  color: #7dd3a8;
}

.theme-dark .whatsapp-costs-form input,
.theme-dark .whatsapp-cost-card {
  background: #111b18;
  border-color: #2a3934;
  color: #eef7f3;
}

.theme-dark .whatsapp-cost-card strong,
.theme-dark .whatsapp-costs-table td {
  color: #eef7f3;
}

.theme-dark .whatsapp-costs-table th,
.theme-dark .whatsapp-costs-table td {
  border-color: #2a3934;
}

.theme-dark .whatsapp-costs-table .total-row td {
  color: #7dd3a8;
}

.theme-dark .admin-stat-card:hover,
.theme-dark .admin-stat-card:focus-visible {
  background: #14211d;
}

.theme-dark .admin-stat-card.is-selected {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16), 0 16px 34px rgba(0, 0, 0, 0.26);
}

.theme-dark .message {
  color: #111827;
}

.theme-dark .message.in,
.theme-dark .message.out,
.theme-dark .message.system {
  color: #111827;
}

.theme-dark .message.in {
  background: #1b2a3a;
  border-color: #33475e;
  color: #e7eef5;
}

.theme-dark .message.in .message-text,
.theme-dark .message.in .message-meta,
.theme-dark .message.in .shared-contact-text,
.theme-dark .message.in .call-message-text {
  color: #e2eaf3;
}

.theme-dark .message.in .audio-message {
  background: #1b2a3a;
}

.theme-dark .message.in .audio-play {
  color: #dce8f5;
}

.theme-dark .message.in .audio-play:hover {
  background: rgba(226, 234, 243, .12);
}

.theme-dark .message-text,
.theme-dark .message-meta,
.theme-dark .reply-quote strong,
.theme-dark .reply-quote span,
.theme-dark .shared-contact-text,
.theme-dark .call-message-text {
  color: #111827;
}

.theme-dark .message-meta {
  color: #64748b;
}

.theme-dark .reply-quote {
  background: rgba(255, 255, 255, 0.82);
  border-left-color: #60a5fa;
}

.theme-dark .reply-quote strong {
  color: #1d4ed8;
}

.theme-dark .reply-quote span {
  color: #475569;
}

.theme-dark .message-checks {
  color: #64748b;
}

.theme-dark .message-checks.read {
  color: #38bdf8;
}

.theme-dark .message.system .message-text {
  color: #e2e8f0;
}

.theme-dark .message-actions-toggle {
  background: #1a2925;
  color: #c8d9d2;
  border-color: #2a3a34;
}

.theme-dark .message-actions-toggle:hover {
  background: #20312b;
  color: #f0f8f5;
}

.theme-dark .message-actions-menu {
  background: #111b18;
  border-color: #2a3934;
}

.theme-dark .message-actions-menu::before {
  background: #111b18;
  border-color: #2a3934;
}

.theme-dark .message-menu-item:hover {
  background: #1a352e;
  color: #f0f8f5;
}

.theme-dark .conversation-menu,
.theme-dark .reaction-bar,
.theme-dark .document-card,
.theme-dark .shared-contact-card {
  background: #162723;
  color: var(--text);
  border-color: var(--line);
}

.theme-dark .app-toast {
  background: #142622;
  color: #dff6ed;
  border-color: #2b6653;
}

.theme-dark .app-toast.error {
  background: #2b1717;
  color: #fee2e2;
  border-color: #7f1d1d;
}

/* Modais: superfícies e controles precisam permanecer no mesmo plano de
   contraste. Alguns componentes usam cores claras fixas no tema padrão. */
.theme-dark .modal {
  background: rgba(2, 10, 8, 0.74);
  backdrop-filter: blur(3px);
}

.theme-dark .modal-panel {
  background: #101d19;
  border-color: #30443d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.theme-dark .modal-header,
.theme-dark .contact-search,
.theme-dark .quick-contact-form,
.theme-dark .add-contact-actions,
.theme-dark .edit-contact-actions,
.theme-dark .file-request-confirm-actions,
.theme-dark .merge-previous-actions,
.theme-dark .template-form-footer,
.theme-dark .camera-actions {
  background: #101d19;
  border-color: #30443d;
}

.theme-dark .template-form,
.theme-dark .template-form-body,
.theme-dark .contact-picker,
.theme-dark .add-contact-form,
.theme-dark .edit-contact-form,
.theme-dark .camera-capture {
  background: #0d1815;
}

.theme-dark .edit-contact-avatar-editor {
  background: #111f1a;
}

.theme-dark .merge-previous-card {
  background: #162722;
  border-color: #30483f;
}

.theme-dark .add-contact-avatar-editor {
  background: #162722;
  border-color: #30483f;
}

.theme-dark .add-contact-avatar-preview {
  background: #20382f;
  color: #c9f2e3;
  border-color: #385047;
}

.theme-dark .file-request-confirm-icon {
  background: #18362d;
  color: #b7ead8;
}

.theme-dark .merge-previous-icon {
  background: #172846;
  color: #b9d5ff;
}

.theme-dark .modal input,
.theme-dark .modal textarea,
.theme-dark .modal select {
  background: #162722;
  color: #edf5f1;
  border-color: #385047;
}

.theme-dark .modal input:focus,
.theme-dark .modal textarea:focus,
.theme-dark .modal select:focus {
  border-color: color-mix(in srgb, var(--brand) 70%, #9ee3cd);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
  outline: none;
}

.theme-dark .modal input::placeholder,
.theme-dark .modal textarea::placeholder {
  color: #8da29a;
}

.theme-dark .modal .secondary,
.theme-dark .modal .icon-button {
  background: #1c302a;
  color: #e1eee9;
  border-color: #385047;
}

.theme-dark .modal .secondary:hover,
.theme-dark .modal .icon-button:hover {
  background: #29433a;
  color: #fff;
}

.theme-dark .modal .conversation-tickets-panel .conversation-tickets-close {
  border-color: #38574a;
  background: linear-gradient(145deg, #233b30, #1a2d25);
  color: #d8eee2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.theme-dark .modal .conversation-tickets-panel .conversation-tickets-close:hover {
  border-color: #5b8871;
  background: linear-gradient(145deg, #2d4a3c, #254132);
  color: #fff;
  box-shadow: 0 4px 11px rgba(0, 0, 0, 0.38);
}

.theme-dark .modal .conversation-tickets-panel .conversation-tickets-close:focus-visible {
  outline-color: rgba(132, 209, 169, 0.38);
}

.theme-dark .contact-option {
  background: #162722;
  color: #edf5f1;
  border-color: #30483f;
}

.theme-dark .contact-option:hover {
  background: #1c352d;
  border-color: #3f6255;
}

.theme-dark .share-contact-search,
.theme-dark .share-contact-actions {
  border-color: #30443d;
}

.theme-dark .share-contact-option:hover {
  background: #193029;
}

.theme-dark .contact-option .muted,
.theme-dark .modal .muted {
  color: #9fb3ab;
}

.theme-dark .contact-option .badge {
  background: #20483b;
  color: #c9f2e3;
}

.theme-dark .contact-picker {
  scrollbar-color: #397c65 #16231f;
}

.theme-dark .contact-picker::-webkit-scrollbar-track {
  background: #16231f;
}

.theme-dark .contact-picker::-webkit-scrollbar-thumb {
  background: #397c65;
  border-color: #16231f;
}

.theme-dark .template-form-body label,
.theme-dark .template-preview {
  background: #162722;
  color: #edf5f1;
  border-color: #30483f;
}

/* Cartões da equipe exibidos no painel lateral. */
.theme-dark .agent-box,
.theme-dark .team-member {
  background: #162722;
  color: #edf5f1;
  border-color: #30483f;
}

.theme-dark .team-member:hover {
  background: #1b302a;
  border-color: #3a594e;
}

.theme-dark .team-member-body strong {
  color: #edf5f1;
}

.theme-dark .presence-text {
  color: #91a69e;
}

.theme-dark .team-member.online .presence-text {
  color: #73d9ad;
}

/* Modern layout override */
:root {
  --brand-bar-height: 60px;
  --bg: #f6f7fb;
  --panel: #ffffff;
  --line: #e2e8f0;
  --text: #1f2937;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --accent: #2563eb;
  --danger: #dc2626;
  --incoming: #ffffff;
  --outgoing: #dcfce7;
  --chat-bg: #f8fafc;
}

body {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 24%),
    linear-gradient(180deg, #f6f7fb 0%, #eef2f7 100%);
}

.brand-bar {
  height: var(--brand-bar-height);
  margin: 12px 12px 0;
  padding: 0 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.brand-mark img {
  height: 36px;
  max-width: 160px;
}

.provider-badge {
  padding: 6px 10px;
  border-radius: 999px;
  border-color: rgba(226, 232, 240, 0.95);
  background: #f8fafc;
}

.provider-badge-icon {
  width: 24px;
  height: 24px;
}

.brand-session {
  gap: 10px;
}

.brand-user {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.brand-logout,
.theme-toggle {
  min-height: 34px;
  padding: 0 14px;
}

.desk-view {
  height: calc(100dvh - var(--brand-bar-height) - 24px);
  margin: 12px;
  gap: 12px;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr) minmax(280px, 320px);
}

.sidebar,
.conversation-pane,
.details {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.sidebar {
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
}

.details {
  border-left: 1px solid rgba(226, 232, 240, 0.95);
  padding: 14px 10px 14px 14px;
  gap: 12px;
  scrollbar-gutter: stable;
}

.sidebar-header,
.topbar,
.details-header {
  min-height: 68px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.sidebar-header h2,
.details-header h2 {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.sidebar-actions,
.topbar-actions {
  gap: 8px;
}

.icon-button,
.topbar-action,
.conversation-chip,
.conversation-status,
.filter,
.queue-tab,
.composer-icon,
.template-button,
.file-request-button,
.brand-logout,
.theme-toggle {
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: none;
}

.team-action {
  display: none;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
}

.conversation-search {
  padding: 12px 14px 10px;
  border-bottom: 0;
  background: transparent;
}

.conversation-search input {
  min-height: 44px;
  border-radius: 14px;
  background: #f8fafc;
}

.filters {
  padding: 2px 12px 10px;
  gap: 8px;
  flex-wrap: wrap;
}

.filter {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #eff4f9;
  color: #334155;
}

.filter.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.queue-tabs {
  padding: 0 12px 12px;
  gap: 8px;
  border-bottom: 0;
}

.queue-tab {
  min-height: 34px;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
}

.queue-tab.active {
  background: #e0efff;
  color: #1d4ed8;
  border-color: #bfdbfe;
  box-shadow: none;
}

.conversation-list {
  padding: 0 8px 6px;
}

.conversation-item {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  border-bottom: 0;
  padding: 3px 8px;
  background: transparent;
}

.conversation-item.menu-open {
  z-index: 8;
}

.conversation-item.active,
.conversation-item.unread {
  background: transparent;
}

.conversation-select {
  min-height: 72px;
  padding: 9px 50px 9px 12px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  align-items: flex-start;
}

.conversation-select:hover {
  background: #f8fbff;
}

.conversation-item.active .conversation-select {
  background: #eff6ff;
  border-color: #bfdbfe;
  box-shadow: inset 3px 0 0 #2563eb, 0 10px 24px rgba(37, 99, 235, 0.12);
}

.conversation-item.unread .conversation-select {
  background: #f8fbff;
  border-color: #dbeafe;
}

.conversation-item.unread .conversation-select {
  padding-left: 12px;
}

.conversation-menu-wrap {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  z-index: 2;
}

.conversation-item.menu-open .conversation-menu-wrap {
  z-index: 9;
}

.conversation-menu-toggle {
  width: 34px;
  min-height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.08);
  transition: opacity 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.conversation-item:hover .conversation-menu-toggle,
.conversation-menu-toggle[aria-expanded="true"] {
  opacity: 1;
  pointer-events: auto;
  background: #dbeafe;
  border-color: #93c5fd;
}

.conversation-menu-toggle:hover {
  background: #bfdbfe;
  color: #1d4ed8;
}

.conversation-item .preview,
.conversation-item .muted,
.conversation-item .conversation-flags {
  display: none;
}

.conversation-summary {
  gap: 4px;
}

.conversation-row {
  gap: 12px;
}

.conversation-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.contact-company {
  display: block;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.conversation-preview {
  display: -webkit-box;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.conversation-meta,
.conversation-extra {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.conversation-status {
  padding: 3px 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.conversation-status.is-waiting {
  background: #f1f5f9;
  color: #64748b;
}

.conversation-status.is-assigned {
  background: #dcfce7;
  color: #15803d;
}

.conversation-status.is-closed {
  background: #e2e8f0;
  color: #475569;
}

.conversation-owner {
  color: var(--muted);
  font-size: 12px;
}

.conversation-assignee {
  min-width: 0;
  max-width: 142px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.conversation-unread {
  position: absolute;
  top: 14px;
  right: 44px;
  min-width: 22px;
  height: 22px;
  margin: 0;
  padding: 0 6px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  display: inline-grid;
  place-items: center;
  align-self: start;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

.conversation-avatar {
  width: 48px;
  height: 48px;
  box-shadow: none;
}

.conversation-pane {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.conversation-pane.idle .topbar,
.conversation-pane.idle .composer {
  display: none;
}

.topbar {
  padding: 16px 18px;
  align-items: flex-start;
  gap: 12px;
}

#conversationTitle {
  align-items: flex-start;
  gap: 14px;
}

.conversation-heading {
  gap: 6px;
}

.conversation-heading h2 {
  font-size: 21px;
  line-height: 1.1;
}

.conversation-heading .muted {
  color: var(--muted);
  font-size: 13px;
}

.conversation-live-status {
  color: var(--brand-dark);
  font-weight: 600;
}

.conversation-tickets-panel {
  width: min(720px, calc(100vw - 32px));
  max-height: min(82vh, 760px);
}

.conversation-tickets-panel .conversation-tickets-close {
  flex: 0 0 40px;
  width: 40px;
  min-height: 40px;
  border: 1px solid #d6e7de;
  background: linear-gradient(145deg, #f7fbf9, #eaf4ef);
  color: var(--brand-dark);
  box-shadow: 0 2px 7px rgba(13, 89, 52, 0.12);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.conversation-tickets-panel .conversation-tickets-close svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.conversation-tickets-panel .conversation-tickets-close:hover {
  transform: translateY(-1px);
  border-color: #b8d7c7;
  background: linear-gradient(145deg, #edf7f2, #deeee6);
  color: #08482a;
  box-shadow: 0 4px 10px rgba(13, 89, 52, 0.18);
}

.conversation-tickets-panel .conversation-tickets-close:active {
  transform: translateY(0) scale(0.96);
}

.conversation-tickets-panel .conversation-tickets-close:focus-visible {
  outline: 3px solid rgba(23, 114, 69, 0.24);
  outline-offset: 2px;
}

.conversation-tickets-body {
  display: grid;
  gap: 16px;
  max-height: calc(82vh - 86px);
  overflow: auto;
  padding: 18px 22px 22px;
}

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

.conversation-ticket-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid #e7edf3;
  border-radius: 14px;
  background: #fff;
}

.conversation-ticket-card header,
.conversation-ticket-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.conversation-ticket-card p,
.conversation-ticket-card small {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.conversation-ticket-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #e7edf3;
}

.conversation-ticket-form label,
.conversation-ticket-form .wide {
  grid-column: 1 / -1;
}

.conversation-ticket-form input,
.conversation-ticket-form select,
.conversation-ticket-form textarea {
  width: 100%;
}

@media (max-width: 560px) {
  .conversation-ticket-form { grid-template-columns: 1fr; }
  .conversation-ticket-form label { grid-column: 1; }
}

.conversation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.conversation-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.conversation-chip strong {
  color: #1f2937;
  font-weight: 800;
}

.conversation-chip-provider {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}

.conversation-chip-status {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.topbar-actions button {
  min-height: 34px;
}

.messages {
  padding: 24px;
  background-color: #f8fafc;
  background-size: 180px 180px;
}

.message {
  max-width: min(540px, 78%);
  padding: 12px 14px 10px;
  border-radius: 16px;
  border-color: #e2e8f0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.message.in {
  background: #ffffff;
  align-self: flex-start;
}

.message.out {
  background: #dcfce7;
  border-color: #bbf7d0;
  align-self: flex-end;
}

.message.system {
  background: #f8fafc;
}

.message-meta {
  color: var(--muted);
}

.composer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 14px 16px 16px;
  grid-template-columns: auto auto auto auto minmax(120px, 1fr) 52px;
  gap: 10px;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -16px 30px rgba(15, 23, 42, 0.04);
}

.composer #attachButton { grid-column: 1; }
.composer #emojiButton { grid-column: 2; }
.composer #stickerButton { grid-column: 3; }
.composer .template-button { grid-column: 4; }
.composer #messageInput { grid-column: 5; width: 100%; min-width: 0; }
.composer #cancelAudioButton { grid-column: 1; }

.composer-icon,
.template-button,
.file-request-button {
  background: #f8fafc;
  color: #334155;
}

.composer { position: relative; }

.sticker-picker {
  position: absolute;
  z-index: 12;
  left: 112px;
  bottom: calc(100% + 8px);
  width: min(340px, calc(100vw - 32px));
  max-height: min(380px, 55vh);
  padding: 12px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  overflow: hidden;
  border: 1px solid var(--inbox-border, #e2e8f0);
  border-radius: 16px;
  background: var(--inbox-surface, #fff);
  box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
}

.sticker-picker.hidden { display: none; }
.sticker-picker-header { display: flex; align-items: center; justify-content: space-between; }
.sticker-add-button { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; min-height: 34px; padding: 0; border: 1px solid var(--inbox-border, #e2e8f0); border-radius: 50%; background: var(--chat-control, #f1f5f9); color: var(--inbox-text, #334155); cursor: pointer; }
.sticker-add-button:hover { background: var(--inbox-hover, #e8eef6); }
.sticker-add-button:focus-visible { outline: 2px solid var(--inbox-accent, #3b82f6); outline-offset: 2px; }
.sticker-add-button svg { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sticker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; overflow: auto; }
.sticker-option { min-width: 0; aspect-ratio: 1; padding: 5px; border-radius: 10px; background: transparent; }
.sticker-option:hover { background: var(--chat-control, #f1f5f9); }
.sticker-option img { width: 100%; height: 100%; object-fit: contain; }
.sticker-empty { grid-column: 1 / -1; padding: 28px 8px; color: var(--muted, #64748b); text-align: center; font-size: 13px; }

#messageInput {
  min-height: 46px;
  max-height: 146px;
  line-height: 1.35;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  resize: none;
  overflow-y: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#sendButton {
  grid-column: 6;
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  justify-self: end;
  min-height: 46px;
  border-radius: 16px;
  background: #22c55e;
  color: #fff;
  box-shadow: 0 12px 22px rgba(34, 197, 94, 0.24);
}

#sendButton:hover {
  background: #16a34a;
}

.details-header {
  display: grid;
  gap: 8px;
}

.details-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.details-close-button {
  display: none;
}

.team-search {
  min-height: 44px;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  color: #94a3b8;
}

.team-search svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.team-search input {
  min-height: 40px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.team-list {
  padding-right: 12px;
  scrollbar-gutter: stable;
}

.team-groups {
  display: grid;
  gap: 12px;
}

.team-section {
  display: grid;
  gap: 10px;
}

.team-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #1f2937;
  font-size: 13px;
  font-weight: 800;
}

.team-section-header span {
  color: #64748b;
  font-size: 12px;
}

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

.team-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.team-avatar {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.team-card-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.team-card-body strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-card-status,
.team-section-empty,
.team-empty {
  color: #64748b;
  font-size: 12px;
}

.team-card.online .team-card-status {
  color: #15803d;
}

.team-card .presence-dot {
  margin-top: 0;
  justify-self: end;
}

.team-card.online .presence-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16), 0 0 0 8px rgba(34, 197, 94, 0.08);
}

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

  .details {
    position: fixed;
    top: calc(var(--brand-bar-height) + 24px);
    right: 12px;
    bottom: 12px;
    width: min(360px, calc(100vw - 24px));
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(100% + 24px));
    transition: transform 0.22s ease, opacity 0.22s ease;
  }

  .desk-view.team-open .details {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  .team-action {
    display: inline-flex;
  }

  .details-close-button {
    display: grid;
  }
}

@media (max-width: 900px) {
  .desk-view {
    grid-template-columns: 1fr;
  }

  .admin-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    display: grid;
  }

  .conversation-pane {
    display: none;
  }

  .desk-view.conversation-open .sidebar {
    display: none;
  }

  .desk-view.conversation-open .conversation-pane {
    display: grid;
  }

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

  .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .topbar-actions button {
    flex: 1 0 auto;
  }

  .mobile-back-button {
    min-width: 40px;
    width: 40px;
    height: 40px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
  }

  .details {
    left: 12px;
    right: 12px;
    top: calc(var(--brand-bar-height) + 12px);
    bottom: 12px;
    width: auto;
  }

  .team-action {
    display: inline-flex;
  }
}

@media (max-width: 560px) {
  :root {
    --brand-bar-height: 78px;
  }

  .merge-previous-summary {
    grid-template-columns: 1fr;
  }

  .brand-bar {
    margin: 8px 8px 0;
    padding: 4px 14px 8px;
    border-radius: 16px;
  }

  .brand-mark img {
    height: 56px;
    max-width: 170px;
  }

  .brand-flj .brand-mark img {
    height: 60px;
    max-width: 170px;
    transform: scale(1.02);
  }

  .brand-session {
    margin-top: -22px;
    align-items: center;
  }

  .brand-user {
    font-size: 0.8rem;
  }

  .desk-view {
    margin: 8px;
    height: calc(100dvh - var(--brand-bar-height) - 16px);
  }

  .sidebar-header,
  .topbar,
  .details-header {
    padding: 12px 14px;
  }

  .conversation-select {
    min-height: 72px;
  }

  .conversation-heading h2 {
    font-size: 18px;
  }

  .conversation-chips {
    gap: 6px;
  }

  .conversation-chip {
    padding: 6px 10px;
  }

  .messages {
    padding: 18px 14px;
  }

  .conversation-pane.idle .messages {
    padding: 18px 14px;
  }

  .admin-dashboard-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-dashboard-period {
    min-width: 0;
    grid-template-columns: 1fr 1fr;
  }

  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .whatsapp-costs-header {
    align-items: stretch;
    flex-direction: column;
  }

  .whatsapp-costs-form {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .whatsapp-costs-cards {
    grid-template-columns: 1fr;
  }

  .composer {
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .details {
    border-radius: 18px;
  }
}

/* Navigation rail and extensible application modules */
.rail-toggle,
.rail-label {
  display: none;
}

.navigation-rail {
  grid-column: 1;
  grid-row: 1;
  width: 58px;
  min-width: 58px;
  min-height: 0;
  height: 100%;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid #e7edf3;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
  z-index: 10;
}

.rail-brand {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-bottom: 1px solid #e7edf3;
}

.rail-brand img {
  width: 27px;
  height: 27px;
  display: block;
  object-fit: contain;
}

.rail-menu,
.rail-footer {
  display: grid;
  gap: 10px;
  justify-items: center;
}

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

.rail-item {
  position: relative;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #718096;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.rail-item:hover {
  background: #f3f7fc;
  color: #1268e5;
  transform: translateY(-1px);
}

.rail-item.active {
  background: #eaf3ff;
  color: #1268e5;
}

.rail-item.active .rail-indicator {
  position: absolute;
  left: -9px;
  width: 3px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: #1268e5;
}

.rail-item[data-connection-id] { color: var(--rail-connection-color, #168a64); }
.rail-item[data-connection-id] .rail-indicator { background: var(--rail-connection-color, #168a64); }
.rail-item[data-connection-id]:hover { color: var(--rail-connection-color, #168a64); }
.rail-item[data-connection-id].active {
  color: var(--rail-connection-color, #168a64);
  background: color-mix(in srgb, var(--rail-connection-color, #168a64) 12%, #fff);
}
.rail-item[data-connection-id].active .rail-indicator { background: var(--rail-connection-color, #168a64); }

.rail-unread-badge {
  position: absolute;
  top: -4px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.rail-calendar-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #1268e5;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.rail-item .lucide {
  width: 21px;
  height: 21px;
  display: block;
}

.conversation-channel-chip {
  border-color: color-mix(in srgb, var(--conversation-channel-color, #168a64) 38%, #dce5ef) !important;
  background: color-mix(in srgb, var(--conversation-channel-color, #168a64) 10%, #fff) !important;
  color: var(--conversation-channel-color, #168a64) !important;
}

.rail-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  z-index: 30;
  padding: 7px 9px;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  background: #172b45;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(4px, -50%);
  transition: opacity .16s ease, transform .16s ease;
}

.rail-item:hover::after,
.rail-item:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.desk-view {
  grid-template-columns: 58px 390px minmax(0, 1fr) 280px !important;
}

.desk-view.no-details {
  grid-template-columns: 58px 390px minmax(0, 1fr) !important;
}

.desk-view.module-mode {
  grid-template-columns: 58px minmax(0, 1fr) !important;
}

.desk-view.module-mode > .sidebar,
.desk-view.module-mode > .conversation-pane,
.desk-view.module-mode > .details {
  display: none !important;
}

.desk-view.module-mode > .module-view {
  grid-column: 2;
  grid-row: 1;
  display: block;
}

.module-view {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid #e7edf3;
  border-radius: 20px;
  background: #f8fafc;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .06);
}

.module-content,
.module-shell {
  min-height: 100%;
}

.module-shell {
  padding: 28px;
}

.module-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.module-header h1 {
  margin: 0;
  color: #172b45;
  font-size: 30px;
  letter-spacing: -.04em;
}

.module-subtitle {
  margin: 7px 0 0;
  color: #718096;
  font-size: 14px;
}

.module-primary {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  background: #1268e5;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(18, 104, 229, .18);
}

.module-primary:hover {
  background: #0c56c4;
}

.calendar-module-shell { max-width: 1180px; margin: 0 auto; padding: 34px clamp(20px, 4vw, 52px); }
.calendar-module-header .module-primary { display: inline-flex; align-items: center; gap: 8px; }
.calendar-search { width: min(420px, 100%); min-height: 44px; margin: 0 0 25px; padding: 0 13px; display: flex; align-items: center; gap: 10px; border: 1px solid #e4eaf1; border-radius: 12px; background: #fff; color: #8290a2; }
.calendar-search input { width: 100%; border: 0; outline: 0; color: #172b45; background: transparent; font: inherit; }
.calendar-list-section { margin: 0 0 30px; }
.calendar-list-heading { display: flex; align-items: center; gap: 10px; margin: 0 0 13px; }
.calendar-list-heading h2 { margin: 0; color: #26384e; font-size: 16px; }
.calendar-list-heading > span { min-width: 23px; height: 23px; display: grid; place-items: center; border-radius: 99px; background: #eaf2ff; color: #1268e5; font-size: 11px; font-weight: 800; }
.calendar-reminder-list { display: grid; gap: 10px; }
.calendar-reminder { min-width: 0; display: flex; align-items: center; gap: 14px; padding: 16px 17px; border: 1px solid #e7edf3; border-radius: 15px; background: #fff; box-shadow: 0 5px 18px rgba(15, 23, 42, .035); transition: border-color .18s, background .18s, box-shadow .18s; }
.calendar-reminder:hover { border-color: #d8e3f0; box-shadow: 0 8px 22px rgba(15, 23, 42, .055); }
.calendar-reminder-check { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; flex: 0 0 20px; margin: 0; padding: 0; display: inline-grid; place-items: center; border: 1.5px solid #c4ceda !important; border-radius: 50%; background: #fff !important; color: transparent !important; box-shadow: none !important; cursor: pointer; transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease; }
.calendar-reminder-check:hover { border-color: #1268e5 !important; background: #f4f8ff !important; transform: scale(1.06); }
.calendar-reminder-check:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(18, 104, 229, .17) !important; }
.calendar-reminder-check > .lucide { width: 12px; height: 12px; stroke-width: 2.5; }
.calendar-reminder-check.is-static, .calendar-reminder.is-completed .calendar-reminder-check:not(.is-static) { border-color: #1268e5 !important; background: #1268e5 !important; color: #fff !important; cursor: default; }
.calendar-reminder-check.is-static > .lucide, .calendar-reminder.is-completed .calendar-reminder-check:not(.is-static) > .lucide { color: #fff; }
.calendar-reminder-copy { min-width: 0; flex: 1; padding: 1px 0; }
.calendar-reminder-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.calendar-reminder-title-row h3 { margin: 0; color: #20334a; font-size: 14px; font-weight: 750; }
.calendar-reminder-date { margin: 8px 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: #718096; font-size: 12px; line-height: 1.45; }
.calendar-reminder-date > span { display: inline-flex; align-items: center; gap: 4px; }
.calendar-reminder-description { margin: 8px 0 0; color: #586a80; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.calendar-reminder-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; }
.calendar-reminder-actions button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #7b899b; transition: background .16s, border-color .16s, color .16s; }
.calendar-reminder-actions button:hover { border-color: #e7edf4; background: #f5f8fc; color: #1268e5; }
.calendar-form-close { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: transparent; color: #76869b; }
.calendar-form-close:hover { background: #f1f5f9; color: #1268e5; }
.calendar-reminder-actions button.danger:hover { color: #d34848; }
.calendar-reminder.is-overdue { border-color: #f2d3d1; }
.calendar-overdue-label { padding: 3px 8px; border-radius: 99px; background: #fff0ef; color: #bd4540; font-size: 10px; font-weight: 800; }
.calendar-reminder.is-completed { border-color: #e8edf3; background: #fbfcfe; box-shadow: none; }
.calendar-reminder.is-completed .calendar-reminder-title-row h3 { color: #718096; text-decoration: line-through; text-decoration-color: #9aa8b8; }
.calendar-reminder.is-completed .calendar-reminder-date, .calendar-reminder.is-completed .calendar-reminder-description, .calendar-reminder.is-completed .calendar-message-preview { color: #94a0ae; }
.calendar-completed-section .calendar-list-heading h2 { color: #78889a; }
.calendar-empty { min-height: 178px; display: grid; justify-items: center; align-content: center; gap: 8px; border: 1px dashed #dce5ee; border-radius: 16px; background: #fbfcfe; text-align: center; }
.calendar-empty > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: #edf5ff; color: #2674d9; }
.calendar-empty strong { color: #26384e; font-size: 14px; }
.calendar-empty p { margin: 0; color: #78889a; font-size: 12px; }
.calendar-form { display: grid; gap: 15px; margin: 0 0 24px; padding: 22px; border: 1px solid #dce6f1; border-radius: 17px; background: #fff; box-shadow: 0 12px 30px rgba(15, 23, 42, .06); }
.calendar-form-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.calendar-form-heading h2 { margin: 0; color: #20334a; font-size: 17px; }
.calendar-form-heading p { margin: 5px 0 0; color: #78889a; font-size: 12px; }
.calendar-form label { display: grid; gap: 7px; color: #52647a; font-size: 12px; font-weight: 750; }
.calendar-form label span { color: #8795a5; font-weight: 500; }
.calendar-form input, .calendar-form select, .calendar-form textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #dfe6ee; border-radius: 10px; outline: 0; background: #fff; color: #20334a; font: inherit; font-size: 13px; }
.calendar-form textarea { resize: vertical; }
.calendar-form input:focus, .calendar-form select:focus, .calendar-form textarea:focus { border-color: #6ca6f0; box-shadow: 0 0 0 3px rgba(18, 104, 229, .1); }
.calendar-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calendar-form > footer { display: flex; justify-content: flex-end; gap: 9px; }
.calendar-form > footer .module-primary { min-height: 40px; }
.calendar-cancel { min-height: 40px; padding: 0 15px; border: 1px solid #dfe6ee; border-radius: 10px; background: #fff; color: #52647a; font-weight: 700; }
.calendar-error { margin: 0 0 16px; padding: 11px 14px; border-radius: 10px; background: #fff0ef; color: #a43834; font-size: 13px; }
.calendar-message-preview { margin: 9px 0 0; display: flex; align-items: flex-start; gap: 5px; color: #536c88; font-size: 12px; white-space: pre-wrap; }
.calendar-message-preview .lucide { flex: 0 0 auto; margin-top: 1px; }
.calendar-send-error { margin: 8px 0 0; color: #b33c38; font-size: 12px; }
.calendar-send-status { display: inline-flex; margin-top: 8px; padding: 4px 8px; border-radius: 99px; background: #fff5e5; color: #956017; font-size: 10px; font-weight: 800; }
.calendar-send-status.sent { background: #e9f7ef; color: #16845b; }
.calendar-form [hidden] { display: none !important; }
.calendar-template-variable-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.calendar-variable-field { min-width: 0; }
.calendar-template-empty { margin: 10px 0 0; color: #a46825; font-size: 12px; }
.theme-dark .calendar-search, .theme-dark .calendar-reminder, .theme-dark .calendar-form { border-color: #2b4038; background: #17251f; }
.theme-dark .calendar-search input, .theme-dark .calendar-list-heading h2, .theme-dark .calendar-reminder-title-row h3, .theme-dark .calendar-form-heading h2, .theme-dark .calendar-empty strong { color: #e1ece5; }
.theme-dark .calendar-reminder-description, .theme-dark .calendar-reminder-date, .theme-dark .calendar-form-heading p { color: #a2b3aa; }
.theme-dark .calendar-empty { border-color: #344a40; background: #14221c; }
.theme-dark .calendar-reminder-check { border-color: #75897e !important; background: #17251f !important; }
.theme-dark .calendar-reminder-check:hover { background: #20362c !important; }
.theme-dark .calendar-reminder-check.is-static, .theme-dark .calendar-reminder.is-completed .calendar-reminder-check:not(.is-static) { border-color: #1268e5 !important; background: #1268e5 !important; }
.theme-dark .calendar-reminder.is-completed { border-color: #283a32; background: #14221c; }
.theme-dark .calendar-reminder.is-completed .calendar-reminder-title-row h3 { color: #9cac9f; }
.theme-dark .calendar-reminder.is-completed .calendar-reminder-date, .theme-dark .calendar-reminder.is-completed .calendar-reminder-description, .theme-dark .calendar-reminder.is-completed .calendar-message-preview { color: #7f9286; }
.theme-dark .calendar-reminder-actions button:hover { border-color: #30463b; background: #20352b; color: #78aef4; }
.theme-dark .calendar-reminder-actions button.danger:hover { color: #f08a82; }
.theme-dark .calendar-message-preview { color: #afc0b5; }
.theme-dark .calendar-form input, .theme-dark .calendar-form select, .theme-dark .calendar-form textarea, .theme-dark .calendar-cancel { border-color: #344a40; background: #101b16; color: #e1ece5; }
@media (max-width: 680px) { .calendar-form-row, .calendar-template-variable-grid { grid-template-columns: 1fr; } .calendar-module-header { align-items: stretch; } .calendar-module-header .module-primary { justify-content: center; } .calendar-reminder { padding: 13px; gap: 10px; } .calendar-reminder-actions { flex-direction: column; } }

/* Compact daily agenda layout */
.calendar-module-shell { max-width: 1120px; padding-top: 30px; }
.calendar-toolbar-controls { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.calendar-assignee-filter { min-height: 40px; max-width: 220px; padding: 0 32px 0 12px; border: 1px solid #e1e8f0; border-radius: 10px; background: #fff; color: #53647a; font: inherit; font-size: 12px; }
.calendar-modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(17, 29, 44, .48); backdrop-filter: blur(3px); }
.calendar-modal-panel { width: min(640px, 100%); max-height: min(88dvh, 780px); overflow-y: auto; margin: 0; padding: 24px; border-color: #dce6f1; border-radius: 17px; box-shadow: 0 24px 72px rgba(15, 23, 42, .22); }
.calendar-modal-panel .calendar-form-heading { align-items: center; }
.calendar-modal-panel .calendar-form-heading .eyebrow { margin: 0 0 4px; color: #1268e5; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.calendar-modal-panel .calendar-form-heading h2 { font-size: 19px; }
.calendar-modal-panel .calendar-error { margin: 0; }
.calendar-modal-panel [name="assignedToId"] { min-height: 42px; }
.calendar-modal-panel .calendar-task-end[hidden] { display: none !important; }
.calendar-modal-panel > footer { position: sticky; bottom: -24px; margin: 0 -24px -24px; padding: 14px 24px 20px; border-top: 1px solid #edf1f5; background: #fff; }
.theme-dark .calendar-assignee-filter { border-color: #344a40; background: #101b16; color: #dce7df; }
.theme-dark .calendar-modal-backdrop { background: rgba(0, 0, 0, .68); }
.theme-dark .calendar-modal-panel { border-color: #344a40; }
.theme-dark .calendar-modal-panel > footer { border-color: #2c4037; background: #17251f; }
.message.group-message.in {
  margin-left: 34px;
  max-width: min(620px, calc(78% - 34px));
}

.message.group-message.in.image-group-message {
  max-width: min(430px, calc(82% - 34px));
}

.group-message-avatar {
  position: absolute;
  left: -34px;
  top: 7px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface, #fff);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.group-message-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.group-message-avatar.has-avatar {
  border-color: transparent;
}

.image-group-message .group-message-avatar {
  top: 3px;
}

.theme-dark .group-message-avatar {
  background: #16231d;
}

@media (max-width: 680px) {
  .calendar-toolbar-controls { width: 100%; flex-direction: column; align-items: stretch; }
  .calendar-assignee-filter { width: 100%; max-width: none; }
  .calendar-modal-backdrop { align-items: end; padding: 10px; }
  .calendar-modal-panel { width: 100%; max-height: 92dvh; padding: 18px; border-radius: 16px 16px 12px 12px; }
  .calendar-modal-panel > footer { bottom: -18px; margin: 0 -18px -18px; padding: 12px 18px 16px; }
}
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 25px; }
.calendar-toolbar .calendar-search { flex: 0 1 390px; margin: 0; }
.calendar-filters { display: inline-flex; align-items: center; gap: 3px; padding: 4px; border: 1px solid #e7edf3; border-radius: 11px; background: #f4f7fa; }
.calendar-filters button { min-height: 32px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #68788c; font-size: 12px; font-weight: 650; white-space: nowrap; }
.calendar-filters button:hover { color: #1b5fc7; }
.calendar-filters button.active { border-color: #e6ebf1; background: #fff; color: #1d3552; box-shadow: 0 1px 3px rgba(15, 23, 42, .07); }
.calendar-filters button span { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 99px; background: #edf3fb; color: #63758c; font-size: 10px; }
.calendar-groups { display: grid; gap: 22px; }
.calendar-date-group > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 1px 9px; }
.calendar-date-group > header h2 { margin: 0; color: #26384e; font-size: 14px; font-weight: 750; letter-spacing: -.01em; }
.calendar-date-group > header > span { color: #8a97a6; font-size: 11px; }
.calendar-reminder-list { gap: 7px; }
.calendar-reminder { position: relative; display: grid; grid-template-columns: 58px 22px minmax(0, 1fr) 34px; align-items: center; gap: 12px; min-height: 62px; padding: 9px 11px; border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .025); }
.calendar-reminder:hover { box-shadow: 0 3px 10px rgba(15, 23, 42, .045); }
.calendar-reminder-time { min-height: 34px; padding-right: 10px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; border-right: 1px solid #edf0f4; }
.calendar-reminder-time strong { color: #54657a; font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: .01em; }
.calendar-reminder-time small { margin-top: 2px; color: #8a97a6; font-size: 9px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.calendar-reminder-check { box-sizing: border-box !important; width: 22px !important; min-width: 22px !important; max-width: 22px !important; height: 22px !important; min-height: 22px !important; max-height: 22px !important; flex: 0 0 22px !important; justify-self: center; align-self: center; padding: 0 !important; border-width: 1.5px !important; border-color: #bac6d4 !important; border-radius: 50% !important; }
.calendar-reminder-check:hover { border-color: #1268e5 !important; background: #f2f7ff !important; }
.calendar-reminder-copy { align-self: center; padding: 0; }
.calendar-reminder-title-row { gap: 6px; }
.calendar-reminder-title-row h3 { overflow: hidden; color: #21364f; font-size: 13px; font-weight: 700; text-overflow: ellipsis; }
.calendar-reminder-description { display: -webkit-box; overflow: hidden; margin-top: 3px; color: #7a8797; font-size: 11px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.calendar-reminder-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 4px; color: #8290a0; font-size: 10px; }
.calendar-reminder-meta > span:not(.calendar-send-status) { min-width: 0; display: inline-flex; align-items: center; gap: 4px; }
.calendar-reminder-meta > span > .lucide { flex: 0 0 auto; }
.calendar-message-preview { margin: 4px 0 0; color: #73849a; font-size: 11px; line-height: 1.4; }
.calendar-overdue-label, .calendar-soon-label, .calendar-completed-label { padding: 2px 6px; border-radius: 99px; font-size: 9px; font-weight: 750; line-height: 1.4; }
.calendar-overdue-label { background: #fff0ef; color: #b94a44; }
.calendar-soon-label { background: #edf5ff; color: #3473c4; }
.calendar-started-label { padding: 2px 6px; border-radius: 99px; background: #eaf7f1; color: #25805a; font-size: 9px; font-weight: 750; line-height: 1.4; }
.calendar-start-action { min-height: 21px; padding: 2px 7px; border: 1px solid transparent; border-radius: 99px; background: #edf4ff; color: #346fbe; font-size: 9px; font-weight: 750; line-height: 1.35; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.calendar-start-action:hover { border-color: #ccdef6; background: #e3efff; color: #1559ac; }
.calendar-start-action.active { background: #eaf7f1; color: #25805a; }
.calendar-start-action.active:hover { border-color: #c4e5d3; background: #dff2e8; }
.calendar-completed-label { background: #edf2f6; color: #748295; }
.calendar-reminder.is-overdue .calendar-reminder-time strong { color: #b94a44; }
.calendar-reminder.is-started:not(.is-overdue) { border-color: #cce8d9; }
.calendar-reminder:not(.is-completed):not(.is-overdue) .calendar-reminder-time strong { color: #326db8; }
.calendar-reminder-actions { display: contents; }
.calendar-card-menu { position: relative; justify-self: end; align-self: center; }
.calendar-card-menu > summary { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 8px; color: #8491a0; cursor: pointer; list-style: none; transition: color .15s, background .15s, border-color .15s; }
.calendar-card-menu > summary::-webkit-details-marker { display: none; }
.calendar-card-menu > summary:hover, .calendar-card-menu[open] > summary { border-color: #e7edf3; background: #f5f8fb; color: #365d8d; }
.calendar-card-menu-popover { position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; min-width: 164px; padding: 5px; border: 1px solid #e4eaf0; border-radius: 10px; background: #fff; box-shadow: 0 10px 28px rgba(15, 23, 42, .13); }
.calendar-card-menu-popover button { width: 100%; min-height: 34px; padding: 0 9px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 7px; background: transparent; color: #415269; text-align: left; font-size: 12px; }
.calendar-card-menu-popover button:hover { background: #f2f6fb; color: #1268e5; }
.calendar-card-menu-popover button.danger:hover { background: #fff2f1; color: #c3443d; }
.calendar-send-status { margin: 0; padding: 3px 7px; font-size: 9px; }
.calendar-reminder.is-completed { border-color: #e9edf2; background: #fafbfd; }
.calendar-reminder.is-completed .calendar-reminder-title-row h3 { color: #778596; }
.calendar-reminder.is-completed .calendar-reminder-time strong, .calendar-reminder.is-completed .calendar-reminder-meta { color: #98a3b0; }
.calendar-reminder.is-completed .calendar-reminder-check:not(.is-static) { border-color: #1268e5 !important; background: #1268e5 !important; }
.calendar-reminder.is-completed .calendar-reminder-check:not(.is-static) > .lucide { color: #fff; }
.calendar-empty { min-height: 150px; border-radius: 13px; }
.calendar-empty > span { width: 40px; height: 40px; border-radius: 12px; }
.theme-dark .calendar-filters { border-color: #2b4038; background: #13211b; }
.theme-dark .calendar-filters button { color: #a4b3aa; }
.theme-dark .calendar-filters button.active { border-color: #34473e; background: #1d3028; color: #e1ece5; box-shadow: none; }
.theme-dark .calendar-filters button span { background: #293e34; color: #bac8be; }
.theme-dark .calendar-date-group > header h2 { color: #dbe7df; }
.theme-dark .calendar-date-group > header > span { color: #8fa197; }
.theme-dark .calendar-reminder { border-color: #2b4038; box-shadow: none; }
.theme-dark .calendar-reminder:hover { border-color: #3b594b; background: #1b2c24; }
.theme-dark .calendar-reminder-time { border-color: #34483e; }
.theme-dark .calendar-reminder-time strong { color: #b6c5bb; }
.theme-dark .calendar-reminder-title-row h3 { color: #e1ece5; }
.theme-dark .calendar-reminder-description, .theme-dark .calendar-reminder-meta, .theme-dark .calendar-message-preview { color: #9bac9f; }
.theme-dark .calendar-soon-label { background: #20364b; color: #8dbaf1; }
.theme-dark .calendar-started-label { background: #203b30; color: #8ad0ab; }
.theme-dark .calendar-start-action { background: #20364b; color: #8dbaf1; }
.theme-dark .calendar-start-action:hover { border-color: #365779; background: #294766; color: #bbd7ff; }
.theme-dark .calendar-start-action.active { background: #203b30; color: #8ad0ab; }
.theme-dark .calendar-start-action.active:hover { border-color: #365846; background: #294738; }
.theme-dark .calendar-reminder.is-started:not(.is-overdue) { border-color: #365846; }
.theme-dark .calendar-completed-label { background: #293b32; color: #a8b8ac; }
.theme-dark .calendar-card-menu > summary:hover, .theme-dark .calendar-card-menu[open] > summary { border-color: #34483e; background: #23382e; color: #b4c7ba; }
.theme-dark .calendar-card-menu-popover { border-color: #34483e; background: #1b2c24; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); }
.theme-dark .calendar-card-menu-popover button { color: #c4d1c8; }
.theme-dark .calendar-card-menu-popover button:hover { background: #263d32; color: #8dbaf1; }
.theme-dark .calendar-card-menu-popover button.danger:hover { background: #422b29; color: #f08a82; }
.theme-dark .calendar-reminder.is-completed { border-color: #283a32; background: #14221c; }
.theme-dark .calendar-reminder.is-completed .calendar-reminder-title-row h3 { color: #9cac9f; }
.theme-dark .calendar-reminder.is-completed .calendar-reminder-time strong, .theme-dark .calendar-reminder.is-completed .calendar-reminder-meta { color: #7f9286; }
@media (max-width: 680px) {
  .calendar-module-shell { padding: 22px 16px; }
  .calendar-toolbar { align-items: stretch; flex-direction: column; gap: 10px; margin-bottom: 20px; }
  .calendar-toolbar .calendar-search { flex: 0 0 auto; width: 100%; }
  .calendar-filters { width: 100%; justify-content: stretch; }
  .calendar-filters button { flex: 1 1 0; justify-content: center; padding: 0 7px; }
  .calendar-groups { gap: 18px; }
  .calendar-reminder { grid-template-columns: 48px 22px minmax(0, 1fr) 30px; gap: 8px; min-height: 60px; padding: 8px 7px; }
  .calendar-reminder-time { min-height: 30px; padding-right: 6px; }
  .calendar-reminder-time strong { font-size: 11px; }
  .calendar-card-menu > summary { width: 30px; height: 30px; }
  .calendar-reminder-actions { display: contents; }
}
@media (max-width: 380px) {
  .calendar-reminder { grid-template-columns: 43px 22px minmax(0, 1fr) 28px; gap: 6px; padding-inline: 5px; }
  .calendar-reminder-time { padding-right: 4px; }
  .calendar-reminder-title-row h3 { font-size: 12px; }
  .calendar-card-menu > summary { width: 28px; height: 28px; }
}

.settings-module-shell { max-width: 1240px; margin: 0 auto; padding: 40px clamp(22px, 4vw, 64px); }
.settings-module-header { margin-bottom: 28px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr); align-items: start; gap: 18px; }
.settings-card { min-width: 0; padding: 22px; border: 1px solid #e4eaf1; border-radius: 18px; background: #fff; box-shadow: 0 10px 26px rgba(15, 23, 42, .035); }
.settings-account-card { grid-row: span 2; }
.settings-card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.settings-card-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; background: #eff6ff; color: #1268e5; }
.settings-card-heading h2 { margin: 0; color: #172b45; font-size: 17px; letter-spacing: -.02em; }
.settings-card-heading p { margin: 5px 0 0; color: #718096; font-size: 12px; }
.settings-form { display: grid; gap: 14px; }
.settings-form label { display: grid; gap: 7px; color: #52647a; font-size: 12px; font-weight: 700; }
.settings-form input { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid #dce4ed; border-radius: 10px; background: #fff; color: #172b45; font: inherit; font-size: 13px; }
.settings-form input:focus { outline: none; border-color: #6ea4f6; box-shadow: 0 0 0 3px rgba(18, 104, 229, .1); }
.settings-form input[readonly] { background: #f7f9fc; color: #738197; }
.settings-account-meta { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 2px; color: #718096; font-size: 12px; }
.settings-account-meta strong { color: #30435b; font-size: 12px; }
.settings-card-actions { display: flex; justify-content: flex-end; }
.settings-card-actions .module-primary { min-height: 40px; }
.settings-feedback, .settings-note { min-height: 16px; margin: 0; color: #52708f; font-size: 12px; }
.settings-feedback.is-error { color: #c2413b; }
.settings-password-form { margin-top: 8px; padding-top: 20px; border-top: 1px solid #e9eef4; }
.settings-password-form h3 { margin: 0 0 2px; color: #23374f; font-size: 14px; }
.settings-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-switch-row { position: relative; display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 0; border-top: 1px solid #edf1f5; cursor: pointer; }
.settings-switch-row > span:first-child { display: grid; gap: 5px; }
.settings-switch-row strong { color: #2c3d53; font-size: 13px; }
.settings-switch-row small { color: #718096; font-size: 11px; line-height: 1.45; }
.settings-switch-row input { position: absolute; right: 0; width: 42px; height: 24px; opacity: 0; cursor: pointer; }
.settings-switch { position: relative; width: 40px; height: 23px; flex: 0 0 auto; margin-left: auto; border-radius: 999px; background: #cbd5e1; transition: background .16s ease; }
.settings-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .2); transition: transform .16s ease; }
.settings-switch-row input:checked + .settings-switch { background: #1268e5; }
.settings-switch-row input:checked + .settings-switch::after { transform: translateX(17px); }
.settings-switch-row input:focus-visible + .settings-switch { outline: 3px solid rgba(18, 104, 229, .2); outline-offset: 2px; }
.settings-theme-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-theme-option { display: grid; gap: 8px; padding: 10px; border: 1px solid #dfe6ef; border-radius: 13px; color: #52647a; font-size: 12px; cursor: pointer; }
.settings-theme-option.active { border-color: #3980ed; box-shadow: 0 0 0 2px rgba(18, 104, 229, .1); color: #155fc8; }
.settings-theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-preview { height: 64px; display: flex; align-items: center; gap: 5px; padding: 7px; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.theme-preview i { height: 100%; display: block; border-radius: 4px; }
.theme-preview i:first-child { width: 22%; }
.theme-preview i:nth-child(2) { flex: 1; }
.theme-preview i:last-child { width: 20%; }
.theme-preview-light { background: #f5f8fc; }
.theme-preview-light i { background: #fff; border: 1px solid #e6ebf1; }
.theme-preview-dark { background: #101a18; border-color: #283832; }
.theme-preview-dark i { background: #1a2925; }
.settings-note { margin-top: 14px; }

.theme-dark .settings-card { border-color: var(--line); background: var(--panel); }
.theme-dark .settings-card-heading h2,
.theme-dark .settings-password-form h3,
.theme-dark .settings-switch-row strong { color: var(--text); }
.theme-dark .settings-card-heading p,
.theme-dark .settings-form label,
.theme-dark .settings-switch-row small,
.theme-dark .settings-note,
.theme-dark .settings-feedback { color: var(--muted); }
.theme-dark .settings-form input { border-color: var(--line); background: #15211e; color: var(--text); }
.theme-dark .settings-form input[readonly] { background: #111c19; color: var(--muted); }
.theme-dark .settings-password-form,
.theme-dark .settings-switch-row { border-color: var(--line); }
.theme-dark .settings-account-meta strong { color: #d5dfeb; }
.theme-dark .settings-theme-option { border-color: var(--line); color: var(--muted); }
.theme-dark .settings-theme-option.active { color: #7eb0ff; }

.broadcast-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.broadcast-summary-card {
  min-width: 0;
  min-height: 104px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid #e7edf3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .035);
}

.broadcast-summary-card > div {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.broadcast-summary-card span:not(.broadcast-summary-icon) {
  color: #718096;
  font-size: 12px;
  font-weight: 700;
}

.broadcast-summary-card strong {
  color: #172b45;
  font-size: 24px;
  line-height: 1;
}

.broadcast-summary-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
}

.broadcast-summary-icon.sent { background: #eaf3ff; color: #1268e5; }
.broadcast-summary-icon.delivered { background: #eafaf3; color: #13966b; }
.broadcast-summary-icon.read { background: #f1edff; color: #7254d6; }
.broadcast-summary-icon.failed { background: #fff1f1; color: #d14c4c; }

.broadcast-list-card {
  overflow: hidden;
  border: 1px solid #e7edf3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .035);
}

.broadcast-list-heading {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #edf1f5;
}

.broadcast-list-heading h2 {
  color: #172b45;
  font-size: 18px;
}

.broadcast-list-heading .eyebrow {
  color: #1268e5;
}

.broadcast-list-count {
  color: #718096;
  font-size: 12px;
  font-weight: 700;
}

.broadcast-table-wrap {
  overflow-x: auto;
}

.broadcast-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  color: #475569;
  font-size: 12px;
}

.broadcast-table th,
.broadcast-table td {
  padding: 16px 14px;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
  white-space: nowrap;
}

.broadcast-table th {
  background: #fbfcfe;
  color: #718096;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.broadcast-table tr:last-child td {
  border-bottom: 0;
}

.broadcast-table td strong {
  color: #172b45;
  font-size: 13px;
}

.broadcast-template-name {
  color: #1268e5;
  font-weight: 700;
}

.broadcast-status {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.broadcast-status.processando { background: #fff7df; color: #a36e00; }
.broadcast-status.concluido { background: #eafaf3; color: #16825e; }
.broadcast-status.agendado { background: #eaf3ff; color: #1268e5; }
.broadcast-status.rascunho { background: #f1f5f9; color: #64748b; }
.broadcast-status.pausado { background: #fff7df; color: #a36e00; }
.broadcast-status.cancelado { background: #fff1f1; color: #c24141; }

.module-placeholder-shell {
  display: grid;
  place-items: center;
}

.module-placeholder {
  max-width: 420px;
  padding: 42px 28px;
  text-align: center;
}

.module-placeholder h1 {
  margin: 8px 0 10px;
  color: #172b45;
  font-size: 28px;
}

.module-placeholder p:last-child {
  margin: 0;
  color: #718096;
  font-size: 14px;
  line-height: 1.6;
}

.module-empty-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: #eaf3ff;
  color: #1268e5;
}

.module-empty-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.templates-module-shell {
  max-width: 1280px;
  margin: 0 auto;
}

.templates-module-header {
  margin-bottom: 20px;
}

.templates-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.templates-summary-card {
  min-width: 0;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e7edf3;
  border-radius: 14px;
  background: #fff;
}

.templates-summary-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: #eaf3ff;
  color: #1268e5;
}

.templates-summary-icon.utility {
  background: #eafaf3;
  color: #16825e;
}

.templates-summary-icon.marketing {
  background: #fff4e6;
  color: #b66b00;
}

.templates-summary-card div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.templates-summary-card span:not(.templates-summary-icon) {
  color: #718096;
  font-size: 12px;
  font-weight: 700;
}

.templates-summary-card strong {
  color: #172b45;
  font-size: 22px;
  letter-spacing: -.03em;
}

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

.templates-module-search {
  width: min(560px, 100%);
  min-height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #dfe7ef;
  border-radius: 12px;
  background: #fff;
  color: #718096;
}

.templates-module-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #172b45;
  font: inherit;
}

.templates-count {
  color: #718096;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.template-card {
  min-width: 0;
  padding: 18px;
  display: grid;
  gap: 14px;
  border: 1px solid #e7edf3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .035);
}

.template-card-header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.template-card-header h2 {
  margin: 4px 0 0;
  overflow: hidden;
  color: #172b45;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-card-eyebrow {
  color: #718096;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.template-card-status {
  min-height: 25px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eafaf3;
  color: #16825e;
  font-size: 11px;
  font-weight: 800;
}

.template-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-card-meta span {
  padding: 5px 8px;
  border-radius: 7px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.template-card-message {
  display: grid;
  gap: 11px;
}

.template-card-message > div {
  display: grid;
  gap: 4px;
}

.template-card-message strong,
.template-card-tags > span,
.template-card-buttons > span {
  color: #718096;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.template-card-message p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.template-card-tags,
.template-card-buttons {
  display: grid;
  gap: 7px;
}

.template-card-tags > div,
.template-card-buttons > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-card-tags em,
.template-card-buttons > div > span {
  padding: 5px 8px;
  border-radius: 7px;
  background: #f5f8fc;
  color: #1268e5;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.template-card-buttons > div > span {
  background: #fff4e6;
  color: #a36e00;
}

.templates-module-state {
  min-height: 280px;
  padding: 28px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed #d9e2ec;
  border-radius: 16px;
  background: rgba(255, 255, 255, .62);
  text-align: center;
}

.templates-module-state h2,
.templates-module-state p {
  margin: 0;
}

.templates-module-state h2 {
  color: #172b45;
  font-size: 18px;
}

.templates-module-state p {
  max-width: 520px;
  color: #718096;
  font-size: 14px;
  line-height: 1.6;
}

.contacts-module-shell {
  max-width: 1280px;
  margin: 0 auto;
}

.contacts-module-header {
  margin-bottom: 20px;
}

.contacts-module-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.contacts-module-search {
  width: min(520px, 100%);
  min-height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #dfe7ef;
  border-radius: 12px;
  background: #fff;
  color: #718096;
}

.contacts-module-search .lucide {
  flex: 0 0 auto;
}

.contacts-module-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #172b45;
  font: inherit;
}

.contacts-count {
  color: #718096;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.contact-card {
  min-width: 0;
  padding: 18px;
  display: grid;
  gap: 18px;
  border: 1px solid #e7edf3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .035);
}

.contact-card-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.contact-card-avatar {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  font-size: 16px;
}

.contact-card-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.contact-card-copy h2 {
  margin: 0;
  overflow: hidden;
  color: #172b45;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-card-copy p,
.contact-card-copy small {
  margin: 0;
  overflow: hidden;
  color: #718096;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-card-action {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #dfe7ef;
  border-radius: 9px;
  background: #fff;
  color: #526176;
  font-size: 12px;
  font-weight: 800;
}

.contact-card-action:hover {
  background: #f3f7fc;
}

.contact-card-action.primary {
  border-color: #1268e5;
  background: #1268e5;
  color: #fff;
}

.contact-card-action.primary:hover {
  background: #0c56c4;
}

.contact-card-action.danger {
  color: #c24141;
}

.contact-card-action.danger:hover {
  border-color: #f1caca;
  background: #fff5f5;
}

.contacts-module-state {
  min-height: 280px;
  padding: 28px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed #d9e2ec;
  border-radius: 16px;
  background: rgba(255, 255, 255, .62);
  text-align: center;
}

.contacts-module-state h2,
.contacts-module-state p {
  margin: 0;
}

.contacts-module-state h2 {
  color: #172b45;
  font-size: 18px;
}

.contacts-module-state p:not(.form-error) {
  color: #718096;
  font-size: 14px;
}

.reports-module-shell {
  max-width: 1220px;
  margin: 0 auto;
}

.reports-module-header {
  margin-bottom: 18px;
}

.reports-module-header .module-primary:disabled {
  opacity: .7;
  cursor: wait;
}

.reports-period-card {
  margin-bottom: 18px;
  padding: 16px 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #e7edf3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .035);
}

.reports-period-card > div:first-child {
  display: grid;
  gap: 6px;
}

.reports-period-card > div:first-child strong {
  color: #172b45;
  font-size: 14px;
}

.reports-period-card > div:first-child span {
  color: #718096;
  font-size: 13px;
}

.reports-period-card .admin-dashboard-period {
  min-width: 360px;
}

.reports-summary-grid {
  margin-bottom: 18px;
}

.reports-detail-section {
  margin-bottom: 18px;
}

.reports-module-state {
  min-height: 340px;
  padding: 32px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed #d9e2ec;
  border-radius: 16px;
  background: rgba(255, 255, 255, .62);
  text-align: center;
}

.reports-module-state h1,
.reports-module-state h2,
.reports-module-state p {
  margin: 0;
}

.reports-module-state h1,
.reports-module-state h2 {
  color: #172b45;
}

.reports-module-state h1 { font-size: 26px; }
.reports-module-state h2 { font-size: 18px; }

.reports-module-state p:not(.eyebrow) {
  max-width: 520px;
  color: #718096;
  font-size: 14px;
  line-height: 1.6;
}

.broadcast-wizard-panel {
  width: min(760px, 100%);
  max-height: min(820px, calc(100dvh - 40px));
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

.broadcast-wizard-panel .modal-header {
  padding: 18px 24px;
}

.broadcast-wizard-live {
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 8px;
  align-content: start;
  gap: 16px;
}

.broadcast-wizard-live-steps {
  padding: 14px 24px 0;
}

.broadcast-wizard-error {
  padding-inline: 24px;
}

.broadcast-wizard-steps {
  padding: 18px 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.broadcast-wizard-steps span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

.broadcast-wizard-steps b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef2f7;
  color: #718096;
}

.broadcast-wizard-steps span.active { color: #1268e5; }
.broadcast-wizard-steps span.active b { background: #eaf3ff; color: #1268e5; }

.broadcast-wizard-empty {
  padding: 42px 28px 36px;
  text-align: center;
}

.broadcast-wizard-empty .module-empty-icon { margin-bottom: 14px; }
.broadcast-wizard-empty h3 { margin: 0 0 8px; color: #172b45; }
.broadcast-wizard-empty p { max-width: 480px; margin: 0 auto; color: #718096; font-size: 14px; line-height: 1.6; }

.broadcast-wizard-actions {
  padding: 16px 24px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.broadcast-wizard-actions button { min-width: 112px; }

.theme-dark .navigation-rail,
.theme-dark .module-view,
.theme-dark .broadcast-summary-card,
.theme-dark .broadcast-list-card {
  border-color: var(--line);
  background: var(--panel);
}

.theme-dark .rail-brand { border-color: var(--line); }
.theme-dark .rail-item { color: #9aada5; }
.theme-dark .rail-item:hover { background: #1a2925; color: #7fb5ff; }
.theme-dark .rail-item.active { background: #173c69; color: #7fb5ff; }
.theme-dark .rail-item.active .rail-indicator { background: #4b98ff; }
.theme-dark .rail-item[data-connection-id].active { background: color-mix(in srgb, var(--rail-connection-color, #168a64) 22%, #172522); }
.theme-dark .rail-item[data-connection-id].active .rail-indicator { background: var(--rail-connection-color, #168a64); }
.theme-dark .rail-unread-badge { border-color: var(--panel); }
.theme-dark .rail-calendar-badge { border-color: var(--panel); background: #4b98ff; color: #102239; }
.theme-dark .module-view { background: #0e1816; }
.theme-dark .contacts-module-search,
.theme-dark .templates-module-search,
.theme-dark .contact-card,
.theme-dark .templates-summary-card,
.theme-dark .template-card,
.theme-dark .contacts-module-state,
.theme-dark .templates-module-state,
.theme-dark .contact-card-action {
  border-color: var(--line);
  background: var(--panel);
}
.theme-dark .contacts-module-search input,
.theme-dark .templates-module-search input,
.theme-dark .contact-card-copy h2,
.theme-dark .template-card-header h2,
.theme-dark .template-card-message p,
.theme-dark .templates-module-state h2,
.theme-dark .contacts-module-state h2 { color: var(--text); }
.theme-dark .contact-card-action { color: var(--muted); }
.theme-dark .contact-card-action:hover { background: #1a2925; }
.theme-dark .contacts-module-state { background: rgba(23, 49, 37, .4); }
.theme-dark .templates-module-state { background: rgba(23, 49, 37, .4); }
.theme-dark .reports-period-card,
.theme-dark .reports-module-state {
  border-color: var(--line);
  background: var(--panel);
}
.theme-dark .reports-period-card > div:first-child strong,
.theme-dark .reports-module-state h1,
.theme-dark .reports-module-state h2 { color: var(--text); }
.theme-dark .module-header h1,
.theme-dark .module-placeholder h1,
.theme-dark .broadcast-summary-card strong,
.theme-dark .templates-summary-card strong,
.theme-dark .broadcast-list-heading h2,
.theme-dark .broadcast-table td strong,
.theme-dark .broadcast-wizard-empty h3 { color: var(--text); }
.theme-dark .broadcast-list-heading,
.theme-dark .broadcast-table th,
.theme-dark .broadcast-table td,
.theme-dark .broadcast-wizard-steps,
.theme-dark .broadcast-wizard-actions { border-color: var(--line); }
.theme-dark .broadcast-table th { background: #15211e; }
.theme-dark .templates-summary-card span:not(.templates-summary-icon),
.theme-dark .templates-count,
.theme-dark .template-card-eyebrow,
.theme-dark .template-card-message strong,
.theme-dark .template-card-tags > span,
.theme-dark .template-card-buttons > span { color: var(--muted); }
.theme-dark .template-card-meta span { background: #1a2925; color: var(--muted); }
.theme-dark .template-card-tags em { background: #173c69; color: #7fb5ff; }
.theme-dark .template-card-buttons > div > span { background: #4b3820; color: #f4c46d; }

@media (max-width: 1180px) {
  .desk-view:not(.module-mode),
  .desk-view.no-details:not(.module-mode) {
    grid-template-columns: 58px minmax(300px, 340px) minmax(0, 1fr) !important;
  }

  .navigation-rail > .rail-toggle { display: none; }
  .rail-item > .rail-label { display: none; }
}

@media (max-width: 900px) {
  .desk-view,
  .desk-view.no-details,
  .desk-view.module-mode {
    position: relative;
    display: block;
    overflow: hidden;
  }

  .navigation-rail {
    position: absolute;
    inset: 0 auto 0 0;
    height: auto;
  }

  .desk-view > .sidebar,
  .desk-view > .conversation-pane,
  .desk-view > .module-view {
    width: calc(100% - 70px);
    height: 100%;
    margin-left: 70px;
  }

  .desk-view.module-mode > .module-view { display: block; }
  .desk-view > .details { left: 70px !important; }
}

@media (max-width: 720px) {
  .module-shell { padding: 20px; }
  .module-header { align-items: flex-start; flex-direction: column; }
  .module-primary { width: 100%; }
  .contacts-toolbar { align-items: stretch; flex-direction: column; }
  .contacts-module-search { width: 100%; }
  .contacts-count { align-self: flex-start; }
  .contacts-module-actions { width: 100%; }
  .contacts-module-actions button { width: auto; flex: 1 1 180px; }
  .templates-toolbar { align-items: stretch; flex-direction: column; }
  .templates-module-search { width: 100%; }
  .templates-count { align-self: flex-start; }
  .templates-summary-grid { grid-template-columns: 1fr; }
  .broadcast-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reports-period-card { align-items: stretch; flex-direction: column; }
  .reports-period-card .admin-dashboard-period { min-width: 0; width: 100%; }
}

@media (max-width: 560px) {
  .navigation-rail { border-radius: 14px; }
  .module-shell { padding: 14px; }
  .module-header h1 { font-size: 26px; }
  .broadcast-summary-card { padding: 14px 12px; }
  .broadcast-summary-card strong { font-size: 21px; }
  .broadcast-wizard-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (hover: none), (pointer: coarse) {
  .conversation-menu-toggle,
  .message-actions-toggle {
    display: none;
  }

  .conversation-item.menu-open .conversation-menu-toggle {
    display: grid;
    opacity: 1;
    pointer-events: auto;
  }

  .conversation-menu-wrap {
    pointer-events: none;
  }

  .conversation-item.menu-open .conversation-menu-wrap {
    pointer-events: auto;
  }

  .conversation-item.menu-open .conversation-menu {
    top: 42px;
    right: 0;
    width: min(190px, calc(100vw - 64px));
  }

  .message-actions {
    pointer-events: none;
  }

  .message-actions.open {
    pointer-events: auto;
  }
}

.brand-user-menu {
  position: relative;
  flex: 0 0 auto;
}

.brand-user {
  min-height: 46px;
  max-width: min(260px, 42vw);
  padding: 7px 12px 7px 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #eef5f1;
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 18px rgba(13, 89, 52, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  text-align: left;
}

.brand-user:hover,
.brand-user-menu.open .brand-user {
  background: #d9eee3;
  color: var(--brand-dark);
}

.brand-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #d9eee3;
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.brand-user-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  line-height: 1;
}

.brand-user-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-user-name {
  min-width: 0;
  max-width: 150px;
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-user-chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
  transition: transform 0.16s ease;
}

.brand-user-menu.open .brand-user-chevron {
  transform: rotate(180deg);
}

.brand-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: 176px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 4px;
  overflow: hidden;
}

.brand-user-dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--line);
}

.brand-user-dropdown .theme-toggle,
.brand-user-dropdown .brand-logout {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-weight: 400;
}

.brand-user-dropdown .theme-toggle:hover,
.brand-user-dropdown .brand-logout:hover {
  background: #eef5f1;
  color: var(--brand-dark);
}

.brand-user-dropdown .theme-toggle svg,
.brand-user-dropdown .brand-logout svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.brand-user-dropdown .theme-toggle span,
.brand-user-dropdown .brand-logout-label {
  display: inline;
}

.brand-user-dropdown .brand-logout {
  color: #17211d;
}

.theme-dark .brand-user {
  background: #1a2925;
  border-color: #2a3934;
  color: #c8d9d2;
}

.theme-dark .brand-user:hover,
.theme-dark .brand-user-menu.open .brand-user {
  background: #20342f;
  color: #f0f8f5;
}

.theme-dark .brand-user-avatar {
  background: #20342f;
  color: #f0f8f5;
}

.theme-dark .brand-user-name {
  color: #f0f8f5;
}

.theme-dark .brand-user-dropdown {
  background: #101a23;
  border-color: #233142;
}

.theme-dark .brand-user-dropdown .theme-toggle,
.theme-dark .brand-user-dropdown .brand-logout {
  background: transparent;
  color: #e7eef5;
}

.theme-dark .brand-user-dropdown .theme-toggle:hover,
.theme-dark .brand-user-dropdown .brand-logout:hover {
  background: #1a352e;
  color: #f0f8f5;
}

@media (max-width: 560px) {
  .brand-session {
    justify-content: flex-end;
  }

  .brand-user {
    max-width: min(180px, 56vw);
    min-height: 42px;
    padding: 6px 10px 6px 7px;
    border-radius: 13px;
  }

  .brand-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 13px;
  }

  .brand-user-name {
    max-width: 96px;
    font-size: 13px;
  }

  .brand-user-dropdown {
    right: 0;
    width: 160px;
  }
}

.theme-dark {
  --bg: #0a1016;
  --panel: #101a23;
  --line: #233142;
  --text: #e7eef5;
  --muted: #94a3b8;
  --brand: #60a5fa;
  --brand-dark: #3b82f6;
  --accent: #60a5fa;
  --danger: #f87171;
  --incoming: #111c27;
  --outgoing: #12331f;
  --chat-bg: #0c131b;
}

.theme-dark body {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 24%),
    linear-gradient(180deg, #0a1016 0%, #091116 100%);
}

.theme-dark .brand-bar,
.theme-dark .sidebar,
.theme-dark .conversation-pane,
.theme-dark .details,
.theme-dark .composer {
  background: #101a23;
  border-color: #233142;
}

.theme-dark .conversation-select,
.theme-dark .team-card,
.theme-dark .conversation-chip,
.theme-dark .team-search,
.theme-dark .conversation-search input,
.theme-dark #messageInput,
.theme-dark .composer-icon,
.theme-dark .template-button,
.theme-dark .file-request-button,
.theme-dark .team-action {
  background: #0f1720;
  border-color: #233142;
  color: #e7eef5;
}

.theme-dark .conversation-item.active .conversation-select {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(96, 165, 250, 0.35);
}

.theme-dark .conversation-status.is-waiting {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.theme-dark .conversation-status.is-assigned {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

.theme-dark .conversation-status.is-closed {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.theme-dark .conversation-chip-provider {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.22);
  color: #86efac;
}

.theme-dark .conversation-chip-status {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.22);
  color: #bfdbfe;
}

.theme-dark .conversation-chip {
  color: #dbe7f3;
}

.theme-dark .contact-company,
.theme-dark .conversation-assignee {
  color: #b7c6d6;
}

.theme-dark .conversation-chip strong {
  color: #f8fbff;
}

.conversation-subtitle {
  margin: 0;
  color: #667781;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
}

.conversation-subtitle.presence-online {
  color: #0a7c5b;
}

.conversation-subtitle.presence-offline {
  color: #667781;
}

@media (max-width: 560px) {
  :root {
    --brand-bar-height: 72px;
  }

  .brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--brand-bar-height);
    padding: 8px 12px;
    gap: 10px;
  }

  .brand-mark,
  .brand-session {
    flex: 0 1 auto;
  }

  .brand-mark img,
  .brand-flj .brand-mark img {
    height: 44px;
    max-width: 128px;
    transform: none;
  }

  .brand-session {
    min-width: 0;
    margin-top: 0;
    justify-content: flex-end;
  }

  .brand-user {
    max-width: min(152px, 48vw);
    min-height: 40px;
    padding: 5px 9px 5px 6px;
    gap: 8px;
  }

  .brand-user-avatar {
    width: 28px;
    height: 28px;
  }

  .brand-user-label {
    font-size: 10px;
  }

  .brand-user-name {
    max-width: 82px;
    font-size: 12px;
  }

  .brand-user-dropdown {
    top: calc(100% + 6px);
    right: 0;
  }

  .desk-view {
    height: calc(100dvh - var(--brand-bar-height) - 16px);
  }

  .topbar {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 10px;
    min-height: 0;
    align-items: center;
  }

  .mobile-back-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }

  #conversationTitle {
    gap: 8px;
    align-items: center;
  }

  #conversationTitle .header-avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .conversation-heading {
    gap: 2px;
  }

  .conversation-heading h2 {
    font-size: 16px;
    line-height: 1.15;
  }

  .conversation-heading .muted,
  .conversation-subtitle {
    font-size: 12px;
    line-height: 1.2;
  }

  .conversation-chips {
    margin-top: 0;
    gap: 4px;
  }

  .conversation-chip {
    display: none;
  }

  .conversation-chip-status {
    display: inline-flex;
    min-height: 22px;
    max-width: 100%;
    padding: 3px 8px;
    font-size: 11px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
  }

  .topbar-actions button {
    min-width: 0;
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }

  .topbar-actions .close-action {
    grid-column: 1 / -1;
  }

  .messages {
    padding: 12px 10px;
  }

  #messageInput {
    max-height: 126px;
  }
}

/* Keep the functional wizard above the legacy placeholder styles. */
.broadcast-wizard-panel > .broadcast-wizard-steps,
.broadcast-wizard-panel > .broadcast-wizard-empty,
.broadcast-wizard-panel > .broadcast-wizard-actions {
  display: none !important;
}

.broadcast-wizard-live-actions {
  display: flex;
}

.broadcast-wizard-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

.broadcast-wizard-live {
  min-height: 0;
  overflow-y: auto;
}

.theme-dark .broadcast-wizard-live-steps button,
.theme-dark .broadcast-contact-option,
.theme-dark .broadcast-choice,
.theme-dark .broadcast-review-grid > div {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

.theme-dark .broadcast-field,
.theme-dark .broadcast-step-intro h3,
.theme-dark .broadcast-choice strong,
.theme-dark .broadcast-review-grid strong {
  color: var(--text);
}

.theme-dark .broadcast-field input,
.theme-dark .broadcast-field select,
.theme-dark .broadcast-field textarea {
  border-color: var(--line);
  background: #0d1815;
  color: var(--text);
}

.theme-dark .broadcast-choice input {
  border-color: #718096;
  background: #0d1815;
}

.theme-dark .broadcast-choice input:checked {
  border-color: #4b98ff;
  background: radial-gradient(circle, #4b98ff 0 47%, #0d1815 50% 100%);
}

/* The global form controls are intentionally large; wizard selectors stay compact. */
.broadcast-contact-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

.broadcast-choice {
  display: grid;
  align-items: center;
  gap: 10px;
}

.broadcast-contact-option input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 18px;
  border-radius: 5px;
  box-shadow: none;
}

.broadcast-choice input[type="radio"] {
  grid-column: 2;
  grid-row: 1;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 1.5px solid #8792a3;
  border-radius: 999px;
  background: #fff;
  box-shadow: none;
}

.broadcast-choice input[type="radio"]:checked {
  border-color: #1268e5;
  background: radial-gradient(circle, #1268e5 0 47%, #fff 50% 100%);
}

.theme-dark .broadcast-choice input[type="radio"] {
  border-color: #718096;
  background: #0d1815;
}

.theme-dark .broadcast-choice input[type="radio"]:checked {
  border-color: #4b98ff;
  background: radial-gradient(circle, #4b98ff 0 47%, #0d1815 50% 100%);
}

.broadcast-row {
  cursor: pointer;
  transition: background .16s ease;
}

.broadcast-row:hover,
.broadcast-row:focus-visible {
  outline: 0;
  background: #f7fbff;
}

.broadcast-detail-panel {
  width: min(860px, 100%);
  max-height: min(820px, calc(100dvh - 32px));
  grid-template-rows: auto minmax(0, 1fr);
}

.broadcast-detail-content {
  min-height: 0;
  overflow: auto;
  padding: 22px 24px 26px;
  display: grid;
  gap: 18px;
}

.broadcast-detail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.broadcast-detail-meta > div {
  min-width: 0;
  padding: 13px;
  border: 1px solid #e7edf3;
  border-radius: 11px;
  background: #fbfcfe;
}

.broadcast-detail-meta span,
.broadcast-detail-meta strong {
  display: block;
}

.broadcast-detail-meta span {
  margin-bottom: 7px;
  color: #718096;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.broadcast-detail-meta strong {
  overflow: hidden;
  color: #172b45;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.broadcast-detail-meta em {
  font-style: normal;
}

.broadcast-detail-message,
.broadcast-detail-recipients {
  padding: 18px;
  border: 1px solid #e7edf3;
  border-radius: 14px;
  background: #fff;
}

.broadcast-detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.broadcast-detail-section-heading h3 {
  margin: 4px 0 0;
  color: #172b45;
  font-size: 16px;
}

.broadcast-detail-section-heading > span,
.broadcast-detail-section-heading > strong {
  color: #718096;
  font-size: 12px;
}

.broadcast-detail-message > p {
  margin: 0;
  padding: 14px;
  border: 1px solid #dce9f8;
  border-radius: 11px;
  background: #f6faff;
  color: #2f435c;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.broadcast-detail-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  border-bottom: 1px solid #edf1f5;
}

.broadcast-detail-tabs button {
  min-height: 34px;
  padding: 0 10px;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: #718096;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.broadcast-detail-tabs button:hover,
.broadcast-detail-tabs button.active {
  border-bottom-color: #1268e5;
  background: #f3f8ff;
  color: #1268e5;
}

.broadcast-detail-tabs b {
  margin-left: 5px;
  font-size: 10px;
}

.broadcast-recipient-list {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.broadcast-recipient-row {
  min-height: 54px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #edf1f5;
  border-radius: 10px;
}

.broadcast-recipient-person,
.broadcast-recipient-result {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.broadcast-recipient-person > span:last-child,
.broadcast-recipient-result {
  display: grid;
  gap: 3px;
}

.broadcast-recipient-person strong {
  color: #172b45;
  font-size: 12px;
}

.broadcast-recipient-person small,
.broadcast-recipient-result small {
  color: #718096;
  font-size: 11px;
}

.broadcast-recipient-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #eaf3ff;
  color: #1268e5;
  font-size: 11px;
  font-weight: 800;
}

.broadcast-recipient-result {
  justify-items: end;
}

.broadcast-status.enviado { background: #eaf3ff; color: #1268e5; }
.broadcast-status.entregue { background: #eafaf3; color: #16825e; }
.broadcast-status.lido { background: #f1edff; color: #7254d6; }
.broadcast-status.falha { background: #fff1f1; color: #c24141; }
.broadcast-status.pendente { background: #f1f5f9; color: #64748b; }

.theme-dark .broadcast-row:hover,
.theme-dark .broadcast-row:focus-visible {
  background: #162b25;
}

.theme-dark .broadcast-detail-meta > div,
.theme-dark .broadcast-detail-message,
.theme-dark .broadcast-detail-recipients,
.theme-dark .broadcast-recipient-row {
  border-color: var(--line);
  background: var(--panel);
}

.theme-dark .broadcast-detail-meta strong,
.theme-dark .broadcast-detail-section-heading h3,
.theme-dark .broadcast-recipient-person strong {
  color: var(--text);
}

@media (max-width: 700px) {
  .broadcast-detail-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .broadcast-detail-content {
    padding: 16px;
  }

  .broadcast-detail-meta {
    grid-template-columns: 1fr;
  }

  .broadcast-recipient-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .broadcast-recipient-result {
    width: 100%;
    align-items: start;
    justify-items: start;
  }
}

/* Quadro Kanban opcional, habilitado por empresa na administração da plataforma. */
:root {
  --kanban-page: #f5f8fc;
  --kanban-column: #edf2f8;
  --kanban-card: #ffffff;
  --kanban-card-hover: #f5f9ff;
  --kanban-text: #172b45;
  --kanban-muted: #61738a;
  --kanban-line: #dce5ef;
  --kanban-control: #ffffff;
  --kanban-control-text: #40536b;
  --kanban-empty-bg: rgba(255, 255, 255, .48);
  --kanban-waiting: #e58a18;
  --kanban-mine: #2563eb;
  --kanban-others: #7c3aed;
  --kanban-closed: #64748b;
  --kanban-archived: #0f766e;
}

.theme-dark {
  --kanban-page: #0f1722;
  --kanban-column: #182331;
  --kanban-card: #202d3d;
  --kanban-card-hover: #26374b;
  --kanban-text: #e8eef7;
  --kanban-muted: #a6b4c6;
  --kanban-line: #2b3a4c;
  --kanban-control: #1a2736;
  --kanban-control-text: #d4deeb;
  --kanban-empty-bg: rgba(15, 23, 34, .35);
  --kanban-waiting: #f0aa50;
  --kanban-mine: #6594ff;
  --kanban-others: #ae8aff;
  --kanban-closed: #9aa8ba;
  --kanban-archived: #43b5a2;
  --kanban-placeholder: #adbacb;
  --kanban-search-icon: #9eafc3;
  --kanban-unread-bg: #4c83f5;
}

.desk-view.kanban-layout {
  grid-template-columns: 58px minmax(0, 1fr) !important;
}

.desk-view.kanban-layout > .sidebar,
.desk-view.kanban-layout > .conversation-pane,
.desk-view.kanban-layout > .details {
  display: none !important;
}

.desk-view.kanban-layout > .kanban-view {
  display: flex !important;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  padding: 22px;
  background: var(--kanban-page);
}

.desk-view.kanban-layout.module-mode > .kanban-view {
  display: none !important;
}

.desk-view.kanban-layout.kanban-conversation-open {
  grid-template-columns: 58px 320px minmax(0, 1fr) !important;
}

.desk-view.kanban-layout.kanban-conversation-open > .kanban-view,
.desk-view.kanban-layout.kanban-conversation-open > .details {
  display: none !important;
}

.desk-view.kanban-layout.kanban-conversation-open > .sidebar {
  display: grid !important;
  grid-column: 2;
  grid-row: 1;
}

.desk-view.kanban-layout.kanban-conversation-open > .conversation-pane {
  display: grid !important;
  grid-column: 3;
  grid-row: 1;
}

.kanban-conversation-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .9);
  backdrop-filter: blur(5px);
}

.kanban-conversation-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: default;
}

.kanban-conversation-backdrop:hover,
.kanban-conversation-backdrop:active {
  background: transparent;
}

.kanban-conversation-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: min(1120px, 100%);
  height: min(820px, calc(100dvh - 48px));
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(15, 23, 42, .3);
}

.kanban-conversation-content,
.kanban-conversation-content > .conversation-pane {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.kanban-conversation-content {
  position: relative;
}

.kanban-new-messages {
  position: absolute;
  z-index: 4;
  top: 150px;
  right: 16px;
  max-width: min(420px, calc(100% - 32px));
  border: 1px solid var(--kanban-line);
  border-left: 4px solid var(--kanban-mine);
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--panel);
  color: var(--kanban-text);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  white-space: normal;
}

.kanban-new-messages:hover,
.kanban-new-messages:focus-visible {
  background: var(--kanban-card-hover);
  color: var(--kanban-text);
  border-color: var(--kanban-mine);
  border-left-color: var(--kanban-mine);
}

.kanban-conversation-content > .conversation-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.kanban-conversation-close {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.kanban-conversation-content .conversation-pane > .topbar {
  padding-right: 54px;
}

.conversation-pane.is-loading .messages {
  display: grid;
  place-items: center;
}

.kanban-loading-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.kanban-loading-state p { margin: 0; }

.kanban-loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(37, 99, 235, .18);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: kanban-loading-spin .75s linear infinite;
}

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

.kanban-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 24px;
}

.kanban-header h1 {
  margin: 2px 0 4px;
  font-size: 25px;
}

.kanban-header p:not(.eyebrow) {
  margin: 0;
  color: var(--kanban-muted);
}

.kanban-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kanban-new-conversation-button {
  min-height: 42px;
  border: 1px solid var(--kanban-mine);
  border-radius: 12px;
  background: var(--kanban-mine);
  padding: 0 16px;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 5px 14px rgb(37 99 235 / 16%);
}

.kanban-refresh-button {
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  line-height: 0;
  border: 1px solid var(--kanban-line);
  border-radius: 12px;
  background: var(--kanban-control);
  color: var(--kanban-control-text);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, color .16s ease;
}

.kanban-refresh-button svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.kanban-refresh-button:hover,
.kanban-refresh-button:focus-visible {
  border-color: var(--kanban-mine);
  color: var(--kanban-mine);
  box-shadow: 0 2px 8px rgba(37, 99, 235, .1);
}

.kanban-refresh-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--kanban-mine) 26%, transparent);
  outline-offset: 2px;
}

.kanban-new-conversation-button:hover {
  border-color: color-mix(in srgb, var(--kanban-mine) 82%, #000);
  background: color-mix(in srgb, var(--kanban-mine) 82%, #000);
}

.kanban-new-conversation-button:focus-visible {
  outline: 3px solid rgb(37 99 235 / 28%);
  outline-offset: 2px;
}

.kanban-search input {
  width: min(320px, 32vw);
  height: 42px;
  border: 1px solid var(--kanban-line);
  border-radius: 12px;
  background: var(--kanban-control);
  padding: 0 14px;
  color: var(--kanban-text);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.kanban-search input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--kanban-mine) 24%, transparent);
  border-color: var(--kanban-mine);
}

.kanban-search .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.kanban-archive-button,
.kanban-filters button {
  min-height: 38px;
  border: 1px solid var(--kanban-line);
  border-radius: 999px;
  background: var(--kanban-control);
  padding: 0 14px;
  color: var(--kanban-control-text);
  font-weight: 700;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}

.kanban-archive-button:hover,
.kanban-filters button:hover {
  border-color: var(--kanban-mine);
  box-shadow: 0 2px 8px rgba(37, 99, 235, .1);
}

.kanban-archive-button:focus-visible,
.kanban-filters button:focus-visible,
.kanban-new-conversation-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--kanban-mine) 26%, transparent);
  outline-offset: 2px;
}

.kanban-archive-button.active,
.kanban-filters button.active {
  border-color: var(--kanban-mine);
  background: var(--kanban-mine);
  color: #fff;
}

.kanban-filters {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kanban-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.kanban-columns.archived {
  grid-template-columns: repeat(3, minmax(230px, 1fr));
}

.kanban-column {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--kanban-line);
  border-top: 3px solid var(--kanban-closed);
  border-radius: 16px;
  background: var(--kanban-column);
  box-shadow: 0 4px 14px rgba(29, 48, 73, .045);
}

.kanban-column.kanban-waiting { border-top-color: var(--kanban-waiting); }
.kanban-column.kanban-mine { border-top-color: var(--kanban-mine); }
.kanban-column.kanban-others { border-top-color: var(--kanban-others); }
.kanban-column.kanban-closed { border-top-color: var(--kanban-closed); }
.kanban-column.kanban-archived { border-top-color: var(--kanban-archived); }

.kanban-column.drop-target {
  background: color-mix(in srgb, var(--kanban-mine) 10%, var(--kanban-column));
  border-color: color-mix(in srgb, var(--kanban-mine) 50%, var(--kanban-line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kanban-mine) 30%, transparent);
}

.kanban-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 11px;
}

.kanban-column > header h2 {
  margin: 0;
  font-size: 15px;
}

.kanban-column > header > span {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--kanban-control);
  color: var(--kanban-muted);
  font-size: 12px;
  font-weight: 800;
}

.kanban-column-cards {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 0 10px 12px;
}

.kanban-card {
  display: grid;
  flex: 0 0 auto;
  gap: 9px;
  width: 100%;
  border: 1px solid var(--kanban-line);
  border-radius: 13px;
  background: var(--kanban-card);
  padding: 12px;
  color: var(--kanban-text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(31, 50, 77, .055);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.kanban-card-wrap {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
}

.kanban-card-wrap > .kanban-card {
  flex: initial;
}

.kanban-context-menu {
  position: fixed;
  z-index: 45;
  top: auto;
  right: auto;
  width: 220px;
  max-height: min(320px, calc(100dvh - 16px));
  overflow-y: auto;
}

.kanban-card.draggable { cursor: grab; }
.kanban-card.draggable:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .45; }

.kanban-card:hover,
.kanban-card:focus-visible {
  transform: translateY(-1px);
  background: var(--kanban-card-hover);
  color: var(--kanban-text);
  border-color: color-mix(in srgb, var(--kanban-mine) 52%, var(--kanban-line));
  box-shadow: 0 7px 16px rgba(37, 99, 235, .12);
  outline: none;
}

.kanban-card:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kanban-mine) 22%, transparent), 0 5px 14px rgba(37, 99, 235, .12);
}

.kanban-card:active {
  transform: translateY(0);
  border-color: var(--kanban-mine);
}

.kanban-card.unread { border-left: 3px solid var(--kanban-mine); }

.kanban-card.selected {
  border-color: var(--kanban-mine);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--kanban-mine) 20%, transparent), 0 7px 18px rgba(37, 99, 235, .12);
}

.kanban-archived-card {
  align-content: start;
}

.kanban-card-open {
  display: grid;
  gap: 9px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.kanban-card-open:hover,
.kanban-card-open:focus-visible {
  background: transparent;
  color: inherit;
}

.kanban-unarchive-button {
  justify-self: start;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--kanban-line);
  border-radius: 8px;
  background: var(--kanban-control);
  color: var(--kanban-mine);
  font-size: 12px;
  font-weight: 700;
}

.kanban-unarchive-button:hover {
  border-color: var(--kanban-mine);
  background: var(--kanban-card-hover);
  color: var(--kanban-mine);
}

.kanban-card-heading,
.kanban-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-card-heading .conversation-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  font-size: 12px;
}

.kanban-card-heading strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-unread {
  display: grid;
  min-width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 999px;
  background: var(--kanban-mine);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.kanban-company,
.kanban-preview {
  overflow: hidden;
  color: var(--kanban-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card-footer {
  justify-content: space-between;
  border-top: 1px solid var(--kanban-line);
  padding-top: 8px;
  color: var(--kanban-muted);
  font-size: 11px;
}

.kanban-card-footer > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-empty {
  padding: 16px 8px;
  color: var(--kanban-muted);
  font-size: 12px;
  text-align: center;
  border: 1px dashed var(--kanban-line);
  border-radius: 12px;
  background: var(--kanban-empty-bg);
  margin: 10px;
}

.theme-dark .kanban-column { box-shadow: 0 8px 22px rgba(0, 0, 0, .12); }

.theme-dark .kanban-context-menu {
  background: var(--kanban-card);
  color: var(--kanban-text);
  border-color: var(--kanban-line);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .28);
}

.theme-dark .kanban-context-menu .conversation-menu-item {
  color: var(--kanban-text);
}

.theme-dark .kanban-context-menu .conversation-menu-item:hover,
.theme-dark .kanban-context-menu .conversation-menu-item:focus-visible {
  background: var(--kanban-card-hover);
}

.theme-dark .kanban-conversation-modal {
  background: rgba(5, 10, 17, .76);
}

.theme-dark .kanban-conversation-dialog {
  --panel: #182331;
  --line: #2b3a4c;
  --text: #e8eef7;
  --muted: #a6b4c6;
  border-color: var(--kanban-line);
  background: #182331;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .4);
}

.theme-dark .kanban-conversation-dialog .topbar,
.theme-dark .kanban-conversation-dialog .composer,
.theme-dark .kanban-conversation-dialog .details {
  background: #182331;
  border-color: var(--kanban-line);
  color: var(--kanban-text);
}

.theme-dark .kanban-conversation-dialog .messages {
  background-color: #111b28;
}

.theme-dark .kanban-conversation-dialog .message.in {
  background: #223247;
  border-color: #344a62;
  color: #e8eef7;
}

.theme-dark .kanban-conversation-dialog .message.in .message-text,
.theme-dark .kanban-conversation-dialog .message.in .message-meta {
  color: #e0e9f4;
}

.theme-dark .kanban-conversation-dialog .composer input,
.theme-dark .kanban-conversation-dialog .composer textarea,
.theme-dark .kanban-conversation-dialog .composer select {
  background: #111b28;
  border-color: var(--kanban-line);
  color: var(--kanban-text);
}

@media (max-width: 1050px) {
  .kanban-columns { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
  .kanban-columns.archived { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
  .desk-view.kanban-layout > .kanban-view { padding: 16px; }
}

@media (max-width: 720px) {
  .desk-view.kanban-layout > .kanban-view { padding: 12px; }
  .kanban-header { grid-template-columns: 1fr; }
  .kanban-controls { width: 100%; flex-wrap: wrap; }
  .kanban-search { flex: 1; min-width: 0; }
  .kanban-search input { width: 100%; }
  .kanban-columns { grid-template-columns: repeat(4, minmax(78vw, 1fr)); }
  .kanban-columns.archived { grid-template-columns: repeat(3, minmax(78vw, 1fr)); }
  .desk-view.kanban-layout.kanban-conversation-open { grid-template-columns: minmax(0, 1fr) !important; }
  .desk-view.kanban-layout.kanban-conversation-open > .sidebar { display: none !important; }
  .desk-view.kanban-layout.kanban-conversation-open > .conversation-pane { grid-column: 1; }
}

/* A compact mobile rail and a message-first composer for narrow screens. */
@media (max-width: 560px) {
  .navigation-rail {
    position: fixed;
    top: 10px;
    left: 10px;
    right: auto;
    bottom: auto;
    z-index: 50;
    width: 48px;
    min-width: 48px;
    height: 56px;
    min-height: 56px;
    grid-column: auto !important;
    grid-row: auto !important;
    padding: 8px 5px;
    gap: 8px;
    overflow: hidden;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transition: width .18s ease, box-shadow .18s ease;
  }

  .rail-toggle {
    width: 36px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: #526579;
  }

  .rail-toggle svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

  .navigation-rail:not(.mobile-menu-open) .rail-brand,
  .navigation-rail:not(.mobile-menu-open) .rail-menu,
  .navigation-rail:not(.mobile-menu-open) .rail-footer { display: none; }

  .navigation-rail.mobile-menu-open {
    height: auto;
    min-height: 0;
    max-height: min(70vh, 460px);
    bottom: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    width: min(240px, calc(100vw - 24px));
    box-shadow: 0 14px 36px rgba(15, 23, 42, .24);
    overflow-x: hidden;
    overflow-y: auto;
    align-items: stretch;
  }

  .navigation-rail.mobile-menu-open .rail-toggle { align-self: flex-start; background: #0d4d75; color: #fff; }
  .navigation-rail.mobile-menu-open .rail-brand { display: none; }
  .navigation-rail.mobile-menu-open .rail-menu,
  .navigation-rail.mobile-menu-open .rail-footer { justify-items: stretch; }
  .navigation-rail.mobile-menu-open .rail-item { width: 100%; justify-content: start; display: flex; gap: 12px; padding: 0 10px; }
  .navigation-rail.mobile-menu-open .rail-item::after { display: none; }
  .rail-label { display: none; }
  .navigation-rail.mobile-menu-open .rail-label { display: inline; font-size: 13px; font-weight: 700; white-space: nowrap; }
  .navigation-rail.mobile-menu-open .rail-item.active .rail-indicator { left: -6px; }

  .rail-brand {
    width: 36px;
    height: 36px;
  }

  .rail-item {
    width: 36px;
    height: 38px;
    min-height: 38px;
  }

  .rail-item.active .rail-indicator { left: -4px; }

  .desk-view > .sidebar,
  .desk-view > .conversation-pane,
  .desk-view > .module-view {
    width: 100%;
    margin-left: 0;
  }

  .desk-view > .details { left: 0 !important; }

  .composer {
    grid-template-columns: 42px 42px 42px minmax(0, 1fr) 48px;
    grid-template-areas: "attach emoji sticker input send";
    gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }

  .composer .reply-preview,
  .composer .attachment-preview { grid-column: 1 / -1; }

  .composer .template-button,
  .composer .file-request-button { display: none !important; }

  .composer #attachButton {
    grid-area: attach;
    width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .composer #sendButton {
    grid-area: send;
    grid-column: 5;
    grid-row: 1;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 48px;
    min-height: 48px;
    justify-self: end;
    padding: 0;
  }

  .composer #emojiButton {
    grid-area: emoji;
    display: grid;
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
  }

  .composer #stickerButton {
    grid-area: sticker;
    display: grid;
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
  }

  .sticker-picker { left: 58px; bottom: calc(100% + 8px); }

  .composer #messageInput {
    grid-area: input;
    grid-column: 4;
    grid-row: 1;
    width: 100%;
    min-width: 0;
  }

  .composer #cancelAudioButton {
    grid-area: attach;
    grid-column: 1;
    grid-row: 1;
  }

  .attachment-menu .mobile-attachment-action { display: flex; }

  .desk-view:not(.kanban-layout) .composer {
    grid-template-columns: 42px minmax(0, 1fr) 48px;
    grid-template-areas: "attach input send";
  }

  .desk-view:not(.kanban-layout) .composer #emojiButton,
  .desk-view:not(.kanban-layout) .composer #stickerButton { display: none !important; }

  .desk-view:not(.kanban-layout) .composer #messageInput {
    grid-area: input;
    grid-column: 2;
    grid-row: 1;
  }

  .desk-view:not(.kanban-layout) .composer #sendButton {
    grid-area: send;
    grid-column: 3;
    grid-row: 1;
  }

  .desk-view > .sidebar,
  .desk-view > .conversation-pane,
  .desk-view > .module-view { grid-column: 1 / -1 !important; }

  .desk-view > .navigation-rail { grid-column: auto !important; grid-row: auto !important; }

  .desk-view.module-mode > .module-view { grid-column: 1 / -1 !important; }

  .desk-view.no-details { grid-template-columns: minmax(0, 1fr) !important; }
  .desk-view.module-mode { grid-template-columns: minmax(0, 1fr) !important; }
  .desk-view { grid-template-columns: minmax(0, 1fr) !important; }

  .rail-toggle:focus-visible,
  .navigation-rail.mobile-menu-open .rail-item:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
  }

  #messageInput {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 12px 14px;
  }

  #cancelAudioButton { grid-area: attach; }
  .composer:has(#cancelAudioButton:not(.hidden)) #attachButton { display: none; }
}

/* Paleta semântica compartilhada pelo layout clássico de conversas. */
:root {
  --inbox-surface: #ffffff;
  --inbox-subtle: #f5f8fc;
  --inbox-card: #ffffff;
  --inbox-hover: #f8fbff;
  --inbox-selected: #eff6ff;
  --inbox-unread: #f3f8ff;
  --inbox-border: #e2e8f0;
  --inbox-text: #172b45;
  --inbox-muted: #64748b;
  --inbox-accent: #2563eb;
  --chat-canvas: #f1f5f9;
  --chat-incoming: #ffffff;
  --chat-outgoing: #dcfce7;
  --chat-outgoing-border: #bbf7d0;
  --chat-compose: #ffffff;
  --chat-control: #f8fafc;
}

.theme-dark {
  --inbox-surface: #141e2b;
  --inbox-subtle: #111b28;
  --inbox-card: #1b2939;
  --inbox-hover: #202f42;
  --inbox-selected: #1c3550;
  --inbox-unread: #192b3e;
  --inbox-border: #2a3a4d;
  --inbox-text: #e8eef7;
  --inbox-muted: #a6b4c6;
  --inbox-accent: #70a2ff;
  --chat-canvas: #101925;
  --chat-incoming: #223247;
  --chat-outgoing: #1b4037;
  --chat-outgoing-border: #2a594c;
  --chat-compose: #141e2b;
  --chat-control: #101925;
}

.desk-view:not(.kanban-layout) .sidebar,
.desk-view:not(.kanban-layout) .conversation-pane,
.desk-view:not(.kanban-layout) .details {
  border-color: var(--inbox-border);
}

.desk-view:not(.kanban-layout) .conversation-search input {
  min-height: 42px;
  border: 1px solid var(--inbox-border);
  border-radius: 12px;
  background: var(--inbox-subtle);
  color: var(--inbox-text);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.desk-view:not(.kanban-layout) .conversation-search input:focus {
  border-color: var(--inbox-accent);
  background: var(--inbox-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--inbox-accent) 18%, transparent);
  outline: 0;
}

.desk-view:not(.kanban-layout) .filter,
.desk-view:not(.kanban-layout) .queue-tab,
.desk-view:not(.kanban-layout) .archived-conversations {
  border: 1px solid var(--inbox-border);
  background: var(--inbox-subtle);
  color: var(--inbox-text);
  transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.desk-view:not(.kanban-layout) .filter:hover,
.desk-view:not(.kanban-layout) .queue-tab:hover,
.desk-view:not(.kanban-layout) .archived-conversations:hover {
  border-color: color-mix(in srgb, var(--inbox-accent) 45%, var(--inbox-border));
  background: var(--inbox-hover);
}

.desk-view:not(.kanban-layout) .filter.active,
.desk-view:not(.kanban-layout) .queue-tab.active,
.desk-view:not(.kanban-layout) .archived-conversations.active {
  border-color: var(--inbox-accent);
  background: var(--inbox-accent);
  color: #ffffff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--inbox-accent) 22%, transparent);
}

.desk-view:not(.kanban-layout) .conversation-item {
  border-radius: 14px;
  transition: background .16s ease;
}

.desk-view:not(.kanban-layout) .conversation-select {
  border: 1px solid var(--inbox-border);
  background: var(--inbox-card);
  color: var(--inbox-text);
  box-shadow: 0 3px 10px rgba(31, 50, 77, .045);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.desk-view:not(.kanban-layout) .conversation-item:hover .conversation-select {
  border-color: color-mix(in srgb, var(--inbox-accent) 32%, var(--inbox-border));
  background: var(--inbox-hover);
  transform: translateY(-1px);
}

.desk-view:not(.kanban-layout) .conversation-item.active .conversation-select {
  border-color: color-mix(in srgb, var(--inbox-accent) 58%, var(--inbox-border));
  background: var(--inbox-selected);
  box-shadow: inset 3px 0 0 var(--inbox-accent), 0 5px 14px color-mix(in srgb, var(--inbox-accent) 12%, transparent);
}

.desk-view:not(.kanban-layout) .conversation-item.unread .conversation-select {
  border-color: color-mix(in srgb, var(--inbox-accent) 28%, var(--inbox-border));
  background: var(--inbox-unread);
}

.desk-view:not(.kanban-layout) .conversation-item.active.unread .conversation-select {
  background: var(--inbox-selected);
  border-color: color-mix(in srgb, var(--inbox-accent) 58%, var(--inbox-border));
}

.desk-view:not(.kanban-layout) .conversation-menu-toggle {
  border-color: var(--inbox-border);
  background: var(--inbox-subtle);
  color: var(--inbox-accent);
}

.desk-view:not(.kanban-layout) .conversation-menu-toggle:hover {
  background: var(--inbox-selected);
  color: var(--inbox-accent);
}

.desk-view:not(.kanban-layout) .messages {
  background-color: var(--chat-canvas);
  background-size: 180px 180px;
}

.desk-view:not(.kanban-layout) .message.in {
  background: var(--chat-incoming);
  border-color: var(--inbox-border);
  color: var(--inbox-text);
}

.desk-view:not(.kanban-layout) .message.out {
  background: var(--chat-outgoing);
  border-color: var(--chat-outgoing-border);
  color: var(--inbox-text);
}

.desk-view:not(.kanban-layout) .message.in .message-text,
.desk-view:not(.kanban-layout) .message.in .message-meta {
  color: var(--inbox-text);
}

.desk-view:not(.kanban-layout) .message.out .message-text,
.desk-view:not(.kanban-layout) .message.out .message-meta {
  color: var(--inbox-text);
}

.desk-view:not(.kanban-layout) .composer {
  background: var(--chat-compose);
  border-color: var(--inbox-border);
}

.desk-view:not(.kanban-layout) .composer #messageInput,
.desk-view:not(.kanban-layout) .composer .composer-icon,
.desk-view:not(.kanban-layout) .composer .template-button,
.desk-view:not(.kanban-layout) .composer .file-request-button {
  border-color: var(--inbox-border);
  background: var(--chat-control);
  color: var(--inbox-text);
}

.desk-view:not(.kanban-layout) .composer #messageInput:focus {
  border-color: var(--inbox-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--inbox-accent) 18%, transparent);
  outline: 0;
}

.desk-view:not(.kanban-layout) .composer #sendButton {
  background: var(--inbox-accent);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--inbox-accent) 22%, transparent);
}

.desk-view:not(.kanban-layout) .composer #sendButton:hover {
  background: color-mix(in srgb, var(--inbox-accent) 82%, #000);
}

.theme-dark .desk-view:not(.kanban-layout) .sidebar,
.theme-dark .desk-view:not(.kanban-layout) .sidebar-header,
.theme-dark .desk-view:not(.kanban-layout) .conversation-search,
.theme-dark .desk-view:not(.kanban-layout) .filters,
.theme-dark .desk-view:not(.kanban-layout) .queue-tabs,
.theme-dark .desk-view:not(.kanban-layout) .conversation-list,
.theme-dark .desk-view:not(.kanban-layout) .conversation-pane,
.theme-dark .desk-view:not(.kanban-layout) .topbar,
.theme-dark .desk-view:not(.kanban-layout) .composer,
.theme-dark .desk-view:not(.kanban-layout) .details {
  background-color: var(--inbox-surface);
  border-color: var(--inbox-border);
  color: var(--inbox-text);
}

.theme-dark .desk-view:not(.kanban-layout) .conversation-search input,
.theme-dark .desk-view:not(.kanban-layout) .conversation-search input:focus,
.theme-dark .desk-view:not(.kanban-layout) .composer #messageInput,
.theme-dark .desk-view:not(.kanban-layout) .composer .composer-icon,
.theme-dark .desk-view:not(.kanban-layout) .composer .template-button,
.theme-dark .desk-view:not(.kanban-layout) .composer .file-request-button {
  background: var(--chat-control);
  border-color: var(--inbox-border);
  color: var(--inbox-text);
}

.theme-dark .desk-view:not(.kanban-layout) .composer #stickerButton {
  border-color: var(--inbox-border);
  background: var(--chat-control);
  color: var(--inbox-text);
}

.theme-dark .desk-view:not(.kanban-layout) .composer #stickerButton {
  border-color: var(--inbox-border);
  background: var(--chat-control);
  color: var(--inbox-text);
}

.theme-dark .desk-view:not(.kanban-layout) .conversation-search input::placeholder,
.theme-dark .desk-view:not(.kanban-layout) #messageInput::placeholder {
  color: var(--inbox-muted);
}

.theme-dark .desk-view:not(.kanban-layout) .conversation-search input:focus,
.theme-dark .desk-view:not(.kanban-layout) .composer #messageInput:focus {
  border-color: var(--inbox-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--inbox-accent) 20%, transparent);
}

.theme-dark .desk-view:not(.kanban-layout) .contact-name,
.theme-dark .desk-view:not(.kanban-layout) .conversation-select,
.theme-dark .desk-view:not(.kanban-layout) .conversation-item.unread .preview,
.theme-dark .desk-view:not(.kanban-layout) .conversation-heading h2 {
  color: var(--inbox-text);
}

.theme-dark .desk-view:not(.kanban-layout) .preview,
.theme-dark .desk-view:not(.kanban-layout) .conversation-time,
.theme-dark .desk-view:not(.kanban-layout) .conversation-owner,
.theme-dark .desk-view:not(.kanban-layout) .contact-company,
.theme-dark .desk-view:not(.kanban-layout) .conversation-assignee,
.theme-dark .desk-view:not(.kanban-layout) .conversation-heading .muted {
  color: var(--inbox-muted);
}

.theme-dark .desk-view:not(.kanban-layout) .conversation-item.active .preview,
.theme-dark .desk-view:not(.kanban-layout) .conversation-item.active .conversation-time,
.theme-dark .desk-view:not(.kanban-layout) .conversation-item.active .conversation-owner {
  color: #d1deee;
}

.theme-dark .desk-view:not(.kanban-layout) .conversation-status.is-waiting {
  background: #273549;
  border-color: #3a4b62;
  color: #cbd8e8;
}

.theme-dark .desk-view:not(.kanban-layout) .conversation-status.is-assigned {
  background: #183b35;
  border-color: #2b5b50;
  color: #a8e5d1;
}

.theme-dark .desk-view:not(.kanban-layout) .conversation-status.is-closed {
  background: #252f3e;
  border-color: #3a4658;
  color: #cad3df;
}

.theme-dark .desk-view:not(.kanban-layout) .conversation-item.active .conversation-select {
  background: var(--inbox-selected);
}

.theme-dark .desk-view:not(.kanban-layout) .message.in {
  background: var(--chat-incoming);
  border-color: var(--inbox-border);
  color: var(--inbox-text);
}

.theme-dark .desk-view:not(.kanban-layout) .message.out {
  background: var(--chat-outgoing);
  border-color: var(--chat-outgoing-border);
  color: #e5f4ed;
}

.theme-dark .desk-view:not(.kanban-layout) .message.in .message-text,
.theme-dark .desk-view:not(.kanban-layout) .message.in .message-meta,
.theme-dark .desk-view:not(.kanban-layout) .message.in .shared-contact-text,
.theme-dark .desk-view:not(.kanban-layout) .message.out .message-text,
.theme-dark .desk-view:not(.kanban-layout) .message.out .message-meta {
  color: inherit;
}

.theme-dark .desk-view:not(.kanban-layout) .messages {
  background-color: var(--chat-canvas);
  background-image: radial-gradient(rgba(148, 163, 184, .045) 1px, transparent 1px);
  background-size: 24px 24px;
}

.theme-dark .desk-view:not(.kanban-layout) .message.in .audio-message {
  background: var(--chat-incoming);
}

.theme-dark .desk-view:not(.kanban-layout) .message.in .audio-play {
  color: var(--inbox-text);
}

.theme-dark .desk-view:not(.kanban-layout) .conversation-menu {
  background: var(--inbox-card);
  border-color: var(--inbox-border);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .28);
}

.theme-dark .desk-view:not(.kanban-layout) .conversation-menu-item {
  color: var(--inbox-text);
}

.theme-dark .desk-view:not(.kanban-layout) .conversation-menu-item:hover {
  background: var(--inbox-hover);
  color: var(--inbox-text);
}

.theme-dark .modal-panel {
  background: #141e2b;
  border-color: var(--inbox-border);
}

.theme-dark .modal-header,
.theme-dark .contact-search,
.theme-dark .quick-contact-form,
.theme-dark .add-contact-actions,
.theme-dark .edit-contact-actions,
.theme-dark .template-form-footer,
.theme-dark .camera-actions {
  background: #141e2b;
  border-color: var(--inbox-border);
}

.theme-dark .modal input,
.theme-dark .modal textarea,
.theme-dark .modal select {
  background: #101925;
  border-color: var(--inbox-border);
  color: var(--inbox-text);
}

/* Refinamentos pontuais do Kanban no tema escuro. */
.theme-dark .kanban-column {
  border-color: color-mix(in srgb, var(--kanban-line) 78%, transparent);
  background: #192432;
}

.theme-dark .kanban-card {
  border-color: color-mix(in srgb, var(--kanban-line) 72%, transparent);
  background: #222f3e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  transition-duration: 170ms;
}

.theme-dark .kanban-card:hover {
  border-color: color-mix(in srgb, var(--kanban-mine) 38%, var(--kanban-line));
  background: #263548;
  box-shadow: 0 5px 13px rgba(0, 0, 0, .16);
}

.theme-dark .kanban-card:focus-visible {
  border-color: color-mix(in srgb, var(--kanban-mine) 58%, var(--kanban-line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--kanban-mine) 22%, transparent), 0 5px 13px rgba(0, 0, 0, .16);
}

.theme-dark .kanban-card.unread {
  border-left-color: var(--kanban-mine);
  background: color-mix(in srgb, var(--kanban-mine) 5%, #222f3e);
}

.theme-dark .kanban-card.selected {
  border-color: color-mix(in srgb, var(--kanban-mine) 60%, var(--kanban-line));
  background: color-mix(in srgb, var(--kanban-mine) 8%, #222f3e);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--kanban-mine) 24%, transparent), 0 4px 12px rgba(0, 0, 0, .14);
}

.theme-dark .kanban-card-heading .conversation-muted-indicator,
.theme-dark .kanban-card-heading .kanban-unread {
  flex: 0 0 auto;
  white-space: nowrap;
}

.theme-dark .kanban-unread {
  background: var(--kanban-unread-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}

.theme-dark .kanban-company,
.theme-dark .kanban-preview,
.theme-dark .kanban-card-footer,
.theme-dark .kanban-empty {
  color: #b2bfce;
}

.theme-dark .kanban-empty {
  margin: auto 10px;
  border-style: solid;
  border-color: transparent;
  background: transparent;
}

.theme-dark .kanban-column-cards:has(.kanban-empty) {
  justify-content: center;
}

.theme-dark .kanban-search input {
  padding-left: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239eafc3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px;
}

.theme-dark .kanban-search input::placeholder {
  color: var(--kanban-placeholder);
  opacity: 1;
}

.theme-dark .desk-view.kanban-layout > .kanban-view {
  gap: 15px;
}

.theme-dark .kanban-conversation-dialog {
  border-color: color-mix(in srgb, var(--kanban-line) 78%, transparent);
}

.theme-dark .desk-view:not(.kanban-layout) .details-header {
  border-bottom-color: var(--inbox-border);
}

.theme-dark .desk-view:not(.kanban-layout) .team-search {
  border-color: var(--inbox-border);
  background: var(--chat-control);
  color: var(--inbox-muted);
}

.theme-dark .desk-view:not(.kanban-layout) .team-search input {
  background: transparent;
  color: var(--inbox-text);
}

.theme-dark .desk-view:not(.kanban-layout) .team-search input::placeholder {
  color: var(--inbox-muted);
}

.theme-dark .desk-view:not(.kanban-layout) .team-section-header {
  color: var(--inbox-text);
}

.theme-dark .desk-view:not(.kanban-layout) .team-section-header span {
  color: var(--inbox-muted);
}

.theme-dark .desk-view:not(.kanban-layout) .team-card {
  border-color: var(--inbox-border);
  border-radius: 14px;
  background: var(--inbox-card);
  color: var(--inbox-text);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
  transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.theme-dark .desk-view:not(.kanban-layout) .team-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--inbox-accent) 42%, var(--inbox-border));
  background: var(--inbox-hover);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .16);
}

.theme-dark .desk-view:not(.kanban-layout) .team-card-body strong {
  color: var(--inbox-text);
}

.theme-dark .desk-view:not(.kanban-layout) .team-card-status,
.theme-dark .desk-view:not(.kanban-layout) .team-section-empty,
.theme-dark .desk-view:not(.kanban-layout) .team-empty {
  color: var(--inbox-muted);
}

.theme-dark .desk-view:not(.kanban-layout) .team-card.online .team-card-status {
  color: #73d9ad;
}

.theme-dark .desk-view:not(.kanban-layout) .team-card:not(.online) .presence-dot {
  background: #718096;
  box-shadow: 0 0 0 4px rgba(113, 128, 150, .14);
}

.theme-dark .desk-view:not(.kanban-layout) .team-card.online .presence-dot {
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .18), 0 0 0 7px rgba(52, 211, 153, .07);
}

/* Conversation emoji picker: keep its controls readable on the dark surface. */
.theme-dark .emoji-picker {
  border-color: var(--inbox-border, var(--line));
  background: var(--chat-panel, #111b18);
  color: var(--inbox-text, var(--text));
  box-shadow: 0 18px 42px rgba(0, 0, 0, .34);
}

.theme-dark .emoji-search-input {
  border-color: var(--inbox-border, var(--line));
  background: var(--chat-control, #15211e);
  color: var(--inbox-text, var(--text));
}

.theme-dark .emoji-search-input::placeholder {
  color: var(--inbox-muted, #a6b4c6);
  opacity: 1;
}

.theme-dark .emoji-search-input:focus {
  border-color: var(--inbox-accent, #5b8cff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--inbox-accent, #5b8cff) 20%, transparent);
}

.theme-dark .emoji-category-chip {
  border-color: var(--inbox-border, var(--line));
  background: var(--chat-control, #15211e);
  color: var(--inbox-text, var(--text));
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.theme-dark .emoji-category-chip.active,
.theme-dark .emoji-category-chip:hover {
  border-color: color-mix(in srgb, var(--inbox-accent, #5b8cff) 48%, var(--inbox-border, var(--line)));
  background: color-mix(in srgb, var(--inbox-accent, #5b8cff) 18%, var(--chat-control, #15211e));
  color: var(--inbox-text, var(--text));
}

.theme-dark .emoji-section-header {
  background: linear-gradient(180deg, var(--chat-panel, #111b18) 76%, transparent);
  color: var(--inbox-text, var(--text));
}

.theme-dark .emoji-option:hover {
  background: color-mix(in srgb, var(--inbox-accent, #5b8cff) 16%, transparent);
}

.theme-dark .emoji-category-nav::-webkit-scrollbar-thumb,
.theme-dark .emoji-sections::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, .38);
}

.theme-dark .kanban-conversation-modal {
  background: rgba(5, 10, 17, .76);
}

.theme-dark .kanban-conversation-backdrop,
.theme-dark .kanban-conversation-backdrop:hover,
.theme-dark .kanban-conversation-backdrop:active {
  background: transparent;
}

.theme-dark .composer .file-request-button,
.theme-dark .composer .file-request-button:disabled,
.theme-dark .composer .file-request-button:disabled:hover {
  border-color: var(--inbox-border);
  background: var(--inbox-subtle);
  color: var(--inbox-text);
  opacity: 1;
}

.theme-dark .composer .file-request-button:not(:disabled):hover {
  border-color: color-mix(in srgb, var(--inbox-accent) 48%, var(--inbox-border));
  background: var(--inbox-hover);
  color: var(--inbox-text);
}

.theme-dark .topbar-actions .topbar-action {
  min-height: 34px;
  border: 1px solid var(--inbox-border);
  border-radius: 999px;
  background: var(--inbox-subtle);
  color: var(--inbox-text);
  box-shadow: none;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.theme-dark .topbar-actions .topbar-action:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--inbox-accent) 48%, var(--inbox-border));
  background: var(--inbox-hover);
  color: var(--inbox-text);
}

.theme-dark .topbar-actions .assign-action:disabled,
.theme-dark .topbar-actions .assign-action:disabled:hover {
  border-color: var(--inbox-border);
  background: var(--inbox-card);
  color: var(--inbox-muted);
  opacity: 1;
}

.theme-dark .topbar-actions .assign-action:not(:disabled),
.theme-dark .topbar-actions .transfer-action:not(:disabled) {
  border-color: var(--inbox-accent);
  background: var(--inbox-accent);
  color: #fff;
}

.theme-dark .topbar-actions .assign-action:not(:disabled):hover,
.theme-dark .topbar-actions .transfer-action:not(:disabled):hover {
  border-color: color-mix(in srgb, var(--inbox-accent) 84%, #000);
  background: color-mix(in srgb, var(--inbox-accent) 84%, #000);
}

.theme-dark .topbar-actions .close-action:not(:disabled) {
  border-color: #8e4654;
  background: #512c38;
  color: #ffd5dc;
}

.theme-dark .topbar-actions .close-action:not(:disabled):hover {
  border-color: #b65c6c;
  background: #673442;
  color: #fff0f2;
}

@media (max-width: 900px) {
  .settings-module-shell { padding: 28px 22px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-account-card { grid-row: auto; }
}

@media (max-width: 560px) {
  .settings-module-shell { padding: 22px 14px; }
  .settings-card { padding: 17px; border-radius: 15px; }
  .settings-form-row { grid-template-columns: minmax(0, 1fr); }
  .settings-module-header { margin-bottom: 18px; }
}

/* Keep the standalone workspace modules on the same Dark palette as Conversations. */
.theme-dark .desk-view.module-mode > .navigation-rail {
  border-color: var(--inbox-border);
  background: var(--inbox-surface);
}

.theme-dark .desk-view.module-mode > .module-view {
  border-color: var(--inbox-border);
  background: var(--chat-canvas);
  color: var(--inbox-text);
}

.theme-dark .module-header h1,
.theme-dark .module-placeholder h1,
.theme-dark .broadcast-summary-card strong,
.theme-dark .broadcast-list-heading h2,
.theme-dark .broadcast-table td strong,
.theme-dark .contacts-module-state h2,
.theme-dark .contact-card-copy h2,
.theme-dark .settings-card-heading h2,
.theme-dark .settings-password-form h3,
.theme-dark .settings-switch-row strong,
.theme-dark .reports-period-card > div:first-child strong,
.theme-dark .reports-module-state h1,
.theme-dark .reports-module-state h2,
.theme-dark .admin-dashboard-header h2,
.theme-dark .admin-dashboard-section h3,
.theme-dark .admin-stat-card strong {
  color: var(--inbox-text);
}

.theme-dark .module-subtitle,
.theme-dark .broadcast-summary-card span:not(.broadcast-summary-icon),
.theme-dark .broadcast-list-count,
.theme-dark .broadcast-table,
.theme-dark .contacts-count,
.theme-dark .contact-card-copy p,
.theme-dark .contact-card-copy small,
.theme-dark .contacts-module-state p:not(.form-error),
.theme-dark .reports-period-card > div:first-child span,
.theme-dark .reports-module-state p:not(.eyebrow),
.theme-dark .settings-card-heading p,
.theme-dark .settings-form label,
.theme-dark .settings-account-meta,
.theme-dark .settings-switch-row small,
.theme-dark .settings-note,
.theme-dark .settings-feedback,
.theme-dark .admin-dashboard-subtitle,
.theme-dark .admin-assignee-row span {
  color: var(--inbox-muted);
}

.theme-dark .module-primary {
  background: var(--inbox-accent);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--inbox-accent) 18%, transparent);
}

.theme-dark .module-primary:hover {
  background: color-mix(in srgb, var(--inbox-accent) 84%, #000);
}

.theme-dark .broadcast-summary-card,
.theme-dark .broadcast-list-card,
.theme-dark .contact-card,
.theme-dark .settings-card,
.theme-dark .reports-period-card,
.theme-dark .reports-module-state,
.theme-dark .admin-stat-card,
.theme-dark .admin-dashboard-section {
  border-color: var(--inbox-border);
  background: var(--inbox-card);
  color: var(--inbox-text);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .12);
}

.theme-dark .broadcast-list-heading,
.theme-dark .broadcast-table th,
.theme-dark .broadcast-table td,
.theme-dark .settings-password-form,
.theme-dark .settings-switch-row {
  border-color: var(--inbox-border);
}

.theme-dark .broadcast-table th,
.theme-dark .contacts-module-search,
.theme-dark .settings-form input,
.theme-dark .settings-theme-option,
.theme-dark .admin-dashboard-period select {
  border-color: var(--inbox-border);
  background: var(--inbox-subtle);
  color: var(--inbox-text);
}

.theme-dark .broadcast-table td {
  background: var(--inbox-card);
  color: var(--inbox-muted);
}

.theme-dark .broadcast-table tr:hover td,
.theme-dark .contact-card-action:hover {
  background: var(--inbox-hover);
}

.theme-dark .broadcast-summary-icon.sent { background: #1c3550; color: #8bb8ff; }
.theme-dark .broadcast-summary-icon.delivered { background: #163a36; color: #6ee7c0; }
.theme-dark .broadcast-summary-icon.read { background: #302c50; color: #c1a8ff; }
.theme-dark .broadcast-summary-icon.failed { background: #482b36; color: #ff9b9b; }

.theme-dark .contacts-module-search input,
.theme-dark .settings-form input {
  color: var(--inbox-text);
}

.theme-dark .contacts-module-search input::placeholder,
.theme-dark .settings-form input::placeholder {
  color: var(--inbox-muted);
  opacity: 1;
}

.theme-dark .contacts-module-search:focus-within,
.theme-dark .settings-form input:focus {
  border-color: var(--inbox-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--inbox-accent) 18%, transparent);
}

.theme-dark .contact-card-action {
  border-color: var(--inbox-border);
  background: var(--inbox-subtle);
  color: var(--inbox-text);
}

.theme-dark .contact-card-action.primary {
  border-color: var(--inbox-accent);
  background: var(--inbox-accent);
  color: #fff;
}

.theme-dark .contact-card-action.primary:hover {
  background: color-mix(in srgb, var(--inbox-accent) 84%, #000);
}

.theme-dark .contact-card-action.danger {
  color: #ff9b9b;
}

.theme-dark .contacts-module-state {
  border-color: var(--inbox-border);
  background: var(--inbox-card);
}

.theme-dark .reports-module-state .module-empty-icon,
.theme-dark .contacts-module-state .module-empty-icon {
  border-color: var(--inbox-border);
  background: var(--inbox-subtle);
  color: var(--inbox-accent);
}

.theme-dark .settings-account-meta strong {
  color: var(--inbox-text);
}

.theme-dark .settings-theme-option.active {
  border-color: var(--inbox-accent);
  background: var(--inbox-selected);
  color: var(--inbox-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--inbox-accent) 14%, transparent);
}

.theme-dark .settings-switch-row input:checked + .settings-switch {
  background: var(--inbox-accent);
}

.theme-dark .theme-preview-dark {
  border-color: var(--inbox-border);
  background: var(--chat-canvas);
}

.theme-dark .theme-preview-dark i {
  border-color: var(--inbox-border);
  background: var(--inbox-card);
}

.theme-dark .admin-dashboard-period select:focus {
  border-color: var(--inbox-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--inbox-accent) 18%, transparent);
}

.theme-dark .admin-assignee-row {
  border-color: var(--inbox-border);
  background: var(--inbox-subtle);
}

.mobile-whatsapp-connection-picker {
  display: none;
}

@media (max-width: 760px) {
  .sidebar-heading {
    min-width: 0;
  }

  .mobile-whatsapp-connection-picker:not(.hidden) {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    max-width: min(210px, calc(100vw - 180px));
    min-height: 27px;
    margin-top: 4px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    vertical-align: top;
  }

  .mobile-whatsapp-connection-color {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
  }

  .mobile-whatsapp-connection-picker select {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    appearance: none;
    -webkit-appearance: none;
  }

  .mobile-whatsapp-connection-picker > svg {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

@media (max-width: 560px) {
  .desk-view:not(.kanban-layout) .topbar-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .desk-view:not(.kanban-layout) .topbar-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 5px;
    border-radius: 11px;
    font-size: 11px;
    line-height: 1;
    text-align: center;
  }

  .desk-view:not(.kanban-layout) .topbar-actions .close-action {
    grid-column: auto;
  }

  .desk-view:not(.kanban-layout) > .sidebar .sidebar-header {
    min-height: 50px;
    padding: 5px 12px;
    gap: 8px;
  }

  .desk-view:not(.kanban-layout) > .sidebar .sidebar-heading {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-height: 0;
  }

  .desk-view:not(.kanban-layout) > .sidebar .sidebar-heading > .eyebrow,
  .desk-view:not(.kanban-layout) > .sidebar .sidebar-heading > h2 {
    display: none;
  }

  .desk-view:not(.kanban-layout) > .sidebar .mobile-whatsapp-connection-picker:not(.hidden) {
    margin: 0;
  }

  .desk-view:not(.kanban-layout) > .sidebar .sidebar-actions {
    gap: 7px;
  }

  .desk-view:not(.kanban-layout) > .sidebar .sidebar-actions .icon-button {
    width: 38px;
    min-height: 38px;
  }

  .desk-view:not(.kanban-layout) > .sidebar .queue-tabs {
    display: none !important;
  }

  .desk-view:not(.kanban-layout) > .sidebar .conversation-search {
    padding: 8px 12px;
    gap: 6px;
  }

  .desk-view:not(.kanban-layout) > .sidebar .conversation-search input {
    min-height: 38px;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 14px;
  }

  .desk-view:not(.kanban-layout) > .sidebar .filters {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 0 12px 7px;
  }

  .desk-view:not(.kanban-layout) > .sidebar .filter {
    min-height: 30px;
    padding: 0 11px;
    font-size: 12px;
  }

}

/* Keep conversation controls together in the Kanban conversation window. */
.kanban-conversation-content .conversation-pane > .topbar #conversationTitle {
  flex: 1 1 auto;
  min-width: 0;
}

.kanban-conversation-content .conversation-pane > .topbar .topbar-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  justify-content: flex-end;
}

.kanban-conversation-content .conversation-pane > .topbar .topbar-actions .topbar-action {
  flex: 0 0 auto;
}

.conversation-pane {
  position: relative;
}

.conversation-pane.file-drop-active::after {
  content: 'Solte os arquivos para anexar';
  position: absolute;
  inset: 12px;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 2px dashed var(--brand);
  border-radius: 18px;
  background: rgba(239, 246, 255, 0.92);
  color: var(--brand-dark);
  font-size: clamp(15px, 2vw, 21px);
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}

.theme-dark .conversation-pane.file-drop-active::after {
  border-color: var(--inbox-accent);
  background: rgba(16, 25, 37, 0.94);
  color: var(--inbox-accent);
}

.conversation-pane.idle .messages {
  display: flex;
  padding: clamp(12px, 2.2vw, 28px);
  background: #f5f8fc;
  background-image: none;
}

.idle-calendar {
  width: min(1120px, 100%);
  min-width: 0;
  min-height: 440px;
  margin: auto;
  padding: clamp(16px, 2.2vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, .04);
}

.idle-calendar-header,
.idle-calendar-controls,
.idle-calendar-navigation,
.idle-calendar-footer {
  display: flex;
  align-items: center;
}

.idle-calendar-header {
  justify-content: space-between;
  gap: 16px;
}

.idle-calendar-header h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #1e293b;
  font-size: 19px;
  font-weight: 800;
}

.idle-calendar-header h2 svg {
  color: #64748b;
}

.idle-calendar-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.idle-calendar-assignee,
.idle-calendar-owner,
.idle-calendar-add,
.idle-calendar-view-switch,
.idle-calendar-navigation > button {
  min-height: 36px;
  border: 1px solid #dbe3ed;
  border-radius: 10px;
  background: #fff;
  color: #334155;
}

.idle-calendar-assignee,
.idle-calendar-owner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: #64748b;
}

.idle-calendar-assignee select {
  max-width: 170px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #334155;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.idle-calendar-add,
.idle-calendar-navigation > button {
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  cursor: pointer;
}

.idle-calendar-add {
  width: 38px;
  color: #2563eb;
}

.idle-calendar-add:hover,
.idle-calendar-navigation > button:hover {
  border-color: #93b4ee;
  background: #f4f8ff;
  color: #1d4ed8;
}

.idle-calendar-view-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #f1f5f9;
}

.idle-calendar-view-switch button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.idle-calendar-view-switch button[aria-pressed="true"] {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.idle-calendar-navigation {
  justify-content: center;
  gap: 12px;
  color: #64748b;
}

.idle-calendar-navigation > button {
  min-height: 32px;
  border-color: transparent;
  background: transparent;
}

.idle-calendar-navigation > button[data-idle-calendar-today] {
  border-color: #dbe3ed;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

.idle-calendar-navigation strong {
  min-width: 160px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.idle-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 8px;
  border-bottom: 1px solid #edf1f5;
}

.idle-calendar-days.is-day-view {
  grid-template-columns: minmax(130px, 190px);
  justify-content: center;
}

.idle-calendar-day {
  min-width: 0;
  min-height: 74px;
  padding: 8px 5px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #172033;
  cursor: pointer;
}

.idle-calendar-day > span {
  max-width: 100%;
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idle-calendar-day strong {
  font-size: 17px;
  line-height: 1.2;
}

.idle-calendar-day small {
  min-height: 13px;
  color: #8290a2;
  font-size: 9px;
}

.idle-calendar-day.is-today:not(.is-selected) strong {
  color: #2563eb;
}

.idle-calendar-day:hover {
  background: #f2f6fc;
}

.idle-calendar-day.is-selected {
  border-color: #2563eb;
  background: #3478ed;
  color: #fff;
}

.idle-calendar-day.is-selected > span,
.idle-calendar-day.is-selected small {
  color: rgba(255, 255, 255, .86);
}

.idle-calendar-content {
  flex: 1 1 auto;
  min-height: 140px;
  overflow: auto;
}

.idle-calendar-empty {
  height: 100%;
  min-height: 160px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  color: #8290a2;
  text-align: center;
}

.idle-calendar-empty > span {
  color: #a8b5c6;
}

.idle-calendar-empty p {
  margin: 0;
  font-size: 14px;
}

.idle-calendar-empty small {
  font-size: 12px;
}

.idle-calendar-empty small button,
.idle-calendar-footer button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.idle-calendar-events {
  display: grid;
  gap: 8px;
}

.idle-calendar-event {
  width: 100%;
  min-height: 54px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  text-align: left;
}

.idle-calendar-event:hover {
  border-color: #a8c2ee;
  background: #f8fbff;
}

.idle-calendar-event time {
  min-width: 52px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.idle-calendar-event > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.idle-calendar-event strong {
  overflow: hidden;
  color: #263449;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idle-calendar-event small {
  color: #8290a2;
  font-size: 11px;
}

.idle-calendar-event.is-completed strong {
  color: #8995a4;
  text-decoration: line-through;
}

.idle-calendar-footer {
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #edf1f5;
  color: #8290a2;
  font-size: 11px;
}

.theme-dark .conversation-pane.idle .messages {
  background: #101b16;
}

.theme-dark .idle-calendar {
  border-color: #2b4038;
  background: #17251f;
  box-shadow: none;
}

.theme-dark .idle-calendar-header h2,
.theme-dark .idle-calendar-day,
.theme-dark .idle-calendar-event strong {
  color: #e1ece5;
}

.theme-dark .idle-calendar-assignee,
.theme-dark .idle-calendar-owner,
.theme-dark .idle-calendar-add,
.theme-dark .idle-calendar-navigation > button,
.theme-dark .idle-calendar-event {
  border-color: #344a40;
  background: #14221c;
  color: #c4d1c8;
}

.theme-dark .idle-calendar-assignee select,
.theme-dark .idle-calendar-navigation strong {
  color: #dce7df;
}

.theme-dark .idle-calendar-view-switch {
  border-color: #344a40;
  background: #101b16;
}

.theme-dark .idle-calendar-view-switch button[aria-pressed="true"] {
  background: #263d32;
  color: #8dbaf1;
}

.theme-dark .idle-calendar-days,
.theme-dark .idle-calendar-footer {
  border-color: #2b4038;
}

.theme-dark .idle-calendar-day > span,
.theme-dark .idle-calendar-day small,
.theme-dark .idle-calendar-empty,
.theme-dark .idle-calendar-event small,
.theme-dark .idle-calendar-footer {
  color: #9bac9f;
}

.theme-dark .idle-calendar-day.is-selected {
  border-color: #70a2ff;
  background: #2563eb;
}

.theme-dark .idle-calendar-empty > span {
  color: #708477;
}

@media (max-width: 760px) {
  .conversation-pane.idle .messages { padding: 10px; }
  .idle-calendar { min-height: 400px; padding: 14px; gap: 14px; }
  .idle-calendar-header { align-items: flex-start; flex-direction: column; }
  .idle-calendar-controls { width: 100%; justify-content: space-between; }
  .idle-calendar-assignee { flex: 1 1 130px; }
  .idle-calendar-assignee select { max-width: none; min-width: 0; }
  .idle-calendar-days { grid-template-columns: repeat(7, minmax(58px, 1fr)); }
}
/* Universal ticket module */
.tickets-module-shell{max-width:1480px;margin:0 auto}.tickets-toolbar{display:flex;gap:10px;margin:18px 0}.tickets-toolbar input{flex:1;min-width:0;padding:11px 14px;border:1px solid var(--line,#dce6df);border-radius:10px;background:var(--surface,#fff);color:var(--text,#20382d)}.tickets-workspace{display:grid;grid-template-columns:minmax(250px,340px) minmax(0,1fr);min-height:560px;border:1px solid var(--line,#dce6df);border-radius:14px;overflow:hidden;background:var(--surface,#fff)}.ticket-list{border-right:1px solid var(--line,#dce6df);overflow:auto;max-height:70vh}.ticket-list-row{display:flex;width:100%;flex-direction:column;gap:7px;padding:14px 16px;text-align:left;border:0;border-bottom:1px solid var(--line,#edf1ed);background:transparent;color:inherit;cursor:pointer}.ticket-list-row:hover,.ticket-list-row.active{background:var(--surface-muted,#f4f8f5)}.ticket-row-top,.ticket-row-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px}.ticket-row-top strong{font-size:12px}.ticket-row-title{font-size:14px}.ticket-list-row>span{font-size:12px;color:var(--muted,#74847b)}.ticket-row-bottom{justify-content:flex-start;font-size:11px}.ticket-row-bottom i{width:8px;height:8px;border-radius:50%;background:var(--ticket-status-color);flex:none}.ticket-priority{font-size:10px;text-transform:uppercase;color:var(--muted,#74847b)}.ticket-priority.urgent,.ticket-priority.high{color:#b34d45}.ticket-content{min-width:0;padding:22px}.ticket-detail>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.ticket-detail h2{margin:5px 0;font-size:23px}.ticket-detail>header p:last-child{color:var(--muted,#74847b);font-size:13px}.ticket-detail-meta{display:flex;flex-wrap:wrap;gap:9px;margin:17px 0}.ticket-detail-meta span{padding:7px 10px;border:1px solid var(--line,#dce6df);border-radius:8px;font-size:11px;color:var(--muted,#74847b)}.ticket-description{padding:16px;background:var(--surface-muted,#f5f8f5);border-radius:10px;line-height:1.6;overflow-wrap:anywhere}.ticket-actions{display:flex;flex-wrap:wrap;gap:8px;margin:17px 0}.ticket-note-form,.ticket-create-form{display:grid;gap:12px;padding:16px;margin:16px 0;border:1px solid var(--line,#dce6df);border-radius:12px}.ticket-note-form label,.ticket-create-form label{display:grid;gap:7px;font-size:12px;font-weight:600}.ticket-note-form textarea,.ticket-create-form textarea,.ticket-create-form input,.ticket-create-form select{width:100%;padding:10px;border:1px solid var(--line,#dce6df);border-radius:8px;background:var(--surface,#fff);color:var(--text,#20382d);font:inherit}.ticket-create-form{max-width:720px}.ticket-create-form h2{margin:0}.ticket-create-form footer{display:flex;justify-content:flex-end;gap:8px}.ticket-timeline{margin-top:24px}.ticket-timeline h3{font-size:16px}.ticket-timeline-entry{padding:12px 14px;margin:8px 0;border-left:3px solid #78a88a;background:var(--surface-muted,#f5f8f5);border-radius:0 9px 9px 0}.ticket-timeline-entry.internal{border-left-color:#d3a24d}.ticket-timeline-entry p{margin:6px 0;white-space:pre-wrap;overflow-wrap:anywhere}.ticket-timeline-entry small{color:var(--muted,#74847b)}.ticket-empty,.ticket-list-state{padding:30px;text-align:center;color:var(--muted,#74847b)}.ticket-empty h2{color:var(--text,#20382d)}
@media(max-width:760px){.tickets-workspace{grid-template-columns:1fr}.ticket-list{max-height:34vh;border-right:0;border-bottom:1px solid var(--line,#dce6df)}.ticket-content{padding:14px}.ticket-detail>header{flex-direction:column}.tickets-module-shell .module-header{align-items:flex-start}.ticket-create-form{padding:12px}}
.ticket-attachments{margin:18px 0;padding:14px;border:1px solid var(--line,#dce6df);border-radius:10px}.ticket-attachments h3{margin:0 0 10px;font-size:14px}.ticket-attachments>p{font-size:12px;color:var(--muted,#74847b)}.ticket-attachment-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid var(--line,#edf1ed);font-size:12px}.ticket-attachment-row small{display:block;margin-top:3px;color:var(--muted,#74847b)}.ticket-attachments form{display:flex;align-items:center;gap:10px;margin-top:12px;flex-wrap:wrap}.ticket-attachments input{max-width:100%;font-size:12px}
.tickets-toolbar select{max-width:190px;padding:10px;border:1px solid var(--line,#dce6df);border-radius:9px;background:var(--surface,#fff);color:var(--text,#20382d)}.ticket-pagination{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin-top:12px}.ticket-pagination span{font-size:12px;color:var(--muted,#74847b)}.ticket-pagination button:disabled{opacity:.5;cursor:not-allowed}
.ticket-view-switch{display:inline-flex;padding:3px;border:1px solid var(--line,#dce6df);border-radius:9px;background:var(--surface-muted,#f4f8f5)}.ticket-view-switch button{padding:7px 11px;border:0;border-radius:6px;background:transparent;color:var(--muted,#74847b);font:inherit;font-size:12px;cursor:pointer}.ticket-view-switch button.active{background:var(--surface,#fff);color:var(--text,#20382d);box-shadow:0 1px 3px rgba(20,50,35,.12)}
.ticket-board{display:flex;align-items:stretch;gap:14px;overflow-x:auto;padding:4px 2px 14px;min-height:470px}.ticket-board-column{display:flex;flex:0 0 min(300px,82vw);flex-direction:column;max-height:calc(100vh - 310px);min-height:370px;overflow:hidden;border:1px solid var(--line,#dce6df);border-radius:12px;background:var(--surface-muted,#f5f8f5)}.ticket-board-column>header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 13px 8px}.ticket-board-column>header>div{display:flex;align-items:center;gap:8px;min-width:0}.ticket-board-column>header>div>span{width:9px;height:9px;flex:none;border-radius:50%;background:var(--ticket-column-color)}.ticket-board-column h2{margin:0;overflow:hidden;font-size:14px;text-overflow:ellipsis;white-space:nowrap}.ticket-board-column>header small,.ticket-board-workflow{color:var(--muted,#74847b);font-size:11px}.ticket-board-workflow{margin:0;padding:0 13px 10px}.ticket-board-cards{display:flex;flex:1;flex-direction:column;gap:9px;overflow:auto;padding:0 9px 10px}.ticket-board-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:12px;text-align:left;border:1px solid var(--line,#e0e9e3);border-radius:9px;background:var(--surface,#fff);color:var(--text,#20382d);cursor:pointer;box-shadow:0 1px 3px rgba(25,55,38,.04)}.ticket-board-card:hover,.ticket-board-card.selected{border-color:var(--ticket-column-color);box-shadow:0 0 0 1px color-mix(in srgb,var(--ticket-column-color) 20%,transparent)}.ticket-board-card>span,.ticket-board-card footer{display:flex;justify-content:space-between;align-items:center;gap:8px}.ticket-board-card>span strong{font-size:11px;color:var(--muted,#74847b)}.ticket-board-card>b{font-size:13px;line-height:1.4;overflow-wrap:anywhere}.ticket-board-card>small,.ticket-board-card footer{font-size:11px;color:var(--muted,#74847b)}.ticket-board-card footer span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ticket-board-empty{padding:20px 8px;text-align:center;color:var(--muted,#74847b);font-size:12px}.ticket-board-detail{max-width:1000px;margin:14px auto 0;border:1px solid var(--line,#dce6df);border-radius:12px;background:var(--surface,#fff)}
@media(max-width:760px){.tickets-toolbar{flex-wrap:wrap}.tickets-toolbar input{flex:1 1 100%}.ticket-board-column{max-height:calc(100vh - 360px);min-height:330px}.ticket-board{min-height:360px}}
.ticket-header-actions{display:flex;gap:8px;align-items:center}.ticket-custom-fields,.ticket-work-section,.ticket-admin-settings{margin:16px 0;padding:16px;border:1px solid var(--line,#dce6df);border-radius:12px;background:var(--surface,#fff)}.ticket-custom-fields>header,.ticket-work-section>header,.ticket-admin-settings>header{display:flex;justify-content:space-between;align-items:center;gap:10px}.ticket-custom-fields h3,.ticket-work-section h3,.ticket-admin-settings h2,.ticket-admin-settings h3{margin:0 0 10px}.ticket-custom-fields>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.ticket-custom-field,.ticket-custom-field-readonly{display:grid;gap:6px;font-size:12px}.ticket-custom-field>span,.ticket-custom-field-readonly strong{font-weight:650}.ticket-custom-field small,.ticket-custom-field-readonly span{color:var(--muted,#74847b);font-size:11px}.ticket-custom-field input,.ticket-custom-field textarea,.ticket-custom-field select,.ticket-create-work-form input,.ticket-create-work-form textarea,.ticket-create-work-form select,.ticket-pending-response textarea,.ticket-admin-settings input,.ticket-admin-settings select{width:100%;min-width:0;padding:9px;border:1px solid var(--line,#dce6df);border-radius:8px;background:var(--surface,#fff);color:var(--text,#20382d);font:inherit}.ticket-custom-field input[type=checkbox],.ticket-check input{width:auto}.ticket-form-custom-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:14px;border:1px solid var(--line,#dce6df);border-radius:10px}.ticket-form-custom-fields h3{grid-column:1/-1;margin:0}.ticket-work-item{margin:10px 0;padding:13px;border:1px solid var(--line,#dce6df);border-radius:10px;background:var(--surface-muted,#f5f8f5)}.ticket-work-item.blocking{border-left:3px solid #c78328}.ticket-work-item header{display:flex;justify-content:space-between;gap:10px}.ticket-work-item header>div{display:grid;gap:4px}.ticket-work-item header small,.ticket-work-item>small,.ticket-work-item blockquote small{font-size:11px;color:var(--muted,#74847b)}.ticket-work-item p{margin:8px 0;white-space:pre-wrap;overflow-wrap:anywhere}.ticket-work-item blockquote{margin:9px 0 0;padding:10px;border-left:2px solid #8da99a;background:var(--surface,#fff)}.ticket-work-item blockquote p{margin:0 0 5px}.ticket-work-badge{padding:4px 7px;border-radius:20px;background:#fff0d7;color:#8a5a18;font-size:10px}.ticket-pending-response{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;gap:7px;margin-top:10px}.ticket-approval-actions{display:flex;gap:8px;margin-top:10px}.ticket-create-work-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line,#dce6df)}.ticket-create-work-form h4{grid-column:1/-1;margin:0}.ticket-create-work-form label,.ticket-admin-settings label{display:grid;gap:6px;font-size:12px;font-weight:600}.ticket-create-work-form label:has(input[type=checkbox]),.ticket-check{display:flex;align-items:center;gap:7px}.ticket-admin-settings{background:var(--surface-muted,#f5f8f5)}.ticket-admin-settings>header{margin-bottom:12px}.ticket-admin-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.ticket-admin-settings-grid>section{min-width:0;padding:14px;border:1px solid var(--line,#dce6df);border-radius:10px;background:var(--surface,#fff)}.ticket-admin-settings-grid form{display:grid;gap:9px}.ticket-admin-settings-grid button{margin-top:6px}.ticket-admin-number-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.ticket-admin-field-list article{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:9px 0;border-bottom:1px solid var(--line,#e5ece7)}.ticket-admin-field-list article span{display:grid;gap:3px}.ticket-admin-field-list small{color:var(--muted,#74847b);font-size:10px}
@media(max-width:760px){.ticket-custom-fields>div,.ticket-form-custom-fields,.ticket-admin-settings-grid,.ticket-create-work-form{grid-template-columns:1fr}.ticket-pending-response{grid-template-columns:1fr 1fr}.ticket-header-actions{flex-wrap:wrap}}
.ticket-alert-list{margin:12px 0;padding:14px 16px;border:1px solid #ead8a9;border-radius:12px;background:var(--surface,#fff)}.ticket-alert-list h2{margin:0 0 8px;font-size:15px}.ticket-alert-list article{display:flex;align-items:center;gap:12px;padding:8px 0;border-top:1px solid var(--line,#edf1ed);font-size:12px}.ticket-alert-list article span{flex:1;color:var(--muted,#74847b)}.ticket-sla-state{padding:5px 9px;border-radius:99px;background:#e8f4ec;color:#287047;font-size:11px}.ticket-sla-state.paused{background:#fff3d8;color:#8a5a18}.ticket-sla-state.overdue{background:#fde9e7;color:#a7443d}.ticket-sla-panel .ticket-detail-meta{margin:10px 0}.ticket-sla-panel>small{display:block;color:var(--muted,#74847b);line-height:1.6}
.ticket-dashboard{display:grid;grid-template-columns:repeat(auto-fit,minmax(115px,1fr));gap:8px;margin:12px 0}.ticket-dashboard article{display:grid;gap:4px;padding:11px 13px;border:1px solid var(--line,#dce6df);border-radius:10px;background:var(--surface,#fff)}.ticket-dashboard strong{font-size:20px;color:var(--text,#20382d)}.ticket-dashboard span{font-size:11px;color:var(--muted,#74847b)}
.ticket-report-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:9px;margin:12px 0;padding:12px;border:1px solid var(--line,#dce6df);border-radius:10px;background:var(--surface,#fff)}.ticket-report-filters label{display:grid;gap:5px;font-size:11px;color:var(--muted,#74847b)}.ticket-report-filters input,.ticket-report-filters select{width:100%;min-width:0;padding:8px;border:1px solid var(--line,#dce6df);border-radius:8px;background:var(--surface,#fff);color:var(--text,#20382d)}
.ticket-report-table-wrap{margin:12px 0;padding:14px;border:1px solid var(--line,#dce6df);border-radius:12px;background:var(--surface,#fff)}.ticket-report-table-wrap h2{margin:0 0 10px;font-size:15px}.ticket-report-table-scroll{overflow:auto}.ticket-report-table{width:100%;border-collapse:collapse;font-size:11px}.ticket-report-table th,.ticket-report-table td{padding:8px;text-align:left;border-bottom:1px solid var(--line,#edf1ed);white-space:nowrap}.ticket-report-table th{color:var(--muted,#74847b);font-weight:650}

/* Keep ticket administration checkboxes compact and aligned inside grid forms. */
.ticket-admin-settings label.ticket-check{display:flex;align-items:center;gap:8px}
.ticket-admin-settings label.ticket-check input[type="checkbox"]{appearance:auto;width:16px;min-width:16px;height:16px;min-height:16px;padding:0;margin:0;border:initial;border-radius:initial;background:initial;font:initial;flex:0 0 16px}

/* Ticket surfaces and hover states follow the active light/dark theme. */
.tickets-module-shell{--surface:#fff;--surface-muted:#f5f8f5}
.theme-dark .tickets-module-shell{--surface:#111b18;--surface-muted:#15211e;--text:#edf5f1;--muted:#9aada5;--line:#2a3934}
.ticket-board-card:hover,.ticket-board-card:focus-visible,.ticket-board-card.selected{background:color-mix(in srgb,var(--ticket-column-color,#177245) 9%,var(--surface,#fff));color:var(--text,#17211d);border-color:var(--ticket-column-color);box-shadow:0 0 0 1px color-mix(in srgb,var(--ticket-column-color) 25%,transparent)}
.theme-dark .ticket-board-card:hover,.theme-dark .ticket-board-card:focus-visible,.theme-dark .ticket-board-card.selected{background:color-mix(in srgb,var(--ticket-column-color,#4ade80) 18%,var(--surface,#111b18));color:var(--text,#edf5f1)}
.ticket-board-card:focus-visible{outline:2px solid var(--ticket-column-color);outline-offset:2px}

/* Kanban ticket details open as a responsive, theme-aware dialog. */
.ticket-detail-modal-backdrop{position:fixed;inset:0;z-index:120;display:grid;place-items:center;overflow-y:auto;padding:20px;background:rgba(17,29,44,.52);backdrop-filter:blur(3px)}
.ticket-board-detail{width:min(100%,1000px);max-height:90vh;overflow-y:auto;margin:0;border:1px solid var(--line,#dce6df);border-radius:14px;background:var(--surface,#fff);box-shadow:0 24px 80px rgba(0,0,0,.28)}
.theme-dark .ticket-detail-modal-backdrop{background:rgba(0,0,0,.68)}
@media(max-width:760px){.ticket-detail-modal-backdrop{align-items:end;padding:10px}.ticket-board-detail{width:100%;max-height:95vh;padding:14px;border-radius:16px 16px 0 0}.ticket-board-detail .ticket-detail>header{flex-direction:row;align-items:flex-start}}

/* Ticket detail sections stay compact until the user opens an action. */
.ticket-detail-disclosure{margin:10px 0;overflow:hidden;border:1px solid var(--line,#dce6df);border-radius:10px;background:var(--surface,#fff)}
.ticket-detail-disclosure>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 15px;list-style:none;cursor:pointer;color:var(--text,#20382d);font-weight:700}
.ticket-detail-disclosure>summary::-webkit-details-marker{display:none}
.ticket-detail-disclosure>summary::after{content:"+";color:var(--brand,#177245);font-size:18px;line-height:1}
.ticket-detail-disclosure[open]>summary{border-bottom:1px solid var(--line,#dce6df)}.ticket-detail-disclosure[open]>summary::after{content:"−"}
.ticket-detail-disclosure>summary:hover{background:color-mix(in srgb,var(--brand,#177245) 6%,var(--surface,#fff))}.theme-dark .ticket-detail-disclosure>summary:hover{background:color-mix(in srgb,var(--brand,#177245) 14%,var(--surface,#111b18))}
.ticket-detail-disclosure>:is(.ticket-work-section,.ticket-attachments,.ticket-custom-fields,.ticket-timeline,.ticket-actions){margin:0;padding:14px;border:0;border-radius:0;background:transparent}
.ticket-detail-disclosure>.ticket-actions{display:flex}

/* One compact action menu reveals the selected ticket section. */
.ticket-detail-content[hidden]{display:none!important}.ticket-detail-content{margin-top:12px;outline:none}
.ticket-detail-header-actions{display:flex;align-items:flex-start;gap:8px;flex:none}.ticket-detail-actions-menu{position:relative;z-index:5;display:inline-block;margin:0}
.ticket-detail-actions-menu>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:104px;min-height:40px;padding:0 12px;list-style:none;border:1px solid var(--line,#dce6df);border-radius:8px;background:var(--brand,#177245);color:#fff;font-weight:700;cursor:pointer}
.ticket-detail-actions-menu>summary::-webkit-details-marker{display:none}.ticket-detail-actions-menu>summary::after{content:"▾"}.ticket-detail-actions-menu[open]>summary::after{content:"▴"}
.ticket-detail-actions-list{position:fixed;z-index:140;display:grid;gap:3px;width:min(320px,calc(100vw - 24px));max-height:calc(100vh - 24px);overflow:auto;padding:6px;border:1px solid var(--line,#dce6df);border-radius:10px;background:var(--surface,#fff);box-shadow:0 14px 38px rgba(12,32,23,.22)}
.ticket-activity-feed{margin:14px 0 2px}.ticket-activity-feed>h3{margin:0 0 8px;font-size:14px;color:var(--text,#20382d)}.ticket-activity-entry{margin:8px 0}.ticket-activity-entry>strong{display:block}.ticket-activity-entry>small{display:block;margin-top:5px}.ticket-activity-entry>button{margin-top:8px;padding:6px 10px;font-size:12px}
.ticket-assignees-form{margin:0;padding:16px;border:1px solid var(--line,#dce6df);border-radius:12px;background:var(--surface,#fff)}.ticket-assignees-form h3{margin:0 0 6px}.ticket-assignees-form>p{margin:0 0 10px;color:var(--muted,#74847b);font-size:13px}.ticket-assignee-search{display:grid;gap:6px;margin:0 0 8px;font-size:12px;font-weight:600}.ticket-assignee-search input{width:100%;padding:9px 10px;border:1px solid var(--line,#dce6df);border-radius:8px;background:var(--surface,#fff);color:var(--text,#20382d);font:inherit}.ticket-assignees-count{margin:0 0 8px;color:var(--muted,#74847b);font-size:11px}.ticket-assignee-choices{display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:5px;max-height:260px;overflow-y:auto;padding:2px 6px 2px 2px;margin-bottom:12px}.ticket-assignee-choices .ticket-check{min-width:0;padding:7px 9px;border:1px solid var(--line,#dce6df);border-radius:8px}.ticket-assignee-choices .ticket-check>span{display:grid;gap:2px}.ticket-assignee-choices small{color:var(--muted,#74847b);font-size:11px}.ticket-assignee-choices [hidden]{display:none!important}.ticket-assignees-form input[type=checkbox]{width:16px;height:16px;flex:none;accent-color:var(--brand,#177245)}
.ticket-detail-menu-option{width:100%;min-height:38px;padding:9px 10px;border-radius:6px;background:transparent;color:var(--text,#20382d);text-align:left;font-size:13px}
.ticket-detail-menu-option:hover,.ticket-detail-menu-option:focus-visible{background:color-mix(in srgb,var(--brand,#177245) 9%,var(--surface,#fff));color:var(--text,#20382d)}
.theme-dark .ticket-detail-actions-list{box-shadow:0 18px 45px rgba(0,0,0,.55)}.theme-dark .ticket-detail-menu-option:hover,.theme-dark .ticket-detail-menu-option:focus-visible{background:color-mix(in srgb,var(--brand,#177245) 18%,var(--surface,#111b18));color:var(--text,#edf5f1)}

/* Priority labels need a strong color cue while staying readable in both themes. */
.ticket-priority{display:inline-flex;align-items:center;gap:5px;padding:4px 7px;border-radius:999px;font-size:10px;font-style:normal;font-weight:700;line-height:1.2;white-space:nowrap}
.ticket-priority::before{content:"";width:7px;height:7px;flex:none;border-radius:50%;background:currentColor}
.ticket-priority.low{background:#e8f1fb;color:#245b91}
.ticket-priority.normal{background:#e9f4ec;color:#287047}
.ticket-priority.high{background:#fff3d8;color:#925c08}
.ticket-priority.urgent{background:#fde9e7;color:#a7443d}
.theme-dark .ticket-priority.low{background:#1d3550;color:#a9d2ff}
.theme-dark .ticket-priority.normal{background:#173a2b;color:#9ee1b5}
.theme-dark .ticket-priority.high{background:#493719;color:#ffd482}
.theme-dark .ticket-priority.urgent{background:#4b2422;color:#ffaaa4}
.ticket-detail-meta .ticket-priority{border-color:transparent}

.ticket-pending-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}
.ticket-pending-reply-backdrop{position:fixed;inset:0;z-index:180;display:grid;place-items:center;padding:20px;background:rgba(17,29,44,.62);backdrop-filter:blur(3px)}
.ticket-pending-reply-modal{width:min(100%,620px);max-height:90vh;overflow:auto;padding:22px;border:1px solid var(--line,#dce6df);border-radius:14px;background:var(--surface,#fff);color:var(--text,#20382d);box-shadow:0 24px 80px rgba(0,0,0,.32)}
.ticket-pending-reply-modal>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}.ticket-pending-reply-modal>header h2{margin:3px 0 0;font-size:20px}.ticket-pending-reply-question{margin:0 0 14px;padding:12px 14px;border-radius:9px;background:var(--surface-muted,#f5f8f5);white-space:pre-wrap;overflow-wrap:anywhere}
.ticket-pending-reply-history{margin:0 0 14px}.ticket-pending-reply-history h3{margin:0 0 8px;font-size:14px}.ticket-pending-reply-history blockquote{margin:7px 0;padding:10px 12px;border-left:2px solid #8da99a;background:var(--surface-muted,#f5f8f5)}.ticket-pending-reply-history blockquote p{margin:0 0 5px;white-space:pre-wrap}.ticket-pending-reply-history small{color:var(--muted,#74847b);font-size:11px}
.ticket-pending-reply-form{display:grid;gap:8px}.ticket-pending-reply-form>label{font-size:12px;font-weight:650}.ticket-pending-reply-form textarea,.ticket-pending-reply-form input[type=file]{width:100%;min-width:0;padding:10px;border:1px solid var(--line,#dce6df);border-radius:8px;background:var(--surface,#fff);color:var(--text,#20382d);font:inherit}.ticket-pending-reply-form textarea{resize:vertical}.ticket-pending-reply-form footer{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
.theme-dark .ticket-pending-reply-backdrop{background:rgba(0,0,0,.72)}
@media(max-width:600px){.ticket-pending-reply-backdrop{align-items:end;padding:10px}.ticket-pending-reply-modal{max-height:92vh;padding:16px;border-radius:16px 16px 0 0}.ticket-pending-reply-modal>header h2{font-size:18px}.ticket-pending-actions>*{flex:1}}

.ticket-approval-rejection-backdrop{position:fixed;inset:0;z-index:190;display:grid;place-items:center;padding:20px;background:rgba(17,29,44,.62);backdrop-filter:blur(4px)}
.ticket-approval-rejection-modal{width:min(100%,520px);padding:24px;border:1px solid var(--line,#dce6df);border-radius:16px;background:var(--surface,#fff);color:var(--text,#20382d);box-shadow:0 24px 80px rgba(0,0,0,.32);animation:ticket-modal-enter .16s ease-out}
.ticket-approval-rejection-modal>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.ticket-approval-rejection-modal>header h2{margin:4px 0 0;font-size:21px}.ticket-modal-close{display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid var(--line,#dce6df);border-radius:9px;background:var(--surface-muted,#f5f8f5);color:var(--text,#20382d);font-size:24px;line-height:1;cursor:pointer}.ticket-modal-close:hover{background:color-mix(in srgb,var(--brand,#177245) 10%,var(--surface,#fff))}
.ticket-approval-rejection-context{margin:18px 0 8px;padding:11px 13px;border-radius:9px;background:var(--surface-muted,#f5f8f5);font-size:13px}.ticket-approval-rejection-help{margin:0 0 18px;color:var(--muted,#74847b);font-size:13px;line-height:1.5}.ticket-approval-rejection-modal form{display:grid;gap:8px}.ticket-approval-rejection-modal form>label{display:flex;justify-content:space-between;gap:8px;font-size:13px;font-weight:700}.ticket-approval-rejection-modal form>label span{color:#a7443d;font-size:11px;font-weight:600}.ticket-approval-rejection-modal textarea{width:100%;min-height:120px;padding:11px 12px;border:1px solid var(--line,#dce6df);border-radius:9px;background:var(--surface,#fff);color:var(--text,#20382d);font:inherit;line-height:1.5;resize:vertical}.ticket-approval-rejection-modal textarea:focus{outline:3px solid color-mix(in srgb,var(--brand,#177245) 20%,transparent);border-color:var(--brand,#177245)}.ticket-approval-rejection-modal footer{display:flex;justify-content:flex-end;gap:9px;margin-top:10px}
.theme-dark .ticket-approval-rejection-backdrop{background:rgba(0,0,0,.72)}
@keyframes ticket-modal-enter{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:600px){.ticket-approval-rejection-backdrop{align-items:end;padding:10px}.ticket-approval-rejection-modal{padding:18px;border-radius:16px 16px 0 0}.ticket-approval-rejection-modal>header h2{font-size:19px}}

.ticket-create-modal-backdrop{position:fixed;inset:0;z-index:200;display:grid;place-items:center;overflow-y:auto;padding:20px;background:rgba(17,29,44,.58);backdrop-filter:blur(4px)}
.ticket-create-dialog{width:min(100%,760px);max-height:min(92vh,900px);overflow-y:auto;border:1px solid var(--line,#dce6df);border-radius:16px;background:var(--surface,#fff);color:var(--text,#20382d);box-shadow:0 24px 80px rgba(0,0,0,.34);animation:ticket-modal-enter .16s ease-out}
.ticket-requester-directory{width:min(100%,720px)}.ticket-directory-body{display:grid;gap:16px;padding:18px 22px 22px}.ticket-directory-body>form,.ticket-directory-body>label,.ticket-directory-contacts,.ticket-directory-body>p{margin:0;padding:14px;border:1px solid var(--line,#dce6df);border-radius:12px;background:var(--surface-muted,#f5f8f5)}.ticket-directory-body form{display:grid;gap:10px}.ticket-directory-body label{display:grid;gap:6px;font-size:12px;font-weight:600}.ticket-directory-body input:not([type=checkbox]),.ticket-directory-body select{width:100%;min-width:0;padding:10px;border:1px solid var(--line,#dce6df);border-radius:8px;background:var(--surface,#fff);color:var(--text,#20382d);font:inherit}.ticket-directory-contacts>header{display:flex;justify-content:space-between;align-items:end;gap:12px;margin-bottom:10px}.ticket-directory-contacts>header h3,.ticket-directory-body form h3{margin:0}.ticket-directory-contacts>header p{margin:5px 0 0;color:var(--muted,#74847b);font-size:12px}.ticket-directory-contacts>header input{max-width:240px}.ticket-directory-contacts article{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--line,#dce6df)}.ticket-directory-contacts article>div:first-child{display:grid;gap:4px}.ticket-directory-contacts article small{color:var(--muted,#74847b);font-size:11px}.ticket-directory-contacts article>div:last-child{display:flex;gap:6px;flex-wrap:wrap}.ticket-directory-contacts label.ticket-check{display:flex;align-items:center;gap:7px;font-weight:400}.ticket-directory-contacts label.ticket-check input{width:16px;height:16px;margin:0}
.ticket-create-modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px 22px 14px;border-bottom:1px solid var(--line,#dce6df)}
.ticket-create-modal-header .eyebrow{margin:0 0 4px;color:var(--brand,#177245);font-size:11px;font-weight:750;letter-spacing:.04em;text-transform:uppercase}
.ticket-create-modal-header h2{margin:0;font-size:22px}
.ticket-create-modal-header p:last-child{margin:5px 0 0;color:var(--muted,#74847b);font-size:13px}
.ticket-create-modal-header .ticket-modal-close{flex:none}
.ticket-create-modal-form{grid-template-columns:repeat(2,minmax(0,1fr));max-width:none;margin:0;padding:18px 22px 22px;border:0;border-radius:0;background:transparent}
.ticket-create-modal-form>label:first-of-type,.ticket-create-modal-form>.ticket-create-description,.ticket-create-modal-form>.ticket-create-custom-fields,.ticket-create-modal-form>footer{grid-column:1/-1}
.ticket-create-modal-form>.ticket-create-custom-fields{margin-top:0}
.ticket-create-modal-form>footer{padding-top:4px}
.theme-dark .ticket-create-modal-backdrop{background:rgba(0,0,0,.74)}
.theme-dark .ticket-create-dialog{border-color:#30443d;box-shadow:0 24px 80px rgba(0,0,0,.52)}
.theme-dark .ticket-directory-body>form,.theme-dark .ticket-directory-body>label,.theme-dark .ticket-directory-contacts,.theme-dark .ticket-directory-body>p{background:#17231e;border-color:#30443d}.theme-dark .ticket-directory-body input:not([type=checkbox]),.theme-dark .ticket-directory-body select{background:#101915;color:#e6eee9;border-color:#30443d}
@media(max-width:620px){.ticket-directory-body{padding:14px}.ticket-directory-contacts>header,.ticket-directory-contacts article{align-items:stretch;flex-direction:column}.ticket-directory-contacts>header input{max-width:none}.ticket-directory-contacts article>div:last-child button{flex:1}}
@media(max-width:620px){.ticket-create-modal-backdrop{align-items:end;padding:10px}.ticket-create-dialog{width:100%;max-height:94vh;border-radius:16px 16px 0 0}.ticket-create-modal-header{padding:16px 16px 12px}.ticket-create-modal-form{grid-template-columns:1fr;padding:14px 16px 18px}.ticket-create-modal-form>label:first-of-type,.ticket-create-modal-form>.ticket-create-description,.ticket-create-modal-form>.ticket-create-custom-fields,.ticket-create-modal-form>footer{grid-column:1}}

.ticket-timeline-approval-related{display:grid;gap:8px;margin:12px 0 2px 18px;padding-left:12px;border-left:2px solid var(--line,#dce6df)}
.ticket-timeline-related-decision{padding:9px 11px;border-radius:8px;background:var(--surface,#fff);border-left:2px solid #5a9b70}.ticket-timeline-related-decision.rejected{border-left-color:#bd5a50}.ticket-timeline-related-decision strong{display:block;font-size:12px}.ticket-timeline-related-decision small{display:block;margin-top:4px;color:var(--muted,#74847b);font-size:11px}.ticket-timeline-related-decision p{margin:7px 0 0;padding:8px 10px;border-radius:6px;background:var(--surface-muted,#f5f8f5);font-size:12px;white-space:pre-wrap}.ticket-timeline-approval-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0}.theme-dark .ticket-timeline-related-decision{background:var(--surface-muted,#17231e)}
@media(max-width:600px){.ticket-timeline-approval-related{margin-left:10px;padding-left:9px}}
