/* URSA — white workspace, graphite typography, compact conversation list. */
:root {
  color-scheme: light;
  --bg-base: #fff; --bg-surface: #fff; --bg-card: #fff; --bg-card-hover: #f7f7f7;
  --text-primary: #171717; --text-secondary: #484848; --text-muted: #737373;
  --border-subtle: #ededed; --border-medium: #dedede; --border-strong: #b5b5b5; --border-focus: #343434;
  --accent-blue: #292929; --accent-indigo: #292929; --accent-emerald: #343434;
  --accent-amber: #525252; --accent-rose: #262626; --accent-cyan: #404040;
  --shadow-subtle: none; --shadow-card: 0 2px 8px #00000005;
}
body.graphite-theme { background: #fff; color: #171717; font-family: Inter, 'Segoe UI', sans-serif; }
.graphite-theme :is(h1,h2,h3,h4,h5,h6) { font-family: inherit; color: #171717; }
.graphite-theme :is(.logo-icon,.auth-logo-badge,.empty-icon,.model-icon) { display: none !important; }
.graphite-theme .app-container { background: #fff; height: 100dvh; }
/* Sidebar Styles: Apple / Instagram White Aesthetic */
.graphite-theme .sidebar,
.sidebar {
  width: 240px !important;
  min-width: 240px !important;
  max-width: 240px !important;
  padding: 0 !important;
  background: #ffffff !important;
  border-right: 1px solid #e5e5ea !important;
  color: #1d1d1f !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100dvh !important;
  box-sizing: border-box !important;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), padding 0.22s ease !important;
  z-index: 20 !important;
  position: relative !important;
  flex-shrink: 0 !important;
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.04) !important;
}

/* Sidebar Collapsed: Instagram-style White Rail (72px) */
.graphite-theme .sidebar.collapsed,
.sidebar.collapsed {
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  padding: 12px 6px !important;
  background: #ffffff !important;
  border-right: 1px solid #e5e5ea !important;
  overflow: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.graphite-theme .sidebar-header,
.sidebar-header {
  padding: 20px 16px 14px 16px !important;
  border: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border-bottom: 1px solid #f2f2f7 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.graphite-theme .brand-logo,
.brand-logo {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.graphite-theme .ursa-logo-badge,
.ursa-logo-badge {
  width: 40px !important;
  height: 40px !important;
  background: #ffffff !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid #e5e5ea !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  flex-shrink: 0 !important;
  padding: 3px !important;
}

.ursa-logo-badge img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.graphite-theme .brand-info,
.brand-info {
  display: flex !important;
  flex-direction: column !important;
}

.graphite-theme .brand-info h2,
.brand-info h2 {
  color: #1d1d1f !important;
  font-size: 18px !important;
  letter-spacing: -0.02em !important;
  font-weight: 800 !important;
  margin: 0 !important;
  line-height: 1.1 !important;
}

.graphite-theme .brand-caption,
.brand-caption {
  display: block !important;
  margin-top: 2px !important;
  color: #86868b !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

.graphite-theme .sidebar-nav,
.sidebar-nav {
  padding: 8px 10px 16px 10px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  flex: 1 !important;
  overflow-y: auto !important;
  scrollbar-width: none !important;
}
.graphite-theme .sidebar-nav::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
  display: none !important;
}

.graphite-theme .sidebar-group-label,
.sidebar-group-label {
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: #86868b !important;
  padding: 14px 10px 6px 10px !important;
  margin: 0 !important;
  white-space: nowrap !important;
  user-select: none !important;
}

.graphite-theme .nav-item,
.nav-item {
  display: flex !important;
  align-items: center !important;
  gap: 11px !important;
  min-height: 40px !important;
  padding: 8px 12px !important;
  margin: 1px 0 !important;
  border-radius: 9px !important;
  color: #424245 !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  width: 100% !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  text-align: left !important;
}

.graphite-theme .nav-item:hover,
.nav-item:hover {
  background: #f5f5f7 !important;
  color: #1d1d1f !important;
  transform: none !important;
}

.graphite-theme .nav-item.active,
.nav-item.active {
  background: #f5f5f7 !important;
  color: #1d1d1f !important;
  font-weight: 600 !important;
  box-shadow: inset 0 0 0 1px #e5e5ea !important;
}

.graphite-theme .sidebar-item-icon,
.sidebar-item-icon {
  width: 20px !important;
  height: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  color: #86868b !important;
  transition: color 0.15s ease !important;
}

.graphite-theme .nav-item:hover .sidebar-item-icon,
.nav-item:hover .sidebar-item-icon {
  color: #1d1d1f !important;
}

.graphite-theme .nav-item.active .sidebar-item-icon,
.nav-item.active .sidebar-item-icon {
  color: #d97706 !important;
}

.graphite-theme .sidebar-item-icon svg,
.sidebar-item-icon svg {
  width: 17px !important;
  height: 17px !important;
  stroke: currentColor !important;
}

.graphite-theme .sidebar-item-label,
.sidebar-item-label {
  flex: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.graphite-theme .sidebar-item-dot,
.sidebar-item-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  margin-left: auto !important;
  flex-shrink: 0 !important;
}
.graphite-theme .sidebar-item-dot.dot-live,
.sidebar-item-dot.dot-live {
  background: #10b981 !important;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7) !important;
}
.graphite-theme .sidebar-item-dot.dot-info,
.sidebar-item-dot.dot-info {
  background: #38bdf8 !important;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.7) !important;
}

/* User Profile card at the bottom of sidebar */
.graphite-theme .sidebar-footer,
.sidebar-footer {
  margin-top: auto !important;
  padding: 10px 12px 14px 12px !important;
  border-top: 1px solid #f2f2f7 !important;
  background: #ffffff !important;
}

.graphite-theme .sidebar-user-card,
.sidebar-user-card {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 10px !important;
  border-radius: 9px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

.graphite-theme .sidebar-user-avatar,
.sidebar-user-avatar {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #e2e8f0 !important;
  color: #1e293b !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-transform: lowercase !important;
  flex-shrink: 0 !important;
  border: 1px solid #cbd5e1 !important;
}

.graphite-theme .sidebar-user-info,
.sidebar-user-info {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.graphite-theme .sidebar-user-name,
.sidebar-user-name {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: #1d1d1f !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.graphite-theme .sidebar-user-role,
.sidebar-user-role {
  font-size: 10.5px !important;
  color: #86868b !important;
  line-height: 1.2 !important;
}

.graphite-theme .btn-sidebar-logout,
.btn-sidebar-logout {
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
  background: transparent !important;
  border: none !important;
  color: #86868b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
}

.graphite-theme .btn-sidebar-logout:hover,
.btn-sidebar-logout:hover {
  background: #fee2e2 !important;
  color: #dc2626 !important;
}

/* ========================================================
   ESTADO CONTRAÍDO (INSTAGRAM / APPLE RAIL STYLE)
   ======================================================== */
.sidebar.collapsed,
.graphite-theme .sidebar.collapsed {
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  padding: 14px 6px !important;
  background: #ffffff !important;
  border-right: 1px solid #e5e5ea !important;
  overflow: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), padding 0.22s ease !important;
}

.sidebar.collapsed .brand-info,
.graphite-theme .sidebar.collapsed .brand-info,
.sidebar.collapsed .sidebar-group-label,
.graphite-theme .sidebar.collapsed .sidebar-group-label,
.sidebar.collapsed .sidebar-item-label,
.graphite-theme .sidebar.collapsed .sidebar-item-label,
.sidebar.collapsed .sidebar-user-info,
.graphite-theme .sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .btn-sidebar-logout,
.graphite-theme .sidebar.collapsed .btn-sidebar-logout,
.sidebar.collapsed .btn-sidebar-collapse,
.graphite-theme .sidebar.collapsed .btn-sidebar-collapse {
  display: none !important;
}

.sidebar.collapsed .sidebar-header,
.graphite-theme .sidebar.collapsed .sidebar-header {
  padding: 6px 0 14px 0 !important;
  margin-bottom: 6px !important;
  border-bottom: 1px solid #f2f2f7 !important;
  display: flex !important;
  justify-content: center !important;
}

.sidebar.collapsed .brand-logo,
.graphite-theme .sidebar.collapsed .brand-logo {
  justify-content: center !important;
  width: 100% !important;
  margin: 0 auto !important;
}

.sidebar.collapsed .ursa-logo-badge,
.graphite-theme .sidebar.collapsed .ursa-logo-badge {
  width: 42px !important;
  height: 42px !important;
  margin: 0 auto !important;
  cursor: pointer !important;
  transition: transform 0.18s ease !important;
}
.sidebar.collapsed .ursa-logo-badge:hover,
.graphite-theme .sidebar.collapsed .ursa-logo-badge:hover {
  transform: scale(1.08) !important;
}

.sidebar.collapsed .sidebar-nav,
.graphite-theme .sidebar.collapsed .sidebar-nav {
  padding: 4px 0 !important;
  gap: 6px !important;
  align-items: center !important;
}

.sidebar.collapsed .nav-item,
.graphite-theme .sidebar.collapsed .nav-item {
  width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  padding: 0 !important;
  margin: 2px auto !important;
  justify-content: center !important;
  border-radius: 12px !important;
  position: relative !important;
}

.sidebar.collapsed .nav-item:hover,
.graphite-theme .sidebar.collapsed .nav-item:hover {
  background: #f5f5f7 !important;
  transform: scale(1.08) !important;
}

.sidebar.collapsed .nav-item.active,
.graphite-theme .sidebar.collapsed .nav-item.active {
  background: #fff8eb !important;
  box-shadow: inset 0 0 0 1px #fde68a !important;
}
.sidebar.collapsed .nav-item.active .sidebar-item-icon,
.graphite-theme .sidebar.collapsed .nav-item.active .sidebar-item-icon {
  color: #d97706 !important;
}

.sidebar.collapsed .sidebar-item-icon,
.graphite-theme .sidebar.collapsed .sidebar-item-icon {
  width: 22px !important;
  height: 22px !important;
  margin: 0 !important;
}

.sidebar.collapsed .sidebar-item-dot,
.graphite-theme .sidebar.collapsed .sidebar-item-dot {
  position: absolute !important;
  top: 9px !important;
  right: 9px !important;
  width: 7px !important;
  height: 7px !important;
  margin: 0 !important;
}

.sidebar.collapsed .sidebar-footer,
.graphite-theme .sidebar.collapsed .sidebar-footer {
  padding: 10px 0 !important;
  border-top: 1px solid #f2f2f7 !important;
  background: transparent !important;
  display: flex !important;
  justify-content: center !important;
}

.sidebar.collapsed .sidebar-user-card,
.graphite-theme .sidebar.collapsed .sidebar-user-card {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  justify-content: center !important;
}

.sidebar.collapsed .sidebar-user-avatar,
.graphite-theme .sidebar.collapsed .sidebar-user-avatar {
  width: 36px !important;
  height: 36px !important;
  margin: 0 auto !important;
  cursor: pointer !important;
  transition: transform 0.15s ease !important;
}
.sidebar.collapsed .sidebar-user-avatar:hover,
.graphite-theme .sidebar.collapsed .sidebar-user-avatar:hover {
  transform: scale(1.08) !important;
}

.graphite-theme .sidebar-resizer { width: 3px; background: transparent; }
.graphite-theme .main-content { min-width: 0; background: #fff; }
.graphite-theme .top-header { background: #fff; border-bottom: 1px solid #eee; padding: 16px 24px; gap: 12px; flex-wrap: wrap; }
.graphite-theme .header-actions { gap: 8px; flex-wrap: wrap; }
.graphite-theme :is(.card,.modal-card,.auth-card) { border: 1px solid #e7e7e7; background: #fff; box-shadow: 0 2px 12px #00000004; }
.graphite-theme :is(button,.btn) { font-family: inherit; }
.graphite-theme :is(.btn,.btn-secondary,.btn-outline,.btn-action-light,.btn-mark-all-read,.btn-mode-pill,.btn-global-ai-master,.btn-logout) { background: #fff; color: #343434; border-color: #dedede; box-shadow: none; }

/* Botón 3 puntitos verticales para expandir/colapsar sidebar */
.btn-sidebar-toggle,
.conv-title-wrap .btn-sidebar-toggle,
.graphite-theme .btn-sidebar-toggle,
.graphite-theme .conv-title-wrap .btn-sidebar-toggle {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 2px !important;
  width: 22px !important;
  height: 28px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  color: #374151 !important;
  border-radius: 4px !important;
  outline: none !important;
  transition: opacity 0.15s ease, color 0.15s ease !important;
}

.btn-sidebar-toggle:hover,
.conv-title-wrap .btn-sidebar-toggle:hover,
.graphite-theme .btn-sidebar-toggle:hover,
.graphite-theme .conv-title-wrap .btn-sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #111827 !important;
  border: none !important;
}

.btn-sidebar-toggle svg,
.conv-title-wrap .btn-sidebar-toggle svg,
.graphite-theme .btn-sidebar-toggle svg,
.graphite-theme .conv-title-wrap .btn-sidebar-toggle svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  fill: currentColor !important;
}
body.graphite-theme :is(.btn-primary,.btn-auth-submit) { background: #242424 !important; color: #fff !important; border: 1px solid #242424; box-shadow: none; border-radius: 8px; }
body.graphite-theme :is(.btn-primary,.btn-auth-submit) span { color: inherit !important; }
body.graphite-theme :is(.btn-primary,.btn-auth-submit):hover { background: #454545 !important; }
body.graphite-theme button.text-control { width: auto !important; height: auto !important; min-width: 32px; min-height: 30px; padding: 6px 9px !important; font-size: 11px !important; border-radius: 6px; line-height: 1.3; flex-shrink: 0; }
.graphite-theme .control-text { white-space: nowrap; }
.graphite-theme :is(input,textarea,select) { background: #fff; color: #242424; border-color: #dedede; accent-color: #333; caret-color: #222; }
.graphite-theme :is(input,textarea)::placeholder { color: #858585; opacity: 1; }
.graphite-theme :is(button,a,input,textarea,select,[tabindex]):focus-visible { outline: 2px solid #555; outline-offset: 3px; box-shadow: none; }
.graphite-theme button:disabled { opacity: .45; cursor: not-allowed; }
.graphite-theme :is(.badge-hot,.agent-badge,.user-auth-badge,.response-mode-segmented,.model-selector-wrap) { background: #f3f3f3; color: #494949; border-color: #e5e5e5; box-shadow: none; }
body.graphite-theme .inbox-grid { display: flex !important; background: #fff !important; height: 100dvh !important; max-height: 100dvh !important; gap: 0; }
body.graphite-theme .conv-sidebar { width: 354px !important; min-width: 310px !important; max-width: 440px; padding: 0 !important; background: #fff !important; border: 0 !important; border-right: 1px solid #e7e7e7 !important; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; }
.graphite-theme .conv-header { background: #fff; padding: 24px 18px 12px; border-bottom: 1px solid #ededed; gap: 0; }
.graphite-theme .conv-header-top { gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.graphite-theme .conv-title-wrap h3 { color: #171717; font-size: 18px; font-weight: 650; }
.graphite-theme .btn-mark-all-read { font-size: 10px; border: 0; color: #737373; padding: 4px; }
.graphite-theme .search-conv-box { background: #f5f5f5; border: 0; border-radius: 8px; padding: 0; }
.graphite-theme .search-conv-box input { background: transparent; border: 0; padding: 11px 12px !important; font-size: 12px; box-shadow: none; }
.graphite-theme .channel-filter { display: flex; gap: 6px; padding: 12px 0 0; background: transparent; flex-wrap: wrap; }
.graphite-theme :is(.filter-btn,.crm-pill-filter,.crm-filter-btn) { background: transparent; color: #737373; border: 0; padding: 6px 10px; font-size: 11px; border-radius: 5px; box-shadow: none; }
.graphite-theme :is(.filter-btn,.crm-pill-filter,.crm-filter-btn).active { background: #ededed; color: #1b1b1b; font-weight: 650; }
.graphite-theme .crm-pipeline-filter { display: flex; gap: 4px; padding: 8px 0 0; background: transparent; overflow-x: auto; scrollbar-width: thin; border: 0; }
.graphite-theme .crm-pipeline-filter button { flex-shrink: 0; font-size: 10px; padding: 5px 7px; }
.graphite-theme .conv-list { gap: 0; padding: 0; overflow-x: hidden; }
body.graphite-theme .conv-item { position: relative; display: flex; flex-direction: row; align-items: center; gap: 12px; flex: 0 0 auto; min-height: 86px; padding: 15px 18px; margin: 0; border: 0; border-bottom: 1px solid #f0f0f0; border-radius: 0; background: #fff; box-shadow: none; transform: none; }
body.graphite-theme .conv-item:hover { background: #fafafa; box-shadow: none; transform: none; }
body.graphite-theme .conv-item.active { background: #f1f1f1; box-shadow: inset 3px 0 #343434; }
.graphite-theme .conv-avatar { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-width: 40px; border-radius: 50%; background: #ededed !important; color: #555; font-size: 12px; font-weight: 600; box-shadow: none; }
.graphite-theme .conv-content { flex: 1; min-width: 0; }
.graphite-theme .conv-row-top,.graphite-theme .conv-row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.graphite-theme .conv-contact-name { color: #202020; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.graphite-theme .conv-contact-label { display: block; color: #777; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.graphite-theme .conv-time { color: #858585; font-size: 10px; flex-shrink: 0; }
.graphite-theme .conv-row-bottom { margin-top: 4px; }
.graphite-theme .conv-snippet-wrapper { display: flex; min-width: 0; flex: 1; gap: 3px; }
.graphite-theme .conv-snippet-text { color: #777; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graphite-theme .conv-row-meta { display: flex; gap: 5px; align-items: center; }
.graphite-theme .wa-unread-badge { background: #333; color: #fff; min-width: 18px; height: 18px; padding: 1px 5px; border-radius: 20px; font-size: 10px; text-align: center; }
.graphite-theme .has-unread .conv-contact-name { font-weight: 750; color: #111; }
.graphite-theme .has-unread .conv-snippet-text { color: #333; }
.graphite-theme .wa-ai-dot { display: inline-flex; background: transparent; color: #737373; border: 0; padding: 2px 0; font-size: 9px; cursor: pointer; white-space: nowrap; }
.graphite-theme .conv-item .btn-del-item { position: absolute; right: 12px; bottom: 5px; opacity: 0; pointer-events: none; background: #fff; color: #555; }
.graphite-theme .conv-item:is(:hover,:focus-within) .btn-del-item { opacity: 1; pointer-events: auto; }
.graphite-theme .conv-item:is(:hover,:focus-within) .conv-row-bottom { padding-right: 62px; }
.graphite-theme .conv-section-header { background: #fafafa; color: #777; font-size: 10px; padding: 12px 18px; }
body.graphite-theme .chat-viewport { background: #fff !important; flex: 1; min-width: 0 !important; border: 0; border-radius: 0; box-shadow: none; }
.graphite-theme .chat-view-header { background: #fff; padding: 16px 24px; height: auto; min-height: 76px; overflow: visible; border-bottom: 1px solid #ededed; flex-wrap: wrap; gap: 12px; }
.graphite-theme .chat-contact-info h3 { font-size: 15px; color: #202020; max-width: 280px; }
.graphite-theme #chat-contact-name { max-width: 260px; }
.graphite-theme .chat-contact-info { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; gap: 3px; }
.graphite-theme #back-to-inbox { display: none; }
.graphite-theme .chat-contact-info p { color: #777; font-size: 11px; }
.graphite-theme .avatar-circle { background: #efefef !important; color: #444 !important; border: 0; box-shadow: none; width: 36px; height: 36px; }
.graphite-theme .chat-controls,.graphite-theme .chat-global-tools { flex-wrap: wrap; gap: 7px; }
.graphite-theme .chat-controls { margin-left: auto; }
.graphite-theme .btn-label-text { display: inline !important; }
.graphite-theme .lead-tracking-banner { margin: 0; padding: 12px 24px; background: #fafafa !important; color: #555 !important; border: 0; border-bottom: 1px solid #ededed; border-radius: 0; font-size: 11px; }
.graphite-theme .banner-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.graphite-theme .btn-banner-action { background: #fff; color: #444; border: 1px solid #ddd; border-radius: 5px; padding: 6px 10px; font-size: 11px; cursor: pointer; }
.graphite-theme .messages-container { background: #fcfcfc; background-image: none; padding: 28px; min-height: 0; }
.graphite-theme .chat-bubble { max-width: 76%; padding: 12px 16px; box-shadow: none; border: 1px solid #e7e7e7; font-size: 14px; color: #262626; }
.graphite-theme .chat-bubble.contact { background: #fff; border-radius: 12px 12px 12px 3px; }
.graphite-theme .chat-bubble.contact.is-unread-msg { box-shadow: none !important; border-color: #d5d5d5 !important; }
.graphite-theme .chat-bubble:is(.ai,.seller) { background: #ededed; border-color: #ededed; border-radius: 12px 12px 3px 12px; }
.graphite-theme .bubble-author { color: #555 !important; font-size: 10px; }
.graphite-theme .bubble-text { color: #262626; }
.graphite-theme .bubble-time { color: #777; font-size: 10px; }
.graphite-theme :is(.bubble-date-label,.bubble-date-sep,.bubble-time-label) { color: #858585; background: transparent; border: 0; box-shadow: none; font-size: 10px; }
.graphite-theme .chat-composer { background: #fff; border-top: 1px solid #eee; padding: 16px 24px; gap: 12px; }
.graphite-theme #manual-message-input { background: #f6f6f6; color: #222; border: 1px solid #eee; border-radius: 8px; padding: 12px 14px; font-size: 13px; }
.graphite-theme .empty-state { padding: 32px; color: #777; font-size: 13px; }
.graphite-theme .empty-state::before { content: 'Tus conversaciones, en un solo lugar'; color: #333; font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
.graphite-theme .top-header { box-shadow: none; }
.graphite-theme .auth-overlay { background: #f5f5f5; }
.graphite-theme .auth-card { border: 0; padding: 36px 32px; border-radius: 16px; box-shadow: 0 20px 64px #0000000c; }
.graphite-theme .auth-card-header { margin-bottom: 28px; }
.graphite-theme .auth-card-header h2 { color: #222; }
.graphite-theme .auth-subtitle { color: #777; margin-top: 8px; }
/* Login: one underline, no nested field boxes or external focus ring. */
body.graphite-theme #login-form :is(.form-group,.password-input-wrapper) {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
body.graphite-theme #login-form :is(#login-username,#login-password) {
  appearance: none;
  min-height: 48px;
  padding-left: 0;
  border: 0 !important;
  border-bottom: 1px solid #b5b5b5 !important;
  border-radius: 0 !important;
  background: transparent !important;
  outline: 0 !important;
  box-shadow: none !important;
}
body.graphite-theme #login-form :is(#login-username,#login-password):is(:focus,:focus-visible) {
  border-bottom-color: #171717 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
body.graphite-theme #btn-toggle-login-pwd {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  right: 0;
}
body.graphite-theme #btn-toggle-login-pwd:focus-visible { outline: 0; text-decoration: underline; }
.graphite-theme #login-password { padding-right: 90px !important; }
.graphite-theme .auth-card-footer { border: 0; padding-top: 0; color: #777; }
@media (max-width: 1100px) {
  .graphite-theme .sidebar { width: 210px; min-width: 210px; padding-inline: 10px; }
  body.graphite-theme .conv-sidebar { width: 320px !important; min-width: 280px !important; }
  .graphite-theme .chat-view-header { padding: 14px 16px; }
}
@media (max-width: 760px) {
  body.graphite-theme .main-content { width: 100% !important; max-width: 100vw; min-width: 0 !important; }
  .graphite-theme .sidebar-resizer { display: none !important; }
  .graphite-theme .sidebar:not(.collapsed) { position: absolute; inset: 0 auto 0 0; width: 220px; box-shadow: 16px 0 48px #0002; }
  body.graphite-theme .inbox-grid { flex-direction: column !important; }
  body.graphite-theme .conv-sidebar { width: 100% !important; min-width: 0 !important; max-width: none; height: 100dvh !important; min-height: 0; flex-shrink: 0; border-right: 0 !important; }
  .graphite-theme .conv-header { padding: 14px 16px 8px; }
  .graphite-theme .conv-header-top { margin-bottom: 10px; }
  body.graphite-theme .chat-viewport { display: none !important; width: 100% !important; height: 100dvh !important; min-height: 0; max-height: 100dvh !important; }
  body.graphite-theme.conversation-open .conv-sidebar { display: none !important; }
  body.graphite-theme.conversation-open .chat-viewport { display: flex !important; }
  .graphite-theme .conv-resizer { display: none !important; }
  .graphite-theme #back-to-inbox { display: inline-flex; background: #fff; color: #333; border: 1px solid #ddd; border-radius: 6px; padding: 7px 10px; font-size: 11px; }
  .graphite-theme .chat-view-header { padding: 10px 14px; gap: 8px; }
  .graphite-theme .chat-global-tools { display: none !important; }
  .graphite-theme .messages-container { padding: 16px; }
  .graphite-theme .chat-bubble { max-width: 90%; }
  .graphite-theme .chat-composer { padding: 10px 12px; }
  .graphite-theme .lead-tracking-banner { padding: 8px 14px; }
  .graphite-theme .auth-card { padding: 30px 24px; }
  .graphite-theme .modal-card { max-width: calc(100vw - 24px) !important; }
}
@media (prefers-reduced-motion: reduce) {
  .graphite-theme *, .graphite-theme *::before, .graphite-theme *::after { animation: none !important; transition: none !important; }
}
