/* Get it done · Grundgestaltung im smartvillage-Design (design system smartvillage v3, Corporate Design Manual 2025).
   Hell, ruhig, flach: Sand als Grund, Navy für Schrift und Seitenleiste, Hellblau für ruhige Flächen und Auswahl,
   Coral nur für Handlungsknöpfe, Links und das eine Akzentwort. Keine Schatten, keine Verläufe, kein Emoji.
   Schrift: ATC Arquette (lizenziert), Fallback Arial. */

@font-face { font-family: 'ATC Arquette'; src: url('/assets/fonts/ATCArquette-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'ATC Arquette'; src: url('/assets/fonts/ATCArquette-Medium.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'ATC Arquette'; src: url('/assets/fonts/ATCArquette-Semibold.otf') format('opentype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'ATC Arquette'; src: url('/assets/fonts/ATCArquette-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;

  /* Markenfarben */
  --sv-blue: #000831;        /* Hauptfarbe, Pantone 282 C */
  --sv-coral: #FF5A49;       /* Akzent, Pantone Warm Red C – nur Handlungsknöpfe, Links, Akzentwort, überfällig */
  --sv-coral-dark: #E84D3D;
  --done-green: #4FA37C;     /* erledigt-Haken wie bei Asana */  /* Coral beim Darüberfahren, rund 8 % dunkler */
  --sv-light-blue: #D1DEFF;  /* Ergänzungsfarbe, Pantone 2707 C */
  --sv-sand-1: #F1EBE4;
  --sv-sand-2: #F6F3EF;
  --sv-sand-3: #FBFAF9;      /* Seitenhintergrund */
  --sv-white: #FFFFFF;

  /* Bedeutung */
  --fg-1: var(--sv-blue);
  --fg-2: color-mix(in oklab, var(--sv-blue) 70%, transparent);
  --fg-3: color-mix(in oklab, var(--sv-blue) 45%, transparent);
  --fg-4: color-mix(in oklab, var(--sv-blue) 28%, transparent);
  --bg-page: var(--sv-sand-3);
  --bg-soft: var(--sv-sand-2);
  --bg-warm: var(--sv-sand-1);
  --bg-cool: var(--sv-light-blue);
  --bg-cool-soft: color-mix(in oklab, var(--sv-light-blue) 45%, white);
  --bg-dark: var(--sv-blue);
  --bg-card: var(--sv-white);
  --border-soft: color-mix(in oklab, var(--sv-blue) 10%, transparent);
  --border-mid: color-mix(in oklab, var(--sv-blue) 20%, transparent);
  --on-dark-1: #FFFFFF;
  --on-dark-2: rgba(255, 255, 255, .72);
  --on-dark-3: rgba(255, 255, 255, .48);

  --font: 'ATC Arquette', Arial, Helvetica, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 32px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 140ms;
  --t-base: 220ms;
  --t-slow: 360ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg-page); color: var(--fg-1); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sv-coral); text-decoration: none; }
a:hover { opacity: .75; }
[hidden] { display: none !important; }
::selection { background: var(--sv-coral); color: var(--sv-white); }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -.01em; margin: 0; }
:focus-visible { outline: 2px solid var(--sv-blue); outline-offset: 2px; }

/* Akzentwort: Farbe statt Kursiv */
.accent { font-style: normal; color: var(--sv-coral); }
/* Kleine Überzeile: Versalien, gesperrt, gedämpftes Navy */
.eyebrow { display: inline-block; font: 500 12px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); }
.muted { color: var(--fg-2); }
.faint { color: var(--fg-3); }

.ic { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.ic-fill { fill: currentColor; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }

/* ================= Knöpfe: Pillen ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px;
  background: transparent; color: var(--sv-blue); box-shadow: inset 0 0 0 1.5px var(--sv-blue); font: 500 14px/1 var(--font); text-decoration: none; white-space: nowrap;
  transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), transform var(--t-fast) var(--ease); }
.btn:hover { background: var(--sv-blue); color: var(--sv-white); opacity: 1; }
.btn:active { transform: scale(.98); }
.btn:disabled { background: var(--fg-4); color: var(--sv-white); box-shadow: none; cursor: not-allowed; }
.btn-primary { background: var(--sv-coral); color: var(--sv-white); box-shadow: none; }
.btn-primary:hover { background: var(--sv-coral-dark); }
.btn-dark { background: var(--sv-blue); color: var(--sv-white); box-shadow: none; }
.btn-dark:hover { background: color-mix(in oklab, var(--sv-blue) 85%, white); }
.btn-soft { box-shadow: none; background: var(--bg-soft); }
.btn-soft:hover { background: var(--bg-warm); color: var(--fg-1); }
.btn-ghost { box-shadow: none; color: var(--fg-2); padding: 0 12px; }
.btn-ghost:hover { background: var(--bg-soft); color: var(--fg-1); }
.btn-ghost.is-on { background: var(--bg-cool); color: var(--fg-1); }
.btn.sm { min-height: 32px; padding: 0 14px; font-size: 13px; gap: 6px; }
.btn.xs { min-height: 26px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.btn.icon-only { padding: 0; width: 36px; min-height: 36px; }
.btn.sm.icon-only { width: 32px; min-height: 32px; }
.btn.is-armed { background: var(--sv-blue); color: var(--sv-white); box-shadow: none; }
.btn-link { border: 0; background: none; padding: 0; color: var(--sv-coral); font: inherit; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }

/* Unsichtbarer Knopf für Felder, Zellen, Symbole */
.plain { border: 0; background: none; padding: 0; margin: 0; text-align: left; color: inherit; font: inherit; }
.hit { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 8px; border-radius: var(--r-sm); border: 0; background: none; color: inherit; transition: background var(--t-fast) var(--ease); }
.hit:hover { background: var(--bg-soft); }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 999px; background: none; color: var(--fg-2); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.icon-btn:hover { background: var(--bg-soft); color: var(--fg-1); }
.icon-btn.is-on { color: var(--fg-1); background: var(--bg-cool); }

/* ================= Eingaben ================= */
.field { display: grid; gap: 6px; }
.field > span { font: 500 13px/1.3 var(--font); color: var(--fg-2); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--border-mid); border-radius: var(--r-md); background: var(--sv-white); color: var(--fg-1); outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--sv-blue); box-shadow: 0 0 0 3px var(--bg-cool); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field.has-error .input { border-color: var(--sv-coral); }
.field-error { color: var(--sv-coral-dark); font-size: 13px; }
.bare { width: 100%; border: 0; outline: none; background: transparent; padding: 0; color: inherit; font: inherit; resize: none; }
.bare::placeholder, .input::placeholder, .textarea::placeholder { color: var(--fg-3); }
.kbd { display: inline-block; padding: 1px 6px; border-radius: 6px; font: 500 11.5px/1.5 var(--font); }

/* ================= Personen-Plakette ================= */
.av { display: inline-grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 999px; font: 600 10px/1 var(--font); letter-spacing: .02em; user-select: none; }
.av.c-navy { background: var(--sv-blue); color: var(--sv-white); }
.av.c-hellblau { background: var(--sv-light-blue); color: var(--sv-blue); }
.av.c-sand { background: var(--sv-sand-1); color: var(--sv-blue); box-shadow: inset 0 0 0 1px var(--border-soft); }
.av.c-weiss { background: var(--sv-white); color: var(--sv-blue); box-shadow: inset 0 0 0 1.5px var(--sv-blue); }
.av.md { width: 30px; height: 30px; font-size: 11.5px; }
.av.lg { width: 40px; height: 40px; font-size: 14px; }
.av.xl { width: 64px; height: 64px; font-size: 22px; }
.av.sm { width: 20px; height: 20px; font-size: 8.5px; }
.av.empty { background: transparent; color: var(--fg-3); box-shadow: inset 0 0 0 1.5px var(--fg-4); border: 0; }
.av.empty .ic { width: 13px; height: 13px; }
.av-stack { display: inline-flex; }
.av-stack .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--bg-page); }
.av-stack .av:first-child { margin-left: 0; }

/* ================= Pillen und Marken ================= */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font: 500 12px/1 var(--font); white-space: nowrap; }
.prio-hoch { background: var(--sv-blue); color: var(--sv-white); }
.prio-mittel { background: var(--sv-light-blue); color: var(--sv-blue); }
.prio-niedrig { background: var(--sv-sand-1); color: var(--sv-blue); }
.st-im-plan { background: var(--sv-light-blue); color: var(--sv-blue); }
.st-gefaehrdet { background: color-mix(in oklab, var(--sv-coral) 16%, white); color: var(--sv-coral-dark); }
.st-verzoegert { background: var(--sv-coral); color: var(--sv-white); }
.st-pausiert { background: var(--sv-sand-1); color: var(--sv-blue); }
.st-abgeschlossen { background: var(--sv-blue); color: var(--sv-white); }
.st-dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--sv-light-blue); color: var(--sv-blue); font: 600 11px/1 var(--font); }
.due { white-space: nowrap; }
.due.is-overdue { color: var(--sv-coral-dark); }
.due.is-soon { font-weight: 500; }
.due.is-done { color: var(--fg-3); }

/* Projektkachel wie bei Asana: farbiges Quadrat (--pc), dunkles Symbol aus der smartvillage-Bibliothek */
.pico { display: inline-grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; background: var(--pc, #E8E5E0); overflow: hidden; }
.pico img { width: 86%; height: 86%; display: block; }
.pico.sm { width: 18px; height: 18px; border-radius: 5px; }
.pico.md { width: 30px; height: 30px; border-radius: 8px; }
.pico.lg { width: 44px; height: 44px; border-radius: 11px; }
.pico.xl { width: 56px; height: 56px; border-radius: 14px; }

/* ================= Abhaken ================= */
.check { position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 999px; border: 0; padding: 0; background: transparent;
  color: transparent; box-shadow: inset 0 0 0 1.5px var(--fg-3); transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.check .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.check:hover { box-shadow: inset 0 0 0 1.5px var(--sv-blue); color: var(--fg-2); background: var(--bg-cool-soft); }
.check:active { transform: scale(.9); }
.check.is-done { background: var(--done-green); color: var(--sv-white); box-shadow: none; }
.check.lg { width: 24px; height: 24px; }

/* Kleine Feier beim Abhaken: Kreise und Halbkreise der Bildmarke springen auf */
.burst { position: fixed; z-index: 400; pointer-events: none; width: 0; height: 0; }
.burst i { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 999px; animation: burst 720ms var(--ease) forwards; }
.burst i.half { border-radius: 10px 10px 0 0; height: 5px; }
.burst i.c1 { background: var(--sv-coral); } .burst i.c2 { background: var(--sv-light-blue); } .burst i.c3 { background: var(--sv-blue); }
@keyframes burst { 0% { transform: translate(0, 0) scale(.4) rotate(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .burst { display: none; } }

/* ================= Schwebendes: Menüs, Auswahl, Fenster, Meldungen ================= */
.pop { position: fixed; z-index: 300; min-width: 220px; max-width: 340px; max-height: min(440px, calc(100vh - 24px)); overflow: auto; padding: 6px; border-radius: var(--r-md);
  background: var(--sv-white); border: 1px solid var(--border-mid); animation: pop-in var(--t-fast) var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pop-search { margin: 2px 2px 6px; }
.pop-search .input { min-height: 36px; padding: 7px 12px; font-size: 14px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--fg-1); text-align: left; font: 400 14px/1.2 var(--font); }
.menu-item:hover, .menu-item.is-active { background: var(--bg-soft); }
.menu-item.is-selected { font-weight: 500; }
.menu-item .end { margin-left: auto; color: var(--fg-3); font-size: 12.5px; }
.menu-item.danger { color: var(--sv-coral-dark); }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--border-soft); }
.menu-head { padding: 8px 10px 4px; }

.overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: start center; padding: 9vh 16px 16px; background: color-mix(in oklab, var(--sv-blue) 30%, transparent); animation: fade var(--t-base) var(--ease); overflow: auto; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); padding: 28px; border-radius: var(--r-lg); background: var(--sv-white); animation: rise var(--t-base) var(--ease); }
.modal.wide { width: min(760px, 100%); }
.modal h2 { font-size: 24px; line-height: 1.2; margin-bottom: 4px; }
.modal .lead { margin: 0 0 20px; color: var(--fg-2); }
.modal-form { display: grid; gap: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } }

.toasts { position: fixed; left: 24px; bottom: 24px; z-index: 500; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 0 8px 0 18px; border-radius: 999px; background: var(--sv-blue); color: var(--sv-white); font-size: 14px; animation: rise var(--t-base) var(--ease); max-width: min(560px, calc(100vw - 48px)); }
.toast .btn-link { color: var(--sv-light-blue); font-weight: 500; }
.toast .icon-btn { color: var(--on-dark-2); }
.toast .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.toast.is-error { background: var(--sv-coral-dark); }

/* Datumswahl */
.dp { width: 286px; padding: 12px; }
.dp-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 8px; font-weight: 500; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-grid .wd { font-size: 11.5px; color: var(--fg-3); padding: 4px 0; }
.dp-day { height: 34px; border: 0; border-radius: 999px; background: none; color: var(--fg-1); font-size: 13.5px; }
.dp-day:hover { background: var(--bg-soft); }
.dp-day.is-out { color: var(--fg-4); }
.dp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--sv-coral); }
.dp-day.is-range { background: var(--bg-cool-soft); border-radius: 0; }
.dp-day.is-sel { background: var(--sv-blue); color: var(--sv-white); }
.dp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.dp-mode { display: flex; gap: 6px; margin-bottom: 10px; }
.dp-mode button { flex: 1; text-align: left; padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--border-mid); background: none; font-size: 13px; }
.dp-mode button.is-on { border-color: var(--sv-blue); box-shadow: inset 0 0 0 1px var(--sv-blue); }
.dp-mode small { display: block; color: var(--fg-3); font-size: 11.5px; }

.empty-state { display: grid; justify-items: center; gap: 10px; padding: 48px 20px; text-align: center; color: var(--fg-2); }
.empty-state img { width: 64px; height: 64px; opacity: .9; }
.empty-state h3 { color: var(--fg-1); font-size: 20px; }

.spin { width: 18px; height: 18px; border-radius: 999px; border: 2px solid var(--border-mid); border-top-color: var(--sv-blue); animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }
