.workspace {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  padding-top: 54px;
}
.page.active.attendance-page {
  display: grid !important;
  height: 100%;
  min-height: 0 !important;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  align-items: stretch;
  padding: 16px 16px 0 !important;
  gap: 0;
}
.attendance-page .tool-rail,
.attendance-page .queue-panel,
.attendance-page .conversation-stage {
  min-height: 0 !important;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
.attendance-page .tool-rail { min-height: 0 !important; height: 100%; }
.attendance-page .queue-panel { display: flex; flex-direction: column; overflow: hidden; min-height: 0 !important; }
.attendance-page .conversation-stage {
  min-height: 0 !important;
  display: flex !important;
  place-items: stretch !important;
  align-items: stretch !important;
  border-radius: 0 10px 0 0;
  background: #fff;
}
.queue-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; flex: 1; min-height: 0; overflow-y: auto; }
.queue-item-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
}
.queue-item { text-align: left; width: 100%; border: 1px solid #e8efe8; background: #fff; border-radius: 14px; padding: 12px; cursor: pointer; }
.queue-item.active, .queue-item:hover { border-color: #16a34a; }
.queue-item-delete {
  display: grid;
  place-items: center;
  width: 38px;
  border: 1px solid #e8efe8;
  border-radius: 12px;
  background: #fff;
  color: #94a3b8;
  cursor: pointer;
  flex-shrink: 0;
}
.queue-item-delete:hover { border-color: #fecaca; background: #fef2f2; color: #dc2626; }
.queue-item-delete i { width: 16px; height: 16px; }
.queue-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.queue-item-head strong { font-size: 14px; flex: 1; min-width: 0; }
.queue-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  flex-shrink: 0;
}
.queue-item.is-instagram .queue-brand-icon { background: #fce7f3; color: #db2777; }
.queue-item.is-facebook .queue-brand-icon { background: #dbeafe; color: #2563eb; }
.chat-policy-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eef4ee;
  color: #db2777;
  flex-shrink: 0;
}
.queue-item p, .queue-item-head span { font-size: 12px; color: #64748b; }
.queue-item-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 11px; }
.queue-unread { background: #16a34a; color: #fff; border-radius: 999px; padding: 2px 7px; }

.channel-picker { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.channel-picker-compact { margin-bottom: 14px; }
.channel-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid #dbe7db; background: #fff; color: #334155;
  border-radius: 999px; padding: 10px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.channel-pill.active { border-color: #16a34a; background: #ecfdf3; color: #15803d; box-shadow: inset 0 0 0 1px #bbf7d0; }
.channel-panel[hidden] { display: none !important; }
.connected-hub-card { margin-bottom: 8px; }
.connected-channel-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.connected-channel-item i { color: #16a34a; }
.connected-badge { background: #dcfce7; color: #15803d; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.connection-log { margin-top: 14px; background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 12px; font-size: 12px; white-space: pre-wrap; }

.comment-post-wrap { display: block; text-decoration: none; color: inherit; margin-bottom: 8px; }
.comment-post-card { display: grid; gap: 0; overflow: hidden; border: 1px solid #dbe7db; border-radius: 12px; background: #fff; max-width: 280px; }
.comment-post-image { width: 100%; max-height: 180px; object-fit: cover; display: block; }
.comment-post-placeholder { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; min-height: 120px; background: #eef4ee; color: #64748b; font-size: 12px; }
.chat-reply-post-thumb.is-placeholder { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; text-decoration: none; color: #64748b; font-size: 11px; }
.comment-post-body { padding: 10px 12px; display: grid; gap: 6px; }
.comment-post-label { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #64748b; }
.comment-post-caption { margin: 0; font-size: 12px; line-height: 1.4; color: #334155; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.comment-post-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #16a34a; font-weight: 600; }
.chat-bubble.is-comment { max-width: 320px; }
.chat-bubble .comment-tag { display: inline-block; margin-bottom: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; color: #64748b; }

.chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  max-height: 100%;
  background: #fff;
  border-radius: 0;
  overflow: hidden;
}
.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0 !important;
  max-height: 100%;
  overflow: hidden;
  align-content: stretch;
}
.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #fff;
}
.chat-header,
.chat-tags-bar,
.chat-policy-banner,
.chat-composer,
.chat-composer-pro {
  flex-shrink: 0;
}
.chat-contact-sidebar { background: #fff; border-left: 1px solid #e5efe5; padding: 20px; overflow-y: auto; }
.chat-contact-sidebar h3 { margin: 0 0 16px; font-size: 16px; }
.chat-contact-meta { display: grid; gap: 12px; margin: 0 0 16px; }
.chat-contact-meta div { display: grid; gap: 4px; }
.chat-contact-meta dt { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.chat-contact-meta dd { margin: 0; font-size: 14px; color: #0f172a; }
.chat-contact-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chat-contact-tags span { background: #ecfdf3; color: #15803d; padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.outline-btn.full { width: 100%; }

.conversation-stage.chat-active {
  display: flex !important;
  flex-direction: column;
  place-items: stretch !important;
  align-items: stretch !important;
  padding: 0;
  height: 100%;
  min-height: 0 !important;
  overflow: hidden;
}
.conversation-stage.chat-active .chat-panel {
  flex: 1 1 auto;
  min-height: 0;
  align-self: stretch;
}

.attendance-page.has-chat { grid-template-columns: 50px 300px minmax(0, 1fr); }
.attendance-page.chat-expanded { grid-template-columns: 50px minmax(0, 1fr); }
.attendance-page.chat-expanded #queuePanel,
.attendance-page.chat-expanded .attendance-search-panel { display: none; }
.attendance-page.chat-expanded .chat-layout { grid-template-columns: minmax(0, 1fr) 320px; }

.chat-header { padding: 16px 20px; background: #fff; border-bottom: 1px solid #e5efe5; border-radius: 0; }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chat-header-actions { display: flex; align-items: center; gap: 8px; }
.chat-header-actions .outline-btn { padding: 8px 10px; }
.chat-header h2 { margin: 0; font-size: 18px; }
.chat-header p { margin: 4px 0 0; font-size: 12px; color: #64748b; }
.message-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overscroll-behavior: contain;
}
.chat-bubble { max-width: min(680px, 78%); padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid #e2ece2; }
.chat-bubble.customer { align-self: flex-start; }
.chat-bubble.agent { align-self: flex-end; background: #ecfdf3; border-color: #bbf7d0; }
.chat-bubble.system { align-self: center; background: #f1f5f9; border-style: dashed; max-width: 90%; }
.chat-bubble p { margin: 0 0 6px; font-size: 15px; line-height: 1.5; }
.chat-bubble time { font-size: 11px; color: #64748b; }
.chat-composer {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
  margin: 0;
  background: #fff;
  border-top: 1px solid #e5efe5;
  border-radius: 0;
  align-items: flex-end;
}
.chat-composer-tools { display: flex; gap: 4px; padding-bottom: 6px; }
.chat-composer textarea { flex: 1; resize: none; border: 1px solid #dbe7db; border-radius: 14px; padding: 14px 16px; font: inherit; min-height: 72px; max-height: 180px; }
.chat-composer .primary-btn { width: 52px; height: 52px; padding: 0; flex-shrink: 0; }

@media (max-width: 1100px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-contact-sidebar { display: none; }
  .attendance-page.has-chat { grid-template-columns: 50px 260px minmax(0, 1fr); }
}

.hub-view-page { padding: 24px; background: #f8faf8; }
.hub-shell { max-width: 1100px; margin: 0 auto; }
.hub-header h1 { margin: 8px 0; font-size: 30px; color: #0f172a; }
.hub-header p { color: #64748b; margin: 0 0 20px; }
.kpi-grid, .integration-grid, .settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.kpi-card, .integration-card, .settings-card, .hub-card { background: #fff; border: 1px solid #e5efe5; border-radius: 18px; padding: 20px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04); }
.kpi-card span { display: block; font-size: 12px; color: #64748b; margin-bottom: 8px; }
.kpi-card strong { font-size: 28px; color: #0f172a; }
.kpi-card small { display: block; margin-top: 8px; color: #16a34a; }
.integration-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.integration-card-head h3 { margin: 0; }
.integration-status { font-size: 11px; padding: 4px 8px; border-radius: 999px; background: #f1f5f9; color: #64748b; white-space: nowrap; }
.integration-status.online { background: #ecfdf3; color: #15803d; }
.integration-card.connected { border-color: #bbf7d0; }
.integration-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.integration-actions .outline-btn { flex: 1; }

.integration-modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; }
.integration-modal[hidden] { display: none; }
.integration-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.integration-modal-card { position: relative; width: min(640px, 92vw); max-height: 88vh; overflow: auto; background: #fff; border-radius: 20px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18); }
.integration-modal-head, .integration-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; }
.integration-modal-head { border-bottom: 1px solid #eef2ef; }
.integration-modal-foot { border-top: 1px solid #eef2ef; justify-content: flex-end; }
.integration-modal-body { padding: 20px; display: grid; gap: 14px; }
.integration-lead { margin: 0; color: #64748b; }
.integration-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.integration-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: #64748b; }
.integration-checklist { display: grid; gap: 8px; font-size: 14px; color: #334155; }
.copy-field { display: flex; gap: 8px; align-items: center; }
.copy-field input { flex: 1; }

.users-table { display: grid; gap: 8px; margin-bottom: 12px; }
.users-table-head, .users-table-row { display: grid; grid-template-columns: 1.2fr 1.4fr 0.8fr 0.8fr; gap: 8px; font-size: 13px; }
.users-table-head { color: #64748b; font-weight: 600; }
.users-table-row { padding: 10px 12px; border: 1px solid #eef2ef; border-radius: 10px; background: #fafafa; }

.integration-card h3, .settings-card h3, .hub-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 18px; }
.integration-card p, .settings-card p { color: #64748b; min-height: 44px; }
.integration-card code { background: #f1f5f9; padding: 2px 6px; border-radius: 6px; }
.activity-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.activity-list li { display: flex; align-items: center; gap: 10px; color: #334155; font-size: 14px; }
.settings-toggle { display: flex; align-items: center; gap: 8px; margin: 12px 0 16px; font-size: 14px; color: #334155; }

.profile-menu-wrap { position: relative; }
.profile-dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: #fff; border: 1px solid #e5efe5; border-radius: 16px; box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12); padding: 8px; z-index: 30; }
.profile-dropdown[hidden] { display: none; }
.profile-dropdown-head { padding: 10px 12px 12px; border-bottom: 1px solid #eef2ef; margin-bottom: 6px; }
.profile-dropdown-head strong { display: block; font-size: 14px; color: #0f172a; }
.profile-dropdown-head span { display: block; margin-top: 4px; font-size: 12px; color: #64748b; word-break: break-all; }
.profile-dropdown-item { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 10px 12px; border-radius: 10px; cursor: pointer; font: inherit; color: #0f172a; text-align: left; }
.profile-dropdown-item[href] { text-decoration: none; }
.profile-dropdown-item:hover { background: #f1f5f9; }
.profile-dropdown-item.danger { color: #dc2626; }

.profile-shell { display: grid; gap: 16px; }
.profile-shell .profile-card,
.profile-section {
  background: #fff;
  border: 1px solid #e5efe5;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.profile-avatar-wrap { display: grid; justify-items: center; gap: 12px; }
.profile-avatar-large {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  font-size: 36px;
  font-weight: 700;
  overflow: hidden;
}
.profile-avatar-large img,
.avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-avatar-large.has-image {
  background: #fff;
  border: 1px solid #dbe7db;
}
.profile-avatar-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.profile-avatar-reset { border: 1px solid #e5efe5; border-radius: 12px; }
.profile-section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.profile-section { display: grid; gap: 14px; align-content: start; }
.profile-section-head h2 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; font-size: 18px; }
.profile-section-head p { margin: 0; color: #64748b; font-size: 13px; }
.profile-fields { display: grid; gap: 12px; }
.profile-preferences { display: grid; gap: 10px; }
.profile-session-list { display: grid; gap: 10px; }
.profile-session-list div { border: 1px solid #eef2ef; border-radius: 12px; padding: 10px 12px; background: #fafafa; }
.profile-session-list span { display: block; color: #64748b; font-size: 12px; margin-bottom: 3px; }
.profile-session-list strong { color: #0f172a; word-break: break-word; }
.profile-session-actions { display: grid; gap: 10px; }
.profile-session-actions .outline-btn,
.profile-session-actions .primary-btn,
.profile-session-actions a.outline-btn {
  width: 100%;
  text-decoration: none;
  justify-content: center;
}
.primary-btn.danger { background: #dc2626; }
.primary-btn.danger:hover { background: #b91c1c; }

body.theme-dark {
  background: #0f172a;
  color: #e2e8f0;
}
body.theme-dark .hub-view-page,
body.theme-dark .chat-panel,
body.theme-dark .conversation-stage,
body.theme-dark .queue-panel { background: #0f172a; }
body.theme-dark .kpi-card,
body.theme-dark .integration-card,
body.theme-dark .settings-card,
body.theme-dark .hub-card,
body.theme-dark .profile-shell .profile-card,
body.theme-dark .profile-section,
body.theme-dark .profile-dropdown,
body.theme-dark .queue-item,
body.theme-dark .chat-header,
body.theme-dark .chat-composer,
body.theme-dark .users-table-row,
body.theme-dark .utility-drawer {
  background: #111827;
  border-color: #1f2937;
  color: #e2e8f0;
}
body.theme-dark .hub-header h1,
body.theme-dark .profile-section-head h2,
body.theme-dark .profile-session-list strong,
body.theme-dark .profile-dropdown-item { color: #f8fafc; }
body.theme-dark .hub-header p,
body.theme-dark .integration-card p,
body.theme-dark .settings-card p,
body.theme-dark .profile-section-head p,
body.theme-dark .profile-session-list span,
body.theme-dark .profile-dropdown-head span { color: #94a3b8; }
body.theme-dark .profile-dropdown-item:hover { background: #1f2937; }
body.theme-dark .chat-bubble { background: #0f172a; border-color: #1f2937; color: #e2e8f0; }
body.theme-dark .chat-bubble.agent { background: #052e16; border-color: #14532d; }
body.theme-dark .chat-bubble.system { background: #1e293b; border-color: #334155; }
body.theme-dark .field input,
body.theme-dark .field select,
body.theme-dark .chat-composer textarea,
body.theme-dark .notes-editor {
  background: #0b1220;
  border-color: #334155;
  color: #e2e8f0;
}
body.theme-dark .topbar { background: #0b1220; border-bottom: 1px solid #1f2937; }

.queue-menu { position: absolute; right: 12px; top: 58px; background: #fff; border: 1px solid #e5efe5; border-radius: 12px; box-shadow: 0 12px 30px rgba(15,23,42,.1); padding: 6px; z-index: 20; min-width: 160px; }
.queue-menu[hidden] { display: none; }
.queue-panel { position: relative; }
.queue-menu button { width: 100%; border: 0; background: transparent; text-align: left; padding: 10px 12px; border-radius: 8px; cursor: pointer; font: inherit; }
.queue-menu button:hover { background: #f1f5f9; }
.queue-popover-menu { right: auto; left: 44px; top: 58px; min-width: 180px; }
.queue-empty { padding: 24px 12px; color: #64748b; font-size: 14px; text-align: center; }

.attendance-page { position: relative; }
.attendance-search-panel { position: absolute; right: 20px; top: 18px; width: min(340px, 92vw); background: #fff; border: 1px solid #e5efe5; border-radius: 16px; box-shadow: 0 18px 38px rgba(15,23,42,.14); z-index: 28; display: grid; gap: 12px; padding: 14px; }
.attendance-search-panel[hidden] { display: none; }
.attendance-search-head { display: flex; justify-content: space-between; align-items: center; }
.attendance-search-head h3 { margin: 0; font-size: 15px; }
.attendance-search-field { display: flex; align-items: center; gap: 8px; border: 1px solid #dbe7db; border-radius: 12px; padding: 8px 10px; }
.attendance-search-field input { border: 0; outline: 0; width: 100%; font: inherit; }
.attendance-search-hint { font-size: 12px; color: #64748b; }
.attendance-search-results { display: grid; gap: 8px; max-height: 220px; overflow-y: auto; }
.attendance-search-item { border: 1px solid #eef2ef; border-radius: 10px; background: #fff; padding: 10px; text-align: left; cursor: pointer; }
.attendance-search-item:hover { border-color: #16a34a; background: #f8fff9; }
.attendance-search-item strong { display: block; font-size: 13px; color: #0f172a; }
.attendance-search-item span { display: block; margin-top: 4px; font-size: 12px; color: #64748b; }

.feature-card[role="button"] { cursor: pointer; }
.feature-card[role="button"]:hover, .feature-card[role="button"]:focus-visible { border-color: #16a34a; box-shadow: 0 8px 20px rgba(22,163,74,.12); outline: none; }

.utility-drawer { position: fixed; top: 54px; right: 0; width: min(360px, 92vw); height: calc(100vh - 54px); background: #fff; border-left: 1px solid #e5efe5; box-shadow: -12px 0 40px rgba(15,23,42,.08); z-index: 25; display: flex; flex-direction: column; }
.utility-drawer[hidden] { display: none; }
.utility-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid #eef2ef; }
.utility-drawer-head h2 { margin: 0; font-size: 18px; }
.utility-drawer-body { padding: 16px 18px; overflow-y: auto; }
.drawer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.drawer-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid #eef2ef; border-radius: 12px; font-size: 14px; }
.drawer-list span { color: #64748b; }
.notes-editor { width: 100%; border: 1px solid #dbe7db; border-radius: 14px; padding: 12px; font: inherit; margin-bottom: 12px; }

.kpi-card[data-ui-action], .activity-list li[data-ui-action] { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.kpi-card[data-ui-action]:hover, .activity-list li[data-ui-action]:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15,23,42,.08); }

.campaign-filter-menu { position: absolute; z-index: 22; background: #fff; border: 1px solid #e5efe5; border-radius: 12px; box-shadow: 0 12px 30px rgba(15,23,42,.1); padding: 6px; min-width: 180px; }
.campaign-filter-menu[hidden] { display: none; }
.campaign-filter-menu button { width: 100%; border: 0; background: transparent; text-align: left; padding: 10px 12px; border-radius: 8px; cursor: pointer; font: inherit; }
.campaign-filter-menu button:hover { background: #f1f5f9; }
.campaigns-page { position: relative; }

.feature-card[role="button"] { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.feature-card[role="button"]:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,.08); }

@media (max-width: 900px) {
  .profile-section-grid { grid-template-columns: 1fr; }
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #64748b;
  flex-shrink: 0;
}
.connection-hub-icon .brand-icon { color: #334155; }
.connections-new-menu .brand-icon[data-brand-icon="whatsapp"] { color: #25d366; }
.connections-new-menu .brand-icon[data-brand-icon="instagram"] { color: #e1306c; }
.connections-new-menu .brand-icon[data-brand-icon="facebook"] { color: #1877f2; }
.channel-pill .brand-icon[data-brand-icon="instagram"] { color: #e1306c; }
.channel-pill .brand-icon[data-brand-icon="facebook"] { color: #1877f2; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Conexões (hub estilo ChatSC) —— */
.connections-page {
  padding: 20px 24px 32px;
  background: #f3f6f3;
  min-height: calc(100vh - 54px);
}
.connections-hub {
  background: #fff;
  border: 1px solid #e8efe8;
  border-radius: 4px;
  min-height: calc(100vh - 110px);
  padding: 0 0 24px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.connections-hub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #eef2ef;
}
.connections-hub-toolbar-left { display: flex; gap: 4px; }
.connections-hub-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.connections-toolbar-btn {
  font-size: 13px;
  padding: 9px 14px;
  white-space: nowrap;
}
.connections-new-wrap { position: relative; }
.connections-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 9px 16px;
}
.connections-new-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: #fff;
  border: 1px solid #e5efe5;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  padding: 6px;
  z-index: 30;
  display: grid;
  gap: 2px;
}
.connections-new-menu[hidden] { display: none; }
.connections-new-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  color: #0f172a;
}
.connections-new-menu button:hover:not(:disabled) { background: #f1f5f9; }
.connections-new-menu button:disabled { opacity: 0.55; cursor: not-allowed; }
.connections-new-menu button span {
  margin-left: auto;
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.connections-new-menu button i { width: 18px; height: 18px; color: #64748b; }
.connections-hub-title {
  margin: 18px 20px 14px;
  font-size: 22px;
  font-weight: 700;
  color: #16a34a;
}
.connections-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 0 20px;
}
.connections-cards-grid.is-list {
  grid-template-columns: 1fr;
}
.connections-empty-state {
  grid-column: 1 / -1;
  padding: 48px 20px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}
.connection-hub-card {
  position: relative;
  background: #fff;
  border: 1px solid #e8efe8;
  border-radius: 12px;
  padding: 16px 16px 12px 20px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}
.connection-hub-card.is-list {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px 14px 20px;
}
.connection-hub-stripe {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #3b82f6;
}
.connection-hub-card.is-instagram .connection-hub-stripe { background: #e1306c; }
.connection-hub-card.is-facebook .connection-hub-stripe { background: #1877f2; }
.connection-hub-card.is-whatsapp .connection-hub-stripe { background: #25d366; }
.connection-hub-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.connection-hub-card.is-list .connection-hub-head { margin: 0; }
.connection-hub-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.connection-hub-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f1f5f9;
  flex-shrink: 0;
}
.connection-hub-brand strong {
  display: block;
  font-size: 15px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.connection-hub-brand small {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: .04em;
}
.connection-hub-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #15803d;
  background: #ecfdf3;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.connection-hub-status i { width: 8px; height: 8px; fill: #16a34a; color: #16a34a; }
.connection-hub-status.is-expired { color: #b91c1c; background: #fef2f2; }
.connection-hub-status.is-expired i { width: 14px; height: 14px; fill: #dc2626; color: #dc2626; }
.connection-hub-status.is-ok { color: #15803d; background: #ecfdf3; }
.connection-hub-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #64748b;
}
.connection-hub-meta em { font-style: normal; color: #94a3b8; }
.connection-comments-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
}
.connection-comments-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.connection-comments-toggle .toggle-ui {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background .2s;
}
.connection-comments-toggle .toggle-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  transition: transform .2s;
}
.connection-comments-toggle input:checked + .toggle-ui { background: #16a34a; }
.connection-comments-toggle input:checked + .toggle-ui::after { transform: translateX(16px); }
.connection-hub-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.connection-hub-card.is-list .connection-hub-stats { margin: 0; }
.conn-stat-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  color: #64748b;
  background: #f8fafc;
}
.conn-stat-chip.is-pending { color: #2563eb; border-color: #bfdbfe; background: #eff6ff; }
.conn-stat-chip.is-msgs { color: #15803d; border-color: #bbf7d0; background: #ecfdf3; }
.connection-hub-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}
.connection-hub-actions button {
  border: 0;
  background: transparent;
  color: #94a3b8;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
}
.connection-hub-actions button:hover { background: #f1f5f9; color: #64748b; }

/* —— Chat pro (atendimento Meta) —— */
.chat-header-pro {
  padding: 12px 16px;
  gap: 10px;
}
.chat-back-btn { flex-shrink: 0; }
.chat-header-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}
.chat-avatar.has-image {
  background: #e2e8f0;
  color: transparent;
}
.chat-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chat-sidebar-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.chat-sidebar-avatar {
  width: 72px;
  height: 72px;
  font-size: 24px;
}
.chat-header-pro h2 {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-assigned {
  margin: 2px 0 0 !important;
  font-size: 11px !important;
  color: #94a3b8 !important;
}
.chat-header-actions-pro { gap: 2px; }
.chat-tags-bar { display: none; }
.chat-wallpaper {
  background-color: #e5ddd5;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4cdc4' fill-opacity='0.45'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.chat-policy-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 16px 8px;
  padding: 12px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  font-size: 12px;
  color: #334155;
}
.chat-policy-banner[hidden] { display: none; }
.chat-policy-banner > i { flex-shrink: 0; color: #e1306c; margin-top: 2px; }
.chat-policy-banner strong { display: block; font-size: 13px; margin-bottom: 2px; }
.chat-policy-banner p { margin: 0; line-height: 1.4; color: #64748b; }
.chat-policy-banner small { display: block; margin-top: 4px; color: #94a3b8; }
.chat-policy-timer {
  margin-left: auto;
  align-self: center;
  flex-shrink: 0;
  background: #16a34a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.chat-composer-pro {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
}
.chat-composer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.chat-reply-mode-bar {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dbe7db;
  border-radius: 14px;
  background: #f8faf8;
}
.chat-reply-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.chat-reply-mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid #dbe7db;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.chat-reply-mode-btn.is-active {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.chat-reply-target {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
}
.chat-reply-post-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.chat-reply-post-thumb.is-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef4ee;
  color: #64748b;
}
.chat-reply-target-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.chat-reply-target-copy strong,
.chat-reply-target-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-reply-target-copy strong {
  font-size: 12px;
  color: #334155;
}
.chat-reply-target-copy small {
  font-size: 11px;
  color: #64748b;
}

.chat-composer-pro .chat-composer-tools {
  display: flex;
  gap: 2px;
  padding-bottom: 0;
  order: 1;
}
.chat-composer-pro textarea {
  flex: 1 1 100%;
  order: 3;
  min-height: 44px;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
}
.chat-composer-side {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  order: 2;
}
.chat-composer-pro .primary-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
}

@media (max-width: 900px) {
  .connections-hub-toolbar { flex-direction: column; align-items: stretch; }
  .connections-hub-toolbar-right { justify-content: flex-start; }
  .connection-hub-card.is-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .chat-header-actions-pro .ghost-icon:nth-child(n+4) { display: none; }
}

/* Meta App Review — bloqueia recursos fora de FB/IG */
body.meta-review-mode .meta-locked {
  position: relative;
  pointer-events: none;
  opacity: 0.62;
  cursor: not-allowed !important;
  filter: grayscale(0.15);
}
body.meta-review-mode button.meta-locked,
body.meta-review-mode .nav-item.meta-locked,
body.meta-review-mode [role="button"].meta-locked,
body.meta-review-mode .feature-card.meta-locked {
  user-select: none;
}
body.meta-review-mode .meta-locked::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / 11px no-repeat;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
body.meta-review-mode .nav-item.meta-locked::after {
  top: 2px;
  right: 8px;
}
body.meta-review-mode .rail-action.meta-locked::after,
body.meta-review-mode .ghost-icon.meta-locked::after,
body.meta-review-mode .round-action.meta-locked::after {
  top: 2px;
  right: 2px;
}
body.meta-review-mode .connections-new-menu button.meta-locked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-right: 12px;
}
body.meta-review-mode .connections-new-menu button.meta-locked::after {
  position: static;
  flex-shrink: 0;
  margin-left: auto;
}

.chat-reply-mode-banner { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: #ecfdf3; color: #166534; font-size: 12px; font-weight: 600; }
.chat-reply-post-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chat-reply-post-tab { border: 1px solid #dbe7db; background: #fff; color: #334155; border-radius: 999px; padding: 6px 12px; font-size: 12px; white-space: nowrap; cursor: pointer; }
.chat-reply-post-tab.is-active { background: #16a34a; border-color: #16a34a; color: #fff; }
.chat-reply-comment-list { display: grid; gap: 6px; max-height: 140px; overflow: auto; }
.chat-reply-comment-item { display: grid; gap: 2px; text-align: left; border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.chat-reply-comment-item.is-active { border-color: #16a34a; background: #f0fdf4; }
.chat-reply-comment-item span { font-size: 12px; color: #0f172a; }
.chat-reply-comment-item small { font-size: 11px; color: #64748b; }
.chat-reply-delete { color: #dc2626; }
.chat-bubble-row { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.chat-bubble-row p { margin: 0; flex: 1; }
.chat-bubble-delete { border: 0; background: transparent; color: #dc2626; cursor: pointer; padding: 2px; }
.chat-bubble.is-automation { background: #f8fafc; border: 1px dashed #cbd5e1; color: #334155; }
.chat-bubble.is-automation .automation-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 6px; }
.connection-auto-reply-modal { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; }
.connection-auto-reply-modal[hidden] { display: none !important; }
.connection-auto-reply-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.connection-auto-reply-panel { position: relative; width: min(520px, calc(100vw - 32px)); background: #fff; border-radius: 16px; padding: 20px; display: grid; gap: 12px; box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2); }
.connection-auto-reply-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.connection-auto-reply-panel h3 { margin: 0; font-size: 18px; }
.connection-auto-reply-lead { margin: 0; font-size: 13px; color: #64748b; }
.connection-auto-reply-panel label { display: grid; gap: 6px; font-size: 13px; color: #334155; }
.connection-auto-reply-panel input[type="text"],
.connection-auto-reply-panel textarea { width: 100%; border: 1px solid #dbe7db; border-radius: 10px; padding: 10px 12px; font: inherit; }
.connection-auto-reply-toggle { display: flex; align-items: center; gap: 8px; }
.integration-status.is-active { background: #dcfce7; color: #166534; }
.comment-auto-reply-card { grid-column: 1 / -1; }
.comment-auto-reply-form { display: grid; gap: 12px; margin-top: 8px; }
.comment-auto-reply-channel { margin: 0; font-size: 13px; color: #64748b; }
.comment-auto-reply-toggle { margin: 0; }
