/* BespokeLife / private.moosetrail.xyz — Delad stilmall */

:root {
  --bg:        #f5f7fa;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --accent:    #2563eb;
  --accent2:   #16a34a;
  --text:      #1a202c;
  --muted:     #64748b;
  --radius:    12px;
  --font:      'Inter', system-ui, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Toppnavigering ── */
nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
nav .logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
nav a:hover { color: var(--text); }
nav .spacer { flex: 1; }

/* ── Sidinnehåll ── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0;
}
h2 {
  font-size: 0.9rem;
  font-weight: 400;
  margin-bottom: 0;
  color: var(--muted);
}
.page-title-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.header-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

/* ── Kort (landningssida) ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.card .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.card .title {
  font-size: 1.2rem;
  font-weight: 600;
}
.card .desc {
  font-size: 0.9rem;
  color: var(--muted);
}
.card.green:hover { border-color: var(--accent2); }

/* ── Sektion på dashboardsidor ── */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── KPI-rad ── */
.kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 1.1rem 0.2rem;
  flex: 1;
  min-width: 100px;
}
.kpi .label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.kpi .value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0;
  line-height: 1.2;
}
.kpi .sub { display: none; }

/* ── Status/laddning ── */
.loading {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 2rem 0;
  text-align: center;
}

/* ── Sticky toppsektion ── */
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding-top: 0.6rem;
  padding-bottom: 0;
  margin-bottom: 1.5rem;
}
.sticky-top .tab-nav {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* ── Datumfilter ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0;
  flex-wrap: wrap;
}
.period-btns { display: flex; gap: 0.35rem; }
.period-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}
.period-btn:hover { border-color: var(--accent); color: var(--accent); }
.period-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.date-inputs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.date-inputs input[type="date"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.28rem 0.55rem;
  font-size: 0.82rem;
  font-family: var(--font);
}

/* ── Natts puls navigering ── */
.natt-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.natt-nav button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  padding: 0.25rem 0.65rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}
.natt-nav button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.natt-nav button:disabled { opacity: 0.35; cursor: default; }
.natt-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  min-width: 7rem;
  text-align: center;
}

/* ── Dagtid-avdelare ── */
.dag-separator {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0.5rem 0 1.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.dag-separator::before,
.dag-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Grafbeskrivning ── */
.chart-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
  line-height: 1.55;
}

/* ── Graffotnot ── */
.chart-footer {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

/* ── Korrelationsgauges ── */
.korr-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.gauge-card {
  width: 130px;
  flex-shrink: 0;
  text-align: center;
  padding: 0.25rem 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.gauge-card svg { width: 100%; height: auto; display: block; }
.gauge-label {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 0.15rem;
  padding: 0 0.2rem;
}
.gauge-r {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.1rem;
}
.gauge-n {
  font-size: 0.62rem;
  color: var(--muted);
}

/* ── Fotnoter ── */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* ── Tabbar ───────────────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  font-family: var(--font);
  white-space: nowrap;
  margin-bottom: -2px;
  margin-right: 3px;
  position: relative;
}
.tab-btn:hover { color: var(--accent); background: var(--surface); }
.tab-btn.active {
  background: var(--surface);
  border-color: var(--border);
  border-bottom: 2px solid var(--surface);
  color: var(--accent);
  font-weight: 600;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
