/* Fluent 2-design (Microsoft) – farver og værdier fra Fluent 2's design tokens */
:root {
  /* Brand (blå) */
  --brand: #0f6cbd;          /* colorBrandBackground */
  --brand-hover: #115ea3;    /* colorBrandBackgroundHover */
  --brand-pressed: #0c3b5e;  /* colorBrandBackgroundPressed */
  --brand-fg: #0f6cbd;       /* colorBrandForeground1 */
  --brand-fg2: #115ea3;
  --brand-bg2: #ebf3fc;      /* colorBrandBackground2 */
  --brand-stroke: #b4d6fa;   /* colorBrandStroke2 */
  --header: #0f548c;         /* mørkere brand til topbjælken */

  /* Neutrale */
  --canvas: #f5f5f5;         /* colorNeutralBackground3 */
  --surface: #ffffff;        /* colorNeutralBackground1 */
  --surface-2: #fafafa;      /* colorNeutralBackground2 */
  --surface-hover: #f5f5f5;
  --fg1: #242424;            /* colorNeutralForeground1 */
  --fg2: #424242;
  --fg3: #616161;
  --stroke1: #d1d1d1;        /* colorNeutralStroke1 */
  --stroke2: #e0e0e0;
  --stroke-access: #616161;  /* colorNeutralStrokeAccessible */

  --danger: #c50f1f;         /* colorPaletteRedBackground3 */
  --danger-hover: #b10e1c;
  --success-bg: #f1faf1;
  --success-fg: #0e700e;

  --r-m: 4px;                /* borderRadiusMedium */
  --r-l: 8px;                /* borderRadiusLarge */
  --shadow4: 0 0 2px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.14);
  --shadow8: 0 0 2px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.14);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px; line-height: 20px;
  background: var(--canvas);
  color: var(--fg1);
  -webkit-font-smoothing: antialiased;
}

/* Topbjælke (som i Microsoft 365) */
nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--header);
  height: 48px; padding: 0 16px;
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  box-shadow: var(--shadow4);
}
nav .brand { color: #fff; font-weight: 600; font-size: 16px; margin-right: 16px; }
nav a, nav button.link {
  color: #fff; text-decoration: none; font-weight: 400;
  padding: 6px 10px; border-radius: var(--r-m); opacity: .92;
}
nav a:hover, nav button.link:hover { background: rgba(255,255,255,.12); opacity: 1; }
nav form { margin-left: auto; }

main { max-width: 960px; margin: 0 auto; padding: 24px 20px 48px; }
h1 { font-size: 28px; line-height: 36px; font-weight: 600; margin: 0 0 20px; }   /* Title 2 */
h2 { font-size: 16px; line-height: 22px; font-weight: 600; margin: 24px 0 8px; color: var(--fg1); }  /* Subtitle 2 */

/* Kort (Fluent Card) */
.card {
  background: var(--surface);
  border-radius: var(--r-l);
  box-shadow: var(--shadow4);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.narrow { max-width: 440px; }

/* Felter (Fluent Input / Dropdown / Textarea) */
label { display: block; margin-bottom: 16px; font-weight: 600; color: var(--fg1); }
label small { display: block; font-weight: 400; color: var(--fg3); margin-top: 4px; font-size: 12px; line-height: 16px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px;
  min-height: 32px; padding: 5px 10px;
  font: inherit; font-weight: 400; color: var(--fg1);
  background: var(--surface);
  border: 1px solid var(--stroke1);
  border-bottom-color: var(--stroke-access);
  border-radius: var(--r-m);
  transition: border-color .1s, box-shadow .1s;
}
textarea { resize: vertical; padding-top: 6px; }
input:hover, select:hover, textarea:hover { border-color: #c7c7c7; border-bottom-color: var(--fg2); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-bottom-color: var(--brand);
  box-shadow: inset 0 -1px 0 0 var(--brand);  /* Fluent: blå understregning ved fokus */
}

/* Knapper (Fluent Button) */
button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 32px; padding: 5px 16px;
  font: inherit; font-weight: 600;
  border: 1px solid transparent; border-radius: var(--r-m);
  background: var(--brand); color: #fff;
  cursor: pointer; text-decoration: none;
  transition: background .1s;
}
button:hover, .button:hover { background: var(--brand-hover); }
button:active, .button:active { background: var(--brand-pressed); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--fg1); outline-offset: 2px; }
button.link { background: none; border: 0; min-height: 0; font-weight: 400; }
button.danger { background: var(--danger); }
button.danger:hover { background: var(--danger-hover); }
a.button { background: var(--surface); color: var(--fg1); border-color: var(--stroke1); }   /* Secondary */
a.button:hover { background: var(--surface-hover); border-color: #c7c7c7; }

.inline { display: inline; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 16px; }
.inline-form label, .inline-form input, .inline-form select { margin: 0; width: auto; display: inline-block; }
.inline-form label { display: flex; align-items: center; gap: 8px; }

/* Ny registrering */
.entry .row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 12px; align-items: start; }
.duration { margin-bottom: 16px; font-weight: 600; }
.duration span { display: block; }
.duration output {
  display: flex; align-items: center; margin-top: 4px;
  min-height: 32px; padding: 5px 10px;
  background: var(--brand-bg2); color: var(--brand-fg2);
  border: 1px solid var(--brand-stroke); border-radius: var(--r-m);
  font-weight: 600;
}
#ugenr { color: var(--brand-fg); font-weight: 600; }

/* Summer */
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.totals .card { margin: 0; border-left: 4px solid var(--brand-stroke); }
.totals .card:first-child { border-left-color: var(--brand); }
.totals span { display: block; color: var(--fg3); font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.totals strong { display: block; font-size: 28px; line-height: 36px; font-weight: 600; margin-top: 4px; }
.totals .card:first-child strong { color: var(--brand-fg); }

/* Månedsnavigation */
.monthnav { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 12px; }
.monthnav a { color: var(--brand-fg); text-decoration: none; font-weight: 600; padding: 6px 12px; border-radius: var(--r-m); }
.monthnav a:hover { background: var(--brand-bg2); }
.monthnav strong { font-size: 20px; line-height: 28px; font-weight: 600; }

/* Tabel (Fluent DataGrid) */
table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface);
  border-radius: var(--r-l); box-shadow: var(--shadow4);
  overflow: hidden; margin-bottom: 20px;
}
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--stroke2); vertical-align: middle; }
thead th { background: var(--surface); color: var(--fg2); font-weight: 600; border-bottom: 1px solid var(--stroke1); }
tbody tr:hover td { background: var(--surface-hover); }
tbody td a { color: var(--brand-fg); font-weight: 600; text-decoration: none; }
tbody td a:hover { text-decoration: underline; }
tr.weekhead td {
  background: var(--brand-bg2); color: var(--brand-fg2);
  font-weight: 600; padding: 6px 12px; border-bottom-color: var(--brand-stroke);
}
tr.weekhead span { font-weight: 400; color: var(--fg2); margin-left: 8px; }
tr.weeksum td { background: var(--surface-2); font-weight: 600; color: var(--fg1); }
tr.weekhead:hover td { background: var(--brand-bg2); }
tr.weeksum:hover td { background: var(--surface-2); }
tfoot th { background: var(--brand); color: #fff; border-bottom: 0; font-size: 16px; }
.nowrap { white-space: nowrap; }

/* Beskeder (Fluent MessageBar) */
.muted { color: var(--fg3); }
.flash, .error { padding: 8px 12px; border-radius: var(--r-m); margin-bottom: 16px; border: 1px solid; }
.flash { background: var(--success-bg); color: var(--success-fg); border-color: #9fd89f; }
.error { background: #fdf3f4; color: #b10e1c; border-color: #eeacb2; }

@media (max-width: 640px) {
  nav { height: auto; min-height: 48px; padding: 6px 8px; }
  nav .brand { width: 100%; margin: 2px 0 0 10px; }
  main { padding: 16px 12px 32px; }
  h1 { font-size: 24px; line-height: 32px; }
  input, select, textarea, button, .button { min-height: 40px; }   /* større touch-flader */
  .entry .row { grid-template-columns: 1fr 1fr; }
  .duration output { min-height: 40px; }
  .totals { gap: 10px; }
  .totals strong { font-size: 22px; line-height: 28px; }
  th, td { padding: 8px 8px; font-size: 13px; }
  table { display: block; overflow-x: auto; }
}
