*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  /* Previne zoom no double-tap em iOS */
  touch-action: manipulation;
}

body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── App shell ── */
#shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: var(--screen-max);
  margin: 0 auto;
  position: relative;
}

/* Header */
#app-header {
  flex-shrink: 0;
  height: var(--header-h);
  background: var(--bg-overlay);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-3);
  position: relative;
  z-index: 10;
}

#app-logo {
  height: 32px;
  width: auto;
  display: block;
}

#app-header h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-yellow);
  text-shadow: 0 0 12px rgba(255,215,0,0.4);
  flex: 1;
}

#header-badge {
  /* Preenchido pelo router com badge de contexto */
}

/* Main content */
#app {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Scrollbar fina */
#app::-webkit-scrollbar { width: 3px; }
#app::-webkit-scrollbar-track { background: transparent; }
#app::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }

/* ── Screen ── */
.screen {
  min-height: 100%;
  padding: var(--space-5) var(--space-6) calc(var(--space-8) + var(--safe-bottom));
}

.screen-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.screen-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  min-height: 240px;
}

.empty-state-icon {
  font-size: 48px;
  opacity: 0.4;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 240px;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-default), transparent);
  margin: var(--space-5) 0;
}

/* ── Section label ── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

/* ════════════════════════════════════
   LANDSCAPE (celular deitado)
   ════════════════════════════════════ */

@media (orientation: landscape) and (max-height: 600px) {
  #shell {
    flex-direction: row;
    max-width: 100%;
  }

  /* Header ocupa espaço precioso na vertical — esconde */
  #app-header {
    display: none;
  }

  /* Conteúdo ocupa toda a altura */
  #app {
    flex: 1;
  }

  .screen {
    padding: var(--space-3) var(--space-5) var(--space-3);
  }

  /* Remove o espaço extra do bottom-nav que não existe mais embaixo */
  #app > .screen:last-child {
    padding-bottom: var(--space-3);
  }
}
