/* ==========================================================================
   Lukstime Media – Creator Partner Program
   Design-System
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../assets/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  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: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  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 {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f2f2f4;
  --surface-3: #ebebee;
  --hover: rgba(17, 17, 17, 0.04);
  --active: rgba(17, 17, 17, 0.07);
  --border: rgba(17, 17, 17, 0.08);
  --border-strong: rgba(17, 17, 17, 0.14);
  --text: #111111;
  --text-2: #6b6b73;
  --text-3: #9a9aa3;
  --inverse: #ffffff;

  --accent: #1d5bd8;
  --accent-hover: #174cb8;
  --accent-soft: rgba(29, 91, 216, 0.08);
  --accent-ring: rgba(29, 91, 216, 0.22);

  --green: #1d7f4a;
  --green-soft: rgba(29, 127, 74, 0.09);
  --amber: #a15c00;
  --amber-soft: rgba(196, 120, 0, 0.1);
  --red: #c4362f;
  --red-soft: rgba(196, 54, 47, 0.08);
  --violet: #6a48c9;
  --violet-soft: rgba(106, 72, 201, 0.09);
  --gray-soft: rgba(17, 17, 17, 0.05);

  --primary-bg: #111111;
  --primary-hover: #2a2a2d;
  --primary-text: #ffffff;

  --shadow-xs: 0 1px 1px rgba(17, 17, 17, 0.03);
  --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.04), 0 1px 1px rgba(17, 17, 17, 0.02);
  --shadow-md: 0 1px 2px rgba(17, 17, 17, 0.04), 0 8px 24px -12px rgba(17, 17, 17, 0.12);
  --shadow-lg: 0 2px 6px rgba(17, 17, 17, 0.04), 0 24px 64px -20px rgba(17, 17, 17, 0.28);

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --sidebar-w: 248px;
  --topbar-h: 56px;
  --tabbar-h: 64px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0c0c0d;
  --surface: #141415;
  --surface-2: #1c1c1e;
  --surface-3: #242427;
  --hover: rgba(255, 255, 255, 0.04);
  --active: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f2f2f3;
  --text-2: #a0a0a8;
  --text-3: #6e6e76;
  --inverse: #111111;

  --accent: #5b8ff2;
  --accent-hover: #74a1f5;
  --accent-soft: rgba(91, 143, 242, 0.13);
  --accent-ring: rgba(91, 143, 242, 0.3);

  --green: #4cc38a;
  --green-soft: rgba(76, 195, 138, 0.12);
  --amber: #e6a23c;
  --amber-soft: rgba(230, 162, 60, 0.12);
  --red: #f0716a;
  --red-soft: rgba(240, 113, 106, 0.12);
  --violet: #a58cf2;
  --violet-soft: rgba(165, 140, 242, 0.13);
  --gray-soft: rgba(255, 255, 255, 0.06);

  --primary-bg: #f2f2f3;
  --primary-hover: #ffffff;
  --primary-text: #111111;

  --shadow-xs: none;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, 0.7);

  color-scheme: dark;
}

/* --- Reset -------------------------------------------------------------- */

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.015em; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg { display: block; }
[hidden] { display: none !important; }

::selection { background: var(--accent-ring); }

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

.icon {
  width: 16px;
  height: 16px;
  flex: none;
  stroke-width: 1.75;
}
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- Boot ---------------------------------------------------------------- */

.boot {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
.boot-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  opacity: 0.9;
  animation: pulse 1.6s var(--ease) infinite;
}

/* --- Login --------------------------------------------------------------- */

.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 380px;
}
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
}
.auth-brand img {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  margin-bottom: 20px;
  box-shadow: 0 6px 16px -8px rgba(29, 91, 216, 0.5);
}
.auth-brand .eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.auth-brand h1 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.auth-brand p {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.5;
}
.auth-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
}
.auth-panel .stack { gap: 14px; }
.auth-foot {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}
.auth-link {
  display: block;
  margin: 14px auto 0;
  font-size: 13px;
  color: var(--text-2);
  transition: color 0.15s;
}
.auth-link:hover { color: var(--text); }

/* --- App-Shell ----------------------------------------------------------- */

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 14px;
  min-width: 0;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex: none;
}
.brand-text { min-width: 0; line-height: 1.2; }
.brand-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}

.nav-section { margin-top: 14px; }
.nav-label {
  padding: 0 10px 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-weight: 500;
  font-size: 13.5px;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border);
}
.nav-item .icon { color: var(--text-3); transition: color 0.15s; }
.nav-item:hover .icon,
.nav-item.is-active .icon { color: var(--text); }
.nav-count {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.nav-dot {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border-radius: var(--r-md);
  text-align: left;
  transition: background 0.15s;
}
.user-chip:hover { background: var(--hover); }
.user-chip .meta { min-width: 0; flex: 1; line-height: 1.25; }
.user-chip .name { font-weight: 500; font-size: 13.5px; }
.user-chip .role { font-size: 12px; color: var(--text-2); }

.main {
  min-width: 0;
  padding: 8px 8px 8px 0;
}
.content {
  min-height: calc(100vh - 16px);
  min-height: calc(100dvh - 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 40px 64px;
  animation: page-in 0.22s var(--ease);
}
.page-narrow { max-width: 760px; }
.page-wide { max-width: 1320px; }

.topbar { display: none; }
.tabbar { display: none; }

/* --- Page-Header --------------------------------------------------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.page-head .lead {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 15px;
}
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 14px;
  margin-left: -2px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

.section { margin-top: 32px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head h2 {
  font-size: 15px;
  letter-spacing: -0.01em;
}
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
  transition: color 0.15s;
}
.section-link:hover { color: var(--text); }

/* --- Layout-Helfer -------------------------------------------------------- */

.stack { display: flex; flex-direction: column; gap: 12px; }
.row-flex { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* --- Karten -------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 0;
}
.card-head h3 { font-size: 14px; }
.card-body { padding: 16px 20px 20px; }
.card-foot {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
}
a.card,
button.card {
  display: block;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.2s var(--ease);
}
a.card:hover,
button.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

/* Kennzahlen */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
  display: block;
  padding: 16px 18px 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.2s;
}
a.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}
.stat-top .icon { color: var(--text-3); }
.stat-value {
  margin-top: 14px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-hint {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-3);
}

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

.list { display: flex; flex-direction: column; }
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  min-height: 56px;
  border-top: 1px solid var(--border);
  transition: background 0.12s;
  min-width: 0;
}
.list-item:first-child { border-top: 0; }
a.list-item:hover,
button.list-item:hover { background: var(--hover); }
button.list-item { width: 100%; text-align: left; }
.list-main { flex: 1; min-width: 0; }
.list-title {
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-sub {
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 1px;
}
.list-sub .sep::before { content: '·'; color: var(--text-3); }
.list-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  color: var(--text-2);
  font-size: 13px;
}
.card > .list:first-child > .list-item:first-child { border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.card > .list:last-child > .list-item:last-child { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }
.card-head + .list { margin-top: 8px; }
.card-head + .list > .list-item:first-child { border-top: 1px solid var(--border); }

/* Datumskachel */
.date-tile {
  width: 44px;
  flex: none;
  text-align: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  line-height: 1;
}
.date-tile .m {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 0 3px;
}
.date-tile .d {
  display: block;
  font-size: 17px;
  font-weight: 600;
  padding: 5px 0 6px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.date-tile.is-muted .m { color: var(--text-2); background: var(--gray-soft); }

/* Ticketnummer */
.ticket-no {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  flex: none;
  min-width: 40px;
}

/* --- Badges -------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--gray-soft);
  color: var(--text-2);
  flex: none;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}
.badge.no-dot::before { display: none; }
.badge-blue { background: var(--accent-soft); color: var(--accent); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-gray { background: var(--gray-soft); color: var(--text-2); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  white-space: nowrap;
}

/* --- Avatar -------------------------------------------------------------- */

.avatar {
  --size: 28px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: none;
  font-size: calc(var(--size) * 0.38);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--av-fg, var(--text-2));
  background: var(--av-bg, var(--surface-2));
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.04);
  user-select: none;
}
.avatar-sm { --size: 22px; }
.avatar-md { --size: 36px; }
.avatar-lg { --size: 56px; border-radius: 16px; }
.avatar-xl { --size: 72px; border-radius: 20px; }
.avatar-square { border-radius: 9px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -6px; }

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: 13.5px;
  white-space: nowrap;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s;
  user-select: none;
}
.btn:hover { background: var(--surface-2); }
.btn:active { background: var(--surface-3); }
.btn:disabled, .btn.is-loading { opacity: 0.55; pointer-events: none; }
.btn .icon { width: 15px; height: 15px; }

.btn-primary {
  background: var(--primary-bg);
  border-color: var(--primary-bg);
  color: var(--primary-text);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:active { background: var(--primary-hover); }

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: transparent; }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-solid:hover { background: var(--red); filter: brightness(0.94); }

.btn-ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--hover); color: var(--text); }

.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 14.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg);
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.75px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

/* --- Formulare ----------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.label .optional { font-weight: 400; color: var(--text-3); }
.hint { font-size: 12.5px; color: var(--text-3); }
.field-error { font-size: 12.5px; color: var(--red); }

.input,
.select,
.textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
.input::placeholder,
.textarea::placeholder { color: var(--text-3); }
.input:hover,
.select:hover,
.textarea:hover { border-color: rgba(17, 17, 17, 0.22); }
:root[data-theme='dark'] .input:hover,
:root[data-theme='dark'] .select:hover,
:root[data-theme='dark'] .textarea:hover { border-color: rgba(255, 255, 255, 0.22); }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.is-invalid .input,
.is-invalid .select,
.is-invalid .textarea { border-color: var(--red); }
.is-invalid .input:focus,
.is-invalid .select:focus,
.is-invalid .textarea:focus { box-shadow: 0 0 0 3px var(--red-soft); }

.textarea {
  height: auto;
  min-height: 96px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}
.select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a9aa3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.select-sm, .input-sm { height: 32px; font-size: 13px; }
input[type='date'].input,
input[type='time'].input { font-variant-numeric: tabular-nums; }

.input-icon { position: relative; }
.input-icon .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.input-icon .input { padding-left: 34px; }

.form-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
}
.form-error .icon { margin-top: 2px; }

/* Auswahl-Chips (Mehrfachauswahl) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { background: var(--hover); }
.chip .check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: transparent;
  transition: background 0.15s, color 0.15s;
}
.chip .check .icon { width: 12px; height: 12px; stroke-width: 2.5; }
.chip:has(input:checked) {
  border-color: var(--text);
  color: var(--text);
  background: var(--surface);
}
.chip:has(input:checked) .check { background: var(--text); color: var(--surface); }
.chip:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-ring); }

/* Schalter */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13.5px;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 32px;
  height: 20px;
  border-radius: 999px;
  background: var(--surface-3);
  position: relative;
  flex: none;
  transition: background 0.2s;
}
.switch .track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s var(--ease);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(12px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-ring); }

/* Segment-Control */
.segmented {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: var(--surface-2);
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  height: 28px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--border);
}
.segmented .count {
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar .input-icon { width: 260px; max-width: 100%; }
.toolbar .toolbar-search { width: 210px; }
.toolbar-select { width: auto; min-width: 160px; }

/* --- Definitionslisten -------------------------------------------------- */

.dl { display: grid; gap: 14px; }
.dl-item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; font-size: 13.5px; }
.dl-item dt { color: var(--text-2); }
.dl-item dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dl-item dd a { color: var(--accent); }
.dl-item dd a:hover { text-decoration: underline; }

.meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 13.5px;
}
.meta-line .icon { color: var(--text-3); }

.prose {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.note-box {
  border-radius: var(--r-md);
  background: var(--amber-soft);
  padding: 14px 16px;
  font-size: 13.5px;
}
.note-box .note-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 6px;
}

.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* --- Empty / Error States ------------------------------------------------ */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 24px;
}
.empty-sm { padding: 28px 20px; }
.empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-2);
  margin-bottom: 14px;
}
.empty-icon .icon { width: 20px; height: 20px; }
.empty h3 { font-size: 14.5px; }
.empty p {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 13.5px;
  max-width: 340px;
}
.empty .btn { margin-top: 16px; }
.empty-sm .empty-icon { width: 36px; height: 36px; border-radius: 10px; margin-bottom: 10px; }
.empty-sm .empty-icon .icon { width: 17px; height: 17px; }
.empty-sm h3 { font-size: 13.5px; }
.empty-sm p { font-size: 13px; }

/* --- Skeleton ------------------------------------------------------------ */

.skel {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skel-text { height: 12px; }
.skel-title { height: 24px; width: 260px; max-width: 70%; }
.skel-card { height: 104px; border-radius: var(--r-lg); }
.skel-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.skel-row:first-child { border-top: 0; }
.skel-circle { width: 32px; height: 32px; border-radius: 50%; flex: none; }

/* --- Toasts -------------------------------------------------------------- */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: #18181a;
  color: #f4f4f5;
  font-size: 13.5px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.25s var(--ease);
}
:root[data-theme='dark'] .toast { background: #26262a; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 30px -10px rgba(0, 0, 0, 0.6); }
.toast.is-leaving { animation: toast-out 0.2s var(--ease) forwards; }
.toast .icon { color: #8de0b0; }
.toast.is-error .icon { color: #ff9a92; }
.toast.is-info .icon { color: #9dbcff; }

/* --- Modal --------------------------------------------------------------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 10, 12, 0.32);
  animation: fade-in 0.18s var(--ease);
  overflow-y: auto;
}
:root[data-theme='dark'] .modal-root { background: rgba(0, 0, 0, 0.6); }
.modal-root.is-leaving { animation: fade-out 0.16s var(--ease) forwards; }
.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  animation: modal-in 0.22s var(--ease);
}
.modal-lg { max-width: 680px; }
.modal-sm { max-width: 420px; }
.modal-root.is-leaving .modal { animation: modal-out 0.16s var(--ease) forwards; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 0 24px;
}
.modal-head h2 { font-size: 17px; letter-spacing: -0.015em; padding-top: 4px; }
.modal-head p { color: var(--text-2); margin-top: 4px; font-size: 13.5px; }
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
}
.modal-foot .left { margin-right: auto; }

.secret-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.02em;
}

/* --- Dropdown-Menü ------------------------------------------------------- */

.menu {
  position: fixed;
  z-index: 950;
  min-width: 200px;
  padding: 5px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  animation: menu-in 0.14s var(--ease);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--text);
  text-align: left;
}
.menu-item .icon { color: var(--text-2); }
.menu-item:hover,
.menu-item:focus-visible { background: var(--hover); outline: none; }
.menu-item.is-danger { color: var(--red); }
.menu-item.is-danger .icon { color: var(--red); }
.menu-sep { height: 1px; background: var(--border); margin: 5px -5px; }
.menu-label { padding: 8px 10px 4px; font-size: 12px; color: var(--text-3); }

/* --- Benachrichtigungen ------------------------------------------------- */

.notif-panel {
  position: fixed;
  z-index: 950;
  width: 380px;
  max-width: calc(100vw - 24px);
  max-height: min(560px, calc(100dvh - 80px));
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  animation: menu-in 0.16s var(--ease);
  overflow: hidden;
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.notif-head h3 { font-size: 14px; }
.notif-list { overflow-y: auto; }
.notif {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--hover); }
.notif-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--surface-2);
  color: var(--text-2);
}
.notif-icon .icon { width: 15px; height: 15px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 500; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.notif-text { font-size: 13px; color: var(--text-2); margin-top: 1px; overflow-wrap: anywhere; }
.notif-time { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.notif.is-unread .notif-title::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: auto;
  flex: none;
}

/* --- Ticket-Chat --------------------------------------------------------- */

.chat {
  display: flex;
  flex-direction: column;
  min-height: 420px;
}
.chat-head {
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.chat-head h1 {
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.chat-head .list-sub { margin-top: 6px; }
.chat-stream {
  flex: 1;
  padding: 20px 22px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.day-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}
.day-sep::before,
.day-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.msg {
  display: flex;
  gap: 10px;
  max-width: 82%;
  margin-top: 10px;
  animation: msg-in 0.2s var(--ease);
}
.msg.is-cont { margin-top: 2px; }
.msg.is-cont .msg-head,
.msg.is-cont .avatar { visibility: hidden; height: 0; }
.msg.is-cont .avatar { height: auto; }
.msg-col { min-width: 0; display: flex; flex-direction: column; }
.msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12.5px;
}
.msg-head .who { font-weight: 600; color: var(--text); }
.msg-head .org { color: var(--text-2); }
.msg-head .when { color: var(--text-3); }
.bubble {
  padding: 9px 13px;
  border-radius: 16px;
  border-top-left-radius: 6px;
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  width: fit-content;
  max-width: 100%;
}
.msg.is-mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg.is-mine .msg-col { align-items: flex-end; }
.msg.is-mine .msg-head { flex-direction: row-reverse; }
.msg.is-mine .bubble {
  background: var(--primary-bg);
  color: var(--primary-text);
  border-top-left-radius: 16px;
  border-top-right-radius: 6px;
}
.msg.is-internal .bubble {
  background: var(--amber-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(196, 120, 0, 0.18);
}
.internal-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--amber);
  font-weight: 500;
}
.internal-label .icon { width: 12px; height: 12px; }

.composer {
  position: sticky;
  bottom: 0;
  padding: 12px 16px 16px;
  background: linear-gradient(to bottom, transparent, var(--surface) 14px);
}
.composer-box {
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.composer-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.composer-box.is-internal { border-color: rgba(196, 120, 0, 0.5); background: var(--amber-soft); }
.composer-box.is-internal:focus-within { box-shadow: 0 0 0 3px var(--amber-soft); }
.composer textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  max-height: 240px;
  padding: 12px 14px 4px;
  border: 0;
  background: transparent;
  resize: none;
  line-height: 1.5;
  font-size: 14px;
}
.composer textarea:focus { outline: none; }
.composer-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 6px 8px 8px 12px;
}
.composer-bar .hint { margin-right: auto; }
.chat-closed {
  margin: 12px 16px 16px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.side-panel { position: sticky; top: 24px; }
.side-summary { list-style: none; cursor: default; padding-bottom: 0; }
.side-summary::-webkit-details-marker { display: none; }
.side-summary-meta { display: none; align-items: center; gap: 8px; }
.side-panel .card-body { display: grid; gap: 16px; }
.side-field { display: grid; gap: 6px; }
.side-field > .label { color: var(--text-2); font-weight: 500; font-size: 12.5px; }
.side-value { font-size: 13.5px; display: flex; align-items: center; gap: 8px; min-width: 0; }

/* --- Kalender ------------------------------------------------------------ */

.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cal-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  min-width: 170px;
}
.cal-nav { display: inline-flex; gap: 2px; }

.cal-month {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
}
.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal-weekdays div {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.cal-day {
  min-height: 118px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  text-align: left;
  transition: background 0.12s;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-grid .cal-day:nth-last-child(-n + 7) { border-bottom: 0; }
.cal-day.is-other { background: var(--bg); }
.cal-day.is-other .cal-num { color: var(--text-3); }
.cal-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}
.cal-day.is-today .cal-num { background: var(--accent); color: #fff; }
.cal-dots { display: none; }

.cal-event {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
  text-align: left;
  background: var(--accent-soft);
  color: var(--accent);
  min-width: 0;
  transition: filter 0.15s;
}
.cal-event:hover { filter: brightness(0.96); }
:root[data-theme='dark'] .cal-event:hover { filter: brightness(1.15); }
.cal-event .t { font-variant-numeric: tabular-nums; opacity: 0.8; flex: none; }
.cal-event .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cal-event.is-meeting { background: var(--violet-soft); color: var(--violet); }
.cal-event.is-deadline { background: var(--red-soft); color: var(--red); }
.cal-event.is-release { background: var(--green-soft); color: var(--green); }
.cal-event.is-other { background: var(--gray-soft); color: var(--text-2); }
.cal-event.is-cancelled .n { text-decoration: line-through; color: var(--text-3); }
.cal-more {
  font-size: 12px;
  color: var(--text-2);
  padding: 2px 7px;
  text-align: left;
  font-weight: 500;
}
.cal-more:hover { color: var(--text); }

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cal-week-day {
  border-right: 1px solid var(--border);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cal-week-day:last-child { border-right: 0; }
.cal-week-head {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.cal-week-head .wd { font-size: 12px; color: var(--text-3); font-weight: 500; }
.cal-week-head .dn { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cal-week-day.is-today .dn { color: var(--accent); }
.cal-week-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cal-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  font-size: 12.5px;
  transition: filter 0.15s;
}
.cal-card:hover { filter: brightness(0.97); }
.cal-card .t { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 12px; }
.cal-card .n { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.cal-card .s { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.cal-card.is-meeting { background: var(--violet-soft); border-left-color: var(--violet); }
.cal-card.is-deadline { background: var(--red-soft); border-left-color: var(--red); }
.cal-card.is-release { background: var(--green-soft); border-left-color: var(--green); }
.cal-card.is-other { background: var(--gray-soft); border-left-color: var(--text-3); }
.cal-card.is-cancelled .n { text-decoration: line-through; color: var(--text-2); }

.cal-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-2);
}
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--accent); }
.cal-legend i.meeting { background: var(--violet); }
.cal-legend i.deadline { background: var(--red); }
.cal-legend i.release { background: var(--green); }

.cal-daylist { margin-top: 16px; display: none; }

.agenda-day { margin-bottom: 20px; }
.agenda-date {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.agenda-date .subtle { font-weight: 500; }
.agenda-date.is-today { color: var(--accent); }

.type-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; background: var(--accent); }
.type-dot.is-meeting { background: var(--violet); }
.type-dot.is-deadline { background: var(--red); }
.type-dot.is-release { background: var(--green); }
.type-dot.is-other { background: var(--text-3); }

/* --- Creator-Profil ------------------------------------------------------ */

.profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.profile-head .info { flex: 1; min-width: 200px; }
.profile-head h1 { font-size: 26px; letter-spacing: -0.025em; }
.profile-head .row-flex { margin-top: 6px; color: var(--text-2); flex-wrap: wrap; }

.social-list { display: grid; gap: 8px; }
.social {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  min-width: 0;
}
.social .icon { color: var(--text-2); }
.social a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social a:hover { color: var(--accent); }

.creator-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.creator-card-top { display: flex; align-items: center; gap: 12px; }
.creator-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.mini-stat .v { font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.mini-stat .l { font-size: 12px; color: var(--text-2); }

.project-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; min-height: 168px; }
.project-card h3 { font-size: 15px; letter-spacing: -0.01em; }
.project-card p { color: var(--text-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: 12.5px; }

.resource {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}
.resource:first-child { border-top: 0; }
.resource-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-2);
  display: grid;
  place-items: center;
  flex: none;
}
.resource a.title { font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.resource a.title:hover { color: var(--accent); }
.resource .note { color: var(--text-2); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }

.resource-editor { display: grid; gap: 10px; }
.resource-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto;
  gap: 8px;
  align-items: start;
}
.resource-row .textarea { grid-column: 1 / 3; min-height: 38px; height: 38px; }

.announcement {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.announcement:first-child { border-top: 0; }
.announcement h4 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.announcement h4 .icon { color: var(--accent); width: 14px; height: 14px; }
.announcement .prose { margin-top: 4px; color: var(--text-2); font-size: 13.5px; }
.announcement .when { margin-top: 8px; font-size: 12px; color: var(--text-3); }

.activity {
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}
.activity:first-child { border-top: 0; }
.activity .text { min-width: 0; flex: 1; }
.activity .text b { font-weight: 600; }
.activity .text a:hover { text-decoration: underline; }
.activity .time { font-size: 12px; color: var(--text-3); margin-top: 1px; }

.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  font-size: 13.5px;
}
.callout .icon { color: var(--accent); margin-top: 2px; }
.callout b { font-weight: 600; }

/* --- Animationen --------------------------------------------------------- */

@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(4px) scale(0.99); } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(4px); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.5; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Tablet: kompakte Sidebar -------------------------------------------- */

@media (max-width: 1180px) {
  .grid-main-side { grid-template-columns: minmax(0, 1fr) 280px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) and (min-width: 768px) {
  :root { --sidebar-w: 68px; }
  .sidebar { align-items: center; padding: 12px 8px; }
  .brand { padding: 6px 0 14px; justify-content: center; }
  .brand-text,
  .nav-label,
  .nav-item span,
  .nav-count,
  .user-chip .meta,
  .user-chip > .icon { display: none; }
  .nav-section { margin-top: 10px; width: 100%; padding-top: 10px; border-top: 1px solid var(--border); }
  .nav-section:first-of-type { border-top: 0; padding-top: 0; }
  .nav-item { justify-content: center; height: 40px; padding: 0; }
  .nav-dot {
    position: absolute;
    top: 3px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    padding: 0 4px;
  }
  .user-chip { justify-content: center; padding: 6px; }
  .page { padding: 28px 28px 56px; }
  .grid-main-side { grid-template-columns: minmax(0, 1fr); }
  .side-panel { position: static; }
  .cal-day { min-height: 96px; }
}

/* --- Mobile -------------------------------------------------------------- */

@media (max-width: 767px) {
  body { font-size: 15px; background: var(--surface); }
  .app { display: block; }
  .sidebar { display: none; }
  .main { padding: 0; }
  .content {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: auto;
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 12px 0 16px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
  }
  .topbar.is-scrolled { border-bottom-color: var(--border); }
  .topbar img { width: 28px; height: 28px; border-radius: 8px; }
  .topbar .brand-text { flex: 1; }
  .topbar .brand-name { font-size: 15px; }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding: 6px 6px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border);
  }
  .tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-3);
    border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
  }
  .tab .icon { width: 22px; height: 22px; stroke-width: 1.6; }
  .tab.is-active { color: var(--text); }
  .tab .nav-dot {
    position: absolute;
    top: 2px;
    left: calc(50% + 6px);
    margin: 0;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    padding: 0 4px;
  }

  .page { padding: 12px 16px 32px; }
  .page-head { margin-bottom: 20px; align-items: flex-start; }
  .page-head h1 { font-size: 28px; }
  .page-head .lead { font-size: 15px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .page-actions .btn-icon { flex: none; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stats-3 .stat { padding: 12px; }
  .stats-3 .stat-top { font-size: 12px; line-height: 1.3; }
  .stats-3 .stat-top .icon { display: none; }
  .stats-3 .stat-value { font-size: 24px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 26px; margin-top: 10px; }
  .grid-2, .grid-main-side { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .grid-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .section { margin-top: 26px; }

  .list-item { padding: 12px 16px; }
  .list-meta .hide-sm { display: none; }
  .hide-sm { display: none !important; }
  .card-head { padding: 14px 16px 0; }
  .card-body { padding: 14px 16px 16px; }
  .card-pad { padding: 16px; }

  .input, .select, .textarea { font-size: 16px; height: 42px; }
  .textarea { height: auto; }
  .field-row, .field-row-3 { grid-template-columns: minmax(0, 1fr); }
  .btn { height: 38px; }
  .btn-sm { height: 32px; }
  .toolbar .input-icon,
  .toolbar .toolbar-search { width: 100%; }
  .toolbar-select { flex: 1; min-width: 0; }

  .dl-item { grid-template-columns: minmax(0, 1fr); gap: 2px; }

  .modal-root { padding: 0; place-items: end center; }
  .modal {
    max-width: none;
    max-height: calc(100dvh - 24px);
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet-in 0.28s var(--ease);
  }
  .modal-root.is-leaving .modal { animation: sheet-out 0.2s var(--ease) forwards; }
  .modal-head { padding: 18px 16px 0 20px; }
  .modal-body { padding: 18px 20px; }
  .modal-foot { padding: 12px 16px 16px; }
  .modal-foot .btn { flex: 1; }
  .modal-foot .left { flex: none; }

  .toasts {
    left: 12px;
    right: 12px;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px);
    align-items: center;
  }
  .toast { min-width: 0; width: 100%; }

  .notif-panel {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: 80dvh;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet-in 0.28s var(--ease);
  }

  .ticket-side { order: -1; }
  .side-summary { cursor: pointer; padding: 12px 16px; }
  .side-summary-meta { display: inline-flex; }
  .side-panel[open] .side-summary-meta .icon { transform: rotate(180deg); }
  .side-panel[open] .side-summary { padding-bottom: 0; }
  .chat { min-height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - 120px); }
  .chat-head { padding: 4px 0 14px; }
  .chat-stream { padding: 14px 0 8px; }
  .msg { max-width: 90%; }
  .composer { padding: 10px 0 12px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .ticket-card { border: 0; box-shadow: none; border-radius: 0; }
  .chat-closed { margin: 12px 0; }

  .cal-weekdays div { padding: 8px 0; text-align: center; }
  .cal-day {
    min-height: 52px;
    padding: 4px 2px;
    align-items: center;
    cursor: pointer;
  }
  .cal-day .cal-event,
  .cal-day .cal-more { display: none; }
  .cal-dots { display: flex; gap: 3px; justify-content: center; }
  .cal-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
  .cal-dots i.is-meeting { background: var(--violet); }
  .cal-dots i.is-deadline { background: var(--red); }
  .cal-dots i.is-release { background: var(--green); }
  .cal-day.is-selected .cal-num { background: var(--text); color: var(--surface); }
  .cal-day.is-today.is-selected .cal-num { background: var(--accent); color: #fff; }
  .cal-daylist { display: block; }
  .cal-title { min-width: 0; flex: 1; }
  .cal-toolbar .segmented { order: 3; width: 100%; }
  .cal-toolbar .segmented button { flex: 1; justify-content: center; }

  .cal-week { grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; gap: 0; }
  .cal-week-day { border-right: 0; border-bottom: 1px solid var(--border); min-height: 0; }
  .cal-week-day:last-child { border-bottom: 0; }
  .cal-week-head { border-bottom: 0; padding: 12px 0 6px; }
  .cal-week-body { padding: 0 0 12px; }
  .cal-week-body:empty::after { content: 'Keine Einträge'; font-size: 13px; color: var(--text-3); }

  .resource-row { grid-template-columns: minmax(0, 1fr) auto; }
  .resource-row .input:nth-child(2) { grid-column: 1 / 2; grid-row: 2; }
  .resource-row .textarea { grid-column: 1 / 2; }

  .profile-head h1 { font-size: 24px; }
}

@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }

@media (hover: none) {
  a.card:hover, button.card:hover, a.stat:hover { box-shadow: var(--shadow-sm); border-color: var(--border); }
}

.list-loc { flex-wrap: nowrap; gap: 4px; }
.list-loc .icon { color: var(--text-3); width: 13px; height: 13px; }
