:root {
  --bg: #0b141a;
  --panel: #111b21;
  --panel-2: #202c33;
  --hover: #2a3942;
  --text: #e9edef;
  --muted: #8696a0;
  --accent: #00a884;
  --bubble-out: #005c4b;
  --bubble-in: #202c33;
  --line: #2a3942;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #111b21;
  color: var(--text);
  font-family: Segoe UI, Helvetica, Arial, sans-serif;
  height: 100dvh;
  overflow: hidden;
}

body.auth-lock {
  overflow: hidden !important;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #4b5f69 #0f1b21;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #0f1b21;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #41545d, #31424a);
  border-radius: 999px;
  border: 2px solid #0f1b21;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #556a74, #3f525a);
}

*::-webkit-scrollbar-corner {
  background: #0f1b21;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top right, #18333d 0%, #0b141a 55%);
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: min(420px, 95vw);
  border: 1px solid #2f4a56;
  border-radius: 16px;
  padding: 24px;
  background: linear-gradient(135deg, #0f1b21, #162e38);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 34px;
}

.login-card p {
  margin: 0 0 16px;
  color: #a8b8c0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #b6c9d3;
  font-size: 14px;
}

.login-form input {
  border: 1px solid #314753;
  border-radius: 10px;
  background: #23343e;
  color: #eaf3f7;
  padding: 11px 12px;
  outline: none;
}

.login-form button {
  margin-top: 4px;
}

.profile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 20;
}

.profile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.profile-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: min(400px, 92vw);
  height: 100vh;
  background: #0f1418;
  border-right: 1px solid #25353f;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 21;
  padding: 18px 20px 28px;
  overflow-y: auto;
}

.profile-panel.open {
  transform: translateX(0);
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.profile-header h2 {
  margin: 0;
  font-size: 36px;
  font-weight: 500;
}

.profile-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: #1f2c34;
  color: #d8e4ea;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.profile-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin: 18px auto 26px;
  background: linear-gradient(165deg, #00b28d, #00614e);
  display: grid;
  place-items: center;
  color: #013d30;
  font-size: 42px;
  font-weight: 700;
}

.profile-field {
  margin-bottom: 26px;
  padding: 8px 8px;
}

.profile-label {
  display: block;
  color: #7c919d;
  font-size: 14px;
  margin-bottom: 8px;
}

.profile-field strong {
  font-size: 30px;
  font-weight: 500;
  color: #f2f6f8;
  word-break: break-word;
}

.profile-actions {
  display: flex;
  gap: 10px;
  padding: 2px 8px 12px;
}

.btn-danger {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #5e1f2a;
  color: #ffd9de;
  cursor: pointer;
  font-weight: 700;
}

.btn-danger:hover {
  background: #762734;
}

.qr-panel {
  margin: 8px 8px 20px;
  padding: 12px;
  border: 1px solid #2b3e48;
  border-radius: 12px;
  background: #16242c;
}

.history-sync-panel {
  margin: 8px 8px 18px;
  padding: 12px;
  border: 1px solid #2b3e48;
  border-radius: 12px;
  background: #14252d;
}

.history-sync-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #dce8ee;
  font-size: 14px;
}

.history-sync-head strong {
  color: #8ff2d4;
  font-size: 14px;
}

.history-sync-bar {
  height: 10px;
  border-radius: 999px;
  background: #233842;
  overflow: hidden;
}

.history-sync-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00a884, #64e0bb);
  transition: width 0.25s ease;
}

.history-sync-panel small {
  display: block;
  margin-top: 8px;
  color: #91a7b1;
  font-size: 12px;
}

.history-sync-hint {
  margin: 8px 8px 18px;
  padding: 12px;
  border: 1px solid #28414c;
  border-radius: 12px;
  background: #122129;
  color: #9db3bd;
  font-size: 12px;
  line-height: 1.45;
}

.qr-code-box {
  min-height: 220px;
  display: grid;
  place-items: center;
  background: #f4fafc;
  border-radius: 10px;
  padding: 10px;
}

.qr-code-box img {
  max-width: 100%;
  height: auto;
}

#qrHint {
  display: block;
  margin-top: 8px;
  color: #9eb3be;
  font-size: 12px;
}

.layout {
  display: grid;
  grid-template-columns: 64px minmax(300px, 32vw) minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  width: 100vw;
  overflow: hidden;
}

.layout.no-sidebar {
  grid-template-columns: 64px 1fr;
}

.layout.no-sidebar .chat-main {
  grid-column: 2;
}

.left-rail {
  background: #1f2c34;
  border-right: 1px solid #2f3b42;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.rail-top,
.rail-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.rail-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  display: grid;
  place-items: center;
  color: #aebac1;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.rail-icon i {
  line-height: 1;
}

.rail-icon.active,
.rail-icon:hover {
  background: #2a3942;
}

.rail-icon.profile {
  background: #00a884;
  color: #00291f;
  font-weight: 700;
}

.rail-icon.profile.has-image {
  color: transparent;
}

.rail-icon.profile i {
  font-size: 18px;
  line-height: 1;
}

.rail-phone {
  width: 54px;
  text-align: center;
  color: #8ba0ab;
  font-size: 10px;
  line-height: 1.2;
  word-break: break-word;
}

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

.sidebar-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.sidebar-header h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
}

.wa-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #3b2a2b;
  color: #ff9ca0;
}

.wa-status.online {
  background: #123828;
  color: #64e0bb;
}

.search-wrap {
  padding: 0 12px 10px;
}

.search-wrap input {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 0;
  outline: 0;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 16px;
  font-size: 16px;
}

.filters {
  display: flex;
  gap: 8px;
  padding: 0 12px 10px;
}

.filters.top-actions {
  padding-top: 4px;
}

.filters.service-tabs .chip {
  font-size: 13px;
  padding: 0 10px;
}

.chip {
  border: 1px solid #35444c;
  background: transparent;
  color: #c5d1d8;
  border-radius: 16px;
  height: 32px;
  padding: 0 14px;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip.active {
  background: #103529;
  border-color: #1f775f;
  color: #8ff2d4;
}

.chip.new-chat {
  border-color: #1f775f;
  color: #8ff2d4;
}

.chip {
  cursor: pointer;
}

.chip-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #00a884;
  color: #04372b;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.conversation-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 20px;
}

.conversation-item {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  background: transparent;
  color: var(--text);
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.conversation-item:hover {
  background: #202c33;
}

.conversation-item.active {
  background: #2a3942;
}

.conversation-item.bulk-chat {
  background: linear-gradient(90deg, rgba(154, 96, 0, 0.18), transparent 38%);
}

.conversation-item.bulk-chat.active {
  background: linear-gradient(90deg, rgba(154, 96, 0, 0.28), #2a3942 52%);
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(160deg, #00a884, #005c4b);
  flex-shrink: 0;
}

.conversation-body {
  min-width: 0;
  flex: 1;
}

.conversation-top,
.conversation-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.name {
  font-size: 18px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bulk-alert-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #c88719;
  color: #15110a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.time {
  color: #8ca0aa;
  font-size: 13px;
  flex-shrink: 0;
}

.preview {
  color: var(--muted);
  font-size: 15px;
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-attendant {
  margin-top: 2px;
  color: #8ff2d4;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #062f23;
  font-weight: 700;
  font-size: 13px;
  display: none;
  align-items: center;
  justify-content: center;
}

.badge.show {
  display: inline-flex;
}

.chat-main {
  background: var(--bg);
  display: block;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.chat-main.global-scroll {
  overflow-y: auto;
  overflow-x: hidden;
}

.view {
  display: none;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.view.active {
  display: grid;
}

.view-chat.active {
  grid-template-rows: 72px 1fr 74px;
}

.view-bulk.active,
.view-monitor.active {
  grid-template-rows: 72px 1fr;
}

.view-settings.active {
  grid-template-rows: 72px 1fr;
}

.view-bulk.active,
.view-monitor.active {
  overflow: visible;
  height: auto;
  min-height: 100%;
}

.view-settings.active {
  overflow: visible;
  height: auto;
  min-height: 100%;
}

.chat-header {
  background: #202c33;
  border-bottom: 1px solid #2f3b42;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 18px;
  min-width: 0;
}

.chat-contact {
  font-size: 20px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-contact-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-contact-wrap > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-contact-phone {
  color: #90a3ad;
  font-size: 13px;
  line-height: 1.1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(160deg, #00a884, #005c4b);
  flex-shrink: 0;
}

.chat-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chat-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  font-weight: 700;
}

.chat-header-btn i {
  font-size: 14px;
  line-height: 1;
}

.chat-header-btn-danger {
  background: #5e1f2a !important;
  color: #ffd9de !important;
}

.chat-header-btn-danger:hover {
  background: #762734 !important;
}

.service-status-tag {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.service-status-tag.pending {
  background: rgba(140, 94, 14, 0.18);
  color: #ffd78a;
  border-color: rgba(191, 137, 37, 0.45);
}

.service-status-tag.in_progress {
  background: rgba(0, 122, 97, 0.2);
  color: #8ff2d4;
  border-color: rgba(52, 172, 142, 0.45);
}

.service-status-tag.finalized {
  background: rgba(75, 87, 95, 0.22);
  color: #d2dde3;
  border-color: rgba(124, 142, 153, 0.35);
}

.messages-area {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 28px;
  padding-bottom: 28px;
  background-color: #0b141a;
  background-image:
    radial-gradient(circle at 25px 25px, rgba(255, 255, 255, 0.02) 2px, transparent 0),
    radial-gradient(circle at 75px 75px, rgba(255, 255, 255, 0.02) 2px, transparent 0);
  background-size: 100px 100px;
  min-height: 0;
  min-width: 0;
}

.empty-state {
  color: #94a7b1;
  opacity: 0.8;
  margin-top: 20px;
  text-align: center;
}

.msg-row {
  display: flex;
  margin: 6px 0;
  min-width: 0;
}

.msg-date-divider-row {
  display: flex;
  justify-content: center;
  margin: 14px 0 10px;
}

.msg-date-divider {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(32, 44, 51, 0.92);
  color: #d8e6ec;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.msg-row.inbound {
  justify-content: flex-start;
}

.msg-row.outbound {
  justify-content: flex-end;
}

.msg-bubble {
  max-width: min(70%, 680px);
  min-width: 0;
  border-radius: 8px;
  padding: 8px 10px 6px;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.msg-row.inbound .msg-bubble {
  background: var(--bubble-in);
}

.msg-row.outbound .msg-bubble {
  background: var(--bubble-out);
}

.msg-text {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.msg-audio-player {
  width: min(360px, 62vw);
  min-height: 40px;
  border-radius: 999px;
  background: rgba(12, 20, 25, 0.35);
  padding: 4px 8px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.audio-play-btn {
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #d6e0e6;
  color: #162027;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.audio-progress {
  width: 100%;
  accent-color: #00a884;
  cursor: pointer;
}

.audio-time {
  min-width: 86px;
  font-size: 12px;
  color: #a8bcc6;
  text-align: right;
}

.msg-audio-native {
  display: none;
}

.msg-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #dce9ef;
  text-decoration: none;
  max-width: min(360px, 62vw);
}

.msg-file i {
  font-size: 15px;
}

.msg-file span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-image {
  width: auto;
  height: auto;
  max-width: min(380px, 56vw);
  max-height: 380px;
  border-radius: 8px;
  display: block;
  object-fit: contain;
  background: #0d171d;
  cursor: zoom-in;
}

@media (max-width: 980px) {
  .msg-image {
    max-width: min(300px, 76vw);
    max-height: 300px;
  }
}

.msg-bubble.media-only {
  padding: 6px 6px 4px;
}

.msg-meta {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  color: #9cb0ba;
  font-size: 12px;
}

.checks {
  color: #a9bcc5;
  font-weight: 700;
}

.checks.sent {
  color: #a9bcc5;
}

.checks.delivered {
  color: #a9bcc5;
}

.checks.read {
  color: #53bdeb;
}

.composer {
  background: #202c33;
  border-top: 1px solid #2f3b42;
  padding: 10px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  min-width: 0;
}

.bulk-create-body {
  min-height: 0;
  overflow: visible;
  padding: 20px;
  display: block;
}

.bulk-monitor-body {
  min-height: 0;
  overflow: visible;
  padding: 20px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.settings-body {
  min-height: 0;
  overflow: visible;
  padding: 20px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.settings-shell {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(240px, 310px) minmax(0, 1fr);
  align-items: start;
}

.settings-nav {
  background: #111f27;
  border: 1px solid #2b3f4a;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-nav-item {
  border: 1px solid #2d414c;
  background: #1a2a33;
  color: #d6e3ea;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.settings-nav-item:hover {
  background: #223743;
}

.settings-nav-item.active {
  border-color: #00a884;
  background: #173a35;
  color: #98f0d7;
}

.settings-nav-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-content {
  display: grid;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

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

.settings-profile-item {
  border: 1px solid #2f434f;
  border-radius: 10px;
  background: #1a2b34;
  padding: 12px;
}

.settings-profile-item strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  color: #eef6fa;
  word-break: break-word;
}

.settings-footer-actions {
  display: flex;
  justify-content: flex-end;
}

.bulk-card {
  background: #152229;
  border: 1px solid #2d3e48;
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
  overflow: visible;
}

.bulk-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.bulk-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.bulk-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #bad1db;
}

.bulk-form input,
.bulk-form textarea {
  background: #23343e;
  color: #eaf3f7;
  border: 1px solid #314753;
  border-radius: 8px;
  outline: 0;
  padding: 10px 12px;
  font-size: 15px;
}

.bulk-form small {
  color: #8fa5b1;
}

.bulk-messages-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid #2f4450;
  border-radius: 10px;
  background: #182a33;
  padding: 12px;
}

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

.bulk-messages-head > span {
  color: #d3e2e9;
  font-weight: 700;
  font-size: 14px;
}

.bulk-messages-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bulk-message-item {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  color: #bad1db;
  font-size: 14px;
}

.bulk-remove-message-btn {
  align-self: flex-start;
  padding: 7px 12px;
  font-size: 13px;
}

.bulk-meta {
  color: #8ff2d4;
  font-size: 14px;
}

.bulk-contacts-panel {
  border: 1px solid #314753;
  border-radius: 10px;
  background: #1a2931;
  overflow: visible;
}

.bulk-contacts-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #30424d;
  background: #1b2b34;
}

.bulk-contacts-toolbar input {
  height: 38px;
  border-radius: 8px;
  border: 1px solid #314753;
  background: #243842;
  color: #e7f1f5;
  padding: 0 12px;
  font-size: 14px;
}

.bulk-contacts-actions {
  display: inline-flex;
  gap: 8px;
}

.bulk-contacts-actions .btn-secondary {
  padding: 7px 10px;
  font-size: 13px;
}

.bulk-contacts-list {
  width: 100%;
  max-height: none;
  overflow: visible;
}

.bulk-contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  border-bottom: 1px solid #273944;
  cursor: pointer;
  transition: background 0.12s ease;
}

.bulk-form .bulk-contact-row {
  flex-direction: row;
  gap: 12px;
}

.bulk-contact-row:last-child {
  border-bottom: 0;
}

.bulk-contact-row:hover {
  background: #20333d;
}

.bulk-contact-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #00a884;
  cursor: pointer;
  justify-self: end;
}

.bulk-contact-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bulk-contact-main i {
  color: #8fb4c4;
  font-size: 14px;
  flex-shrink: 0;
}

.bulk-contact-name {
  color: #e8f1f5;
  font-size: 14px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bulk-contact-phone {
  color: #9eb4bf;
  font-size: 13px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bulk-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bulk-job-wrap {
  border: 1px solid #304654;
  border-radius: 10px;
  overflow: hidden;
  background: #1b2b34;
}

.bulk-job-item {
  padding: 10px;
  cursor: pointer;
  background: transparent;
}

.bulk-job-item:hover,
.bulk-job-item.active {
  background: #203742;
}

.bulk-job-title {
  font-size: 14px;
  font-weight: 700;
}

.bulk-job-sub {
  color: #93a7b2;
  font-size: 12px;
  margin-top: 4px;
}

.bulk-progress {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: #263841;
  overflow: hidden;
}

.bulk-progress > span {
  display: block;
  height: 100%;
  background: #00a884;
}

.bulk-job-details {
  color: #cad6dc;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  margin: 0;
}

.bulk-job-expand {
  border-top: 1px solid #2d4350;
  padding: 12px;
  background: #162730;
}

.bulk-job-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.bulk-job-actions .btn-secondary i,
.bulk-job-actions .btn-danger i {
  margin-right: 6px;
}

.composer-form {
  display: block;
  min-width: 0;
}

.text-composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  min-width: 0;
}

.text-composer[hidden],
.audio-composer[hidden] {
  display: none !important;
}

.composer-action {
  border: 0;
  border-radius: 50%;
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  background: #00a884;
  color: #032e24;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.composer-action:hover {
  background: #13bf97;
}

.composer-action .icon-send {
  display: none;
}

.composer-action.send {
  background: #00a884;
  color: #003328;
}

.composer-action.send .icon-send {
  display: inline;
}

.composer-action.send .icon-mic {
  display: none;
}

.composer-action.mic .icon-send {
  display: none;
}

.composer-action.mic .icon-mic {
  display: inline;
}

.ui-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}

.ui-dialog-overlay.open {
  display: flex;
}

.ui-dialog-modal {
  width: min(480px, 92vw);
  border: 1px solid #2f4a56;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f1b21, #122730);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  padding: 18px;
}

.ui-dialog-header h3 {
  margin: 0 0 12px;
  font-size: 23px;
  font-weight: 700;
  color: #e8f2f7;
}

.ui-dialog-message {
  color: #d4e3ea;
  line-height: 1.45;
  font-size: 15px;
  white-space: pre-wrap;
}

.ui-dialog-input-wrap {
  display: block;
  margin-top: 14px;
}

.ui-dialog-input-wrap[hidden] {
  display: none !important;
}

.ui-dialog-input-wrap input {
  width: 100%;
  height: 42px;
  border: 1px solid #2e5562;
  border-radius: 10px;
  background: #1d313a;
  color: #eaf4f8;
  outline: none;
  padding: 0 12px;
  font-size: 15px;
}

.ui-dialog-input-wrap input:focus {
  border-color: #4bd2ea;
  box-shadow: 0 0 0 2px rgba(75, 210, 234, 0.2);
}

.ui-dialog-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.sync-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 8, 10, 0.62);
}

.sync-overlay[hidden] {
  display: none !important;
}

.sync-overlay-card {
  width: min(460px, 92vw);
  border-radius: 16px;
  border: 1px solid #31505d;
  background: linear-gradient(145deg, #0f1c22, #17303a);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  padding: 18px;
}

.sync-overlay-title {
  font-size: 22px;
  font-weight: 700;
  color: #ebf5f9;
}

.sync-overlay-message {
  margin-top: 10px;
  color: #c6d7de;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.sync-overlay-progress {
  margin-top: 14px;
  height: 12px;
  border-radius: 999px;
  background: #24414c;
  overflow: hidden;
}

.sync-overlay-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00a884, #67e3bf);
  transition: width 0.25s ease;
}

.sync-overlay-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #9cc4d1;
  font-size: 13px;
}

.composer-action .icon-send i {
  font-size: 18px;
}

.icon-mic svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  vertical-align: middle;
}

.composer-action.recording {
  background: #8f2428;
  color: #ffd8d8;
}

.text-composer input {
  background: #2a3942;
  border: 0;
  border-radius: 10px;
  outline: 0;
  height: 48px;
  padding: 0 14px;
  color: var(--text);
  font-size: 16px;
  min-width: 0;
}

.attach-wrap {
  position: relative;
}

.attach-btn {
  border: 0;
  width: 44px;
  height: 48px;
  border-radius: 12px;
  background: #2a3942;
  color: #d2e0e7;
  font-size: 18px;
  cursor: pointer;
}

.attach-btn:hover {
  background: #344853;
}

.attach-menu {
  position: absolute;
  bottom: 56px;
  left: 0;
  min-width: 190px;
  border-radius: 12px;
  border: 1px solid #2f414b;
  background: #182229;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  padding: 6px;
  display: none;
  z-index: 10;
}

.attach-menu.open {
  display: block;
}

.attach-menu button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 10px 10px;
  background: transparent;
  color: #dbe7ec;
  text-align: left;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.attach-menu button:hover {
  background: #24323a;
}

.audio-composer {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  background: #1f2c34;
  border-radius: 14px;
  padding: 8px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.audio-icon {
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2a3942;
  color: #d6e3ea;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.audio-icon.danger {
  color: #ffb7b7;
}

.audio-wave {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #d4e4ec;
  min-width: 0;
  overflow: hidden;
}

.audio-dots {
  color: #00a884;
  opacity: 0.9;
  font-size: 10px;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-send {
  border: 0;
  width: 46px;
  height: 36px;
  border-radius: 18px;
  background: #00a884;
  color: #032e24;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.audio-icon i,
.audio-send i {
  font-size: 16px;
  line-height: 1;
}

.audio-send:disabled,
.audio-icon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 56px minmax(260px, 36vw) minmax(0, 1fr);
  }
}

.new-chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 30;
}

.new-chat-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.new-chat-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  width: min(440px, 92vw);
  background: #0f181f;
  border: 1px solid #2a3942;
  border-radius: 12px;
  padding: 18px;
  z-index: 31;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.new-chat-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.new-chat-modal h3 {
  margin: 0 0 14px;
  font-size: 22px;
}

.new-chat-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.new-chat-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #9eb0b9;
  font-size: 14px;
}

.new-chat-form input,
.new-chat-form textarea,
.new-chat-form select {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #1f2c34;
  color: #e9edef;
  padding: 10px 12px;
  font-size: 15px;
  outline: 0;
}

.new-chat-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.settings-header {
  margin: 4px 0 14px;
  color: #9fb3bc;
  font-size: 14px;
}

.settings-admin {
  display: grid;
  gap: 14px;
}

.settings-users-wrap {
  border: 1px solid #2a3d47;
  border-radius: 10px;
  background: #152229;
  padding: 12px;
}

.settings-users-wrap strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #d6e2e8;
}

.settings-users-list {
  max-height: 220px;
  overflow-y: auto;
}

.settings-user-item {
  border: 1px solid #2f434f;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: #dbe6ec;
  margin-bottom: 8px;
  background: #1c2b33;
}

.settings-user-main {
  min-width: 0;
}

.settings-user-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.settings-user-actions .btn-secondary,
.settings-user-actions .btn-danger {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 7px;
}

.settings-user-item:last-child {
  margin-bottom: 0;
}

.settings-user-role {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  background: #203946;
  color: #9fc8d8;
}

@media (max-width: 1200px) {
  .settings-shell {
    grid-template-columns: 1fr;
  }

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

.btn-primary,
.btn-secondary {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
}

.btn-primary {
  background: #00a884;
  color: #003328;
  font-weight: 700;
}

.btn-secondary {
  background: #2a3942;
  color: #dce8ed;
}

.conversation-menu {
  position: fixed;
  z-index: 50;
  min-width: 180px;
  background: #182229;
  border: 1px solid #2f414b;
  border-radius: 10px;
  padding: 6px;
  display: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.conversation-menu.open {
  display: block;
}

.conversation-menu button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dbe7ec;
  text-align: left;
  padding: 9px 10px;
  font-size: 14px;
  cursor: pointer;
}

.conversation-menu button:hover {
  background: #24323a;
}

#deleteConversationBtn {
  color: #ffd4d4;
}

#deleteConversationBtn:hover {
  background: #2b1d22;
}

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

  .left-rail,
  .sidebar {
    display: none;
  }

  .chat-main {
    grid-template-rows: 64px 1fr 70px;
    height: 100dvh;
  }
}
