:root {
  --white: #ffffff;
  --red: #ff3300;
  --navy: #1f2549;
  --blue: #203d88;
  --sand: #e7ccaa;
  --yellow: #efbe2b;
  --steel: #50718c;
  --indigo: #61329a;
  --green: #4faa67;

  --paper: #f4f4f6;
  --line: #dcdde4;
  --muted: #555a6e;
  --ink: #14162b;
  --on-dark-muted: #c9cbe0;
}

* {
  box-sizing: border-box;
}

html * {
  font-family: "Zen Kaku Gothic New", sans-serif;
  letter-spacing: 0.03rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--red);

  &:hover {
    color: var(--navy);
  }
}

h1 {
  margin: 0;
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: 0.3rem;
  color: var(--navy);
}

h2 {
  margin: 0;
  font-size: 18px;
  color: var(--navy);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.app {
  display: flex;
  flex-wrap: wrap;
  min-height: 100vh;
}

.app__main {
  flex: 999 1 560px;
  min-width: 0;
  padding: 40px 48px 64px;

  @media (max-width: 800px) {
    padding: 24px 16px 48px;
  }
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.page-header__eyebrow {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.page-header__lead {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 640px;
}

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

/* Sidebar */

.sidebar {
  flex: 1 1 248px;
  min-width: 0;
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 0;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
}

.sidebar__mark {
  width: 44px;
  height: 44px;
}

.sidebar__word {
  width: 140px;
  height: auto;
}

.sidebar__label {
  margin: -12px 0 0;
  padding: 0 24px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  color: var(--sand);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
}

.sidebar__link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 20px;
  color: var(--white);
  text-decoration: none;
  border-left: 4px solid transparent;

  &:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
  }

  &[aria-current="page"] {
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--red);
  }
}

.sidebar__cta {
  padding: 0 24px;
}

.sidebar__user {
  margin-top: auto;
  padding: 16px 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;

  span {
    color: var(--on-dark-muted);
  }

  button {
    align-self: flex-start;
    padding: 0;
    border: 0;
    background: none;
    color: var(--on-dark-muted);
    text-decoration: underline;
    cursor: pointer;
  }
}

/* Buttons */

.cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.cta {
  border: 0;
  background: var(--red);
  color: var(--white);

  &:hover {
    background: var(--navy);
    color: var(--white);
  }

  &[aria-busy="true"] {
    opacity: 0.7;
    pointer-events: none;
  }

  &:disabled {
    background: var(--line);
    color: var(--muted);
    cursor: not-allowed;
  }
}

.button {
  padding: 8px 20px;
  border: 2px solid var(--navy);
  background: var(--white);
  color: var(--navy);

  &:hover {
    background: var(--navy);
    color: var(--white);
  }
}

.button--small,
.cta--small {
  min-height: 36px;
  padding: 4px 14px;
  font-size: 13px;
}

.link-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--red);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

/* Blocks */

.card {
  background: var(--white);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card__note {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;

  > * {
    flex: 1 1 360px;
    min-width: 0;
  }
}

.band {
  background: var(--steel);
  color: var(--white);
  padding: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;

  h1 {
    color: var(--white);
    text-transform: none;
    letter-spacing: 0.03rem;
    font-size: 30px;
    font-weight: 900;
  }

  p {
    margin: 6px 0 0;
    font-weight: 700;
  }
}

.band__body {
  flex: 1 1 320px;
  min-width: 0;
}

.band .button {
  border-color: var(--white);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  background: var(--navy);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
}

.avatar--large {
  flex-basis: 70px;
  width: 70px;
  height: 70px;
  background: var(--white);
  color: var(--navy);
  font-size: 24px;
  font-weight: 900;
}

.person {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

/* Stats */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat {
  background: var(--white);
  border-top: 4px solid var(--navy);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  color: var(--muted);
}

.stat__value {
  font-size: 28px;
  font-weight: 900;
  color: var(--navy);
}

.stat__note {
  font-size: 14px;
  color: var(--muted);
}

/* Tables */

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06rem;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--navy);
  white-space: nowrap;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: top;
}

tfoot td {
  border-bottom: 0;
  font-weight: 900;
}

.num {
  text-align: right;
}

.muted {
  color: var(--muted);
  font-weight: 400;
}

.sub {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.empty {
  margin: 0;
  padding: 24px 0;
  color: var(--muted);
  text-align: center;
}

/* Status labels */

.status {
  display: inline-block;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 700;
}

.status--concept,
.status--open,
.status--ending {
  background: var(--sand);
  color: var(--navy);
}

.status--sent {
  background: var(--blue);
  color: var(--white);
}

.status--paid,
.status--complete,
.status--present {
  background: var(--steel);
  color: var(--white);
}

.status--empty,
.status--overdue {
  background: var(--navy);
  color: var(--white);
}

.status--planned {
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 400;
}

/* Tabs */

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

.tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 30px;
  border: 2px solid var(--line);
  background: var(--white);
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;

  &[aria-current="page"] {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--white);
  }
}

/* To-do list */

.todo {
  list-style: none;
  margin: 0;
  padding: 0;

  li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);

    &:last-child {
      border-bottom: 0;
    }
  }
}

.todo__kind {
  flex: 0 0 80px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  color: var(--muted);
}

.todo__text {
  flex: 1 1 240px;
}

/* Bars */

.bars {
  display: grid;
  grid-template-columns: 76px 1fr 96px;
  align-items: center;
  gap: 10px 12px;
  font-size: 14px;
}

.bars__bar {
  height: 18px;
  background: var(--navy);

  &.is-current {
    background: var(--blue);
  }
}

/* Definition lists */

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(130px, auto) 1fr;
  gap: 12px 20px;

  dt {
    color: var(--muted);
  }

  dd {
    margin: 0;
    font-weight: 700;
  }
}

/* Forms */

.form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px 20px;

  @media (max-width: 600px) {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;

  label {
    font-weight: 700;
    font-size: 14px;
  }

  &.is-required label::after {
    content: " *";
    color: var(--red);
  }
}

.field--wide {
  grid-column: 1 / -1;
}

.input,
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;

  &:focus {
    outline: 2px solid var(--navy);
    outline-offset: 1px;
  }
}

.field textarea {
  min-height: 110px;
}

.field__hint {
  font-size: 13px;
  color: var(--muted);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 0;
  margin: 0;
  padding: 0;

  legend {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
  }

  label {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 18px;
    border-radius: 30px;
    border: 2px solid var(--line);
    background: var(--white);
    color: var(--navy);
    font-weight: 700;
    cursor: pointer;

    &:has(input:checked) {
      background: var(--navy);
      border-color: var(--navy);
      color: var(--white);
    }

    &:has(input:focus-visible) {
      outline: 2px solid var(--red);
      outline-offset: 2px;
    }
  }

  input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
}

.errors {
  background: var(--sand);
  color: var(--navy);
  padding: 16px 20px;

  ul {
    margin: 6px 0 0;
    padding-left: 18px;
  }
}

.flash {
  padding: 14px 20px;
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
}

.flash--alert {
  background: var(--sand);
  color: var(--navy);
}

.summary {
  flex: 1 1 280px;
  min-width: 0;
  align-self: flex-start;
  background: var(--navy);
  color: var(--white);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;

  h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.12rem;
    color: var(--sand);
  }
}

.summary__big {
  font-size: 36px;
  font-weight: 900;
}

.summary__muted {
  font-size: 14px;
  color: var(--on-dark-muted);
}

.summary__rows {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;

  div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }
}

/* Weekstaat */

.week-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  h2 {
    font-size: 20px;
  }
}

.hours-input {
  width: 64px;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  text-align: right;
  font-size: 15px;

  &:focus {
    outline: 2px solid var(--navy);
    outline-offset: 1px;
    background: var(--white);
  }

  &[readonly] {
    background: transparent;
    outline: 0;
  }
}

/* Product activities */

.activities {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
  white-space: normal;
}

/* Login */

.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--navy);
}

.auth__card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth__brand {
  display: flex;
  align-items: center;
  gap: 12px;

  img {
    width: 44px;
    height: 44px;
  }

  span {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.3rem;
    color: var(--navy);
  }
}
