/* ==========================================================================
   JL-Company – Design-System
   Grünes, luftiges Dashboard-Design (Karten, Pills, weiche Schatten)
   ========================================================================== */

:root {
  --bg: #eceeea;
  --panel: #f6f7f4;
  --card: #ffffff;
  --card-2: #f3f5f1;
  --line: #e7eae5;
  --line-strong: #d6dbd4;
  --text: #121613;
  --text-2: #3c443e;
  --muted: #7d857f;

  --green-950: #0b2e1c;
  --green-900: #0f3d26;
  --green-800: #145233;
  --green-700: #1b6640;
  --green-600: #247a4e;
  --green-500: #3a9464;
  --green-400: #5db485;
  --green-300: #8fd0ab;
  --green-200: #c3e7d1;
  --green-100: #e2f3e8;
  --green-50: #f0f8f2;

  --amber: #b7791f;
  --amber-bg: #fff4dc;
  --amber-line: #f5d9a0;
  --red: #d2453f;
  --red-bg: #fdeceb;
  --red-line: #f5c2bf;
  --blue: #2f6fd6;
  --blue-bg: #e8f0fd;

  --primary: var(--green-800);
  --primary-grad: linear-gradient(135deg, #1f7048 0%, #0f3d26 100%);
  --feature-grad: linear-gradient(155deg, #2c8457 0%, #185536 55%, #0f3d26 100%);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(18, 28, 22, 0.04);
  --shadow: 0 1px 2px rgba(18, 28, 22, 0.04), 0 10px 30px rgba(18, 28, 22, 0.05);
  --shadow-lg: 0 24px 60px rgba(10, 30, 20, 0.18);

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sidebar-w: 264px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #080b09;
  --panel: #0f1411;
  --card: #151c18;
  --card-2: #1b241f;
  --line: #222d26;
  --line-strong: #2e3b33;
  --text: #e9efeb;
  --text-2: #c3ccc6;
  --muted: #8b978f;

  --green-100: #16301f;
  --green-50: #12261a;
  --green-200: #1f4a30;
  --green-300: #3b8a5e;
  --green-400: #5cc08a;
  --green-500: #6fcf9a;
  --green-600: #7fd9a7;
  --green-700: #9ee4bc;
  --primary: #6fcf9a;

  --amber: #f0b44c;
  --amber-bg: #2e2414;
  --amber-line: #5a4520;
  --red: #f07a73;
  --red-bg: #321715;
  --red-line: #5e2a26;
  --blue: #7fa8f0;
  --blue-bg: #17233a;

  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  max-width: 100%;
}

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

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

p {
  margin: 0;
}

::selection {
  background: var(--green-200);
}

/* Legacy-Icons (Material Icons) im neuen, runden Stil */
.material-icons {
  font-family: 'Material Icons Round', 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'liga';
}

[class^='ri-'],
[class*=' ri-'] {
  line-height: 1;
  vertical-align: middle;
}

/* ---------- App-Rahmen ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 16px;
  min-height: 100vh;
  padding: 16px;
}

.sidebar {
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: var(--radius-xl);
  padding: 28px 0 20px;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px 30px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
}

.nav-label {
  padding: 18px 28px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 28px;
  color: var(--muted);
  font-weight: 500;
  font-size: 15.5px;
  cursor: pointer;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-item i {
  font-size: 21px;
}

.nav-item:hover {
  color: var(--text);
}

.nav-item.is-active {
  color: var(--text);
  font-weight: 600;
}

.nav-item.is-active i {
  color: var(--green-800);
}

:root[data-theme='dark'] .nav-item.is-active i {
  color: var(--green-500);
}

.nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 5px;
  border-radius: 0 6px 6px 0;
  background: var(--primary-grad);
}

.nav-badge {
  margin-left: auto;
  min-width: 30px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--green-900);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.nav-item.is-danger:hover {
  color: var(--red);
}

.sidebar-spacer {
  flex: 1;
  min-height: 20px;
}

/* Promo-/Timer-Karte unten in der Sidebar */
.sidebar-card {
  margin: 0 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  color: #fff;
  background: #0b2a1a;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.sidebar-card::before,
.dark-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(92, 180, 133, 0.45) 0%, transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(36, 122, 78, 0.55) 0%, transparent 60%),
    repeating-radial-gradient(circle at 115% 115%, transparent 0 18px, rgba(255, 255, 255, 0.06) 18px 19px);
}

.sidebar-card .sc-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--green-900);
  font-size: 18px;
  margin-bottom: 14px;
}

.sidebar-card h4 {
  color: #fff;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 600;
}

.sidebar-card p {
  font-size: 12.5px;
  opacity: 0.75;
  margin: 6px 0 16px;
}

.sidebar-card .sc-timer {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 14px;
}

.sidebar-card .btn {
  width: 100%;
}

/* ---------- Hauptbereich ---------- */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--panel);
  border-radius: var(--radius-xl);
}

.menu-toggle {
  display: none;
}

.search {
  position: relative;
  flex: 1;
  max-width: 440px;
}

.search i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-2);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 52px;
  padding: 0 70px 0 50px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--card);
  outline: none;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease);
}

.search input:focus {
  box-shadow: 0 0 0 3px var(--green-200);
}

.search input::placeholder {
  color: var(--muted);
}

.search kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--card-2);
  color: var(--text-2);
  font: 600 12px var(--font);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 6px;
}

.user-chip .avatar {
  width: 50px;
  height: 50px;
  font-size: 16px;
}

.user-chip-name {
  font-weight: 600;
  line-height: 1.25;
}

.user-chip-sub {
  color: var(--muted);
  font-size: 13.5px;
}

.content {
  flex: 1;
  background: var(--panel);
  border-radius: var(--radius-xl);
  padding: 32px;
  min-width: 0;
}

/* ---------- Seitenkopf ---------- */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.page-title {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.page-sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
}

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

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  flex-wrap: wrap;
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb i {
  font-size: 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease), opacity 0.2s;
}

.btn i,
.btn .material-icons {
  font-size: 19px;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 8px 20px rgba(20, 82, 51, 0.22);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 12px 28px rgba(20, 82, 51, 0.32);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--text);
}

.btn-outline:hover:not(:disabled) {
  background: var(--text);
  color: var(--card);
}

.btn-soft {
  background: var(--green-100);
  color: var(--green-800);
}

:root[data-theme='dark'] .btn-soft {
  color: var(--green-600);
}

.btn-soft:hover:not(:disabled) {
  background: var(--green-200);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--card-2);
  color: var(--text);
}

.btn-light {
  background: var(--card);
  border-color: var(--line);
}

.btn-light:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--card-2);
}

.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 8px 20px rgba(210, 69, 63, 0.22);
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-danger-soft {
  background: var(--red-bg);
  color: var(--red);
}

.btn-sm {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.btn-xs {
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  gap: 5px;
}

.btn-xs i,
.btn-xs .material-icons {
  font-size: 15px;
}

.btn-lg {
  height: 58px;
  padding: 0 30px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 50px;
  height: 50px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, transform 0.15s;
}

.icon-btn i,
.icon-btn .material-icons {
  font-size: 21px;
}

.icon-btn:hover {
  background: var(--card-2);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn.sm {
  width: 38px;
  height: 38px;
}

.icon-btn.sm i,
.icon-btn.sm .material-icons {
  font-size: 18px;
}

.icon-btn .dot {
  position: absolute;
  top: 12px;
  right: 13px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--card);
}

.arrow-btn {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--text);
  background: transparent;
  color: var(--text);
  transition: transform 0.2s var(--ease), background 0.2s;
}

.arrow-btn i {
  font-size: 20px;
}

a:hover > .arrow-btn,
.arrow-btn:hover {
  transform: rotate(45deg);
}

/* ---------- Karten ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 2px;
}

.card.is-flush {
  padding: 0;
  overflow: hidden;
}

.card-link {
  display: block;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.card-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 1px 2px rgba(18, 28, 22, 0.04), 0 18px 40px rgba(18, 28, 22, 0.09);
}

/* Kennzahl-Karten */
.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.stat-label {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.stat-value {
  margin-top: auto;
  font-size: clamp(46px, 4.6vw, 66px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.stat-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 14px;
  color: var(--green-700);
}

:root[data-theme='dark'] .stat-foot {
  color: var(--green-500);
}

.stat-foot .tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  height: 20px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.stat-foot.is-muted {
  color: var(--muted);
}

.stat-foot.is-warn {
  color: var(--amber);
}

.stat.is-featured {
  background: var(--feature-grad);
  color: #fff;
  box-shadow: 0 16px 40px rgba(15, 61, 38, 0.28);
}

.stat.is-featured .stat-label,
.stat.is-featured .stat-value {
  color: #fff;
}

.stat.is-featured .stat-foot {
  color: var(--green-200);
}

:root[data-theme='dark'] .stat.is-featured .stat-foot {
  color: #c3e7d1;
}

.stat.is-featured .arrow-btn {
  background: #fff;
  border-color: #fff;
  color: var(--green-900);
}

.stat.is-featured::after {
  content: '';
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
  pointer-events: none;
}

/* Dunkle Karte (Time Tracker) */
.dark-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: #0a2718;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 16px 40px rgba(10, 39, 24, 0.28);
}

.dark-card h3,
.dark-card .card-title {
  color: #fff;
}

.timer-display {
  font-size: clamp(40px, 5vw, 58px);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
  margin: 26px 0 22px;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.round-btn {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  font-size: 26px;
  transition: transform 0.15s var(--ease), filter 0.2s;
}

.round-btn:hover {
  filter: brightness(1.06);
  transform: scale(1.05);
}

.round-btn:active {
  transform: scale(0.94);
}

.round-btn.white {
  background: #fff;
  color: var(--green-900);
}

.round-btn.red {
  background: #e0443b;
  color: #fff;
}

.round-btn.green {
  background: var(--green-400);
  color: #fff;
}

.round-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Grids ---------- */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

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

.wrap {
  flex-wrap: wrap;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

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

.small {
  font-size: 13px;
}

.strong {
  font-weight: 600;
}

.nowrap {
  white-space: nowrap;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

/* ---------- Pills / Tags ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill i,
.pill .material-icons {
  font-size: 14px;
}

.pill-success {
  background: var(--green-50);
  border-color: var(--green-200);
  color: var(--green-700);
}

:root[data-theme='dark'] .pill-success {
  color: var(--green-500);
}

.pill-warn {
  background: var(--amber-bg);
  border-color: var(--amber-line);
  color: var(--amber);
}

.pill-danger {
  background: var(--red-bg);
  border-color: var(--red-line);
  color: var(--red);
}

.pill-info {
  background: var(--blue-bg);
  border-color: transparent;
  color: var(--blue);
}

.pill-dark {
  background: var(--green-900);
  border-color: var(--green-900);
  color: #fff;
}

.pill-live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: live 1.6s infinite;
}

@keyframes live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  color: var(--text-2);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.chip:hover {
  border-color: var(--text-2);
}

.chip.is-active {
  background: var(--green-900);
  border-color: var(--green-900);
  color: #fff;
}

.chip .count {
  opacity: 0.7;
  font-weight: 500;
}

/* ---------- Avatare ---------- */
.avatar {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--green-500);
  user-select: none;
}

.avatar.sm {
  width: 32px;
  height: 32px;
  font-size: 11.5px;
}

.avatar.xs {
  width: 26px;
  height: 26px;
  font-size: 10px;
}

.avatar.lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

.avatar-c0 { background: linear-gradient(135deg, #f3b8b0, #e28b80); color: #5c1f18; }
.avatar-c1 { background: linear-gradient(135deg, #bfe3c8, #7cc497); color: #0f3d26; }
.avatar-c2 { background: linear-gradient(135deg, #c6cff5, #919fe6); color: #1d2566; }
.avatar-c3 { background: linear-gradient(135deg, #f6dca8, #e9b95b); color: #5b3c05; }
.avatar-c4 { background: linear-gradient(135deg, #cfe9ee, #8ccad6); color: #0d4450; }
.avatar-c5 { background: linear-gradient(135deg, #ecc9ea, #cf95cb); color: #57184f; }

.avatar-stack {
  display: flex;
}

.avatar-stack .avatar {
  border: 2.5px solid var(--card);
  margin-left: -10px;
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

/* ---------- Listen ---------- */
.list {
  display: flex;
  flex-direction: column;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  min-width: 0;
}

.list-item + .list-item {
  border-top: 1px solid var(--line);
}

.list.is-plain .list-item + .list-item {
  border-top: 0;
}

.list-body {
  flex: 1;
  min-width: 0;
}

.list-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
}

.list-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.list-sub b {
  color: var(--text);
  font-weight: 600;
}

.list-icon {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--green-50);
  color: var(--green-700);
  font-size: 20px;
}

.list-icon.c1 { background: #e8f0fd; color: #2f6fd6; }
.list-icon.c2 { background: #fff1dc; color: #c77a10; }
.list-icon.c3 { background: #f6e8fb; color: #9146b8; }
.list-icon.c4 { background: #e3f6f6; color: #13888a; }
.list-icon.c5 { background: #fdeceb; color: #d2453f; }

:root[data-theme='dark'] .list-icon { background: var(--card-2); }

/* ---------- Tabellen ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--card);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--card-2);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.table tbody tr {
  transition: background 0.15s;
}

.table tbody tr:hover {
  background: var(--green-50);
}

:root[data-theme='dark'] .table tbody tr:hover {
  background: var(--card-2);
}

/* ---------- Formulare ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}

.hint {
  font-size: 12.5px;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  color: var(--text);
  outline: none;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.55;
}

.select {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%237d857f' d='M12 15.6 6.4 10l1.4-1.4 4.2 4.2 4.2-4.2 1.4 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 4px var(--green-100);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted);
}

.input-icon {
  position: relative;
}

.input-icon > i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 19px;
  color: var(--muted);
  pointer-events: none;
}

.input-icon > .input {
  padding-left: 46px;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.check-card:hover {
  border-color: var(--line-strong);
}

.check-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--green-700);
  flex: none;
}

.check-card:has(input:checked) {
  border-color: var(--green-500);
  background: var(--green-50);
}

/* Runde Checkbox (Aufgaben) */
.tick {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--card);
  color: transparent;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  padding: 0;
}

.tick i {
  font-size: 15px;
}

.tick:hover {
  border-color: var(--green-500);
  color: var(--green-400);
}

.tick.is-done {
  background: var(--green-600);
  border-color: var(--green-600);
  color: #fff;
}

:root[data-theme='dark'] .tick.is-done {
  background: var(--green-300);
  border-color: var(--green-300);
}

/* ---------- Fortschritt ---------- */
.progress {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--card-2);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary-grad);
  transition: width 0.8s var(--ease);
}

:root[data-theme='dark'] .progress > span {
  background: linear-gradient(90deg, var(--green-300), var(--green-500));
}

/* Schraffur wie im Balkendiagramm */
.hatched {
  background-image: repeating-linear-gradient(
    -45deg,
    var(--line-strong) 0 5px,
    transparent 5px 11px
  );
  background-color: var(--card);
  border: 1.5px solid var(--line-strong);
}

/* ---------- Balkendiagramm ---------- */
.bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(8px, 2vw, 22px);
  height: 230px;
  padding-top: 34px;
}

.bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.bar {
  position: relative;
  width: 100%;
  max-width: 78px;
  min-height: 34px;
  border-radius: var(--radius-pill);
  transition: height 0.9s var(--ease);
}

.bar.b-mid { background: var(--green-600); }
.bar.b-light { background: var(--green-300); }
.bar.b-dark { background: var(--green-900); }

:root[data-theme='dark'] .bar.b-dark { background: var(--green-500); }
:root[data-theme='dark'] .bar.b-mid { background: var(--green-300); }

.bar-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.bar-tip::after {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(100% + 3px);
  width: 8px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 2px solid var(--green-700);
  background: var(--card);
}

.bar-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.bar-col.is-today .bar-label {
  color: var(--text);
  font-weight: 700;
}

/* ---------- Halbkreis-Anzeige ---------- */
.gauge {
  position: relative;
  max-width: 340px;
  margin: 0 auto;
}

.gauge svg {
  display: block;
  width: 100%;
  height: auto;
}

.gauge-center {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  text-align: center;
}

.gauge-value {
  font-size: clamp(40px, 4.4vw, 56px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.gauge-label {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-2);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend i.sw {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
}

/* ---------- Leerzustände ---------- */
.empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--muted);
}

.empty i,
.empty .material-icons {
  font-size: 40px;
  display: block;
  margin: 0 auto 10px;
  opacity: 0.5;
}

.empty h4 {
  color: var(--text);
  font-size: 17px;
  margin-bottom: 4px;
}

/* ---------- Hinweise ---------- */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert i,
.alert .material-icons {
  font-size: 20px;
  margin-top: 1px;
}

.alert-success {
  background: var(--green-50);
  border-color: var(--green-200);
  color: var(--green-800);
}

:root[data-theme='dark'] .alert-success { color: var(--green-600); }

.alert-error {
  background: var(--red-bg);
  border-color: var(--red-line);
  color: var(--red);
}

.alert-warn {
  background: var(--amber-bg);
  border-color: var(--amber-line);
  color: var(--amber);
}

.alert-info {
  background: var(--blue-bg);
  color: var(--blue);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  overflow-y: auto;
  background: rgba(8, 20, 13, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal.is-open {
  display: flex;
  animation: fade 0.2s ease;
}

.modal-dialog {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: pop 0.28s var(--ease);
}

.modal-dialog.wide {
  max-width: 780px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 28px 0;
}

.modal-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.modal-body {
  padding: 22px 28px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 28px 26px;
  border-top: 1px solid var(--line);
}

@keyframes fade {
  from { opacity: 0; }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
}

body.modal-open {
  overflow: hidden;
}

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 380px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--green-900);
  color: #fff;
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.35s var(--ease);
}

.toast i {
  font-size: 20px;
}

.toast.is-error {
  background: #9b2c27;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px); }
}

/* ---------- KI-Box ---------- */
.ai-box {
  position: relative;
  border-radius: 18px;
  padding: 2px;
  background: linear-gradient(120deg, var(--green-300), var(--green-700), #7cc4a0);
}

.ai-box .textarea {
  border: 0;
  border-radius: 16px;
  min-height: 150px;
}

.ai-box .textarea:focus {
  box-shadow: none;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--green-700);
}

:root[data-theme='dark'] .ai-badge {
  color: var(--green-500);
}

.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  animation: shimmer 1.3s infinite;
  pointer-events: none;
}

:root[data-theme='dark'] .shimmer::after {
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.07) 50%, transparent 80%);
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.spin {
  animation: spin 0.9s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Eintritts-Animation ---------- */
.reveal {
  animation: reveal 0.55s var(--ease) both;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(12px); }
}

.reveal:nth-child(2) { animation-delay: 0.05s; }
.reveal:nth-child(3) { animation-delay: 0.1s; }
.reveal:nth-child(4) { animation-delay: 0.15s; }
.reveal:nth-child(5) { animation-delay: 0.2s; }
.reveal:nth-child(6) { animation-delay: 0.25s; }

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

/* ---------- Responsive ---------- */
.sidebar-backdrop {
  display: none;
}

@media (max-width: 1280px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
    gap: 12px;
  }

  .sidebar {
    position: fixed;
    z-index: 900;
    top: 12px;
    left: 12px;
    bottom: 12px;
    height: auto;
    width: min(var(--sidebar-w), calc(100vw - 48px));
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.3s var(--ease);
    box-shadow: var(--shadow-lg);
  }

  body.sidebar-open .sidebar {
    transform: none;
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 899;
    background: rgba(8, 20, 13, 0.4);
  }

  .menu-toggle {
    display: inline-grid;
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14.5px;
  }

  .app {
    padding: 0;
    gap: 0;
  }

  .topbar {
    border-radius: 0;
    padding: 12px 16px;
    gap: 10px;
  }

  .content {
    border-radius: 0;
    padding: 22px 16px 40px;
  }

  .search {
    max-width: none;
  }

  .search input {
    height: 44px;
    padding-right: 16px;
  }

  .search kbd,
  .user-chip-text,
  .topbar-right .hide-sm {
    display: none;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .user-chip .avatar {
    width: 44px;
    height: 44px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .card,
  .stat,
  .dark-card {
    padding: 20px;
  }

  .stat {
    min-height: 170px;
  }

  .page-head {
    margin-bottom: 22px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-dialog {
    border-radius: 26px 26px 0 0;
    max-height: 94vh;
    overflow-y: auto;
  }

  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 20px;
    padding-right: 20px;
  }

  .modal-foot .btn {
    flex: 1;
  }

  .bars {
    height: 190px;
  }

  .toast-stack {
    left: 16px;
    right: 16px;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 520px) {
  .grid-4 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
  }

  .grid-4 .stat {
    min-height: 150px;
    padding: 16px;
  }

  .grid-4 .stat-label {
    font-size: 15px;
  }

  .grid-4 .stat-value {
    font-size: 40px;
  }

  .grid-4 .stat-foot {
    font-size: 12px;
    margin-top: 12px;
  }

  .grid-4 .arrow-btn {
    width: 34px;
    height: 34px;
  }
}

@media print {
  .sidebar,
  .topbar {
    display: none;
  }

  .app {
    display: block;
    padding: 0;
  }
}
