/* Esmeralda Kit v2 · Base reset + app-shell classes (verbatim from tokens.css) */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  /* Raleway usa algarismos old-style por padrão — força números "normais" (lining) em tudo */
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
}
h1, h2, h3, h4, h5, h6, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font-family: inherit; }
.tnum { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }

a { color: var(--mar-500); text-decoration: none; }
a:hover { color: var(--mar-600); text-decoration: underline; }

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ── APP SHELL ─────────────────────────────────────── */
.app-shell-root { background: var(--bg); min-height: 100vh; display: flex; }

.app-shell-sidebar {
  width: 232px; background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
  flex-shrink: 0; z-index: 60;
}

.app-shell-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 55; display: none;
}

.app-shell-burger {
  display: none;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--neutral-100);
  border: none; color: var(--text);
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}

.app-shell-header {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}

.app-shell-search {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 12px;
  background: var(--neutral-100);
  border-radius: 8px;
  width: 240px;
}

.app-shell-main { padding: 28px; flex: 1; min-width: 0; }

/* Login mobile hero */
.login-header-mobile { display: none; }
.login-header-mobile-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.18em;
  opacity: 0.85; margin-top: 4px;
}
@media (max-width: 767px) {
  .login-header-mobile {
    display: flex !important; flex-direction: column;
    align-items: center;
    position: absolute; top: 0; left: 0; right: 0;
    background: var(--mar-500); color: #fff;
    padding: 40px 24px 56px; gap: 10px;
    overflow: hidden;
    border-bottom-left-radius: 36px;
    border-bottom-right-radius: 36px;
    box-shadow: var(--shadow-mar-md);
    z-index: 1;
  }
  .login-main {
    padding-top: 240px !important;
    padding-bottom: 32px !important;
    justify-content: flex-start !important;
    min-height: 100vh;
  }
}

@media (max-width: 1023px) {
  .app-shell-sidebar {
    position: fixed; top: 0; left: 0;
    transform: translateX(-100%);
    transition: transform 220ms ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  }
  .app-shell-sidebar.open { transform: translateX(0); }
  .app-shell-backdrop { display: block; }
  .app-shell-burger { display: inline-flex; }
  .app-shell-header { padding: 12px 16px; gap: 10px; }
  .app-shell-search { display: none !important; }
  .app-shell-main { padding: 16px; }
}

@media (max-width: 640px) {
  .app-shell-main h1 { font-size: 18px !important; }
  [role="dialog"] {
    max-width: calc(100vw - 24px) !important;
    width: calc(100vw - 24px);
  }
  .app-shell-logout-label { display: none; }
  .form-grid-responsive { grid-template-columns: 1fr !important; }
  .form-grid-responsive-2 { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}
