:root {
  --tile-radius: 16px;
  --avatar-radius: 50%;
  --border: #e4e4e7;
  --text: #18181b;
  --text-muted: #71717a;
  --surface: #fafafa;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body:not(.ready) > *:not(#pageLoader) {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Cards con fondo ligeramente más limpio y radio menor */
.card {
  background: #f4f4f5;
  border-radius: var(--tile-radius);
  border: 1px solid rgba(0,0,0,0.04);
}

/* Toggle */
.toggle {
  --w: 48px; --h: 26px; --p: 3px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  width: var(--w);
  height: var(--h);
  border-radius: 999px;
  border: 1.5px solid #d4d4d8;
  background: #fff;
  position: relative;
  box-sizing: border-box;
  transition: background .2s, border-color .2s;
}
.toggle-sm { --w: 32px; --h: 20px; --p: 3px; }
.toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--p);
  width: calc(var(--h) - 2*var(--p));
  height: calc(var(--h) - 2*var(--p));
  border-radius: 50%;
  background: #a1a1aa;
  transform: translateY(-50%);
  transition: left .18s, background .18s;
}
.toggle:checked { background: #18181b; border-color: #18181b; }
.toggle:checked::after {
  background: #fff;
  left: calc(var(--w) - var(--h) + var(--p));
}

/* Color inputs */
input[type="color"] {
  -webkit-appearance: none;
  border: 1px solid #d4d4d8;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1/1;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 999px; }
.color-circle { width: 2.5rem; height: 2.5rem; border-radius: 9999px; padding: 0; overflow: hidden; aspect-ratio: 1/1; }
.color-circle::-webkit-color-swatch-wrapper { padding: 0; border-radius: 9999px; }
.color-circle::-webkit-color-swatch { border: none; border-radius: 9999px; }

/* Chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 8px 12px;
  border: 1px solid #e4e4e7;
  background: #fff;
  cursor: pointer;
  font-size: 13.5px;
  transition: border-color .12s, background .12s;
}
.chip:hover { border-color: #a1a1aa; }
.chip.active { border-color: #18181b; background: #18181b; color: #fff; }
.activity-score-active { background: #18181b !important; color: #fff !important; border-color: #18181b !important; }

textarea {
  resize: none;
  overflow: hidden;
  min-height: 400px;
}

#fontFamily option { font-size: 14px; padding: 6px 8px; }
#fontFamily option[value="Manrope"]           { font-family: 'Manrope', system-ui, sans-serif; }
#fontFamily option[value="Inter"]             { font-family: 'Inter', system-ui, sans-serif; }
#fontFamily option[value="Poppins"]           { font-family: 'Poppins', system-ui, sans-serif; }
#fontFamily option[value="Roboto"]            { font-family: 'Roboto', system-ui, sans-serif; }
#fontFamily option[value="Playfair Display"]  { font-family: 'Playfair Display', serif; }
#fontFamily option[value="Merriweather"]      { font-family: 'Merriweather', serif; }

#messagesBotFilter:disabled {
  background-color: #f9fafb;
  color: #18181b;
  cursor: default;
  opacity: 1;
}
#messagesBotFilter,
label[for="messagesBotFilter"] {
  display: none;
}

/* Botones negros globales */
button.bg-black {
  background: #18181b;
  color: white !important;
  border: none !important;
  border-radius: 8px !important;
  transition: all 0.2s ease;
  font-weight: 400;
}
button.bg-black:hover {
  background: #27272a;
  color: white !important;
}

/* Días seleccionados */
.day.bg-black {
  background: #18181b !important;
  color: #fff !important;
  border: none !important;
  box-shadow: none !important;
}
.day.bg-black:hover {
  background: #18181b !important;
  color: #fff !important;
}

/* === Button variants === */
.btn-outline-dark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #d4d4d8;
  background: #fff;
  color: #18181b;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.btn-outline-dark:hover {
  background: #f4f4f5;
  border-color: #a1a1aa;
}

.btn-primary-dark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #18181b;
  background: #18181b;
  color: #fff;
  cursor: pointer;
  transition: background 0.12s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.btn-primary-dark:hover {
  background: #27272a;
}

.btn-ghost-danger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 7px;
  border: 1px solid #e4e4e7;
  background: #fff;
  color: #71717a;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.btn-ghost-danger:hover {
  color: #ef4444;
  background: #fee2e2;
  border-color: #fca5a5;
}

/* === Agent type select — mismo estilo que languageSelect === */
#agentTypeSelect {
  height: 34px;
  padding-left: 8px;
  padding-right: 8px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  font-size: 12px;
  color: #18181b;
  background: #fff;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

/* === Custom select dropdown === */
.custom-select {
  position: relative;
  display: inline-block;
}

.custom-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  color: #18181b;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease;
  min-width: 160px;
  justify-content: space-between;
}

.custom-select-trigger:hover {
  border-color: #d4d4d8;
}

.custom-select-trigger svg {
  flex-shrink: 0;
  color: #a1a1aa;
  transition: transform 0.15s ease;
}

.custom-select.open .custom-select-trigger {
  border-color: #a1a1aa;
}

.custom-select.open .custom-select-trigger svg {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 999;
  padding: 4px;
  flex-direction: column;
}

.custom-select.open .custom-select-dropdown {
  display: flex;
}

.custom-select-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  color: #18181b;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s ease;
}

.custom-select-option:hover {
  background: #f4f4f5;
}

.custom-select-option.selected {
  font-weight: 600;
  background: #f4f4f5;
}

/* === Agent save button — same size as custom-select-trigger === */
.agent-save-btn {
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: #18181b;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, opacity 0.2s ease;
}

.agent-save-btn:hover {
  background: #27272a;
}

/* ===================================
   CHAT PANEL — compact sections
   =================================== */

.cp-panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f4f4f5;
  font-size: 15px;
  font-weight: 700;
  color: #18181b;
}

.cp-panel-header-icon {
  width: 18px;
  height: 18px;
  color: #18181b;
}

.cp-panel-header-title {
  flex: 1;
}

.cp-divider {
  height: 1px;
  background: #f4f4f5;
  margin: 0;
}

.cp-section {
  padding: 0;
}

.cp-section-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  transition: background 0.12s;
  border-radius: 12px;
}
.cp-section-row:hover {
  background: #f4f4f5;
}
.cp-section.active .cp-section-row {
  background: #eeeef0;
}
.cp-section.active .cp-section-name {
  color: #000;
  font-weight: 700;
}

.cp-section-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.cp-section-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.cp-section-avatar-icon {
  width: 16px;
  height: 16px;
  color: #71717a;
}

.cp-section-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
}

.cp-section-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.cp-section-name {
  font-size: 13px;
  font-weight: 600;
  color: #18181b;
  white-space: nowrap;
}

.cp-section-preview {
  font-size: 12px;
  color: #a1a1aa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.cp-section-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cp-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.cp-edit-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #71717a;
  transition: color 0.12s, border-color 0.12s;
  flex-shrink: 0;
}
.cp-edit-btn:hover {
  color: #18181b;
  border-color: #a1a1aa;
}
.cp-edit-btn i {
  width: 13px;
  height: 13px;
}

.cp-section-body {
  padding: 0 1.25rem 0.75rem 4rem;
}

.cp-section-desc {
  font-size: 11px;
  color: #a1a1aa;
  line-height: 1.5;
}

.cp-font-select {
  height: 34px;
  border: 1px solid #e4e4e7;
  border-radius: 20px;
  padding: 0 0.75rem;
  font-size: 12px;
  font-weight: 500;
  background: #fff;
  color: #18181b;
  cursor: pointer;
  outline: none;
  transition: border-color 0.12s;
}
.cp-font-select:hover { border-color: #a1a1aa; }

/* Welcome image file picker */
.welcome-file-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border: 1px dashed #d4d4d8;
  border-radius: 10px;
  background: #fff;
  color: #52525b;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  width: 100%;
  justify-content: center;
}
.welcome-file-label:hover {
  border-color: #a1a1aa;
  background: #fafafa;
  color: #18181b;
}
.welcome-file-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ============================================================
   INTEGRATION ACCORDION
   ============================================================ */
.intg-accordion {
  display: flex;
  flex-direction: column;
  border: 1px solid #e4e4e7;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15,23,42,.06);
}

.intg-item {
  border-bottom: 1px solid #f0f0f0;
}
.intg-item:last-child { border-bottom: none; }

/* Header row */
.intg-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.35rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  gap: 1rem;
}
.intg-header:hover { background: #fafafa; }
.intg-item.open > .intg-header { background: #fafafa; }

.intg-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.intg-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #52525b;
  position: relative;
  overflow: hidden;
}
.intg-icon-wrap i { width: 16px; height: 16px; }

.intg-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.intg-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #18181b;
  line-height: 1.2;
}
.intg-subtitle {
  font-size: 12px;
  color: #a1a1aa;
  line-height: 1.3;
}

.intg-chevron {
  width: 16px;
  height: 16px;
  color: #a1a1aa;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.intg-item.open > .intg-header .intg-chevron {
  transform: rotate(180deg);
  color: #52525b;
}

/* Body - collapsed by default */
.intg-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1),
              padding 0.3s cubic-bezier(0.4,0,0.2,1),
              opacity 0.25s ease;
  padding: 0 1.35rem;
  opacity: 0;
}
.intg-item.open > .intg-body {
  max-height: 600px;
  padding: 0.25rem 1.35rem 1.35rem;
  opacity: 1;
}

/* intg-header-right: for chat sections with badge + toggle + chevron */
.intg-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Remove pointer cursor from static font row */
.intg-item[style*="cursor:default"] .intg-header:hover {
  background: transparent;
}

/* ============================================================
   USUARIOS TAB — Card-row design
   ============================================================ */

/* Header card */
.usr-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #f4f4f5;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 20px;
  padding: 1.1rem 1.35rem;
  box-shadow: 0 2px 10px rgba(15,23,42,.05);
}
.usr-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.usr-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f4f4f5;
  color: #52525b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.usr-header-icon i { width: 18px; height: 18px; }
.usr-header-title {
  font-size: 15px;
  font-weight: 700;
  color: #18181b;
  line-height: 1.2;
}
.usr-header-sub {
  font-size: 12px;
  color: #a1a1aa;
  margin-top: 2px;
}
.usr-badge-count {
  font-size: 13px;
  font-weight: 500;
  color: #71717a;
  white-space: nowrap;
}

/* List container */
.usr-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 20px;
  overflow: hidden;
  background: #f4f4f5;
  box-shadow: 0 2px 10px rgba(15,23,42,.05);
}

/* Individual row */
.usr-row {
  display: grid;
  grid-template-columns: 1fr 220px 160px;
  align-items: center;
  gap: 0;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #f4f4f5;
  transition: background 0.12s;
  position: relative;
}
.usr-row:last-child { border-bottom: none; }
.usr-row:hover { background: #fafafa; }

.usr-row-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

/* Avatar circle */
.usr-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff !important;
  border: 1.5px solid #e4e4e7;
  color: #18181b !important;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.usr-row-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.usr-row-email {
  font-size: 13.5px;
  font-weight: 500;
  color: #18181b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.usr-role-badge {
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  padding: 2px 8px;
  display: inline-block;
  width: fit-content;
}
.usr-role-badge.admin {
  background: #dcfce7;
  color: #166534;
}
.usr-role-badge.editor {
  background: #f4f4f5;
  color: #71717a;
}

/* Toggle group — center column */
.usr-toggles {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  justify-content: center;
}
.usr-toggle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.usr-toggle-label {
  font-size: 10px;
  font-weight: 500;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  user-select: none;
}

/* Toggle on/off contrast improvement */
.usr-toggle-item input.toggle:not(:checked) {
  background: #e4e4e7;
}
.usr-toggle-item input.toggle:checked {
  background: #18181b;
}

/* Last access */
.usr-last-access {
  font-size: 11.5px;
  color: #a1a1aa;
  white-space: nowrap;
  text-align: right;
  padding-right: 0.5rem;
  transition: opacity 0.15s;
}
.usr-row:hover .usr-last-access { opacity: 0; }

/* Action buttons — absolutely positioned, appear on hover over date area */
.usr-actions {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.usr-row:hover .usr-actions {
  opacity: 1;
  pointer-events: auto;
}

.usr-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #71717a;
  transition: background 0.12s, color 0.12s;
}
.usr-action-btn:hover {
  background: #f4f4f5;
  color: #18181b;
}
.usr-action-btn.danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* Empty state */
.usr-empty {
  padding: 2.5rem;
  text-align: center;
  color: #a1a1aa;
  font-size: 13px;
}

/* Section headers inside users list */
.usr-section-header {
  display: flex;
  align-items: center;
  padding: 10px 20px 6px;
  gap: 10px;
}
.usr-section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #f0f0f0;
}
.usr-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.usr-section-divider {
  padding-top: 4px;
  margin-top: 4px;
}

/* Invite card */
.usr-invite-card {
  background: #f4f4f5;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 20px;
  padding: 1.35rem;
  box-shadow: 0 2px 10px rgba(15,23,42,.05);
}
.usr-invite-title {
  font-size: 14px;
  font-weight: 600;
  color: #18181b;
  margin-bottom: 0.85rem;
}
.usr-invite-form {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
}
.usr-invite-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.usr-invite-input-icon {
  position: absolute;
  left: 0.85rem;
  width: 15px;
  height: 15px;
  color: #a1a1aa;
  pointer-events: none;
}
.usr-invite-input {
  width: 100%;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 0.6rem 0.85rem 0.6rem 2.4rem;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s;
  background: #fafafa;
}
.usr-invite-input:focus {
  border-color: #18181b;
  background: #fff;
}
.usr-invite-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  background: #18181b;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.usr-invite-btn:hover:not(:disabled) { background: #27272a; }
.usr-invite-btn:disabled { opacity: 1; background: #d4d4d8; color: #fff; cursor: not-allowed; }
.usr-invite-btn i { width: 13px; height: 13px; }

/* ============================================================
   COLORES PANEL — Compact row design
   ============================================================ */
.clr-card {
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(15,23,42,.06);
  overflow: hidden;
}

.clr-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.9rem;
  border-bottom: 1px solid #f0f0f0;
}
.clr-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 14px;
  font-weight: 700;
  color: #18181b;
}
.clr-card-title i { width: 16px; height: 16px; color: #52525b; }

.clr-modelos-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 5px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 20px;
  background: #fafafa;
  font-size: 12px;
  font-weight: 600;
  color: #52525b;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.clr-modelos-btn:hover {
  border-color: #a1a1aa;
  background: #fff;
  color: #18181b;
}
.clr-modelos-btn i { width: 13px; height: 13px; }

.clr-section {
  padding: 0.85rem 1.25rem;
}

.clr-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a1a1aa;
  margin-bottom: 0.65rem;
}

.clr-divider {
  height: 1px;
  background: #f4f4f5;
  margin: 0 1.25rem;
}

.clr-row {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Each color row */
.clr-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.clr-item:hover { background: #f9f9f9; }

/* Hidden native color input — overlaid on swatch */
.clr-input {
  position: absolute;
  opacity: 0;
  width: 34px;
  height: 34px;
  left: 0.65rem;
  cursor: pointer;
  border: none;
  padding: 0;
}

/* Visual swatch circle */
.clr-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.08);
  background: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  pointer-events: none;
  transition: transform 0.15s;
}
.clr-item:hover .clr-swatch { transform: scale(1.08); }

.clr-name {
  font-size: 13px;
  font-weight: 500;
  color: #3f3f46;
  flex: 1;
  pointer-events: none;
}

.clr-hex {
  font-size: 11px;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #a1a1aa;
  background: #f4f4f5;
  border-radius: 6px;
  padding: 2px 7px;
  pointer-events: none;
  transition: color 0.15s;
}
.clr-item:hover .clr-hex { color: #52525b; }

/* ============================================================
   WIDGET PANEL — Redesign
   ============================================================ */
.wgt-card {
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(15,23,42,.06);
  overflow: hidden;
}

.wgt-section {
  padding: 0.85rem 1.25rem;
}

/* Icon row */
.wgt-icon-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.wgt-icon-btn {
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.wgt-icon-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.wgt-icon-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #a1a1aa;
}

/* Radius slider row */
.wgt-radius-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.wgt-radius-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #71717a;
  white-space: nowrap;
  min-width: 75px;
}
.wgt-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #e4e4e7;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}
.wgt-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #18181b;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform 0.12s;
}
.wgt-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.wgt-radius-val {
  font-size: 12px;
  font-weight: 600;
  color: #52525b;
  min-width: 24px;
  text-align: right;
  font-family: 'SF Mono', monospace;
}

/* Position grid */
.wgt-position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.wgt-pos-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0.65rem 0.5rem;
  border: 2px solid #e4e4e7;
  border-radius: 14px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  color: #a1a1aa;
  font-size: 11px;
  font-weight: 500;
}
.wgt-pos-btn:hover {
  border-color: #a1a1aa;
  background: #f4f4f5;
  color: #52525b;
}
.wgt-pos-btn.active {
  border-color: #18181b;
  background: #18181b;
  color: #fff;
}
.wgt-pos-icon {
  width: 32px;
  height: 32px;
}

/* Color copy button */
.clr-hex-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}
.clr-copy-btn {
  pointer-events: all;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c4c4c8;
  opacity: 0;
  transition: opacity 0.15s, background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.clr-copy-btn i { width: 10px; height: 10px; }
.clr-item:hover .clr-copy-btn { opacity: 1; }
.clr-copy-btn:hover { background: #efefef; color: #52525b; }
.clr-copy-btn.copied { color: #16a34a; background: #dcfce7; opacity: 1; }

/* ============================================================
   BOT PANEL — Redesign
   ============================================================ */
.bot-card {
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(15,23,42,.06);
  overflow: hidden;
}

/* Status badge */
.bot-status-badge {
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
}
.bot-status-badge.active {
  background: #dcfce7;
  color: #16a34a;
}
.bot-status-badge.inactive {
  background: #f4f4f5;
  color: #a1a1aa;
}

/* Hero: avatar + name inline */
.bot-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}
.bot-avatar-btn {
  flex-shrink: 0;
  position: relative;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}
.bot-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  transition: transform 0.15s;
}
.bot-avatar-btn:hover .bot-avatar-img { transform: scale(1.05); }
.bot-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #18181b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.bot-name-wrap {
  flex: 1;
  min-width: 0;
}
.bot-name-display {
  font-size: 16px;
  font-weight: 700;
  color: #18181b;
  line-height: 1.2;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-name-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.bot-name-input {
  width: 100%;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 5px 28px 5px 10px;
  font-size: 13px;
  color: #3f3f46;
  background: #fafafa;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.bot-name-input:focus {
  border-color: #18181b;
  background: #fff;
}
.bot-name-edit-icon {
  position: absolute;
  right: 9px;
  width: 12px;
  height: 12px;
  color: #a1a1aa;
  pointer-events: none;
}

/* Section */
.bot-section {
  padding: 0.85rem 1.25rem;
}

/* Toggle rows */
.bot-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f9f9f9;
}
.bot-toggle-row:last-child { border-bottom: none; }
.bot-toggle-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 13px;
  font-weight: 500;
  color: #3f3f46;
}

/* Select rows */
.bot-select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f9f9f9;
}
.bot-select-row:last-child { border-bottom: none; }
.bot-select {
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  background: #fafafa;
  color: #18181b;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
  min-width: 60px;
}
.bot-select:focus { border-color: #18181b; }
.bot-select-tz {
  max-width: 160px;
  font-size: 11px;
}

/* ============================================================
   LEADS PANEL — Redesign
   ============================================================ */

/* Header card */
.leads-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f4f4f5;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 6px rgba(15,23,42,.05);
}
.leads-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.leads-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f4f4f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #52525b;
  flex-shrink: 0;
}
.leads-header-title {
  font-size: 15px;
  font-weight: 700;
  color: #18181b;
  line-height: 1.2;
}
.leads-header-sub {
  font-size: 12px;
  color: #a1a1aa;
  margin-top: 1px;
}
.leads-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.leads-count-badge {
  background: #18181b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 9px;
  min-width: 24px;
  text-align: center;
}
.leads-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #3f3f46;
  background: #fafafa;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.leads-export-btn:hover { background: #f4f4f5; border-color: #a1a1aa; }

/* Card container */
.leads-card {
  background: #f4f4f5;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(15,23,42,.06);
  overflow: hidden;
}

/* Row */
.leads-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f4f4f5;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.leads-row:last-child { border-bottom: none; }
.leads-row:hover { background: #fafafa; }
.leads-row:hover .leads-actions { opacity: 1; }

/* Avatar */
.leads-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* Info */
.leads-info {
  flex: 1;
  min-width: 0;
}
.leads-name {
  font-size: 13px;
  font-weight: 600;
  color: #18181b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leads-contact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2px;
}
.leads-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #71717a;
}
.leads-summary {
  font-size: 11px;
  color: #a1a1aa;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Meta */
.leads-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.leads-date {
  font-size: 11px;
  color: #a1a1aa;
  white-space: nowrap;
}
.leads-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.leads-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.leads-delete-btn { color: #f87171; }
.leads-delete-btn:hover { background: #fef2f2; color: #dc2626; }

/* Empty state */
.leads-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}
.leads-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #f4f4f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d4d4d8;
  margin-bottom: 1rem;
}
.leads-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: #3f3f46;
  margin-bottom: 4px;
}
.leads-empty-sub {
  font-size: 12px;
  color: #a1a1aa;
  max-width: 240px;
}

/* Detail modal */
.leads-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.leads-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  overflow: hidden;
}
.leads-modal-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.25rem;
  border-bottom: 1px solid #f4f4f5;
}
.leads-modal-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.leads-modal-name {
  font-size: 15px;
  font-weight: 700;
  color: #18181b;
}
.leads-modal-date {
  font-size: 12px;
  color: #a1a1aa;
  margin-top: 2px;
}
.leads-modal-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid #e4e4e7;
  background: #fafafa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #71717a;
  transition: background 0.12s;
}
.leads-modal-close:hover { background: #f4f4f5; }
.leads-modal-body { padding: 1.25rem; }
.leads-modal-contact { display: flex; flex-direction: column; gap: 0.5rem; }
.leads-modal-contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  color: #3f3f46;
}
.leads-modal-divider { height: 1px; background: #f4f4f5; margin: 1rem 0; }
.leads-modal-label {
  font-size: 11px;
  font-weight: 600;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.leads-modal-summary {
  font-size: 13px;
  color: #3f3f46;
  line-height: 1.6;
}

/* ============================================================
   PROMPT PANEL — Redesign
   ============================================================ */
.pmt-card {
  background: #f4f4f5;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(15,23,42,.06);
  overflow: hidden;
}

/* Active badge */
.pmt-active-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  padding: 4px 10px;
  background: #eff6ff;
  color: #3b82f6;
  white-space: nowrap;
}

/* Template row */
.pmt-template-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  flex-wrap: wrap;
}
.pmt-template-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.pmt-select .custom-select-trigger,
.pmt-select-trigger {
  border: 1px solid #e4e4e7 !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  background: #fafafa !important;
  color: #18181b !important;
  gap: 6px !important;
}
.pmt-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #18181b;
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  background: #18181b;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}
.pmt-save-btn:hover { opacity: 0.85; }

/* Editor wrapper */
.pmt-editor-wrap {
  border-top: none;
}
.pmt-toolbar {
  display: flex !important;
  align-items: center;
  padding: 0.5rem 1rem !important;
  border-bottom: 1px solid #f4f4f5;
  border-top: none;
  border-left: none;
  border-right: none;
  border-radius: 0 !important;
  background: #fafafa;
  gap: 4px;
}
.pmt-toolbar-spacer { flex: 1; }
.pmt-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #71717a;
}
.pmt-clear-btn span { font-size: 11px; }
.pmt-char-count {
  font-size: 11px;
  color: #a1a1aa;
  font-family: 'SF Mono', 'Fira Mono', monospace;
  white-space: nowrap;
  padding: 2px 8px;
  background: #f4f4f5;
  border-radius: 6px;
}
.pmt-editor {
  min-height: 360px;
  max-height: 520px;
  overflow-y: auto;
  padding: 1.25rem !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none;
  font-size: 13.5px;
  line-height: 1.7;
  color: #18181b;
}

/* Footer */
.pmt-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #f4f4f5;
  background: #fafafa;
}
.pmt-footer-desc {
  font-size: 11px;
  color: #a1a1aa;
}

/* Custom select dropdown icons */
.custom-select-option {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   PROMPT TOOLBAR — Redesign
   ============================================================ */
.pmt-toolbar {
  display: flex !important;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  background: #f9f9f9;
  border-bottom: 1px solid #f0f0f0;
  border-radius: 0;
  flex-wrap: wrap;
}
.pmt-tb-group {
  display: flex;
  align-items: center;
  gap: 1px;
}
.pmt-tb-sep {
  width: 1px;
  height: 16px;
  background: #e4e4e7;
  margin: 0 4px;
  flex-shrink: 0;
}
.pmt-tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #52525b;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  flex-shrink: 0;
}
.pmt-tb-btn:hover { background: #e4e4e7; color: #18181b; }
.pmt-tb-btn.active,
.pmt-tb-btn[aria-pressed="true"] { background: #18181b; color: #fff; }
.pmt-tb-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Clear button — text + icon pill */
.pmt-tb-clear {
  width: auto !important;
  padding: 0 10px;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: #71717a;
  border: 1px solid #e4e4e7;
  background: #fff;
}
.pmt-tb-clear:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}
.pmt-tb-clear span { font-size: 11px; line-height: 1; }

/* ============================================================
   KNOWLEDGE — + Añadir dropdown, Search, Summary
   ============================================================ */

/* + Añadir button */
.knw-add-wrap { position: relative; display: inline-block; }
.knw-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #18181b;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.knw-add-btn:hover { opacity: 0.85; }
.knw-add-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 175px;
  overflow: hidden;
  z-index: 200;
  display: none;
}
.knw-add-dropdown.open { display: block; }
.knw-add-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #3f3f46;
  background: none;
  border: none;
  border-bottom: 1px solid #f4f4f5;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.knw-add-option:last-child { border-bottom: none; }
.knw-add-option:hover { background: #f4f4f5; }

/* Search */
.knw-search-wrap {
  position: relative;
  padding: 8px 8px 4px;
}
.knw-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-25%);
  width: 12px;
  height: 12px;
  color: #a1a1aa;
  pointer-events: none;
}
.knw-search-input {
  width: 100%;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 8px 8px 8px 28px;
  font-size: 12px;
  background: #fff;
  color: #3f3f46;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.knw-search-input:focus { border-color: #18181b; }

/* Summary */
.knw-summary {
  margin-bottom: 4px;
}
.knw-summary:empty { display: none; }
.knw-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
}
.knw-summary-row:last-child { }
.knw-summary-left {
  display: flex;
  align-items: center;
  gap: 7px;
}
.knw-summary-label {
  font-size: 12px;
  font-weight: 500;
  color: #3f3f46;
}
.knw-summary-size {
  font-size: 11px;
  color: #a1a1aa;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   KNOWLEDGE — outer two-column layout
   ============================================================ */
.knw-outer-layout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 1060px;
}

/* Nav sidebar: search + page tabs, outside the card */
.knw-nav-col {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.knw-nav-col .knw-search-wrap {
  padding: 10px 10px 6px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.knw-nav-col .knowledge-tabs {
  padding: 6px 0;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
/* Left column: nav card + summary card stacked */
.knw-left-col {
  width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 120px);
}
/* Summary as separate card below nav */
.knw-nav-summary-card {
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 12px 12px 10px;
  flex-shrink: 0;
}

.knw-main-col {
  flex: 1;
  min-width: 0;
}
.knw-summary-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.knw-summary { }
.knw-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f4f4f5;
}
.knw-summary-row:last-child { border-bottom: none; }
.knw-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.knw-summary-label {
  font-size: 12px;
  font-weight: 500;
  color: #3f3f46;
}
.knw-summary-size {
  font-size: 11px;
  color: #a1a1aa;
  font-variant-numeric: tabular-nums;
}
.knw-summary-empty {
  font-size: 12px;
  color: #d4d4d8;
  text-align: center;
  padding: 8px 0;
}

/* knowledge-layout inside card: now just the content area, no sidebar */
.knowledge-layout {
  display: flex;
  gap: 16px;
}
.knowledge-content {
  flex: 1;
  min-width: 0;
}

@media (max-width: 768px) {
  .knw-outer-layout { flex-direction: column; }
  .knw-left-col { width: 100%; position: static; max-height: none; }
  .knw-nav-col { width: 100%; position: static; max-height: none; }
}

/* Source inline in footer */
.ke-source-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #a1a1aa;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.ke-source-inline .ke-source-label {
  color: #a1a1aa;
  white-space: nowrap;
}
.ke-source-inline a {
  color: #18181b;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.ke-source-inline a:hover { text-decoration: underline; }

/* Sidebar spacer: matches ke-title-section actual rendered height */
.knw-sidebar-spacer {
  height: 19px;
  flex-shrink: 0;
}

/* ============================================================
   ACCORDION
   ============================================================ */
.acc-card {
  overflow: hidden;
  padding: 0 !important;
  background: #fff !important;
  border: 1px solid #e4e4e7 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.04) !important;
}
.acc-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 12px;
  transition: background 0.12s;
}
.acc-header:hover { background: #fafafa; }
.acc-chevron {
  width: 16px;
  height: 16px;
  color: #a1a1aa;
  flex-shrink: 0;
  transition: transform 0.22s ease;
}
.acc-card.open .acc-chevron { transform: rotate(180deg); }
.acc-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}
.acc-card.open .acc-body { grid-template-rows: 1fr; }
.acc-body > .acc-content {
  overflow: hidden;
  padding: 0 20px 20px;
  border-top: 1px solid #f0f0f0;
}

/* ── Create user form ── */
.usr-create-form {
  flex-wrap: wrap;
  align-items: center;
}
.usr-create-form .usr-invite-input-wrap { flex: 1; min-width: 140px; }
.usr-create-toggles {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.usr-create-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: #52525b;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.usr-toggle-wrap { position: relative; display: flex; align-items: center; }
.usr-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.usr-toggle-track {
  display: block;
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: #d4d4d8;
  transition: background .2s;
  position: relative;
}
.usr-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.usr-toggle-input:checked + .usr-toggle-track { background: #18181b; }
.usr-toggle-input:checked + .usr-toggle-track::after { transform: translateX(15px); }
