/* =====================================================================
   global.css — design tokens, reset, layout skeleton, typography
   ===================================================================== */

:root {
  /* Brand — one accent colour, used sparingly */
  --primary-900: #0b4f4a;
  --primary-700: #0f766e;
  --primary-600: #0d9488;
  --primary-100: #ccfbf1;
  --primary-50:  #f0fdfa;

  /* Neutrals */
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --line:    #e2e8f0;
  --line-strong: #cbd5e1;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --canvas: #f1f5f9;

  /* Semantic — status only, never decoration */
  --success-700: #15803d;
  --success-50:  #f0fdf4;
  --warn-700:    #b45309;
  --warn-50:     #fffbeb;
  --danger-700:  #b91c1c;
  --danger-600:  #dc2626;
  --danger-50:   #fef2f2;
  --info-700:    #1d4ed8;
  --info-50:     #eff6ff;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow:    0 1px 3px rgba(15, 23, 42, .08), 0 6px 16px -6px rgba(15, 23, 42, .10);
  --shadow-lg: 0 10px 40px -12px rgba(15, 23, 42, .28);

  --sidebar-w: 248px;
  --topbar-h: 60px;
  --bottomnav-h: 62px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --font-num: "SF Mono", ui-monospace, "Segoe UI Mono", Menlo, Consolas, monospace;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-900);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p  { margin: 0 0 10px; }
a  { color: var(--primary-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Numbers line up in tables and stat cards */
.num { font-variant-numeric: tabular-nums; }

.muted      { color: var(--ink-500); }
.small      { font-size: 13px; }
.strong     { font-weight: 600; }
.nowrap     { white-space: nowrap; }
.text-right { text-align: right; }
.hidden     { display: none !important; }

/* Screen-reader only, but focusable (skip links) */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------------
   App shell
   Desktop: fixed sidebar + scrolling main column.
   Mobile:  sidebar becomes a bottom nav (see responsive.css).
   --------------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;                 /* lets wide tables scroll instead of pushing the page */
}

.view {
  padding: 22px 26px 40px;
  flex: 1;
  max-width: 1240px;
  width: 100%;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.view-header .subtitle {
  color: var(--ink-500);
  font-size: 13.5px;
  margin-top: 3px;
}

.view-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Section grids */
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stack { display: flex; flex-direction: column; gap: 14px; }
.row   { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------------------------------------------------------------------
   Auth pages (login)
   --------------------------------------------------------------------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.auth-card { width: 100%; max-width: 380px; }

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

.auth-aside {
  background: linear-gradient(160deg, var(--primary-700), var(--primary-900));
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-aside h2 { font-size: 26px; line-height: 1.25; max-width: 420px; }
.auth-aside p  { color: rgba(255,255,255,.82); max-width: 420px; margin-top: 12px; }

.auth-aside ol {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
}

.auth-aside li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.9);
  font-size: 14px;
}

.auth-aside li span {
  width: 22px; height: 22px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  font-size: 12px;
  font-weight: 600;
}
