/* ==========================================================================
   MPAATANEL — Base Reset & Typography
   ========================================================================== */

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; }
html.sidebar-open, body.sidebar-open { overflow: hidden; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--bg-canvas) 0%, #edf4ff 55%, #f7fbff 100%);
  color: var(--text-primary);
  font-size: 14.5px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-2);
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; }

p { margin: 0 0 var(--space-3); color: var(--text-secondary); }

a { color: var(--info-500); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--navy-900); }

.tabular-nums { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

::selection { background: var(--gold-400); color: var(--navy-950); }

/* ---- Scrollbars ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg-canvas); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- App shell ---- */
.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.main-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-width);
}

.page-content {
  padding: var(--space-8);
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  animation: fadeInUp var(--transition-slow);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--navy-900);
}

.sidebar-backdrop { display: none; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .main-column { margin-left: 0; }
  .page-content { padding: var(--space-6); }
  .auth-shell { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 14px; }
  .page-content { padding: var(--space-4); }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 17px; }
  .section-title { align-items: flex-start; flex-direction: column; gap: var(--space-4); }
  .section-title > .btn, .section-title > a.btn { width: 100%; }

  .page-content {
    min-width: 0;
    overflow-x: clip;
  }

  .page-content > * {
    min-width: 0;
  }

  .section-title h1,
  .section-title h2,
  .section-title h3 {
    overflow-wrap: anywhere;
  }

  .btn,
  .btn-sm {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  [style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
