/* Acentos compartidos por Inicio, WhatsApp y Chat interno. */
:root {
  --module-rail-width: 58px;
  --gr-orange: #ffad42;
  --gr-orange-hover: #ff9d25;
  --gr-orange-soft: #fff0dc;
  --gr-orange-edge: #cf650b;
  --gr-orange-ink: #2e2620;
}
.module-rail {
  --module-active: var(--gr-orange);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 13px 7px; background: #27292c; border-right: 1px solid #3b3e42;
}
.team .module-rail { --module-active: var(--gr-orange); }
.module-brand { width: 34px; height: 34px; object-fit: contain; border-radius: 9px; margin-bottom: 6px; }
.module-link {
  position: relative; display: grid; place-items: center; width: 42px; min-height: 42px;
  color: #f7f2eb; border-radius: 9px; text-decoration: none;
}
.module-link:hover { background: #3c3f43; }
.module-link[aria-current="page"] { color: var(--gr-orange-ink); background: var(--module-active); }
.module-link svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.module-count {
  position: absolute; inset: -3px -4px auto auto; min-width: 16px; padding: 0 4px;
  color: white; background: #8d5b0a; outline: 2px solid #27292c; border-radius: 12px;
  text-align: center; font-size: 10px; font-weight: 700; line-height: 16px;
}
.module-heading { margin: 4px 7px 13px; font: 700 14px/1.4 system-ui,sans-serif; }
#app,.team { grid-template-columns: var(--module-rail-width) 156px minmax(235px,320px) minmax(0,1fr); }
#app .workspace-nav,.team-options {
  position: relative; min-width: 0; min-height: 0; overflow-y: auto; align-items: stretch; padding: 12px 8px;
  background: #fdfbf8; border-right: 1px solid #e7ddce; color: #38342f;
}
#app .workspace-nav nav,#app .workspace-nav footer { align-items: stretch; gap: 3px; }
#app .workspace-nav footer { padding-top: 6px; }
#app .workspace-nav button,.team-options button {
  display: flex; width: 100%; min-height: 34px; justify-content: flex-start; align-items: center;
  gap: 7px; padding: 4px 6px; color: inherit; background: transparent; font-size: 11px; white-space: nowrap;
}
#app .workspace-nav svg { flex: none; width: 16px; height: 16px; }
#app .workspace-nav button:hover { background: #f5ecdc; }
#app .workspace-nav button[aria-pressed="true"] { background: var(--gr-orange-soft); color: #473421; box-shadow: inset 2px 0 var(--gr-orange-edge); }
#app .workspace-nav .rail-tooltip {
  position: static; visibility: visible; transform: none; padding: 0; color: inherit; background: none; box-shadow: none;
  font-size: inherit; overflow: hidden; text-overflow: ellipsis;
}
#app .workspace-nav .identity { justify-content: flex-start; border-color: #e7ddce; padding: 4px 5px; }
#app .workspace-nav .identity > div { display: block; }
#app .workspace-nav .identity small { color: #685847; }
#app #agentInitial { width: 24px; height: 24px; flex-basis: 24px; }
#app :is(#pendingCount,#unassignedCount,#mentionCount,#authorizationCount) { position: static; order: 1; margin-left: auto; padding: 0 4px; background: #efe2ca; color: #473421; border-radius: 9px; font-size: 10px; }
.team-options { display: flex; flex-direction: column; color: #38342f; background: #fdfbf8; border-color: #e7ddce; }
.team-options nav { display: grid; gap: 4px; }
.team-options button { border: 0; border-radius: 7px; font-weight: 600; font-size: 12px; }
.team-options button:hover,.team-options button[aria-pressed="true"] { background: var(--gr-orange-soft); }
.team-options button[aria-pressed="true"] { box-shadow: inset 2px 0 var(--gr-orange-edge); }
.team-empty { padding: 10px; color: var(--muted); }
@media (max-width: 930px) and (min-width: 761px) {
  #app,.team { grid-template-columns: var(--module-rail-width) 136px minmax(200px,245px) minmax(0,1fr); }
}
@media (max-width: 760px) {
  #app { grid-template-columns: 47px minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); }
  .module-rail { grid-column: 1 / -1; flex-direction: row; gap: 7px; padding: 4px 10px; }
  .module-brand { margin: 0 4px 0 0; width: 29px; height: 29px; }
  .module-link { width: 36px; min-height: 36px; }
  .module-count { inset: 0 -4px auto auto; }
  .module-link svg { width: 21px; height: 21px; }
  #app .workspace-nav { padding: 5px 3px; overflow-y: auto; }
  #app .workspace-nav :is(.rail-tooltip,.module-heading,.identity) { display: none; }
  #app .workspace-nav button { justify-content: center; position: relative; padding: 3px; }
  #app :is(#pendingCount,#unassignedCount,#mentionCount,#authorizationCount) { position: absolute; top: 0; right: 0; }
  #app.chat-open .conversation,#app:has(#pair:not([hidden])) .conversation { grid-row: 2; grid-column: 1 / -1; }
  #app:has(#pair:not([hidden])) .workspace-nav { display: none; }
  .team { grid-template-columns: minmax(0,1fr); grid-template-rows: auto auto auto minmax(0,1fr); }
  .team-options { padding: 5px 10px; border-right: 0; border-bottom: 1px solid #e7ddce; }
  .team-options .module-heading { display: none; }
  .team-options nav { display: flex; }
  .team-options button { width: auto; padding-inline: 9px; min-height: 30px; }
  .directory { border: 0; }
  .directory header { padding: 5px 10px; }
  #people { display: flex; overflow-x: auto; }
  .person { width: auto; flex: none; }
  .person-name small { display: none; }
}
a.module-brand { display: grid; place-items: center; background: #fff8eb; padding: 4px; }
.module-brand img { display: block; width: 100%; height: 100%; object-fit: contain; }
a.module-brand[aria-current="page"] { outline: 2px solid #e5c37d; outline-offset: 2px; }

/* La barra de módulos queda siempre visible aunque la página se desplace. */
.module-rail { position: sticky; top: 0; align-self: start; height: 100dvh; z-index: 20; }
@media (max-width: 760px) {
  .module-rail { height: auto; }
}

/* Chat interno sin columna de filtros: barra, lista y conversación */
.team { grid-template-columns: var(--module-rail-width) minmax(250px,330px) minmax(0,1fr); }
@media (max-width: 930px) and (min-width: 761px) { .team { grid-template-columns: var(--module-rail-width) minmax(210px,270px) minmax(0,1fr); } }
@media (max-width: 760px) { .team { grid-template-columns: minmax(0,1fr); grid-template-rows: auto auto minmax(0,1fr); } }

.module-rail .quote-module-link[hidden] { display:none!important; }

/* El ancho coincide en todos los módulos, también en ventanas estrechas de escritorio. */
@media (max-width: 930px) and (min-width: 761px) {
  :root { --module-rail-width:54px; }
}
.directory header:has(.module-heading) { padding:12px 8px 8px; }
.directory header .module-heading { margin-bottom:0; }
.directory header #directory-status { margin:3px 7px 0; }
