/* =============================================================
   Brotas Beauty - estrutura da tela: login, topo, menu e conteudo.
   Responsivo: computador, tablet e celular (item 35).
   ============================================================= */

/* ---------------------------------------------------------------
   Tela de login
   --------------------------------------------------------------- */
.login-screen {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
  background: linear-gradient(150deg, var(--brand-soft) 0%, var(--brand-light) 55%, #efe3f2 100%);
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  margin-bottom: 24px;
  text-align: center;
}

.login-brand .mark {
  font-size: 40px;
  line-height: 1;
}

.login-brand h1 {
  margin-top: 8px;
  color: var(--brand-dark);
  font-size: 1.4rem;
}

.login-brand .sub {
  color: var(--ink-soft);
  font-size: .85rem;
}

/* ---------------------------------------------------------------
   Moldura do aplicativo
   --------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar content";
  min-height: 100dvh;
  background: #f2f2ef;
  overflow-x: hidden;
}

/* ---------------------------------------------------------------
   Barra superior
   --------------------------------------------------------------- */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 14px;
  background: var(--surface);
  border-bottom: 1px solid #d3cec9;
  box-shadow: 0 1px 2px rgba(60,52,48,.10);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
}

.topbar .menu-toggle {
  display: none;   /* so aparece no celular */
}

.topbar .view-title {
  display: none;
}

.topbar-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 250px;
  width: 250px;
  color: #f47b45;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.topbar-logo .logo-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: #e56f43;
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
}

.topbar-search {
  max-width: 294px;
  flex: 0 1 294px;
  min-height: 32px !important;
  padding: 6px 12px !important;
  font-size: .88rem !important;
  border-radius: 3px !important;
}

.topbar-select {
  max-width: 190px;
  min-height: 32px !important;
  padding: 6px 10px !important;
  font-size: .88rem !important;
  border-radius: 3px !important;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: 0;
  color: #2f2a28;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.topbar-actions button:hover {
  color: var(--brand-dark);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 3px;
  background: #fff7f2;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.user-chip .avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--brand);
  border-radius: 50%;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
}

.user-chip .who {
  line-height: 1.1;
}

.user-chip .who b {
  display: block;
  font-size: .82rem;
  font-weight: 600;
}

.user-chip .who span {
  color: var(--ink-soft);
  font-size: .7rem;
}

/* ---------------------------------------------------------------
   Menu lateral (item 3)
   --------------------------------------------------------------- */
.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  background: #ff7b42;
  border-right: 0;
  position: relative;
  top: 0;
  height: 100%;
  min-height: calc(100dvh - var(--topbar-h));
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 45;
  transition: width .18s ease, box-shadow .18s ease;
}

.sidebar:hover,
.sidebar:focus-within {
  width: 205px;
  box-shadow: 3px 0 12px rgba(88, 54, 36, .18);
}

.sidebar::after {
  content: ">";
  content: "›";
  content: ">";
  position: absolute;
  left: 5px;
  top: 310px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 5px;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  pointer-events: none;
}

.sidebar-brand {
  display: none;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.22);
  color: #fff;
  font-weight: 700;
  font-size: .84rem;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 0;
}

.sidebar-group-label {
  display: none;
  padding: 13px 8px 6px 7px;
  color: rgba(255,255,255,.88);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.sidebar:hover .sidebar-group-label,
.sidebar:focus-within .sidebar-group-label {
  display: block;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  min-height: 45px;
  padding: 0;
  margin-bottom: 0;
  background: none;
  border: 0;
  border-radius: 0;
  color: #fff;
  font: inherit;
  font-size: .76rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
  overflow: hidden;
}

.nav-item:hover {
  background: rgba(165, 67, 25, .28);
  color: #fff;
}

.nav-item.active {
  background: transparent;
  box-shadow: none;
  color: #fff;
  font-weight: 600;
}

.sidebar:hover .nav-item.active,
.sidebar:focus-within .nav-item.active {
  background: rgba(165, 67, 25, .34);
}

.nav-item .icon {
  display: grid;
  place-items: center;
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  flex-shrink: 0;
}

.nav-item .icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item span:not(.icon) {
  display: none;
  color: #fff;
  font-weight: 600;
  opacity: 0;
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .12s ease;
}

.sidebar:hover .nav-item,
.sidebar:focus-within .nav-item {
  justify-content: flex-start;
}

.sidebar:hover .nav-item span:not(.icon),
.sidebar:focus-within .nav-item span:not(.icon) {
  display: inline;
  opacity: 1;
}

.sidebar-foot {
  margin-top: auto;
  padding: 0 3px 8px;
  border-top: 1px solid rgba(255,255,255,.25);
  flex-shrink: 0;
}

.sidebar-foot .btn {
  min-height: 36px;
  justify-content: center;
  padding: 0;
  color: rgba(255,255,255,.92);
}

.sidebar-foot .btn span:not(.icon) {
  display: none;
}

.sidebar:hover .sidebar-foot .btn,
.sidebar:focus-within .sidebar-foot .btn {
  justify-content: flex-start;
}

.sidebar:hover .sidebar-foot .btn span:not(.icon),
.sidebar:focus-within .sidebar-foot .btn span:not(.icon) {
  display: inline;
}

.sidebar-foot .btn:hover {
  background: rgba(165, 67, 25, .24);
  color: #fff;
}

.sidebar {
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar::after {
  content: none !important;
  display: none !important;
}

/* Fundo escuro quando o menu abre no celular */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(43, 36, 48, .45);
  z-index: 35;
}

/* ---------------------------------------------------------------
   Area de conteudo
   --------------------------------------------------------------- */
.content {
  grid-area: content;
  padding: 0;
  min-width: 0;   /* deixa tabelas largas rolarem em vez de esticar */
}

.content > .view:not(#view-agenda) {
  padding: 18px;
}

.view { display: none; }
.view.active { display: block; }

.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.view-head h2 { margin-right: auto; }

/* Aviso de tela ainda nao construida */
.placeholder {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 56px 24px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--ink-soft);
}

.placeholder .big { font-size: 40px; }
.placeholder h3 { color: var(--ink); }

/* ---------------------------------------------------------------
   Tablet
   --------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root { --sidebar-w: 45px; }

  .sidebar-brand span,
  .sidebar-group-label,
  .nav-item span:not(.icon) {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .sidebar-foot .btn span:not(.icon) { display: none; }
}

/* ---------------------------------------------------------------
   Celular: menu vira gaveta deslizante
   --------------------------------------------------------------- */
@media (max-width: 560px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "content";
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }

  .app.menu-open .sidebar { transform: translateX(0); }
  .app.menu-open .sidebar-backdrop { display: block; }

  /* No celular o menu aberto mostra os rotulos de novo */
  .sidebar-brand span,
  .sidebar-group-label,
  .nav-item span:not(.icon) {
    display: block;
  }

  .sidebar-brand {
    display: flex;
  }

  .nav-item {
    justify-content: flex-start;
    padding: 11px 12px;
    gap: 9px;
  }

  .sidebar-foot .btn span:not(.icon) { display: inline; }

  .topbar .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .topbar .view-title { font-size: 1rem; }
  .topbar-logo { min-width: auto; font-size: 1.25rem; }
  .topbar-search,
  .topbar-select,
  .topbar-actions { display: none; }

  /* No celular o nome do usuario sai; fica so o avatar */
  .user-chip .who { display: none; }
  .user-chip { padding: 4px; }

  .content { padding: 14px; }

  .view-head h2 { width: 100%; margin-right: 0; }
  .view-head .btn { flex: 1; }
}
