/* Admin shell — Bootstrap-first layout */
body.admin-app {
  margin: 0;
  font-size: 0.875rem;
  background-color: #f1f3f5;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.admin-shell {
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  min-width: 260px;
  background: #212529;
  color: #adb5bd;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1030;
}

.admin-sidebar-brand {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar-brand a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
}

.admin-sidebar-brand small {
  display: block;
  color: #6c757d;
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

.admin-sidebar-nav {
  padding: 0.75rem 0.5rem;
  overflow-y: auto;
  flex: 1;
}

.admin-sidebar-nav .nav-link {
  color: #ced4da;
  border-radius: 0.5rem;
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}

.admin-sidebar-nav .nav-link i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  opacity: 0.85;
}

.admin-sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-sidebar-nav .nav-link.active {
  background: #0d6efd;
  color: #fff;
}

.admin-sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar-user {
  opacity: 0.85;
}

/* Main area */
.admin-main {
  min-width: 0;
  background: #f1f3f5;
}

.admin-topbar {
  min-height: 56px;
  padding: 0.5rem 1rem;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.admin-topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: #212529;
  margin: 0;
}

.admin-content {
  padding: 1.25rem;
}

.admin-content--flush {
  padding: 0 !important;
}

.admin-mobile-nav-btn {
  border-radius: 999px;
}

/* Page headers (shared pattern) */
.admin-page-header {
  margin-bottom: 1.25rem;
}

.admin-page-header h1,
.admin-page-header .admin-page-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* Cards & tables */
.admin-content .card {
  border: 1px solid #e9ecef;
  border-radius: 0.625rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.admin-content .card > .card-header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
}

.admin-content .table th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #6c757d;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.admin-content .table td {
  vertical-align: middle;
}

.admin-content .table-hover tbody tr:hover {
  background-color: #f8f9fa;
}

.admin-content .badge {
  font-weight: 500;
}

/* Add-on action buttons */
.addon-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.addon-action-form {
  display: inline;
  margin: 0;
}

.addon-actions-col {
  min-width: 180px;
}

/* Login */
.admin-login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0d6efd 0%, #212529 100%);
}

.admin-login-card {
  width: 100%;
  max-width: 420px;
  border: 0;
  border-radius: 0.75rem;
}

/* Chat widgets page */
#merchant-chat-widgets-page.merchant-chat-widgets-page {
  --mcw-list-height: calc(100vh - 11rem);
  --mcw-accent-message: #0d6efd;
  --mcw-accent-menu: #0dcaf0;
  --mcw-accent-input: #ffc107;
  --mcw-accent-button: #495057;
  --mcw-accent-function: #6c757d;
  --mcw-accent-faq: #198754;
  --mcw-accent-default: #adb5bd;
}

#merchant-chat-widgets-page .mcw-layout {
  min-height: var(--mcw-list-height);
}

#merchant-chat-widgets-page .mcw-list-card,
#merchant-chat-widgets-page .mcw-detail-card {
  border: 1px solid #dee2e6;
  border-radius: 0.875rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

#merchant-chat-widgets-page .mcw-list-header {
  padding: 1.1rem 1.1rem 0;
  background: linear-gradient(180deg, #fff 0%, #fbfbfc 100%);
}

#merchant-chat-widgets-page .bg-light-subtle {
  background-color: #f4f6f8 !important;
}

/* Search */
#merchant-chat-widgets-page .mcw-search-wrap {
  position: relative;
}

#merchant-chat-widgets-page .mcw-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 2;
}

#merchant-chat-widgets-page .mcw-search-input {
  padding-left: 2.15rem;
  border-radius: 999px;
  border-color: #dbe1ea;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

#merchant-chat-widgets-page .mcw-search-input:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

/* Filters */
#merchant-chat-widgets-page .mcw-filter-panel {
  border-color: #e2e8f0 !important;
}

#merchant-chat-widgets-page .mcw-filter-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.4rem;
}

#merchant-chat-widgets-page .mcw-filter-track {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.2rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  width: 100%;
}

#merchant-chat-widgets-page .mcw-filter-track--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

#merchant-chat-widgets-page .mcw-filter-btn {
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#merchant-chat-widgets-page .mcw-filter-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

#merchant-chat-widgets-page .mcw-filter-btn.active {
  background: #0d6efd;
  color: #fff;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.28);
}

/* List toolbar & columns */
#merchant-chat-widgets-page .mcw-list-toolbar {
  background: #f8fafc;
}

#merchant-chat-widgets-page .mcw-list-toolbar-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

#merchant-chat-widgets-page .mcw-count-badge {
  background: #e2e8f0;
  color: #334155;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.35em 0.65em;
}

#merchant-chat-widgets-page .mcw-list-columns {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  background: #fff;
}

/* Widget list */
#merchant-chat-widgets-page .widget-menu-list {
  max-height: calc(100vh - 24rem);
  overflow-y: auto;
  margin: 0;
  padding: 0.65rem;
  background: #f8fafc;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

#merchant-chat-widgets-page .widget-menu-list::-webkit-scrollbar {
  width: 6px;
}

#merchant-chat-widgets-page .widget-menu-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

#merchant-chat-widgets-page .mcw-widget-item {
  position: relative;
  list-style: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  margin-bottom: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

#merchant-chat-widgets-page .mcw-widget-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--mcw-accent-default);
}

#merchant-chat-widgets-page .mcw-widget-item.mcw-accent-message::before { background: var(--mcw-accent-message); }
#merchant-chat-widgets-page .mcw-widget-item.mcw-accent-menu::before { background: var(--mcw-accent-menu); }
#merchant-chat-widgets-page .mcw-widget-item.mcw-accent-input::before { background: var(--mcw-accent-input); }
#merchant-chat-widgets-page .mcw-widget-item.mcw-accent-button::before { background: var(--mcw-accent-button); }
#merchant-chat-widgets-page .mcw-widget-item.mcw-accent-function::before { background: var(--mcw-accent-function); }
#merchant-chat-widgets-page .mcw-widget-item.mcw-accent-faq::before { background: var(--mcw-accent-faq); }

#merchant-chat-widgets-page .mcw-widget-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

#merchant-chat-widgets-page .mcw-widget-item.active {
  border-color: #93c5fd;
  background: linear-gradient(90deg, #eff6ff 0%, #fff 18%);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

#merchant-chat-widgets-page .mcw-widget-item .widget-toggle {
  padding: 0.7rem 0.75rem 0.7rem 0.85rem;
}

#merchant-chat-widgets-page .widget-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.5rem 0.65rem;
  align-items: center;
}

#merchant-chat-widgets-page .widget-list-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  margin-bottom: 0.25rem;
}

#merchant-chat-widgets-page .widget-type-icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.4rem;
  background: #f1f5f9;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.78rem;
}

#merchant-chat-widgets-page .mcw-accent-message .widget-type-icon { background: #dbeafe; color: #1d4ed8; }
#merchant-chat-widgets-page .mcw-accent-menu .widget-type-icon { background: #cffafe; color: #0e7490; }
#merchant-chat-widgets-page .mcw-accent-input .widget-type-icon { background: #fef3c7; color: #b45309; }
#merchant-chat-widgets-page .mcw-accent-button .widget-type-icon { background: #e2e8f0; color: #334155; }
#merchant-chat-widgets-page .mcw-accent-function .widget-type-icon { background: #f1f5f9; color: #475569; }
#merchant-chat-widgets-page .mcw-accent-faq .widget-type-icon { background: #dcfce7; color: #15803d; }

#merchant-chat-widgets-page .widget-id {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  flex-shrink: 0;
}

#merchant-chat-widgets-page .widget-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#merchant-chat-widgets-page .widget-slug {
  display: inline-block;
  max-width: 100%;
  font-size: 0.68rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.35rem;
  padding: 0.1rem 0.45rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

#merchant-chat-widgets-page .widget-list-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  max-width: 7.5rem;
}

#merchant-chat-widgets-page .widget-list-badges .badge {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.3em 0.55em;
}

#merchant-chat-widgets-page .widget-chevron {
  color: #cbd5e1;
  font-size: 0.8rem;
  transition: color 0.15s ease, transform 0.15s ease;
}

#merchant-chat-widgets-page .mcw-widget-item:hover .widget-chevron,
#merchant-chat-widgets-page .mcw-widget-item.active .widget-chevron {
  color: #0d6efd;
}

#merchant-chat-widgets-page .mcw-widget-item.active .widget-chevron {
  transform: translateX(2px);
}

#merchant-chat-widgets-page .menu-actions {
  display: none;
  gap: 0.45rem;
  padding: 0 0.75rem 0.7rem 0.85rem;
  border-top: 1px dashed #e2e8f0;
  margin-top: -0.15rem;
  padding-top: 0.55rem;
}

#merchant-chat-widgets-page .mcw-widget-item.active .menu-actions {
  display: flex;
}

#merchant-chat-widgets-page .menu-actions .btn {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
}

#merchant-chat-widgets-page .mcw-detail-card.is-empty {
  background: #fff;
}

#merchant-chat-widgets-page .mcw-empty-icon {
  width: 4.5rem;
  height: 4.5rem;
}

#merchant-chat-widgets-page .mcw-detail-header {
  background: linear-gradient(180deg, #f8f9fb 0%, #fff 100%);
}

#merchant-chat-widgets-page .mcw-meta-tile {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  height: 100%;
}

#merchant-chat-widgets-page .mcw-meta-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6c757d;
  margin-bottom: 0.2rem;
}

#merchant-chat-widgets-page .mcw-meta-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: #212529;
  word-break: break-word;
}

#merchant-chat-widgets-page .mcw-content-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  line-height: 1.5;
  min-height: 3.5rem;
}

#merchant-chat-widgets-page #widget-detail-message.mcw-content-box {
  white-space: pre-wrap;
}

#merchant-chat-widgets-page .mcw-detail-dl {
  display: grid;
  grid-template-columns: minmax(7rem, auto) 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

#merchant-chat-widgets-page .mcw-detail-dl dt {
  margin: 0;
  font-weight: 600;
  color: #475569;
}

#merchant-chat-widgets-page .mcw-detail-dl dd {
  margin: 0;
  color: #1e293b;
}

#merchant-chat-widgets-page .mcw-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

#merchant-chat-widgets-page .mcw-chip-list .badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.35rem 0.55rem;
  max-width: 100%;
  white-space: normal;
  text-align: left;
  line-height: 1.25;
}

#merchant-chat-widgets-page .mcw-options-list .list-group-item {
  background: #fff;
}

#merchant-chat-widgets-page .mcw-raw-details summary {
  cursor: pointer;
  list-style: none;
}

#merchant-chat-widgets-page .mcw-raw-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

#merchant-chat-widgets-page .mcw-raw-summary-label {
  display: inline-flex;
  align-items: center;
}

#merchant-chat-widgets-page #widget-copy-json-btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

#merchant-chat-widgets-page .mcw-raw-details summary::-webkit-details-marker {
  display: none;
}

#merchant-chat-widgets-page .mcw-raw-details[open] summary .bi-chevron-right {
  transform: rotate(90deg);
  display: inline-block;
}

#merchant-chat-widgets-page .mcw-raw-pre {
  background: #212529;
  color: #e9ecef;
  border-radius: 0.5rem;
  padding: 1rem;
  max-height: 16rem;
  overflow: auto;
}

/* Widget modal form */
#widgetModal .mcw-modal-dialog {
  width: min(1100px, 94vw);
  max-width: 94vw;
  margin: 0.75rem auto;
}

#widgetModal .mcw-modal-dialog .modal-content {
  max-height: calc(100vh - 1rem);
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.65rem;
}

#widgetModal .modal-body {
  flex: 0 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#widgetModal .mcw-form {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  overflow: hidden;
  background: #fff;
}

#widgetModal .mcw-form-scroll {
  flex: 0 1 auto;
  overflow-y: auto;
  max-height: calc(100vh - 9rem);
}

#widgetModal .mcw-form-layout {
  align-items: stretch;
}

#widgetModal .mcw-form-layout > [class*="col-"] {
  min-width: 0;
}

#widgetModal .mcw-placement-flags .mcw-check-tile {
  min-height: 0;
}

#widgetModal .mcw-modal-header {
  background: linear-gradient(135deg, #198754 0%, #157347 100%);
  padding: 0.65rem 1rem;
}

#widgetModal .mcw-form-guide {
  background: #f8fafc;
  border-color: #e2e8f0;
}

#widgetModal .mcw-form-guide summary {
  cursor: pointer;
  list-style: none;
  color: #475569;
}

#widgetModal .mcw-form-guide summary::-webkit-details-marker {
  display: none;
}

#widgetModal .mcw-form-guide code {
  background: #eef2f7;
  color: #334155;
  border-radius: 0.25rem;
  padding: 0.05rem 0.3rem;
}

#widgetModal .mcw-multi-select {
  min-height: 9rem;
}

/* Widget placement picker */
#widgetModal .mcw-widget-picker {
  border: 1px solid #dbe1ea;
  border-radius: 0.65rem;
  background: #f8fafc;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#widgetModal .mcw-widget-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: #fff;
  border-bottom: 1px solid #e9ecef;
}

#widgetModal .mcw-widget-picker-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.2;
}

#widgetModal .mcw-widget-picker-hint {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.2rem;
  line-height: 1.35;
}

#widgetModal .mcw-widget-picker-count {
  background: #e8f1ff;
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.35rem 0.55rem;
  flex-shrink: 0;
}

#widgetModal .mcw-widget-picker-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  background: #fff;
  border-bottom: 1px solid #eef2f7;
}

#widgetModal .mcw-widget-picker-search-wrap {
  position: relative;
  flex: 1 1 12rem;
  min-width: 0;
}

#widgetModal .mcw-widget-picker-search-wrap .bi-search {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.8rem;
  pointer-events: none;
}

#widgetModal .mcw-widget-picker-search-wrap .form-control {
  padding-left: 1.85rem;
  background: #f8fafc;
}

#widgetModal .mcw-widget-picker-list {
  flex: 0 0 auto;
  overflow: auto;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 9rem;
}

#widgetModal .mcw-widget-picker-item {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  margin: 0;
  padding: 0.4rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#widgetModal .mcw-widget-picker-item:hover {
  border-color: #bfd4ff;
  background: #fbfdff;
}

#widgetModal .mcw-widget-picker-item.is-system-only {
  opacity: 0.72;
  border-style: dashed;
}

#widgetModal .mcw-widget-picker-item.is-selected {
  border-color: #86b7fe;
  background: #f0f6ff;
  box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.08);
}

#widgetModal .mcw-widget-picker-check {
  margin: 0.2rem 0 0;
  flex-shrink: 0;
}

#widgetModal .mcw-widget-picker-accent {
  width: 3px;
  border-radius: 999px;
  flex-shrink: 0;
  background: #cbd5e1;
}

#widgetModal .mcw-widget-picker-accent.mcw-accent-message { background: #0d6efd; }
#widgetModal .mcw-widget-picker-accent.mcw-accent-menu { background: #0dcaf0; }
#widgetModal .mcw-widget-picker-accent.mcw-accent-input { background: #ffc107; }
#widgetModal .mcw-widget-picker-accent.mcw-accent-button { background: #212529; }
#widgetModal .mcw-widget-picker-accent.mcw-accent-function { background: #6c757d; }
#widgetModal .mcw-widget-picker-accent.mcw-accent-faq { background: #198754; }

#widgetModal .mcw-widget-picker-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

#widgetModal .mcw-widget-picker-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

#widgetModal .mcw-widget-picker-icon {
  color: #64748b;
  font-size: 0.85rem;
  flex-shrink: 0;
}

#widgetModal .mcw-widget-picker-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

#widgetModal .mcw-widget-picker-type {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

#widgetModal .mcw-widget-picker-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

#widgetModal .mcw-widget-picker-id {
  font-size: 0.68rem;
  font-family: var(--bs-font-monospace);
  color: #64748b;
}

#widgetModal .mcw-widget-picker-slug {
  font-size: 0.68rem;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem;
  padding: 0.05rem 0.3rem;
  word-break: break-all;
}

#widgetModal .mcw-widget-picker-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.5rem 1rem;
  color: #94a3b8;
  font-size: 0.8rem;
}

#widgetModal .mcw-form-section {
  border: 1px solid #e9ecef;
  border-radius: 0.55rem;
  background: #fff;
  padding: 0.65rem 0.75rem;
}

#widgetModal .mcw-form-section--compact {
  padding: 0.6rem 0.7rem;
}

#widgetModal .mcw-form-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.5rem;
}

#widgetModal .form-label {
  font-size: 0.82rem;
}

#widgetModal .form-control,
#widgetModal .form-select {
  border-color: #dbe1ea;
}

#widgetModal .form-control:focus,
#widgetModal .form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

#widgetModal .mcw-json-preview {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
}

/* Content section */
#widgetModal .mcw-content-section {
  display: block;
}

#widgetModal .mcw-content-message {
  min-height: 0;
  resize: vertical;
}

#widgetModal .mcw-json-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
  padding: 0.55rem;
}

#widgetModal .mcw-placement-pickers {
  align-items: start;
}

#widgetModal .mcw-placement-advanced {
  border-top: 1px solid #eef2f7;
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

#widgetModal .mcw-inline-checks .mcw-check-tile {
  height: 100%;
}

#widgetModal .mcw-json-field-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

#widgetModal .mcw-json-preview-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.35rem;
}

#widgetModal .mcw-json-preview-body {
  font-size: 0.78rem;
  color: #334155;
  line-height: 1.45;
}

#widgetModal .mcw-json-textarea {
  flex: 0 0 auto;
  min-height: 5rem;
  resize: vertical;
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
  font-size: 0.75rem;
}

#widgetModal .mcw-json-textarea:focus {
  background: #0f172a;
  color: #e2e8f0;
}

#widgetModal .mcw-json-textarea--metadata {
  min-height: 5rem;
}

#widgetModal .mcw-json-examples {
  font-size: 0.75rem;
  color: #64748b;
}

#widgetModal .mcw-json-examples summary {
  cursor: pointer;
  user-select: none;
}

#widgetModal .mcw-json-footnote {
  font-size: 0.72rem;
  color: #64748b;
}

#widgetModal .mcw-json-footnote code {
  font-size: 0.68rem;
  background: #eef2f7;
  border-radius: 0.25rem;
  padding: 0.05rem 0.3rem;
}

#widgetModal .mcw-json-example {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem;
}

#widgetModal .mcw-check-tile {
  display: flex;
  gap: 0.45rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.45rem;
  background: #f8fafc;
  padding: 0.4rem 0.55rem;
  align-items: flex-start;
}

#widgetModal .mcw-check-tile .form-check-input {
  margin-top: 0.15rem;
}

#widgetModal .mcw-check-tile .form-check-label strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.15;
}

#widgetModal .mcw-check-tile .form-check-label small {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.15rem;
}

#widgetModal .mcw-modal-footer {
  border-top: 1px solid #e9ecef;
  background: #fff;
  padding: 0.55rem 0.85rem;
}

#widgetModal .mcw-field-hint {
  font-size: 0.7rem;
  color: #64748b;
  line-height: 1.3;
  margin: 0;
}

#widgetModal .mcw-content-json-row {
  align-items: start;
}

@media (max-width: 991.98px) {
  #merchant-chat-widgets-page .widget-menu-list {
    max-height: 24rem;
  }

  #merchant-chat-widgets-page .widget-list-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #merchant-chat-widgets-page .widget-list-badges {
    grid-column: 1 / -1;
    max-width: none;
    justify-content: flex-start;
    margin-top: 0.15rem;
  }

  #merchant-chat-widgets-page .widget-chevron {
    display: none;
  }
}

@media (max-width: 575.98px) {
  #merchant-chat-widgets-page .mcw-list-header {
    padding: 0.9rem 0.9rem 0;
  }

  #merchant-chat-widgets-page .widget-menu-list {
    padding: 0.5rem;
  }
}

/* Help sections legacy layout inside admin */
.admin-content--flush .chat-container {
  height: calc(100vh - 56px);
  border-radius: 0;
}

/* Live chats page */
.admin-content--flush .live_chat_main_section {
  height: 100vh;
  min-height: 0;
  background: #f1f3f5;
}

.admin-content--flush .live-chat-shell {
  display: flex;
  height: 100%;
  min-height: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.admin-content--flush .live-chat-sidebar {
  width: 320px;
  min-width: 280px;
  max-width: 34%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
}

.admin-content--flush .live-chat-sidebar-header {
  padding: 1rem 1rem 0.85rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.admin-content--flush .live-chat-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

.admin-content--flush .live-chat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.admin-content--flush .live-chat-filters .filter-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #dbe1ea;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-content--flush .live-chat-filters .filter-btn:hover {
  background: #f1f5f9;
}

.admin-content--flush .live-chat-filters .filter-btn.active {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

.admin-content--flush .live-chat-session-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.admin-content--flush .live_chat_main_section .session-item {
  position: relative;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-left: 0;
}

.admin-content--flush .session-item {
  position: relative;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.admin-content--flush .session-item:hover {
  background: #f1f5f9;
}

.admin-content--flush .session-item.active {
  background: #eef4ff;
  border-left: 3px solid #0d6efd;
  padding-left: calc(1rem - 3px);
}

.admin-content--flush .session-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.admin-content--flush .session-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
}

.admin-content--flush .session-item-time {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.admin-content--flush .live-chat-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.admin-content--flush .live-chat-pane-header {
  min-height: 57px;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.admin-content--flush #chatMessages.live-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  height: auto;
  scroll-behavior: smooth;
}

.admin-content--flush .live-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  background: #f8fafc;
}

.admin-content--flush .live-chat-empty-state {
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #64748b;
  gap: 0.35rem;
}

.admin-content--flush .live-chat-empty-state i {
  font-size: 2rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.admin-content--flush .live-chat-empty-state p {
  margin: 0;
  font-weight: 600;
  color: #334155;
}

.admin-content--flush .live-chat-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.admin-content--flush .live-chat-preview:not(:empty) {
  display: flex;
}

.admin-content--flush #chatForm.live-chat-composer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.admin-content--flush #chatForm.live-chat-composer.d-none {
  display: none !important;
}

.admin-content--flush .live-chat-composer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.admin-content--flush .live-chat-composer .attach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  border-radius: 0.5rem;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
}

.admin-content--flush .live-chat-composer .attach-btn:hover {
  background: #f1f5f9;
  color: #0d6efd;
}

.admin-content--flush .live-chat-composer #chatMessage {
  flex: 1;
  min-width: 0;
  border-radius: 999px;
  border-color: #dbe1ea;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}

.admin-content--flush .live-chat-composer #chatMessage:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

.admin-content--flush .live-chat-composer .send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.admin-content--flush .live-chat-composer .send-btn:hover {
  background: #0b5ed7;
}

.admin-content--flush .live-chat-composer.disabled-chat {
  opacity: 0.55;
  pointer-events: none;
}

.admin-content--flush .unread-count-badge {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-content--flush .chat-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  color: #fff;
}

.admin-content--flush .chat-badge.open {
  background: #16a34a;
}

.admin-content--flush .chat-badge.closed {
  background: #dc2626;
}

.admin-content--flush .live-chat-preview .preview-img-box {
  position: relative;
  width: 60px;
  height: 60px;
}

.admin-content--flush .live-chat-preview .preview-img-box img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid #dbe1ea;
}

.admin-content--flush .live-chat-preview .preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 991.98px) {
  .admin-content--flush .live-chat-shell {
    flex-direction: column;
  }

  .admin-content--flush .live-chat-sidebar {
    width: 100%;
    max-width: none;
    max-height: 40vh;
  }
}

.admin-content .help_main_section {
  min-height: calc(100vh - 120px);
}

/* Offcanvas mobile sidebar uses same nav styles */
.offcanvas.admin-sidebar .admin-sidebar-nav .nav-link {
  color: #ced4da;
}

.offcanvas.admin-sidebar .admin-sidebar-nav .nav-link.active {
  background: #0d6efd;
  color: #fff;
}

@media (max-width: 991.98px) {
  .admin-content {
    padding: 1rem;
  }
}
