/* =============================================================
   NORA CRM - Base styles
   Reset + typography + global layout primitives
   ============================================================= */

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--nora-ink);
  background: var(--nora-stone);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--nora-ink);
}

h1 { font-size: 32px; line-height: 1.15; }
h2 { font-size: 24px; line-height: 1.2; }
h3 { font-size: 18px; line-height: 1.3; }
h4 { font-size: 16px; line-height: 1.35; }

p { line-height: 1.55; }

a { color: var(--nora-teal); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--nora-coral); }

button { font-family: inherit; cursor: pointer; border: 0; background: none; }

input, textarea, select {
  font-family: inherit;
  font-size: 14px;
  color: var(--nora-ink);
}

img, svg { display: block; max-width: 100%; }

/* ============== App shell ============== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: var(--content-pad);
  max-width: 100%;
  overflow-x: hidden;
}

.app-main-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.page-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--nora-ink-muted);
  margin-bottom: 6px;
}

.page-title { font-size: 28px; }

.page-subtitle {
  font-family: var(--font-serif);
  font-size: 16px;
  font-style: italic;
  color: var(--nora-ink-muted);
  margin-top: 4px;
}

.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============== Login layout (no sidebar) ============== */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--nora-stone) 0%, var(--nora-sand) 100%);
  padding: 20px;
}

.login-card {
  background: white;
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-logo-mark {
  width: 40px; height: 40px;
  background: var(--nora-teal);
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--nora-coral);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 22px;
}

.login-logo-text {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
}

.login-logo-text .crm {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--nora-ink-muted);
  margin-left: 6px;
  font-weight: 400;
}

/* ============== Utilities ============== */
.muted { color: var(--nora-ink-muted); }
.faint { color: var(--nora-ink-faint); }
.serif { font-family: var(--font-serif); }
.italic { font-style: italic; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; letter-spacing: 0.4px; }
.uppercase { text-transform: uppercase; letter-spacing: 0.5px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.mt-sm { margin-top: 8px; } .mt-md { margin-top: 16px; } .mt-lg { margin-top: 24px; } .mt-xl { margin-top: 32px; }
.mb-sm { margin-bottom: 8px; } .mb-md { margin-bottom: 16px; } .mb-lg { margin-bottom: 24px; } .mb-xl { margin-bottom: 32px; }

.text-right { text-align: right; }
.text-center { text-align: center; }

.hidden { display: none; }

/* ============== Responsive ============== */
@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }
  .app-main { padding: 18px; }
  .sidebar-label { display: none; }
}
