:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  color: #202b3b;
  background: #f5f6f7;
  --navy: #172536;
  --muted: #586779;
  --line: #e4e8ec;
  --focus: #2567ab;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; font-size: 16px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.app-body { background: #f5f6f7; }
.app-shell { display: grid; min-width: 0; min-height: 100vh; grid-template-columns: 246px minmax(0, 1fr); }

/* Desktop navigation */
.sidebar {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  flex-direction: column;
  padding: 27px 16px 18px;
  color: #e5eaf0;
  background: var(--navy);
}
.sidebar :focus-visible { outline-color: #a8cdf4; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 29px; color: #fff; text-decoration: none; }
.brand strong { display: block; font-size: 16px; letter-spacing: .01em; }
.brand small { display: block; margin-top: 3px; color: #b4c0cc; font-size: 14px; letter-spacing: .12em; }
.brand-mark { display: grid; width: 35px; height: 35px; flex: none; place-items: center; border-radius: 10px; color: #fff; background: #405c79; font: 22px Georgia, serif; }
.primary-nav { display: grid; gap: 5px; }
.nav-item, .area-nav {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  color: #c4ced9;
  background: transparent;
  text-align: left;
  font-size: 14px;
}
.nav-item span { width: 18px; color: #91a5b8; font-size: 18px; text-align: center; }
.nav-item:hover, .area-nav:hover { color: #fff; background: #23374c; }
.nav-item.active { color: #fff; background: #2c4055; font-weight: 600; }
.nav-item.active span { color: #bbd1e6; }
.sidebar-section { margin-top: 34px; }
.sidebar-label { margin: 0 11px 10px; color: #b4c0cc; font-size: 12px; font-weight: 650; letter-spacing: .13em; }
.area-nav { min-height: 42px; gap: 10px; }
.area-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #a5b1bd; }
.dot-agentur { background: #83a8ce; }
.dot-helden { background: #c9ab7c; }
.dot-einzel { background: #9eaf93; }
.dot-ueber { background: #b4a1c8; }
.sidebar-bottom { margin-top: auto; padding: 17px 7px 0; border-top: 1px solid #344355; color: #b4c0cc; font-size: 12px; }
.private-indicator { margin-right: 8px; color: #81b394; font-size: 10px; }

/* Page header and controls */
.main-content { width: 100%; min-width: 0; max-width: 1600px; margin: 0 auto; padding: 0 5.3% 28px; }
.topbar { display: flex; min-height: 74px; align-items: center; justify-content: flex-end; gap: 12px; border-bottom: 1px solid #e6e9ec; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.mobile-brand { display: none; }
.demo-badge { padding: 7px 11px; border-radius: 20px; color: #586779; background: #eaedf0; font-size: 14px; }
.icon-button { display: inline-grid; width: 44px; height: 44px; flex: none; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: #405065; background: #fff; font-size: 20px; }
.quiet-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; color: #405065; background: #fff; font-size: 14px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 35px 0 25px; }
.eyebrow { margin: 0 0 9px; color: #586779; font-size: 12px; font-weight: 650; letter-spacing: .13em; }
.page-heading h1 { margin: 0; color: #1c2938; font-size: 29px; font-weight: 650; letter-spacing: -.03em; }
.subheading { margin: 8px 0 0; color: #586779; font-size: 14px; }
.primary-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 7px; padding: 0 18px; border: 0; border-radius: 8px; color: #fff; background: #365b7d; box-shadow: 0 1px 2px #12223422; font-size: 14px; font-weight: 600; }
.primary-button:hover { background: #2c4d6d; }
.primary-button:disabled { cursor: wait; opacity: .6; }
.summary-bar { display: flex; min-height: 67px; align-items: center; gap: 23px; margin-bottom: 18px; padding: 0 22px; border: 1px solid #e6e9ec; border-radius: 10px; color: #586779; background: #fff; font-size: 14px; }
.summary-bar div { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.summary-number { color: #26384b; font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.summary-bar i { height: 25px; border-left: 1px solid var(--line); }

/* Search and filters */
.filter-panel { display: flex; align-items: flex-end; gap: 11px; padding: 15px; border: 1px solid #e6e9ec; border-radius: 10px; background: #fff; }
.search-wrap { display: flex; min-width: 180px; height: 44px; flex: 1; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #dfe4e9; border-radius: 7px; color: #586779; }
.search-wrap span { font-size: 20px; }
.search-wrap input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0 !important; color: #273647; font-size: 14px; }
.search-wrap:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.filter-control { display: grid; min-width: 132px; gap: 5px; color: #586779; font-size: 14px; }
.filter-control select, .field input, .field select, .field textarea {
  min-width: 0;
  border: 1px solid #dfe4e9;
  border-radius: 7px;
  color: #344357;
  background-color: #fff;
  font-size: 14px;
}
.filter-control select, .field input, .field select { height: 44px; padding: 0 10px; }
.filter-control select, .field select {
  appearance: none;
  padding-right: 27px;
  background-image: linear-gradient(45deg, transparent 50%, #617184 50%), linear-gradient(135deg, #617184 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position: calc(100% - 15px) 19px, calc(100% - 10px) 19px;
  background-size: 5px 5px;
}
.reset-button { min-height: 44px; padding: 0 10px; border: 0; color: #405d78; background: transparent; font-size: 14px; white-space: nowrap; }

/* Task list */
.list-heading { display: flex; align-items: center; justify-content: space-between; margin: 26px 1px 10px; }
.list-heading h2 { margin: 0; color: #29384a; font-size: 17px; font-weight: 650; }
.result-count { color: #586779; font-size: 14px; }
.task-list { overflow: hidden; border: 1px solid #e4e8ec; border-radius: 10px; background: #fff; }
.task-row { display: grid; min-height: 77px; grid-template-columns: 44px minmax(180px, 1fr) minmax(250px, auto); align-items: center; gap: 13px; padding: 13px 18px; border-bottom: 1px solid #edf0f2; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #fbfcfd; }
.task-row.overdue { box-shadow: inset 3px 0 #c96e62; }
.task-check { display: grid; width: 44px; height: 44px; place-items: center; cursor: pointer; }
.task-check input { appearance: none; position: relative; width: 20px; height: 20px; margin: 0; border: 2px solid #738397; border-radius: 50%; background: #fff; }
.task-check input:checked { border-color: #426888; background: #426888; }
.task-check input:checked::after { position: absolute; top: -2px; left: 3px; color: #fff; content: "✓"; font-size: 14px; }
.task-main { display: grid; min-width: 0; min-height: 44px; gap: 4px; padding: 5px 0; border: 0; color: #283748; background: transparent; text-align: left; }
.task-title { overflow-wrap: anywhere; font-size: 16px; font-weight: 600; line-height: 1.35; }
.task-next { overflow-wrap: anywhere; color: #586779; font-size: 14px; line-height: 1.4; }
.completed .task-title { color: #596779; text-decoration: line-through; }
.task-meta { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.area-pill, .status-pill, .task-due, .priority-mark, .result-link { font-size: 14px; line-height: 1.3; white-space: nowrap; }
.area-pill, .status-pill { padding: 6px 9px; border-radius: 20px; color: #4b5c6e; background: #f0f3f5; }
.area-agentur { color: #3d5e7d; background: #eaf1f7; }
.area-helden { color: #70552f; background: #f5f0e7; }
.area-einzel { color: #4b6144; background: #edf1ea; }
.area-uebergreifend { color: #5e4d72; background: #f1edf5; }
.status-aktiv { color: #365d7e; background: #eaf1f6; }
.status-entscheidung { color: #70552f; background: #f5efe5; }
.status-wartet { color: #5d5267; background: #f0eef2; }
.status-erledigt { color: #45634d; background: #eaf2eb; }
.task-due { padding: 5px; color: #4b5d70; }
.due-overdue, .priority-mark { color: #963f36; font-weight: 600; }
.result-link { padding: 6px 2px; color: #365d7e; text-decoration: none; }
.result-link:hover { text-decoration: underline; }
.state-message { display: flex; min-height: 125px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 25px; color: #586779; text-align: center; font-size: 14px; }
.state-message strong { color: #354559; font-size: 16px; }
.error-state { color: #963f36; }
.notice { display: flex; align-items: center; gap: 13px; margin: 12px 0; padding: 11px 14px; border-radius: 8px; color: #385b78; background: #edf3f7; font-size: 14px; }
.notice[hidden] { display: none; }
.undo-button { min-height: 36px; padding: 4px 2px; border: 0; color: #294e6f; background: transparent; font-size: 14px; font-weight: 650; text-decoration: underline; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; padding: 16px 2px; color: #586779; font-size: 12px; }

/* Task dialog */
.task-dialog { width: min(620px, calc(100vw - 28px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 0; border: 1px solid #dfe4e8; border-radius: 13px; color: #253448; box-shadow: 0 18px 70px #14223440; }
.task-dialog::backdrop { background: #18253677; backdrop-filter: blur(2px); }
.task-dialog form { padding: 25px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 21px; }
.dialog-header h2 { margin: 0; font-size: 22px; }
.stable-id { margin: 5px 0 0; color: #586779; font-size: 12px; }
.dialog-error { margin: 0 0 14px; padding: 10px 12px; border-radius: 7px; color: #8f342c; background: #fff0ee; font-size: 14px; }
.dialog-error[hidden] { display: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: grid; gap: 7px; color: #4d5b6d; font-size: 14px; font-weight: 550; }
.field input, .field select, .field textarea { width: 100%; font-weight: 400; }
.field textarea { min-height: 84px; padding: 10px; font-family: inherit; resize: vertical; }
.full-field { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; padding-top: 23px; border-top: 1px solid var(--line); }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; transform: translateY(-160%); padding: 12px 16px; border-radius: 6px; color: #fff; background: #172536; font-size: 14px; }
.skip-link:focus { transform: translateY(0); }

/* Login */
.login-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: #f3f5f6; }
.login-card { width: min(100%, 420px); padding: 35px 37px; border: 1px solid #e2e7eb; border-radius: 15px; background: #fff; box-shadow: 0 12px 42px #23374c0d; }
.login-brand { margin-bottom: 42px; padding: 0; color: #223144; }
.login-brand small { color: #586779; }
.login-card .eyebrow { margin-bottom: 10px; }
.login-card h1 { margin: 0; color: #1d2b3b; font-size: 26px; letter-spacing: -.03em; }
.login-copy { margin: 9px 0 24px; color: #586779; font-size: 14px; line-height: 1.55; }
.login-card form { display: grid; gap: 13px; }
.login-card .field input { height: 48px; }
.login-submit { width: 100%; justify-content: center; margin-top: 2px; }
.login-error { margin: 0; color: #8f342c; font-size: 14px; }
.login-error[hidden] { display: none; }
.login-privacy { margin: 25px 0 0; color: #586779; font-size: 14px; text-align: center; }
.login-privacy span { margin-right: 6px; color: #50775b; }

@media (max-width: 1050px) {
  .main-content { padding-inline: 3.5%; }
  .filter-panel { flex-wrap: wrap; }
  .search-wrap { flex: 1 1 100%; }
  .filter-control { min-width: 130px; flex: 1; }
  .task-row { grid-template-columns: 44px minmax(170px, 1fr); }
  .task-meta { grid-column: 2; justify-content: flex-start; }
}

@media (max-width: 700px) {
  .app-shell { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-width: 0; min-height: auto; padding: 0; background: var(--navy); }
  .sidebar > .brand, .sidebar-section, .sidebar-bottom { display: none; }
  .primary-nav { display: flex; width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overflow-y: hidden; gap: 4px; padding: 0 10px 9px; scrollbar-width: thin; }
  .nav-item { min-height: 44px; flex: 0 0 auto; gap: 7px; padding: 0 11px; }
  .main-content { min-width: 0; padding: 0 16px 20px; }
  .topbar { min-height: 0; flex-wrap: wrap; justify-content: space-between; gap: 0; padding: 9px 0 8px; }
  .mobile-brand { display: flex; min-height: 44px; align-items: center; gap: 8px; color: #273648; font-size: 14px; }
  .mobile-brand .brand-mark { width: 29px; height: 29px; border-radius: 8px; font-size: 18px; }
  .topbar-right { width: 100%; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .demo-badge { order: 3; width: 100%; padding: 7px 0 0; border-radius: 0; text-align: left; background: transparent; font-size: 12px; }
  .quiet-button { min-height: 44px; padding: 0 10px; }
  .page-heading { align-items: flex-start; gap: 14px; padding: 25px 0 17px; }
  .page-heading h1 { font-size: 24px; line-height: 1.15; }
  .subheading { font-size: 14px; }
  .page-heading .primary-button { min-height: 44px; flex: none; padding: 0 12px; }
  .summary-bar { min-height: 62px; gap: 10px; justify-content: space-between; padding: 10px 12px; }
  .summary-bar div { display: grid; gap: 1px; font-size: 14px; }
  .summary-number { font-size: 18px; }
  .summary-bar i { height: 25px; }
  .filter-panel { min-width: 0; gap: 8px; padding: 10px; }
  .filter-control { min-width: calc(50% - 5px); font-size: 14px; }
  .filter-control select { height: 44px; font-size: 14px; }
  .search-wrap { height: 44px; }
  .reset-button { min-height: 44px; }
  .list-heading { margin-top: 21px; }
  .task-row { min-height: 76px; grid-template-columns: 44px minmax(0, 1fr); gap: 7px; padding: 12px 9px; }
  .task-meta { gap: 6px; }
  .area-pill, .status-pill, .task-due, .priority-mark, .result-link { font-size: 14px; }
  .page-footer { gap: 8px; font-size: 12px; }
  .task-dialog form { padding: 20px; }
  .login-card { padding: 29px 24px; }
}

@media (max-width: 390px) {
  .nav-item { gap: 6px; padding-inline: 9px; font-size: 14px; }
  .nav-item span { width: 16px; }
  .page-heading { display: grid; }
  .page-heading .primary-button { justify-self: start; }
  .summary-bar { gap: 7px; }
  .summary-bar div { font-size: 14px; }
}
