/* esentiXX Hub – Farben und Schriften aus der esentiXX-Homepage (assets/styles.css). */

@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/schibsted-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/schibsted-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Markenwerte */
  --red: #9a191a;
  --red-bright: #e14747;
  --navy: #2a2f54;
  --navy-deep: #1e2242;
  --ink: #14172e;

  /* Rollen, hell */
  --bg: #f5f6fa;
  --bg-soft: #edeff6;
  --surface: #ffffff;
  --line: #dadeeb;
  --text: var(--ink);
  --muted: #4d5275;
  --accent: var(--red);
  --on-accent: #ffffff;
  --action: var(--navy);
  --action-text: #ffffff;
  --focus: #2a2f54;
  --tile-shadow: 0 1px 2px rgba(20, 23, 46, 0.05);

  --display: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Manrope', -apple-system, 'Segoe UI', Roboto, sans-serif;

  --side: 240px;
  --measure: 58rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1124;
    --bg-soft: #171b36;
    --surface: #171b36;
    --line: #2a315c;
    --text: #eef0f7;
    --muted: #b0b5d2;
    --accent: var(--red-bright);
    --on-accent: #14172e;
    --tile-shadow: none;
    --action: #eef0f7;
    --action-text: #14172e;
    --focus: #eef0f7;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 1.0625rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--surface);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip:focus {
  left: 0;
}

/* ------------------------------------------------------------------ Gerüst */

.shell {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1rem 1.5rem;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.6rem;
  margin-bottom: 2.25rem;
  font: 700 1.125rem/1 var(--display);
  letter-spacing: -0.015em;
  text-decoration: none;
}
.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
  padding: 3px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a,
.settings-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.6rem 0.55rem 0.85rem;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.nav a:hover,
.settings-link:hover {
  color: var(--text);
}
.nav a[aria-current='page'],
.settings-link[aria-current='page'] {
  color: var(--text);
  border-left-color: var(--accent);
  background: var(--bg);
}

.count {
  min-width: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.settings-link {
  margin-top: auto;
  font-size: 0.9375rem;
}

main {
  padding: 3rem clamp(1.25rem, 5vw, 4rem) 6rem;
  outline: none;
}
main > * {
  max-width: var(--measure);
}

/* ------------------------------------------------------------- Seitenkopf */

.page-head {
  margin-bottom: 2rem;
}
.page-head h1 {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.page-head p {
  margin-top: 0.5rem;
  color: var(--muted);
}

.section {
  margin-top: 3rem;
}
.section > h2 {
  font-size: 1.3125rem;
  margin-bottom: 0.75rem;
}
.section > .hint {
  margin-bottom: 0.75rem;
}

.hint,
.empty {
  color: var(--muted);
  font-size: 0.9375rem;
}
.empty {
  padding: 1rem 0;
}

/* ---------------------------------------------------------------- Eingabe */

input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}

input[type='text'],
input[type='date'],
input[type='search'],
input[type='password'],
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
textarea {
  min-height: 7rem;
  resize: vertical;
  line-height: 1.5;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}
label > input,
label > select,
label > textarea {
  margin-top: 0.3rem;
  color: var(--text);
  font-weight: 500;
  font-size: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover {
  border-color: var(--muted);
}
.btn.primary {
  background: var(--action);
  border-color: var(--action);
  color: var(--action-text);
}
.btn.primary:hover {
  filter: brightness(1.15);
}
.btn.quiet {
  border-color: transparent;
  padding: 0 0.6rem;
  color: var(--muted);
}
.btn.quiet:hover {
  color: var(--text);
}
.btn.small {
  min-height: 2.25rem;
  padding: 0 0.8rem;
  font-size: 0.9375rem;
}

.capture {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
  align-items: end;
}
.form-grid .wide {
  grid-column: 1 / -1;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* ------------------------------------------------------ Drei Prioritäten */

/* Kacheln: Übersicht oben auf "Heute", jede Kachel führt in ihren Bereich. */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--tile-shadow);
  text-decoration: none;
}
a.tile:hover {
  border-color: var(--muted);
}
.tile .num {
  font: 800 2.25rem/1 var(--display);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.tile.alert .num {
  color: var(--accent);
}
.tile .label {
  font-weight: 700;
}
.tile .sub {
  color: var(--muted);
  font-size: 0.875rem;
}

.priorities {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.priority {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 12.5rem;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--tile-shadow);
}
.priority.open {
  grid-column: 1 / -1;
}
.priority.free {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}
.priority .rank {
  font: 800 2.75rem/1 var(--display);
  letter-spacing: -0.04em;
  color: var(--accent);
  font-variant-numeric: lining-nums;
}
.priority.free .rank {
  color: var(--muted);
  opacity: 0.45;
}
.priority .title {
  font: 700 1.25rem/1.25 var(--display);
  letter-spacing: -0.015em;
  overflow-wrap: break-word;
  hyphens: auto;
}
.priority .meta {
  margin-top: 0.45rem;
}
.priority > .actions,
.priority > select {
  margin-top: auto;
}

/* ------------------------------------------------------------------ Listen */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--tile-shadow);
}
.row.done {
  background: transparent;
  box-shadow: none;
}
.row.plain {
  grid-template-columns: minmax(0, 1fr) auto;
}
.row .title {
  font-weight: 700;
  overflow-wrap: break-word;
  hyphens: auto;
}
.row.done .title {
  color: var(--muted);
  text-decoration: line-through;
}
.row-main {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.row-main:hover .title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.75rem;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.chip {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}
.chip.late {
  background: var(--accent);
  color: var(--on-accent);
}

.check {
  width: 1.625rem;
  height: 1.625rem;
  padding: 0;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.check::before {
  content: '';
  position: absolute;
  inset: -0.6rem;
}
.check:hover {
  border-color: var(--text);
}
.check[aria-pressed='true'] {
  background: var(--action);
  border-color: var(--action);
}
.check[aria-pressed='true']::after {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0.25rem;
  width: 0.375rem;
  height: 0.7rem;
  border: solid var(--action-text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.detail {
  grid-column: 1 / -1;
  padding: 1rem 0 0.25rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--line);
}
.detail input,
.detail select,
.detail textarea {
  background: var(--bg);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
}
.project-grid .tile .label {
  font: 700 1.125rem/1.25 var(--display);
  letter-spacing: -0.01em;
}
.detail .form-grid {
  margin-bottom: 0.75rem;
}

.history {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.history li {
  padding: 0.15rem 0;
}

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.filters select {
  width: auto;
}

.group-title {
  margin: 2.25rem 0 0.5rem;
  font-size: 1.0625rem;
}

.tag {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ Notiz */

.note {
  line-height: 1.6;
}
.note h2 {
  font-size: 1.375rem;
  margin: 0 0 0.75rem;
}
.note h3 {
  font-size: 1.0625rem;
  margin: 1.75rem 0 0.4rem;
}
.note h4 {
  font-size: 1rem;
  margin: 1.25rem 0 0.3rem;
}
.note p {
  margin: 0 0 0.6rem;
}
.note ul {
  margin: 0 0 0.6rem;
  padding-left: 1.2rem;
}
.note .blank {
  color: var(--muted);
  font-size: 0.9375rem;
}

.note + p,
textarea + .actions {
  margin-top: 1rem;
}

.banner {
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 10px 10px 0;
}

.back {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.back:hover {
  color: var(--text);
}

.status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.status-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.status-list .state {
  color: var(--muted);
}
.status-list .state.on {
  color: var(--text);
  font-weight: 700;
}

/* --------------------------------------------------------------- Hinweise */

.notice {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  max-width: min(32rem, calc(100vw - 2rem));
  padding: 0.75rem 1.1rem;
  background: var(--ink);
  color: #eef0f7;
  border-radius: 12px;
  font-weight: 600;
  z-index: 20;
}
.notice.error {
  background: var(--red);
}

.noscript {
  padding: 2rem;
}

/* -------------------------------------------------------- Schmale Geräte */

@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: calc(0.75rem + env(safe-area-inset-top)) 1.25rem 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    margin: 0;
    padding: 0;
  }
  .settings-link {
    margin: 0;
    padding: 0.4rem 0;
    border: 0;
    background: none !important;
  }
  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    flex-direction: row;
    gap: 0;
    padding: 0 0.25rem env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .nav a {
    flex: 1 1 0;
    justify-content: center;
    gap: 0.3rem;
    min-height: 3.5rem;
    padding: 0.25rem 0.1rem;
    border-left: 0;
    border-top: 3px solid transparent;
    border-radius: 0;
    font-size: 0.8125rem;
  }
  .nav a[aria-current='page'] {
    border-top-color: var(--accent);
    background: none;
  }
  .count {
    min-width: 1.25rem;
    padding: 0 0.3rem;
    font-size: 0.75rem;
  }
  main {
    padding: 1.75rem 1.25rem calc(6.5rem + env(safe-area-inset-bottom));
  }
  .capture {
    grid-template-columns: 1fr 1fr;
  }
  .capture input {
    grid-column: 1 / -1;
  }
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .priorities {
    grid-template-columns: minmax(0, 1fr);
  }
  .priority {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr);
    align-items: start;
    column-gap: 0.5rem;
    min-height: 0;
  }
  .priority > .actions,
  .priority > select,
  .priority > .detail {
    grid-column: 1 / -1;
  }
  .priority .rank {
    font-size: 2.5rem;
  }
  .row {
    padding: 0.85rem 0.9rem;
  }
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filters input {
    grid-column: 1 / -1;
  }
  .filters select {
    width: 100%;
  }
  .notice {
    bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .btn,
  .check,
  .nav a {
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
  }
}
