/* A casca: menu lateral preto, barra de cima e o palco onde as telas montam.
 * Abaixo de 768 px o menu vira barra inferior.
 */

.casca {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--menu-largura) minmax(0, 1fr);
}

/* ───────────── Menu ───────────── */

.menu {
  background: var(--preto);
  color: var(--texto-invertido);
  display: flex;
  flex-direction: column;
  gap: var(--e-4);
  padding: var(--e-5) var(--e-3);
  min-height: 0;
  overflow-y: auto;
}
.menu-marca { font-family: var(--fonte-titulo); font-weight: 800; letter-spacing: 0.08em; font-size: var(--t-16); padding: 0 var(--e-3) var(--e-2); }
.menu-marca span { color: var(--dourado); }
.menu-lista { display: grid; gap: 2px; }

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  padding: var(--e-2) var(--e-3);
  border-radius: var(--raio-p);
  color: var(--texto-invertido-suave);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--t-14);
}
.menu-item:hover { background: var(--preto-2); color: var(--texto-invertido); }
/* O item ativo é um dos dois lugares do dourado. */
.menu-item[aria-current="page"] { background: var(--preto-2); color: var(--dourado); font-weight: 600; box-shadow: inset 3px 0 0 var(--dourado); }

.icone { width: 20px; height: 20px; flex: none; }

.menu-pe { margin-top: auto; display: grid; gap: var(--e-2); padding: var(--e-3); border-top: 1px solid var(--preto-2); }
.menu-usuario { font-size: var(--t-13); color: var(--texto-invertido-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-sair { justify-content: flex-start; background: transparent; border-color: var(--preto-2); color: var(--texto-invertido); }
.menu-sair:hover { background: var(--preto-2); }

/* ───────────── Barra de cima ───────────── */

.casca-corpo { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; }

.barra {
  min-height: var(--barra-altura);
  display: flex;
  align-items: center;
  gap: var(--e-3);
  padding: var(--e-2) var(--e-5);
  background: var(--superficie);
  border-bottom: 1px solid var(--borda);
  flex-wrap: wrap;
}
.barra-direita { margin-left: auto; display: flex; align-items: center; gap: var(--e-2); flex-wrap: wrap; }

/* A cor do cliente vive só aqui. */
.selo-cliente {
  display: inline-flex;
  align-items: center;
  gap: var(--e-2);
  max-width: 100%;
  padding: 4px 12px 4px 8px;
  border-radius: var(--pilula);
  border: 1px solid var(--borda);
  font-weight: 600;
  font-size: var(--t-14);
  overflow: hidden;
}
.selo-cliente-ponto { width: 10px; height: 10px; border-radius: 50%; background: var(--cor-cliente); flex: none; }
#barra-cliente { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────────── Palco ───────────── */

.palco { min-height: 0; min-width: 0; overflow: auto; outline: none; }

/* ───────────── Celular: menu vira barra inferior ───────────── */

@media (max-width: 767px) {
  .casca { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) var(--barra-inferior); }
  .casca-corpo { grid-row: 1; }
  .menu {
    grid-row: 2;
    flex-direction: row;
    padding: 0;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid var(--preto-2);
  }
  .menu-marca, .menu-pe { display: none; }
  .menu-lista { display: flex; width: 100%; gap: 0; }
  .menu-lista li { flex: 1 0 64px; }
  .menu-item {
    flex-direction: column;
    gap: 2px;
    height: 100%;
    justify-content: center;
    padding: var(--e-1);
    font-size: var(--t-12);
    border-radius: 0;
  }
  .menu-item[aria-current="page"] { box-shadow: inset 0 3px 0 var(--dourado); }
  .barra { padding: var(--e-2) var(--e-3); gap: var(--e-2); min-height: 48px; }
  .barra-direita { gap: var(--e-1); }
}
