/* KoreOS brandbook over Chatwoot compiled packs (v4.17+).
   Tokens: vm/marketing/BRAND-BOOK.md · vm/frontend/src/styles/tokens.css
   Primary baked in Chatwoot is #2781F6 (n-brand). Remap at runtime. */

:root {
  --kore-primary: #059669;
  --kore-primary-dark: #047857;
  --kore-emerald: #10b981;
  --kore-teal: #06b6d4;
  --kore-primary-rgb: 5 150 105;
  --kore-primary-dark-rgb: 4 120 87;

  /* Brand blue scale → emerald */
  --blue-3: 209 250 229;
  --blue-4: 167 243 208;
  --blue-5: 110 231 183;
  --blue-6: 52 211 153;
  --blue-7: 16 185 129;
  --blue-8: 5 150 105;
  --blue-9: 5 150 105;
  --blue-10: 4 120 87;
  --blue-11: 4 120 87;
  --blue-12: 6 78 59;

  --iris-9: 5 150 105;
  --iris-10: 4 120 87;
  --iris-11: 4 120 87;

  --solid-blue: 209 250 229;
  --solid-blue-2: 236 253 245;
  --solid-iris: 209 250 229;
  --text-blue: 30 31 39;
  --border-blue: 5, 150, 105, 0.5;
  --border-blue-strong: 4 120 87;

  --background-color: 248 250 252;
  --border-strong: 226 232 240;
  --border-weak: 241 245 249;
}

.dark {
  --blue-3: 6 78 59;
  --blue-4: 6 95 70;
  --blue-5: 4 120 87;
  --blue-6: 5 150 105;
  --blue-7: 16 185 129;
  --blue-8: 52 211 153;
  --blue-9: 5 150 105;
  --blue-10: 16 185 129;
  --blue-11: 110 231 183;
  --blue-12: 209 250 229;

  --iris-9: 5 150 105;
  --iris-10: 16 185 129;
  --iris-11: 110 231 183;

  --solid-blue: 6 78 59;
  --solid-blue-2: 30 31 39;
  --solid-iris: 6 78 59;
  --text-blue: 232 237 242;
  --border-blue: 5, 150, 105, 0.45;
  --border-blue-strong: 167 243 208;

  --background-color: 23 24 30;
  --surface-1: 30 31 39;
  --surface-2: 30 31 39;
  --card-color: 30 31 39;
  --border-strong: 44 45 56;
  --border-weak: 37 38 47;
}

/* Tailwind gera tokens inteiros: `bg-n-brand`, `after:bg-n-brand`, `bg-n-brand/10`.
   [class*="bg-n-brand"] casa TODOS e pinta o elemento pai. Nas abas Mine/Todos
   a classe é `after:bg-n-brand` (só o underline) + `text-n-blue-11`. O fundo
   virava verde e o texto também: rótulo invisível no claro e no escuro.
   Use [class~="token"] (palavra inteira). Nunca substring. */

[class~="bg-n-brand"],
[class~="bg-woot-500"],
[class~="bg-woot-600"],
[class~="bg-n-iris-9"],
[class~="!bg-n-brand"] {
  background-color: var(--kore-primary) !important;
  color: #fff !important;
}

[class~="bg-n-brand"] [class~="text-white"],
[class~="bg-woot-500"] [class~="text-white"],
[class~="bg-woot-600"] [class~="text-white"] {
  color: #fff !important;
}

[class~="text-n-brand"],
[class~="text-woot-500"],
[class~="text-woot-600"] {
  color: var(--kore-primary) !important;
}

[class~="border-n-brand"],
[class~="border-woot-500"],
[class~="border-woot-600"],
[class~="checked:border-n-brand"] {
  border-color: var(--kore-primary) !important;
}

[class~="ring-n-brand"],
[class~="ring-woot-500"] {
  --tw-ring-color: var(--kore-primary) !important;
}

/* Underline das abas e knobs: só o pseudo, nunca o botão */
[class*="after:bg-n-brand"]::after,
[class*="after:bg-woot-500"]::after {
  background-color: var(--kore-primary) !important;
}

[class*="before:bg-n-brand"]::before {
  background-color: var(--kore-primary) !important;
}

[class~="checked:bg-n-brand"]:checked,
[class~="dark:checked:bg-n-brand"]:checked,
[class~="indeterminate:bg-n-brand"]:indeterminate {
  background-color: var(--kore-primary) !important;
}

[class~="bg-n-brand/10"] {
  background-color: color-mix(in srgb, var(--kore-primary) 10%, transparent) !important;
}

[class~="bg-n-brand/20"] {
  background-color: color-mix(in srgb, var(--kore-primary) 20%, transparent) !important;
}

button.bg-n-iris-9,
.bg-n-iris-9 {
  background-color: var(--kore-primary) !important;
}

a {
  --tw-prose-links: var(--kore-primary);
}

/* Texto brand em superfície (link, aba ativa). Não aplicar sobre fill sólido. */
[class~="text-n-blue-11"]:not([class~="bg-n-brand"]):not([class~="bg-woot-500"]),
[class~="text-n-blue-10"]:not([class~="bg-n-brand"]),
[class~="text-n-iris-11"],
a[href*="password"],
.text-link,
a.text-link {
  color: var(--kore-primary) !important;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  outline-color: var(--kore-primary);
}

::selection {
  background: color-mix(in srgb, var(--kore-primary) 28%, transparent);
}

/* Super Admin / Administrate leftovers */
.main-content a,
.navigation a.is-active,
.button--primary,
.btn-primary {
  accent-color: var(--kore-primary);
}

/* Busca local da lista de conversas: linha própria, sem overlay. */
.koreos-list-search-row {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0 0.75rem 0.625rem;
}

.koreos-list-search {
  display: block;
  width: 100%;
}

.koreos-list-search input {
  width: 100%;
  height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.8125rem;
  line-height: 2rem;
  box-shadow: none;
}

.dark .koreos-list-search input {
  background: #111218;
  border-color: #2c2d38;
  color: #e8edf2;
}

.koreos-list-search input::placeholder {
  color: #64748b;
  opacity: 1;
}

.dark .koreos-list-search input::placeholder {
  color: #94a3b8;
}

.koreos-list-search input:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 1px #059669;
}

.koreos-list-search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.conversations-list-wrap.koreos-list-search-active .conversations-list,
.conversations-list-wrap.koreos-list-search-active .koreos-pinned-section {
  display: none !important;
}

.koreos-list-search-results {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.koreos-list-search-result {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.koreos-list-search-result:hover {
  background: rgb(15 23 42 / 0.04);
}

.dark .koreos-list-search-result:hover {
  background: rgb(255 255 255 / 0.04);
}

.koreos-list-search-empty {
  margin: 0;
  padding: 0 0.125rem;
  font-size: 0.6875rem;
  line-height: 1.25;
  color: #64748b;
}

.dark .koreos-list-search-empty {
  color: #94a3b8;
}

/* Conversas fixadas no topo de Minhas */
.conversation.koreos-pin-hidden {
  display: none !important;
}

.koreos-pin-menu {
  display: flex;
  align-items: center;
  width: 12.5rem;
  min-height: 1.75rem;
  padding: 0.25rem;
  border-radius: 0.375rem;
  color: inherit;
  cursor: pointer;
  font-size: 0.75rem;
}

.koreos-pin-menu:hover {
  background: #059669;
  color: #fff;
}

.koreos-pin-menu svg {
  width: 0.875rem;
  height: 0.875rem;
  flex: 0 0 auto;
  margin-left: 0.125rem;
}

.koreos-pin-menu span {
  margin: 0 0.5rem;
}

.koreos-pin-btn {
  position: absolute;
  top: 0.7rem;
  right: 2.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  opacity: 0.35;
}

.conversation:hover > .koreos-pin-btn,
.koreos-pin-btn.is-on,
.koreos-pinned-item .koreos-pin-btn {
  opacity: 1;
}

.koreos-pin-btn:hover,
.koreos-pin-btn.is-on {
  color: #059669;
}

.koreos-pin-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

.koreos-pinned-item .koreos-pin-btn {
  position: static;
}

.koreos-pinned-section {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.25rem 0 0.35rem;
  pointer-events: auto;
}

.dark .koreos-pinned-section {
  border-bottom-color: #2c2d38;
}

.koreos-pinned-label {
  margin: 0;
  padding: 0.25rem 0.75rem 0.15rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}

.dark .koreos-pinned-label {
  color: #94a3b8;
}

.koreos-pinned-item {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.45rem 0.75rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
}

.koreos-pinned-item .koreos-pin-btn {
  position: static;
  top: auto;
  right: auto;
  margin-left: auto;
  opacity: 1;
}

.koreos-pinned-item:hover {
  background: rgb(15 23 42 / 0.04);
}

.dark .koreos-pinned-item:hover {
  background: rgb(255 255 255 / 0.04);
}

.koreos-pinned-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 0.625rem;
  font-weight: 600;
  flex: 0 0 auto;
}

.dark .koreos-pinned-avatar {
  background: #22232c;
  color: #e8edf2;
}

.koreos-pinned-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.koreos-pinned-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dark .koreos-pinned-name {
  color: #e8edf2;
}

.koreos-pinned-preview {
  font-size: 0.75rem;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
