/* ===== Diretrizes digitais da Malta (versão suave) ===== */
:root {
  /* Cores oficiais */
  --all-black: #000000;
  --wooden-sword: #E1B17D;   /* detalhes */
  --white: #FFFFFF;

  /* Paleta de interface */
  --fundo: #FAF7F2;          /* fundo principal */
  --areia: #F3E5D5;          /* destaques suaves */
  --areia-forte: #EAD5BD;
  --acao: #795331;           /* botões e links */
  --acao-hover: #604024;
  --ink: #28231F;            /* títulos e texto */
  --ink-soft: #65594F;       /* texto secundário */
  --line: #E7DCCF;
  --line-strong: #DDCDBB;

  --font-title: 'Kodchasan', system-ui, sans-serif;
  --font-text: 'Lato', system-ui, sans-serif;

  --sidebar-w: 248px;
  --header-h: 68px;
  --radius: 14px;
  --sombra: 0 1px 2px rgba(40, 35, 31, .04), 0 4px 16px rgba(40, 35, 31, .04);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-text);
  color: var(--ink);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .eyebrow, .card__label, .card__value { font-family: var(--font-title); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--wooden-sword); outline-offset: 3px; }

.app { display: flex; min-height: 100vh; }

/* ===== Menu lateral ===== */
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--line);
  color: var(--ink);
  display: flex; flex-direction: column;
  padding: 24px 16px;
  z-index: 30;
  transition: transform .25s ease;
}
.sidebar__brand { display: block; padding: 4px 12px 28px; }
.sidebar__brand img { width: 96px; height: auto; display: block; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar__bottom { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }

.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15px;
  transition: background .15s, color .15s;
}
.nav-item:hover { color: var(--ink); background: var(--fundo); }
.nav-item.is-active { color: var(--acao); background: var(--areia); font-weight: 700; }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--wooden-sword);
}

/* ===== Área principal ===== */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-width: 0;
}

/* ===== Cabeçalho ===== */
.header {
  position: sticky; top: 0; z-index: 10;
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 32px;
  background: rgba(250, 247, 242, .88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header__menu {
  display: none;
  background: none; border: 0; padding: 8px; margin-left: -8px;
  color: var(--ink); cursor: pointer;
}
.header__title { font-size: 22px; font-weight: 600; margin: 0; }
.header__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--ink-soft);
}
.search svg { width: 18px; height: 18px; }
.search input { border: 0; background: none; outline: none; font: inherit; color: var(--ink); width: 180px; }
.search:focus-within { border-color: var(--wooden-sword); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--areia); color: var(--acao);
  font-family: var(--font-title); font-weight: 600; font-size: 14px;
}
.logout {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--white);
  border-radius: 999px; padding: 7px 12px;
  font: inherit; font-size: 14px; color: var(--ink-soft); cursor: pointer;
}
.logout svg { width: 16px; height: 16px; }
.logout:hover { color: var(--acao); border-color: var(--wooden-sword); }

/* Enquanto confere o login, não mostra o conteúdo */
body.is-checking { visibility: hidden; }

/* ===== Conteúdo ===== */
.content { flex: 1; padding: 32px; display: flex; flex-direction: column; gap: 24px; }

.hero {
  position: relative; overflow: hidden;
  background: var(--areia);
  color: var(--ink);
  border-radius: 22px;
  padding: 44px 48px;
  min-height: 220px;
  display: flex; align-items: center;
}
.hero__text { position: relative; max-width: 560px; }
.eyebrow { color: var(--acao); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 600; margin: 0 0 12px; }
.hero h2 { font-size: clamp(24px, 3vw, 36px); line-height: 1.15; letter-spacing: -.03em; margin: 0 0 14px; font-weight: 700; }
.hero p { margin: 0; color: var(--ink-soft); line-height: 1.6; }
.hero__symbol { position: absolute; right: 48px; bottom: 50%; transform: translateY(50%); width: 170px; opacity: .14; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--sombra);
}
.card__label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft);
}
.card__label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--wooden-sword); }
.card__value { font-size: 32px; font-weight: 700; margin: 10px 0 4px; }
.card__hint { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* ===== Rodapé ===== */
.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 20px 32px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--acao); text-decoration: underline; text-decoration-color: var(--wooden-sword); }

/* ===== Celular / tablet ===== */
.overlay { display: none; }
@media (max-width: 1180px) {
  .hero__text { max-width: 62%; }
  .hero__symbol { width: 140px; right: 32px; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(40,35,31,.12); }
  .sidebar.is-open { transform: none; }
  .overlay.is-open { display: block; position: fixed; inset: 0; background: rgba(40,35,31,.28); z-index: 20; }
  .main { margin-left: 0; }
  .header { padding: 0 16px; }
  .header__menu { display: block; }
  .search input { width: 110px; }
  .content { padding: 16px; }
  .hero { padding: 28px 24px; min-height: 0; border-radius: 18px; }
  .hero__text { max-width: none; }
  .hero__symbol { display: none; }
  .footer { padding: 16px; }
}
@media (max-width: 480px) {
  .search { display: none; }
  .logout span { display: none; }
}

/* Botão voltar no cabeçalho */
.header__voltar { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-strong); background: var(--white); color: var(--ink);
  border-radius: 999px; padding: 6px 12px 6px 8px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; flex: none; }
.header__voltar:hover { border-color: var(--wooden-sword); color: var(--acao); }
.header__voltar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 700px) { .header__voltar { padding: 6px; } .header__voltar span { display: none; } }
