:root {
  color-scheme: light;
  --ink: #172126;
  --muted: #657075;
  --panel: #ffffff;
  --line: #d9dfdc;
  --page: #f6f7f4;
  --deep: #12343b;
  --teal: #1d7f73;
  --gold: #f0b84f;
  --coral: #d96b5f;
  --shadow: 0 18px 55px rgba(18, 52, 59, 0.14);
  /* Tamanho da fonte dos diálogos (título da conversa + bolhas). Ajustável pelo
     seletor no cabeçalho do chat; padrão Médio (16px). */
  --chat-font: 16px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #ffffff;
  --muted: #b8c4c7;
  --panel: #111618;
  --line: #2c383c;
  --page: #000000;
  --deep: #0fd6d6;
  --teal: #35d6c6;
  --gold: #f0b84f;
  --coral: #ff8f82;
  --shadow: 0 22px 65px rgba(0, 0, 0, 0.52);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ══════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════ */
.app-shell {
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: clamp(236px, 18.5vw, 300px) minmax(0, 1fr);
  overflow: hidden;
}

/* ══════════════════════════════════════════
   SIDEBAR — base escura
══════════════════════════════════════════ */
.sidebar {
  height: 100dvh;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #12343b;
  overflow: hidden;
}

/* Marca: horizontal compacto */
.brand-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
  gap: clamp(7px, 0.7vw, 12px);
  padding: clamp(10px, 1vw, 16px) clamp(10px, 1vw, 16px) clamp(9px, 0.9vw, 14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: unset;
  text-align: left;
  flex-shrink: 0;
}

.brand-icon {
  width: clamp(34px, 2.6vw, 44px);
  height: clamp(34px, 2.6vw, 44px);
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.brand-row strong {
  display: block;
  font-size: clamp(15.4px, 1.19vw, 19.6px);
  font-weight: 600;
  color: #f6f7f4;
  line-height: 1.3;
}

.brand-row span {
  color: rgba(246, 247, 244, 0.38);
  font-size: clamp(12.6px, 0.98vw, 16.8px);
}

/* Navegação de seções */
.sb-section-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sb-section-btn {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.6vw, 10px);
  padding: clamp(5px, 0.5vw, 8px) clamp(7px, 0.7vw, 10px);
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(246, 247, 244, 0.55);
  font-size: clamp(15.4px, 1.19vw, 18.2px);
  text-align: left;
  transition: background 0.12s, color 0.12s;
  width: 100%;
}

.sb-section-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f6f7f4;
}

.sb-section-btn.active {
  background: rgba(29, 127, 115, 0.3);
  color: #f6f7f4;
}

.sb-section-btn svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}

/* Botão X para fechar a gaveta manualmente (só aparece no modo gaveta ≤860px) */
.sidebar-close-button {
  display: none;
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 3;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(246, 247, 244, 0.75);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-close-button svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.sidebar-close-button:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #f6f7f4;
}

/* Fonte da gaveta 40% maior — APENAS no app instalado (classe .app-mode no <html>).
   Toda a tipografia da gaveta escala junto (mesmo fator ~1.4) p/ manter a proporção. */
html.app-mode .sb-section-btn {
  font-size: clamp(21.5px, 1.67vw, 25.5px);
}

html.app-mode .sb-footer-btn {
  font-size: clamp(19.6px, 1.57vw, 23.5px);
}

html.app-mode .brand-row strong {
  font-size: clamp(21.5px, 1.67vw, 27.4px);
}

html.app-mode .brand-row span {
  font-size: clamp(17.6px, 1.37vw, 23.5px);
}

html.app-mode .brand-icon {
  width: clamp(44px, 3.4vw, 56px);
  height: clamp(44px, 3.4vw, 56px);
}

html.app-mode .sb-conv-label {
  font-size: 19.6px;
}

html.app-mode .conv-select strong {
  font-size: 25.5px;
}

html.app-mode .conv-select span {
  font-size: 23.5px;
}

html.app-mode .sb-section-btn svg {
  width: 26px;
  height: 26px;
}

html.app-mode .sb-footer-btn svg {
  width: 25px;
  height: 25px;
}

/* Área de conversas */
.sb-conv-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.sb-conv-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 4px;
  flex-shrink: 0;
}

.sb-conv-label {
  font-size: 14px;
  color: rgba(246, 247, 244, 0.32);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Oculta conversas quando em outra seção */
.app-shell[data-section="dashboard"] .sb-conv-wrap,
.app-shell[data-section="dossie"] .sb-conv-wrap,
.app-shell[data-section="dashmedias"] .sb-conv-wrap,
.app-shell[data-section="relatorios"] .sb-conv-wrap {
  display: none;
}

/* Nova conversa: botão ícone compacto */
.new-chat-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-height: unset;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: rgba(29, 127, 115, 0.32);
  color: #f6f7f4;
}

.new-chat-button svg {
  width: 14px;
  height: 14px;
}

.new-chat-button span {
  display: none;
}

/* Lista de conversas */
.conversation-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  padding: 2px 8px 6px;
  /* impede que a rolagem "vaze" para a página quando chega ao fim da lista */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 247, 244, 0.22) transparent;
}

.conversation-list::-webkit-scrollbar {
  width: 8px;
}

.conversation-list::-webkit-scrollbar-track {
  background: transparent;
}

.conversation-list::-webkit-scrollbar-thumb {
  background: rgba(246, 247, 244, 0.18);
  border-radius: 4px;
}

.conversation-list::-webkit-scrollbar-thumb:hover {
  background: rgba(246, 247, 244, 0.32);
}

/* Item de conversa: wrapper div com botão de seleção + botão de apagar.
   flex-shrink:0 é obrigatório — sem ele os itens se comprimem para caber no
   container em vez de gerar rolagem, e com muitas missões nenhuma fica legível. */
.conversation-item {
  position: relative;
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1px solid transparent;
  overflow: hidden;
}

.conv-select {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(246, 247, 244, 0.6);
  text-align: left;
  padding: 7px 32px 7px 9px;
}

.conv-select:hover {
  color: #f6f7f4;
}

.conv-select strong {
  display: block;
  font-size: 18.2px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}

.conv-select span {
  display: block;
  font-size: 16.8px;
  color: rgba(246, 247, 244, 0.32);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

/* Botão lixeira por conversa (aparece no hover) */
.conv-delete {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: rgba(246, 247, 244, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}

.conv-delete svg {
  width: 12px;
  height: 12px;
}

.conversation-item:hover .conv-delete {
  opacity: 1;
}

.conv-delete:hover {
  background: rgba(217, 107, 95, 0.22);
  color: #ff8f82;
}

.conversation-item[aria-current="true"] {
  background: rgba(29, 127, 115, 0.22);
  border-color: rgba(29, 127, 115, 0.4);
}

.conversation-item[aria-current="true"] .conv-select {
  color: #f6f7f4;
}

/* Rodapé da sidebar */
.sb-footer {
  margin-top: auto;
  padding: 6px 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
}

.sb-footer-btn {
  display: flex;
  align-items: center;
  gap: clamp(5px, 0.5vw, 9px);
  padding: clamp(4px, 0.4vw, 7px) clamp(7px, 0.7vw, 10px);
  min-height: unset;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(246, 247, 244, 0.42);
  font-size: clamp(14px, 1.12vw, 16.8px);
  width: 100%;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}

.sb-footer-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #f6f7f4;
}

.sb-footer-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Override: as classes originais agora herdam de sb-footer-btn */
.clear-messages-button,
.delete-conversation-button,
.sign-out-button {
  background: transparent;
  border: 0;
}

/* ══════════════════════════════════════════
   THEME TOGGLE
══════════════════════════════════════════ */
.theme-toggle {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(18, 52, 59, 0.12);
}

.theme-toggle span {
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

/* ══════════════════════════════════════════
   SELETOR DE TAMANHO DE FONTE DOS DIÁLOGOS
   (botão ao lado do tema, no cabeçalho do chat)
══════════════════════════════════════════ */
.chat-header .font-size-control {
  position: relative;
  flex: 0 0 auto;
}

.font-size-button {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(18, 52, 59, 0.12);
  display: grid;
  place-items: center;
}

.font-size-button .fs-ico {
  display: flex;
  align-items: baseline;
  gap: 1px;
  line-height: 1;
  font-weight: 600;
}

.font-size-button .fs-ico .fs-small {
  font-size: 12px;
}

.font-size-button .fs-ico .fs-large {
  font-size: 19px;
}

.font-size-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.font-size-control[data-open] .font-size-menu {
  display: block;
}

.font-size-menu-label {
  display: block;
  padding: 4px 8px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.font-size-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.font-size-option:hover {
  background: rgba(29, 127, 115, 0.1);
}

.font-size-option[aria-checked="true"] {
  background: rgba(29, 127, 115, 0.16);
  color: var(--teal);
  font-weight: 600;
}

.font-size-option .fs-sample {
  color: var(--muted);
  line-height: 1;
}

.font-size-option[aria-checked="true"] .fs-sample {
  color: var(--teal);
}

/* ══════════════════════════════════════════
   CHAT PANEL
══════════════════════════════════════════ */
.chat-panel {
  min-width: 0;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.auth-view,
.chat-view {
  height: 100dvh;
  min-height: 0;
}

/* ══════════════════════════════════════════
   SYNC VIEW
══════════════════════════════════════════ */
.sync-view {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px 16px;
  background: var(--page);
}

.sync-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}

.sync-card h1 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  text-align: center;
  color: var(--ink);
}

.sync-desc {
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.sync-steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--page);
  border-radius: 10px;
  padding: 14px 16px;
}

.sync-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.4;
}

.sync-step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.sync-step code {
  background: var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.82rem;
  color: var(--ink);
}

#syncForm {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#syncCodeInput {
  width: 100%;
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--page);
  color: var(--ink);
  outline: none;
  box-sizing: border-box;
  transition: border-color .2s;
  font-family: monospace;
}

#syncCodeInput:focus {
  border-color: var(--teal);
}

#syncCodeInput::placeholder {
  color: var(--line);
  letter-spacing: 0.2em;
}

/* ══════════════════════════════════════════
   AUTH VIEW
══════════════════════════════════════════ */
.auth-view {
  display: flex;
  flex-direction: row;
  padding: 0;
  position: relative;
  background: none;
}

.auth-left {
  width: 44%;
  min-width: 200px;
  background: #12343b;
  padding: clamp(28px, 3vw, 56px) clamp(24px, 3vw, 52px) clamp(20px, 2vw, 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.auth-logo-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1vw, 16px);
  margin-bottom: clamp(24px, 2.5vw, 44px);
}

.auth-left-logo {
  width: clamp(44px, 3.5vw, 66px);
  height: clamp(44px, 3.5vw, 66px);
  border-radius: clamp(10px, 0.9vw, 16px);
  object-fit: cover;
  flex-shrink: 0;
}

.auth-brand-name {
  font-size: clamp(15px, 1.4vw, 22px);
  font-weight: 600;
  color: #f6f7f4;
  line-height: 1.2;
}

.auth-brand-ver {
  font-size: clamp(11px, 0.9vw, 14px);
  color: rgba(246, 247, 244, 0.38);
  margin-top: 1px;
}

.auth-tagline {
  font-size: clamp(18px, 1.8vw, 28px);
  font-weight: 500;
  color: #f6f7f4;
  line-height: 1.3;
  margin: 0 0 clamp(6px, 0.6vw, 12px);
}

.auth-sub {
  font-size: clamp(13px, 1.1vw, 17px);
  color: rgba(246, 247, 244, 0.5);
  line-height: 1.6;
  margin: 0 0 clamp(20px, 2vw, 32px);
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.5vw, 24px);
  flex: 1;
}

.auth-feat {
  display: flex;
  align-items: flex-start;
  gap: clamp(10px, 1vw, 16px);
}

.auth-feat-ico {
  width: clamp(32px, 2.6vw, 48px);
  height: clamp(32px, 2.6vw, 48px);
  border-radius: clamp(7px, 0.6vw, 11px);
  background: rgba(29, 127, 115, 0.22);
  border: 0.5px solid rgba(29, 127, 115, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-feat-ico svg {
  width: clamp(14px, 1.2vw, 22px);
  height: clamp(14px, 1.2vw, 22px);
  stroke: #3ecf8e;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-feat-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 2px;
}

.auth-feat-title {
  font-size: clamp(13px, 1.1vw, 17px);
  font-weight: 500;
  color: #f6f7f4;
  display: block;
}

.auth-feat-desc {
  font-size: clamp(11px, 0.95vw, 15px);
  color: rgba(246, 247, 244, 0.45);
  display: block;
}

.auth-left-foot {
  margin-top: auto;
  padding-top: 16px;
  font-size: clamp(10px, 0.75vw, 13px);
  color: rgba(246, 247, 244, 0.2);
  text-align: center;
}

.auth-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--page);
  min-width: 0;
  overflow-y: auto;
}

.auth-right-hdr {
  display: flex;
  justify-content: flex-end;
  padding: 14px 18px 0;
  flex-shrink: 0;
}

.auth-right-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 2vh, 20px) 24px clamp(16vh, 20vh, 28vh);
}

.auth-theme-toggle {
  position: static;
}

.app-shell[data-view="auth"] {
  display: block;
}

.app-shell[data-view="auth"] .chat-panel {
  min-height: 100dvh;
}

.auth-card {
  width: min(100%, clamp(320px, 28vw, 480px));
  padding: clamp(24px, 2.2vw, 40px) clamp(24px, 2.2vw, 40px) clamp(10px, 1vw, 16px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
  transform: none;
}

.auth-icon {
  display: block;
  width: clamp(140px, 11vw, 200px);
  height: clamp(140px, 11vw, 200px);
  margin: 0 auto;
  border-radius: clamp(20px, 1.8vw, 32px);
  object-fit: cover;
  box-shadow: 0 12px 32px rgba(18, 52, 59, 0.22);
}

.auth-card h1 {
  margin: clamp(12px, 1.2vw, 20px) 0 4px;
  font-size: clamp(22px, 1.8vw, 30px);
  line-height: 1.2;
  letter-spacing: 0;
}

.auth-card-sub {
  font-size: clamp(13px, 1vw, 16px);
  color: var(--muted);
  margin: 0 0 clamp(14px, 1.4vw, 22px);
}

.auth-right .primary-button {
  background: #12343b;
}

#registerForm {
  display: none;
}

.auth-right-body.mode-register #authForm {
  display: none;
}

.auth-right-body.mode-register #registerForm {
  display: block;
}

.reg-code-input {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  font-family: monospace;
}

.auth-right .link-button {
  background: #12343b;
  border-radius: 8px;
  color: var(--teal);
  min-height: 38px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card label {
  text-align: left;
}

/* ══════════════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════════════ */
label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

input {
  height: 44px;
  padding: 0 12px;
}

textarea {
  max-height: 180px;
  min-height: 48px;
  resize: none;
  padding: 13px 52px 13px 14px;
}

input:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(29, 127, 115, 0.14);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--teal);
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  width: 100%;
}

.link-button {
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--teal);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--deep);
  background: #eef3f0;
  border: 0;
  border-radius: 8px;
  min-height: 44px;
}

.form-message,
.error-banner {
  min-height: 20px;
  color: #9e3d34;
  font-size: 13px;
}

.auth-card .form-message {
  min-height: 0;
  margin: 0;
}

.password-hint {
  font-size: 12px;
  color: #6b7280;
  margin: -4px 0 4px;
  line-height: 1.4;
}

/* ══════════════════════════════════════════
   CHAT VIEW
══════════════════════════════════════════ */
.chat-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.chat-header {
  min-height: 60px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.chat-header > div {
  flex: 1;
  min-width: 0;
}

.chat-header strong {
  display: block;
  font-size: var(--chat-font);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header span {
  color: var(--muted);
  font-size: calc(var(--chat-font) - 3px);
}

.chat-theme-toggle {
  margin-left: auto;
  flex: 0 0 auto;
}

.menu-button {
  display: none;
}

.floating-menu-button {
  display: none;
}

/* Área de mensagens */
.messages {
  padding: 22px max(18px, 4vw);
  overflow-y: auto;
  min-height: 0;
}

/* Empty state */
.empty-state {
  max-width: 440px;
  margin: 10vh auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.empty-state-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 8px 28px rgba(18, 52, 59, 0.18);
}

.empty-state h2 {
  font-size: calc(var(--chat-font) + 1px);
  font-weight: 600;
  color: var(--deep);
  margin: 4px 0 0;
}

.empty-state p {
  font-size: calc(var(--chat-font) - 3px);
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.empty-state-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.empty-chip {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: calc(var(--chat-font) - 4px);
  background: var(--panel);
  color: var(--deep);
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}

.empty-chip:hover {
  background: #12343b;
  border-color: #12343b;
  color: #ffffff;
}

/* Mensagens */
.message-row {
  display: flex;
  margin: 14px 0;
}

.message-row.user {
  justify-content: flex-end;
}

.bubble {
  max-width: min(720px, 86%);
  padding: 13px 15px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(18, 52, 59, 0.06);
}

.message-row.user .bubble {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
}

.message-body {
  font-size: var(--chat-font);
  line-height: 1.48;
  overflow-wrap: anywhere;
  white-space: normal;
}

.help-menu-line {
  margin: 0;
}

.help-menu-line.empty {
  height: 0.85em;
}

.message-row.assistant.help-menu .help-menu-justified-line {
  text-align: justify;
  hyphens: auto;
}

.message-row.assistant.help-menu .help-menu-command-line {
  text-align: left;
  hyphens: none;
}

.help-command-chip {
  display: inline;
  border: 0;
  border-bottom: 1px dotted currentColor;
  border-radius: 0;
  padding: 0 2px;
  color: var(--teal);
  background: transparent;
  font: inherit;
  font-weight: 700;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}

.help-command-chip:hover,
.help-command-chip:focus-visible {
  color: #0f5f56;
  background: rgba(29, 127, 115, 0.1);
  outline: none;
}

.message-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: calc(var(--chat-font) - 4px);
  line-height: 1;
  text-align: right;
}

.message-row.user .message-meta {
  color: rgba(255, 255, 255, 0.76);
}

.bubble p {
  margin: 0 0 10px;
}

.bubble p:last-child,
.bubble ul:last-child,
.bubble ol:last-child {
  margin-bottom: 0;
}

.bubble a {
  color: var(--teal);
  font-weight: 700;
}

.bubble code {
  display: inline-block;
  border: 1px solid rgba(33, 126, 116, 0.32);
  border-radius: 6px;
  padding: 1px 6px;
  background: rgba(33, 126, 116, 0.08);
  color: var(--deep);
  font-family: inherit;
  font-size: 0.95em;
  cursor: pointer;
}

.bubble code:hover {
  border-color: var(--teal);
  background: rgba(33, 126, 116, 0.14);
}

.message-row.user .bubble a {
  color: #ffffff;
}

.card-message {
  display: grid;
  gap: 8px;
}

.card-message strong {
  font-size: 15px;
}

/* Botões de ação */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.action-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  padding: 0 12px;
  background: #f7faf8;
  color: var(--deep);
}

.action-button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.action-button.danger {
  border-color: rgba(217, 107, 95, 0.5);
  background: #fff1ef;
  color: #9e3d34;
}

/* Typing indicator */
.typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--teal);
  animation: pulse 1s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* Composer */
.composer-wrap {
  padding: 12px max(18px, 4vw) 18px;
  border-top: 1px solid var(--line);
  background: rgba(246, 247, 244, 0.92);
  backdrop-filter: blur(14px);
}

.composer {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.composer-input-wrap textarea {
  padding-left: 52px;
  padding-right: 14px;
  width: 100%;
}

.send-button {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.attach-button {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  color: var(--deep);
  background: #eef3f0;
}

.attachment-list {
  max-width: 960px;
  margin: 8px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  max-width: 100%;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--deep);
  font-size: 13px;
}

.attachment-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: #f3f5f2;
  color: #9e3d34;
}

.send-button:disabled,
.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

/* ══════════════════════════════════════════
   DASHBOARD VIEW
══════════════════════════════════════════ */
.dashboard-view {
  display: none;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.app-shell[data-view="chat"][data-section="dashboard"] .chat-view {
  display: none;
}

.app-shell[data-view="chat"][data-section="dashboard"] .dashboard-view {
  display: flex;
}

/* Dossiê dos Cartões de Créditos */
.dossie-view {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  gap: 14px;
  background: var(--page);
}

.app-shell[data-view="chat"][data-section="dossie"] .chat-view {
  display: none;
}

.app-shell[data-view="chat"][data-section="dossie"] .dossie-view {
  display: flex;
}

/* Padrões, Médias e Tendências */
.dashmedias-view {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  gap: 14px;
  background: var(--page);
}

.app-shell[data-view="chat"][data-section="dashmedias"] .chat-view {
  display: none;
}

.app-shell[data-view="chat"][data-section="dashmedias"] .dashmedias-view {
  display: flex;
}

.dash-header {
  padding: clamp(10px, 1vw, 16px) clamp(14px, 1.5vw, 26px) clamp(9px, 0.9vw, 14px);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dash-header-left { flex: 1; min-width: 0; }

.dash-header h2 {
  font-size: clamp(13px, 1.1vw, 17px);
  font-weight: 600;
  color: var(--deep);
  margin: 0;
}

.dash-header p {
  font-size: clamp(10px, 0.8vw, 13px);
  color: var(--muted);
  margin: 2px 0 0;
}

.dash-header-desc {
  font-size: clamp(10px, 0.75vw, 12px);
  color: var(--muted);
  margin: 2px 0 0 !important;
  opacity: 0.75;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 32px;
}

.dash-month-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  line-height: 32px;
  margin: 0;
}

.dash-month-select {
  font-size: 12px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  outline: none;
  line-height: 32px;
}

.dash-month-select:focus { border-color: var(--teal); }

.dash-body {
  flex: 1;
  overflow-y: auto;
  padding: clamp(12px, 1.2vw, 22px) clamp(14px, 1.5vw, 26px) clamp(14px, 1.5vw, 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1vw, 18px);
  background: var(--page);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(10px, 1vw, 18px) clamp(12px, 1.1vw, 20px);
}

.kpi-card-label {
  font-size: clamp(10px, 0.75vw, 12px);
  color: var(--muted);
  margin-bottom: 6px;
}

.kpi-card-value {
  font-size: clamp(14px, 1.0vw, 16px);
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.kpi-card-delta {
  font-size: 11px;
  margin-top: 6px;
}

.kpi-card-delta.positive {
  color: #1d7f73;
}

.kpi-card-delta.negative {
  color: #d96b5f;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(12px, 1.1vw, 20px);
}

.chart-card h3 {
  font-size: clamp(10px, 0.8vw, 13px);
  font-weight: 600;
  color: var(--deep);
  margin: 0 0 10px;
}

/* Donut chart */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.donut-svg {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.donut-hole {
  fill: var(--panel);
}

.donut-label-main {
  fill: var(--deep);
  font-weight: 600;
}

.donut-label-sub {
  fill: var(--muted);
}

.donut-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  flex: 1;
  min-width: 0;
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--ink);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 2px;
}

.legend-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.legend-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-val {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Line chart */
.line-chart-svg {
  width: 100%;
  overflow: visible;
}

.chart-axis-label {
  fill: var(--muted);
}

.dash-note {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

/* ══════════════════════════════════════════
   RELATÓRIOS VIEW
══════════════════════════════════════════ */
.relatorios-view {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  gap: 14px;
  background: var(--page);
}

.app-shell[data-view="chat"][data-section="relatorios"] .chat-view {
  display: none;
}

.app-shell[data-view="chat"][data-section="relatorios"] .relatorios-view {
  display: flex;
}

.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  max-width: 280px;
}

.coming-soon-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(18, 52, 59, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
}

.coming-soon-icon svg {
  width: 26px;
  height: 26px;
  stroke: #12343b;
  fill: none;
  stroke-width: 1.6;
}

.coming-soon h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--deep);
  margin: 0;
}

.coming-soon p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.coming-soon-badge {
  display: inline-block;
  background: rgba(240, 184, 79, 0.15);
  color: #9a7200;
  border: 1px solid rgba(240, 184, 79, 0.45);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
}

/* ══════════════════════════════════════════
   VISIBILIDADE VIEWS
══════════════════════════════════════════ */
.app-shell[data-view="auth"] .sidebar,
.app-shell[data-view="auth"] .chat-view,
.app-shell[data-view="auth"] .dashboard-view,
.app-shell[data-view="auth"] .dossie-view,
.app-shell[data-view="auth"] .dashmedias-view,
.app-shell[data-view="auth"] .relatorios-view {
  display: none;
}

.app-shell[data-view="chat"] .auth-view {
  display: none;
}

.app-shell[data-view="sync"] .sync-view {
  display: flex;
}

.app-shell[data-view="sync"] .auth-view,
.app-shell[data-view="sync"] .chat-view {
  display: none;
}

/* ══════════════════════════════════════════
   DARK MODE
══════════════════════════════════════════ */
:root[data-theme="dark"] body {
  background: #000000;
  color: #ffffff;
}

:root[data-theme="dark"] .auth-view {
  background: none;
}

:root[data-theme="dark"] .auth-right {
  background: #0f1f24;
}

:root[data-theme="dark"] .auth-right .primary-button {
  background: #0b8f87;
}

:root[data-theme="dark"] .auth-right .link-button {
  background: transparent;
}

:root[data-theme="dark"] .auth-card-sub {
  color: #b8c4c7;
}

:root[data-theme="dark"] .auth-card,
:root[data-theme="dark"] .bubble,
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .attachment-chip {
  background: #111618;
  color: #ffffff;
}

:root[data-theme="dark"] .auth-card,
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .bubble,
:root[data-theme="dark"] .attachment-chip {
  border-color: #2c383c;
}

:root[data-theme="dark"] .chat-header span,
:root[data-theme="dark"] label,
:root[data-theme="dark"] .empty-state p {
  color: #b8c4c7;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea {
  background: #000000;
  color: #ffffff;
  border-color: #2c383c;
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #8fa0a5;
}

:root[data-theme="dark"] .chat-header,
:root[data-theme="dark"] .composer-wrap {
  background: rgba(0, 0, 0, 0.9);
}

:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .attach-button,
:root[data-theme="dark"] .action-button,
:root[data-theme="dark"] .attachment-chip button {
  background: #172126;
  color: #ffffff;
}

:root[data-theme="dark"] .message-row.user .bubble,
:root[data-theme="dark"] .primary-button {
  background: #0b8f87;
  border-color: #0b8f87;
  color: #ffffff;
}

:root[data-theme="dark"] .action-button.primary,
:root[data-theme="dark"] .send-button {
  background: #0b8f87;
  border-color: #0b8f87;
  color: #ffffff;
}

:root[data-theme="dark"] .action-button.danger {
  background: #351816;
  border-color: rgba(255, 143, 130, 0.45);
  color: #ffb4aa;
}

:root[data-theme="dark"] .help-command-chip {
  color: #7bd7cf;
}

:root[data-theme="dark"] .help-command-chip:hover,
:root[data-theme="dark"] .help-command-chip:focus-visible {
  color: #d8fffb;
  background: rgba(123, 215, 207, 0.14);
}

:root[data-theme="dark"] .form-message,
:root[data-theme="dark"] .error-banner,
:root[data-theme="dark"] .attachment-chip button {
  color: #ffb4aa;
}

:root[data-theme="dark"] .kpi-card,
:root[data-theme="dark"] .chart-card,
:root[data-theme="dark"] .dash-header {
  background: #111618;
  border-color: #2c383c;
}

:root[data-theme="dark"] .dash-month-select {
  background: #111618;
  color: #ffffff;
  border-color: #2c383c;
}

:root[data-theme="dark"] .empty-chip {
  background: #111618;
  border-color: #2c383c;
  color: #f6f7f4;
}

:root[data-theme="dark"] .empty-chip:hover {
  background: #1d7f73;
  border-color: #1d7f73;
}

:root[data-theme="dark"] .coming-soon-icon {
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .coming-soon-icon svg {
  stroke: #35d6c6;
}

:root[data-theme="dark"] .donut-hole {
  fill: #111618;
}

/* ══════════════════════════════════════════
   BOTÕES CONDICIONAIS POR SEÇÃO
══════════════════════════════════════════ */
.app-shell[data-section="dashboard"] .clear-messages-button,
.app-shell[data-section="dashboard"] .delete-conversation-button,
.app-shell[data-section="dossie"] .clear-messages-button,
.app-shell[data-section="dossie"] .delete-conversation-button,
.app-shell[data-section="dashmedias"] .clear-messages-button,
.app-shell[data-section="dashmedias"] .delete-conversation-button,
.app-shell[data-section="relatorios"] .clear-messages-button,
.app-shell[data-section="relatorios"] .delete-conversation-button,
.app-shell[data-section="ajuda"] .clear-messages-button,
.app-shell[data-section="ajuda"] .delete-conversation-button {
  display: none;
}

/* ══════════════════════════════════════════
   AJUDA VIEW
══════════════════════════════════════════ */
.ajuda-view {
  display: none;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.app-shell[data-view="chat"][data-section="ajuda"] .chat-view {
  display: none;
}

.app-shell[data-view="chat"][data-section="ajuda"] .ajuda-view {
  display: flex;
}

.ajuda-content {
  flex: 1;
  overflow-y: auto;
  padding: 22px max(18px, 4vw);
}

.ajuda-bubble {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(18, 52, 59, 0.06);
  font-size: var(--chat-font);
  line-height: 1.6;
}

.ajuda-loading {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  padding: 60px 0;
}

.ajuda-error {
  font-size: 14px;
  color: var(--coral);
  text-align: center;
  padding: 40px 0;
}

:root[data-theme="dark"] .ajuda-bubble {
  background: #111618;
  border-color: #2c383c;
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE
══════════════════════════════════════════ */
@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .auth-left {
    display: none;
  }

  .auth-right {
    width: 100%;
  }

  .auth-right-body {
    padding: 20px;
  }

  .auth-card {
    transform: none;
  }

  .auth-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(90vw, 332px);
    height: 100dvh;
    z-index: 10;
    transform: translateX(-102%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  /* No modo gaveta usamos o botão FLUTUANTE (sempre visível em qualquer seção);
     o ☰ inline do cabeçalho do chat fica escondido para não duplicar. */
  .menu-button {
    display: none;
  }

  .floating-menu-button {
    display: inline-flex;
    position: fixed;
    top: calc(8px + env(safe-area-inset-top));
    left: 10px;
    z-index: 9;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
  }

  .sidebar-close-button {
    display: inline-flex;
  }

  .messages {
    padding: 16px 12px;
  }

  .bubble {
    max-width: 92%;
  }

  .composer-wrap {
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  /* Safe-area (câmera / cantos arredondados do Fold) */
  .chat-header {
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-left: 64px;
  }

  .dash-header {
    padding-left: 64px;
  }

  .sidebar {
    padding-top: env(safe-area-inset-top);
  }
}

/* ══════════════════════════════════════════
   RESPONSIVE — TELA DE CAPA DO FOLD / celulares estreitos
   (Galaxy Z Fold 4 fechado ≈ 344px CSS)
══════════════════════════════════════════ */
@media (max-width: 420px) {
  .kpi-row {
    grid-template-columns: 1fr;
  }

  .messages {
    padding: 14px 10px;
  }

  .bubble {
    max-width: 96%;
  }

  .composer {
    gap: 6px;
  }

  /* Donut empilha sobre a legenda no estreito */
  .donut-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .donut-legend {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  /* Cabeçalho do dashboard quebra em duas linhas */
  .dash-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .dash-header-right {
    width: 100%;
  }

  .dash-month-select {
    flex: 1;
  }
}

/* ══════════════════════════════════════════
   RESPONSIVE — TELA INTERNA DO FOLD (aberto, ~quase quadrada)
   (Galaxy Z Fold 4 aberto ≈ 884px CSS) — mantém 2 painéis
══════════════════════════════════════════ */
@media (min-width: 861px) and (max-width: 1100px) {
  .app-shell {
    grid-template-columns: clamp(224px, 25vw, 268px) minmax(0, 1fr);
  }

  .charts-row {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-row {
    grid-template-columns: repeat(4, 1fr);
  }
}
