/* =========================================================================
   LinkedIn Dashboard — design i samme stil som www.opvaekst.dk
   Tokens hentet direkte fra opvaekst.dk's CSS.
   ========================================================================= */

:root {
  --bg:        #f3ede1;   /* varm cremehvid "papir" */
  --bg-soft:   #ece5d5;   /* lidt dybere creme */
  --card:      #fbf8f1;   /* kort-baggrund */
  --card-2:    #ffffff;
  --ink:       #0f0f17;   /* næsten-sort tekst */
  --sub:       #4b4b5a;   /* dæmpet tekst */
  --blue:      #2236ff;   /* brand-blå / accent */
  --green:     #1fbf5c;   /* vækst / positiv */
  --red:       #e0564f;   /* fald / negativ */
  --line:      rgba(15, 15, 23, 0.14);
  --line-soft: rgba(15, 15, 23, 0.08);
  --white:     #fff;

  --accent:    var(--blue);   /* kan overstyres pr. kunde */

  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --radius:    18px;
  --radius-sm: 12px;
  --pill:      999px;
  --shadow:    0 1px 2px rgba(15,15,23,.04), 0 8px 30px rgba(15,15,23,.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 .4em;
}
h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 400; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.muted { color: var(--sub); }
.diamond { color: var(--accent); }

/* ------------------------------------------------------------------ layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 70%, white);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(140%) blur(8px);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .logo {
  font-family: var(--font-display); font-weight: 600; font-size: 1.3rem;
  color: var(--ink); letter-spacing: -0.02em;
}
.brand .sep { color: var(--accent); }
.brand .tag { color: var(--sub); font-size: .85rem; }
.header-right { display: flex; align-items: center; gap: 16px; font-size: .9rem; }
.header-right .who { color: var(--sub); }

main { padding: 36px 0 80px; }

/* ------------------------------------------------------------------ pills/buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 500; font-size: .92rem;
  padding: 10px 18px; border-radius: var(--pill);
  border: 1px solid var(--ink); background: var(--ink); color: var(--bg);
  cursor: pointer; transition: transform .08s ease, opacity .15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn:active { transform: translateY(1px); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.sm { padding: 7px 14px; font-size: .85rem; }
.btn.danger { background: transparent; color: var(--red); border-color: color-mix(in oklab, var(--red) 40%, transparent); }
.btn.danger:hover { background: color-mix(in oklab, var(--red) 10%, transparent); }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.card.tight { padding: 18px 20px; }

.section-head {
  display: flex; align-items: center; gap: 12px;
  margin: 44px 0 18px;
}
.section-head h2 { margin: 0; }
.section-head::before {
  content: "◆"; color: var(--accent); font-size: .8rem;
}
.section-sub { color: var(--sub); font-size: .9rem; margin: -10px 0 18px; }

/* ------------------------------------------------------------------ KPI grid */
.kpi-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.kpi {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.kpi .label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--sub); font-weight: 600;
}
.kpi .value {
  font-family: var(--font-mono); font-size: 2rem; font-weight: 600;
  margin-top: 8px; letter-spacing: -0.02em; line-height: 1;
}
.kpi .sub { font-size: .8rem; color: var(--sub); margin-top: 8px; }
.delta { font-family: var(--font-mono); font-weight: 600; font-size: .82rem; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.delta.flat { color: var(--sub); }

/* ------------------------------------------------------------------ chart grid */
.grid-2 { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }
.chart-card h3 { margin-bottom: 4px; }
.chart-card .hint { color: var(--sub); font-size: .82rem; margin-bottom: 14px; }
.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 340px; }

/* ------------------------------------------------------------------ period selector */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 8px;
}
.segmented { display: inline-flex; background: var(--bg-soft); border-radius: var(--pill); padding: 4px; gap: 2px; }
.segmented button {
  border: 0; background: transparent; color: var(--sub);
  font-family: var(--font-body); font-weight: 500; font-size: .85rem;
  padding: 7px 14px; border-radius: var(--pill); cursor: pointer;
}
.segmented button.active { background: var(--ink); color: var(--bg); }
.segmented.wrap { flex-wrap: wrap; max-width: 420px; justify-content: flex-end; }
.segmented.wrap button { font-size: .8rem; padding: 6px 12px; }

/* ------------------------------------------------------------------ posts */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.post-list li:last-child { border-bottom: 0; }
.post-rank {
  font-family: var(--font-mono); color: var(--sub); font-size: .8rem;
  width: 22px; text-align: right;
}
.post-metric { font-family: var(--font-mono); font-weight: 600; font-size: 1.05rem; min-width: 64px; }
.post-meta { flex: 1; min-width: 0; }
.post-meta .date { font-size: .8rem; color: var(--sub); }
.post-meta a { font-size: .9rem; }

/* ------------------------------------------------------------------ post cards (preview) */
.posts-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.post-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.post-card-head { padding: 16px 18px 14px; }
.post-card-head .title {
  font-family: var(--font-display); font-weight: 500; font-size: 1.02rem;
  line-height: 1.25; margin-bottom: 10px;
}
.post-card-head .meta { font-size: .82rem; color: var(--sub); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { background: var(--bg-soft); border-radius: var(--pill); padding: 3px 11px; color: var(--ink); font-size: .78rem; }
.post-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.post-actions .open { font-size: .82rem; }
.post-embed { background: var(--bg-soft); }
.post-embed iframe { display: block; width: 100%; height: 540px; border: 0; border-top: 1px solid var(--line-soft); }

/* ------------------------------------------------------------------ demographics */
.demo-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.demo-row { margin: 10px 0; }
.demo-row .top { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 5px; gap: 10px; }
.demo-row .top .name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-row .top .pct { font-family: var(--font-mono); color: var(--sub); flex-shrink: 0; }
.demo-bar { height: 8px; background: var(--bg-soft); border-radius: var(--pill); overflow: hidden; }
.demo-bar > span { display: block; height: 100%; background: var(--accent); border-radius: var(--pill); }

/* ------------------------------------------------------------------ tables (admin) */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line-soft); }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sub); font-weight: 600; }
.table td.mono { font-family: var(--font-mono); }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 600; padding: 3px 10px;
  border-radius: var(--pill); background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: var(--accent); text-transform: uppercase; letter-spacing: .04em;
}
.badge.gray { background: var(--bg-soft); color: var(--sub); }

/* ------------------------------------------------------------------ forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--sub); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--white); color: var(--ink);
  font-family: var(--font-body); font-size: .95rem;
}
.field input:focus, .field select:focus { outline: 2px solid color-mix(in oklab, var(--accent) 50%, transparent); border-color: var(--accent); }
.field input[type="color"] { padding: 4px; height: 44px; cursor: pointer; }
.row-2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .row-2 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ upload dropzone */
.dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 28px; text-align: center; background: var(--bg-soft);
  transition: border-color .15s ease, background .15s ease; cursor: pointer;
}
.dropzone.drag { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 8%, var(--bg-soft)); }
.dropzone .big { font-family: var(--font-display); font-size: 1.1rem; }
.dropzone .file-name { margin-top: 10px; font-family: var(--font-mono); font-size: .85rem; color: var(--accent); }

/* ------------------------------------------------------------------ flash */
.flashes { margin: 18px 0 0; padding: 0; list-style: none; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 10px; font-size: .92rem; border: 1px solid var(--line); }
.flash.success { background: color-mix(in oklab, var(--green) 12%, var(--bg)); border-color: color-mix(in oklab, var(--green) 40%, transparent); }
.flash.error { background: color-mix(in oklab, var(--red) 12%, var(--bg)); border-color: color-mix(in oklab, var(--red) 40%, transparent); }

/* ------------------------------------------------------------------ login */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 1.8rem; }
.login-logo { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; margin-bottom: 6px; }
.login-logo .sep { color: var(--accent); }

/* ------------------------------------------------------------------ misc */
.stack { display: flex; flex-direction: column; gap: 0; }
.flex { display: flex; align-items: center; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.gap-sm { gap: 8px; }
.mt { margin-top: 24px; }
.mt-lg { margin-top: 40px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--sub); }
.empty-state .big { font-family: var(--font-display); font-size: 1.4rem; color: var(--ink); margin-bottom: 8px; }
.hr-diamond { text-align: center; color: var(--accent); margin: 40px 0; letter-spacing: 8px; }
.client-name-lg { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.02em; }
.report-meta { color: var(--sub); font-size: .9rem; }
footer.site-footer { border-top: 1px solid var(--line); color: var(--sub); font-size: .82rem; padding: 24px 0; margin-top: 60px; }
