:root {
      /* Teams-inspirierte Farbpalette */
      --bg-base: #1f1d2e;
      --bg-elevated: #26243a;
      --bg-card: #2d2b42;
      --bg-hover: #36334d;
      --bg-grid: #1a182a;

      --border-subtle: rgba(255, 255, 255, 0.06);
      --border-default: rgba(255, 255, 255, 0.1);
      --border-strong: rgba(255, 255, 255, 0.18);

      --text-primary: #f1f0fa;
      --text-secondary: #a8a4c4;
      --text-muted: #6e6a8a;

      /* Teams-Lila als Primärfarbe */
      --accent: #7c6cf8;
      --accent-hover: #9387ff;
      --accent-deep: #5a4dd6;
      --accent-bg: rgba(124, 108, 248, 0.12);

      /* Tag-Farben */
      --adriana: #ec4899;
      --adriana-bg: rgba(236, 72, 153, 0.18);
      --adriana-border: rgba(236, 72, 153, 0.5);
      --adriana-text: #f9a8d4;

      --can: #3b82f6;
      --can-bg: rgba(59, 130, 246, 0.18);
      --can-border: rgba(59, 130, 246, 0.5);
      --can-text: #93c5fd;

      --beide: #8b5cf6;
      --beide-bg: rgba(139, 92, 246, 0.18);
      --beide-border: rgba(139, 92, 246, 0.5);
      --beide-text: #c4b5fd;

      --success: #10b981;
      --error: #ef4444;
      --warning: #f59e0b;

      --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
      --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
      --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);

      --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

      --radius-sm: 6px;
      --radius-md: 10px;
      --radius-lg: 14px;
      --radius-xl: 20px;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

    html, body {
      background: var(--bg-base);
      color: var(--text-primary);
      font-family: var(--font-body);
      font-size: 15px;
      line-height: 1.5;
      min-height: 100vh;
      overflow-x: hidden;
    }

    body { position: relative; }

    .bg-mesh {
      position: fixed;
      inset: 0;
      background:
        radial-gradient(ellipse at top right, rgba(124, 108, 248, 0.12), transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(236, 72, 153, 0.08), transparent 60%);
      pointer-events: none;
      z-index: 0;
    }

    .demo-banner {
      position: relative;
      z-index: 3;
      background: var(--accent);
      color: white;
      text-align: center;
      padding: 6px 16px;
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.05em;
    }

    /* ============= LOGIN ============= */
    .login-screen {
      position: fixed;
      inset: 0;
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .login-card {
      position: relative;
      z-index: 2;
      background: var(--bg-elevated);
      border: 1px solid var(--border-default);
      border-radius: var(--radius-xl);
      padding: 40px 32px;
      width: 100%;
      max-width: 400px;
      box-shadow: var(--shadow-lg);
      animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes fadeInUp {
      from { opacity: 0; transform: translateY(20px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .login-header { text-align: center; margin-bottom: 32px; }

    .login-logo {
      width: 64px;
      height: 64px;
      margin: 0 auto 16px;
      background: linear-gradient(135deg, var(--accent), var(--accent-deep));
      border-radius: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 8px 24px rgba(124, 108, 248, 0.4);
    }

    .login-logo svg { color: white; }

    .login-title {
      font-family: var(--font-display);
      font-size: 28px;
      font-weight: 700;
      letter-spacing: -0.02em;
      margin-bottom: 4px;
    }

    .login-subtitle {
      color: var(--text-secondary);
      font-size: 14px;
    }

    .login-form .field { margin-bottom: 16px; }

    .login-error {
      color: var(--error);
      font-size: 13px;
      margin-bottom: 14px;
      min-height: 18px;
      text-align: center;
      font-weight: 500;
    }

    /* ============= APP ============= */
    .app {
      position: relative;
      z-index: 2;
      max-width: 1200px;
      margin: 0 auto;
      padding: 16px 16px 100px;
      min-height: 100vh;
    }

    .header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
      gap: 16px;
      flex-wrap: wrap;
    }

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

    .brand-mark {
      width: 40px;
      height: 40px;
      background: linear-gradient(135deg, var(--accent), var(--accent-deep));
      border-radius: 11px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 12px rgba(124, 108, 248, 0.3);
      flex-shrink: 0;
    }

    .brand-text h1 {
      font-family: var(--font-display);
      font-size: 22px;
      font-weight: 700;
      letter-spacing: -0.02em;
      line-height: 1.1;
    }

    .brand-text p {
      font-size: 12px;
      color: var(--text-secondary);
      margin-top: 2px;
    }

    .live-clock {
      display: flex;
      align-items: center;
      gap: 12px;
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      border-radius: 10px;
      padding: 8px 14px;
    }

    .clock-icon {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--success);
      box-shadow: 0 0 8px var(--success);
      animation: blink 2s ease-in-out infinite;
    }

    @keyframes blink {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.4; }
    }

    .clock-time {
      font-family: var(--font-display);
      font-size: 16px;
      font-weight: 600;
      font-variant-numeric: tabular-nums;
      letter-spacing: -0.01em;
      line-height: 1;
    }

    .clock-date {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 2px;
      font-weight: 500;
    }

    /* USER BAR */
    .user-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 8px 14px;
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      border-radius: 10px;
      margin-bottom: 16px;
    }

    .user-info {
      display: flex;
      align-items: center;
      gap: 10px;
      color: var(--text-secondary);
      font-size: 13px;
    }

    .user-avatar {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), var(--adriana));
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: 700;
      font-size: 12px;
      font-family: var(--font-display);
    }

    .user-info strong { color: var(--text-primary); font-weight: 600; }

    .user-actions { display: flex; gap: 6px; }

    .icon-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 12px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-default);
      border-radius: 8px;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.15s ease;
      font-family: inherit;
      font-size: 12px;
      font-weight: 600;
    }

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

    /* TOOLBAR */
    .toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 16px;
      flex-wrap: wrap;
    }

    .toolbar-left, .toolbar-right {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .nav-btn {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      color: var(--text-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .nav-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }

    .today-btn {
      padding: 0 14px;
      height: 32px;
      border-radius: 8px;
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      color: var(--text-primary);
      font-weight: 600;
      font-size: 13px;
      cursor: pointer;
      transition: all 0.15s ease;
      font-family: inherit;
    }

    .today-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }

    .cal-title {
      font-family: var(--font-display);
      font-size: 18px;
      font-weight: 700;
      letter-spacing: -0.01em;
      margin-left: 4px;
      white-space: nowrap;
    }

    .view-switcher {
      display: flex;
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      border-radius: 8px;
      padding: 3px;
      gap: 2px;
    }

    .view-btn {
      padding: 5px 12px;
      background: transparent;
      border: none;
      color: var(--text-secondary);
      cursor: pointer;
      font-family: inherit;
      font-size: 12px;
      font-weight: 600;
      border-radius: 5px;
      transition: all 0.15s ease;
    }

    .view-btn.active {
      background: var(--accent);
      color: white;
    }

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

    /* FILTER BAR */
    .filter-bar {
      display: flex;
      gap: 6px;
      margin-bottom: 16px;
      overflow-x: auto;
      scrollbar-width: none;
      padding: 2px 0;
      -webkit-overflow-scrolling: touch;
    }

    .filter-bar::-webkit-scrollbar { display: none; }

    .filter-chip {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      border-radius: 100px;
      color: var(--text-secondary);
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s ease;
      white-space: nowrap;
      font-family: inherit;
    }

    .filter-chip:hover { background: var(--bg-hover); color: var(--text-primary); }

    .filter-chip.active {
      background: var(--accent-bg);
      color: var(--accent-hover);
      border-color: var(--accent);
    }

    .chip-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
    .dot-alle { background: linear-gradient(135deg, var(--adriana), var(--can)); }
    .dot-adriana { background: var(--adriana); }
    .dot-can { background: var(--can); }
    .dot-beide { background: var(--beide); }

    /* ============= WEEK VIEW (Teams-Style) ============= */
    .week-view {
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-lg);
      overflow: hidden;
      margin-bottom: 24px;
    }

    .week-header {
      display: grid;
      grid-template-columns: 56px repeat(7, 1fr);
      background: var(--bg-elevated);
      border-bottom: 1px solid var(--border-subtle);
    }

    .week-header > div {
      padding: 10px 4px;
      text-align: center;
      border-right: 1px solid var(--border-subtle);
    }

    .week-header > div:last-child { border-right: none; }

    .wh-corner {
      background: var(--bg-elevated);
    }

    .wh-day {
      cursor: pointer;
      transition: background 0.15s ease;
    }

    .wh-day:hover { background: var(--bg-hover); }

    .wh-day-name {
      font-size: 10px;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin-bottom: 4px;
    }

    .wh-day-num {
      font-family: var(--font-display);
      font-size: 18px;
      font-weight: 700;
      color: var(--text-primary);
      width: 30px;
      height: 30px;
      line-height: 30px;
      border-radius: 50%;
      margin: 0 auto;
      transition: all 0.15s ease;
    }

    .wh-day.today .wh-day-num {
      background: var(--accent);
      color: white;
    }

    .wh-day.today .wh-day-name {
      color: var(--accent-hover);
    }

    /* Ganztägige Events Bereich */
    .allday-row {
      display: grid;
      grid-template-columns: 56px repeat(7, 1fr);
      border-bottom: 1px solid var(--border-subtle);
      background: var(--bg-grid);
      min-height: 32px;
    }

    .allday-label {
      font-size: 9px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      padding: 8px 4px;
      text-align: center;
      font-weight: 700;
      border-right: 1px solid var(--border-subtle);
      writing-mode: vertical-rl;
      text-orientation: mixed;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .allday-cell {
      padding: 4px;
      border-right: 1px solid var(--border-subtle);
      min-height: 32px;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .allday-cell:last-child { border-right: none; }

    .allday-event {
      background: var(--accent-bg);
      border-left: 3px solid var(--accent);
      color: var(--text-primary);
      font-size: 11px;
      font-weight: 600;
      padding: 3px 6px;
      border-radius: 4px;
      cursor: pointer;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      transition: filter 0.15s ease;
    }

    .allday-event:hover { filter: brightness(1.2); }

    .allday-event.tag-adriana { background: var(--adriana-bg); border-left-color: var(--adriana); color: var(--adriana-text); }
    .allday-event.tag-can { background: var(--can-bg); border-left-color: var(--can); color: var(--can-text); }
    .allday-event.tag-beide { background: var(--beide-bg); border-left-color: var(--beide); color: var(--beide-text); }

    /* Stunden-Grid */
    .hours-grid {
      display: grid;
      grid-template-columns: 56px repeat(7, 1fr);
      position: relative;
      max-height: 600px;
      overflow-y: auto;
    }

    .time-col {
      border-right: 1px solid var(--border-subtle);
      background: var(--bg-elevated);
      position: sticky;
      left: 0;
      z-index: 2;
    }

    .time-slot {
      height: 48px;
      padding: 2px 6px;
      font-size: 10px;
      color: var(--text-muted);
      text-align: right;
      font-weight: 600;
      font-variant-numeric: tabular-nums;
      border-bottom: 1px solid var(--border-subtle);
      position: relative;
    }

    .day-col {
      border-right: 1px solid var(--border-subtle);
      position: relative;
      cursor: pointer;
    }

    .day-col:last-child { border-right: none; }

    .day-col.today {
      background: rgba(124, 108, 248, 0.04);
    }

    .hour-slot {
      height: 48px;
      border-bottom: 1px solid var(--border-subtle);
      transition: background 0.1s ease;
    }

    .hour-slot:hover {
      background: var(--bg-hover);
    }

    .event-block {
      position: absolute;
      left: 2px;
      right: 2px;
      background: var(--accent-bg);
      border-left: 3px solid var(--accent);
      border-radius: 4px;
      padding: 4px 6px;
      cursor: pointer;
      overflow: hidden;
      transition: all 0.15s ease;
      z-index: 1;
    }

    .event-block:hover {
      filter: brightness(1.3);
      z-index: 3;
      box-shadow: var(--shadow-md);
    }

    .event-block.tag-adriana { background: var(--adriana-bg); border-left-color: var(--adriana); }
    .event-block.tag-can { background: var(--can-bg); border-left-color: var(--can); }
    .event-block.tag-beide { background: var(--beide-bg); border-left-color: var(--beide); }

    .event-title {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-primary);
      line-height: 1.2;
      margin-bottom: 2px;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    .event-time {
      font-size: 10px;
      color: var(--text-secondary);
      font-variant-numeric: tabular-nums;
    }

    .event-block.tag-adriana .event-title { color: var(--adriana-text); }
    .event-block.tag-can .event-title { color: var(--can-text); }
    .event-block.tag-beide .event-title { color: var(--beide-text); }

    /* Aktuelle Zeit Linie */
    .now-line {
      position: absolute;
      left: 56px;
      right: 0;
      height: 2px;
      background: var(--error);
      z-index: 4;
      pointer-events: none;
    }

    .now-line::before {
      content: '';
      position: absolute;
      left: -5px;
      top: -4px;
      width: 10px;
      height: 10px;
      background: var(--error);
      border-radius: 50%;
    }

    /* ============= MONTH VIEW ============= */
    .month-view {
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-lg);
      padding: 12px;
      margin-bottom: 24px;
    }

    .month-weekdays {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 4px;
      margin-bottom: 8px;
    }

    .month-weekdays > div {
      text-align: center;
      font-size: 11px;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      padding: 6px 0;
    }

    .month-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 4px;
    }

    .month-cell {
      aspect-ratio: 1 / 1.05;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 8px;
      padding: 6px;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      transition: all 0.15s ease;
      font-family: inherit;
      color: var(--text-primary);
      overflow: hidden;
      position: relative;
    }

    .month-cell:hover:not(.empty) {
      background: var(--bg-hover);
      border-color: var(--border-strong);
    }

    .month-cell.empty { cursor: default; opacity: 0.4; }
    .month-cell.other-month { opacity: 0.4; }

    .month-cell.today {
      border-color: var(--accent);
      background: rgba(124, 108, 248, 0.08);
    }

    .month-cell.today .mc-day {
      background: var(--accent);
      color: white;
    }

    .mc-day {
      font-size: 13px;
      font-weight: 600;
      width: 22px;
      height: 22px;
      line-height: 22px;
      border-radius: 50%;
      text-align: center;
      align-self: flex-start;
      font-variant-numeric: tabular-nums;
    }

    .mc-events {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 2px;
      margin-top: 4px;
      overflow: hidden;
    }

    .mc-event {
      font-size: 10px;
      font-weight: 600;
      padding: 1px 5px;
      border-radius: 3px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      border-left: 2px solid;
    }

    .mc-event.tag-adriana { background: var(--adriana-bg); border-color: var(--adriana); color: var(--adriana-text); }
    .mc-event.tag-can { background: var(--can-bg); border-color: var(--can); color: var(--can-text); }
    .mc-event.tag-beide { background: var(--beide-bg); border-color: var(--beide); color: var(--beide-text); }

    .mc-more {
      font-size: 10px;
      color: var(--text-muted);
      font-weight: 600;
      padding: 0 4px;
    }

    /* UPCOMING */
    .upcoming { margin-top: 24px; }

    .section-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 12px;
      padding: 0 4px;
    }

    .section-header h3 {
      font-family: var(--font-display);
      font-size: 16px;
      font-weight: 700;
      letter-spacing: -0.01em;
    }

    .count-badge {
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      color: var(--text-secondary);
      font-size: 11px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 100px;
      font-variant-numeric: tabular-nums;
    }

    .termine-list { display: flex; flex-direction: column; gap: 8px; }

    .termin-card {
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      padding: 12px 14px;
      cursor: pointer;
      transition: all 0.15s ease;
      display: flex;
      gap: 12px;
      align-items: flex-start;
      position: relative;
      overflow: hidden;
    }

    .termin-card::before {
      content: '';
      position: absolute;
      left: 0; top: 0; bottom: 0;
      width: 3px;
      background: var(--text-muted);
    }

    .termin-card.tag-adriana::before { background: var(--adriana); }
    .termin-card.tag-can::before { background: var(--can); }
    .termin-card.tag-beide::before { background: var(--beide); }

    .termin-card:hover {
      background: var(--bg-hover);
      transform: translateX(2px);
    }

    .termin-date {
      flex-shrink: 0;
      text-align: center;
      background: var(--bg-elevated);
      border-radius: 8px;
      padding: 6px 10px;
      min-width: 48px;
    }

    .termin-date .day {
      font-family: var(--font-display);
      font-size: 18px;
      font-weight: 700;
      line-height: 1;
      color: var(--text-primary);
    }

    .termin-date .month {
      font-size: 9px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin-top: 3px;
      font-weight: 700;
    }

    .termin-info { flex: 1; min-width: 0; }

    .termin-titel {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .termin-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 6px 10px;
      font-size: 12px;
      color: var(--text-secondary);
      align-items: center;
    }

    .meta-item { display: flex; align-items: center; gap: 4px; }
    .meta-item svg { width: 12px; height: 12px; opacity: 0.7; }

    .termin-link {
      color: var(--accent-hover);
      text-decoration: none;
      font-size: 12px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      margin-top: 6px;
      font-weight: 600;
      padding: 4px 8px;
      background: var(--accent-bg);
      border-radius: 5px;
      transition: all 0.15s ease;
    }

    .termin-link:hover { background: var(--accent); color: white; }

    .tag-badge {
      font-size: 9px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      padding: 2px 7px;
      border-radius: 100px;
      border: 1px solid;
    }

    .tag-badge.tag-adriana { background: var(--adriana-bg); color: var(--adriana-text); border-color: var(--adriana-border); }
    .tag-badge.tag-can { background: var(--can-bg); color: var(--can-text); border-color: var(--can-border); }
    .tag-badge.tag-beide { background: var(--beide-bg); color: var(--beide-text); border-color: var(--beide-border); }

    .empty-state {
      text-align: center;
      padding: 32px 20px;
      color: var(--text-muted);
      font-size: 14px;
    }

    /* FAB */
    .fab {
      position: fixed;
      bottom: 24px;
      right: 24px;
      padding: 0 20px;
      height: 52px;
      border-radius: 14px;
      background: var(--accent);
      color: white;
      border: none;
      cursor: pointer;
      box-shadow: 0 10px 30px rgba(124, 108, 248, 0.5);
      display: flex;
      align-items: center;
      gap: 8px;
      z-index: 50;
      transition: all 0.15s ease;
      font-family: var(--font-display);
      font-weight: 700;
      font-size: 14px;
    }

    .fab:hover {
      transform: translateY(-2px);
      background: var(--accent-hover);
      box-shadow: 0 14px 40px rgba(124, 108, 248, 0.6);
    }

    .fab:active { transform: translateY(0); }

    /* MODAL */
    .modal {
      position: fixed;
      inset: 0;
      z-index: 100;
      display: none;
      align-items: flex-end;
      justify-content: center;
    }

    .modal.active { display: flex; animation: fadeIn 0.2s ease; }

    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

    .modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }

    .modal-card {
      position: relative;
      background: var(--bg-elevated);
      border: 1px solid var(--border-default);
      border-radius: var(--radius-xl) var(--radius-xl) 0 0;
      width: 100%;
      max-width: 560px;
      max-height: 92vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideUp {
      from { transform: translateY(100%); }
      to { transform: translateY(0); }
    }

    .modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border-subtle);
    }

    .modal-header h2 {
      font-family: var(--font-display);
      font-size: 18px;
      font-weight: 700;
      letter-spacing: -0.01em;
    }

    .close-btn {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: transparent;
      border: none;
      color: var(--text-secondary);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s ease;
    }

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

    .modal-body {
      padding: 20px;
      overflow-y: auto;
      flex: 1;
      -webkit-overflow-scrolling: touch;
    }

    .field { margin-bottom: 14px; }

    .field-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-bottom: 14px;
    }

    .field-row .field { margin-bottom: 0; }

    .field label {
      display: block;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-secondary);
      margin-bottom: 6px;
      letter-spacing: 0.01em;
    }

    .field .req { color: var(--accent); }
    .field .hint { color: var(--text-muted); font-weight: 400; font-size: 11px; }

    .field input, .field textarea {
      width: 100%;
      padding: 10px 12px;
      background: var(--bg-card);
      border: 1px solid var(--border-default);
      border-radius: 8px;
      color: var(--text-primary);
      font-size: 14px;
      font-family: inherit;
      transition: all 0.15s ease;
    }

    .field input:focus, .field textarea:focus {
      outline: none;
      border-color: var(--accent);
      background: var(--bg-elevated);
      box-shadow: 0 0 0 3px var(--accent-bg);
    }

    .field input::placeholder, .field textarea::placeholder { color: var(--text-muted); }
    .field textarea { resize: vertical; min-height: 70px; }

    input[type="date"], input[type="time"] { color-scheme: dark; }

    .checkbox-label {
      display: flex !important;
      align-items: center;
      gap: 10px;
      margin-bottom: 0 !important;
      cursor: pointer;
      user-select: none;
      padding: 10px 12px;
      background: var(--bg-card);
      border: 1px solid var(--border-default);
      border-radius: 8px;
      color: var(--text-primary) !important;
      font-weight: 500 !important;
      font-size: 13px !important;
      transition: all 0.15s ease;
    }

    .checkbox-label:hover { background: var(--bg-hover); }

    .checkbox-label input[type="checkbox"] {
      width: 16px !important;
      height: 16px !important;
      accent-color: var(--accent);
      cursor: pointer;
    }

    .tag-selector { display: flex; gap: 6px; flex-wrap: wrap; }
    .tag-option { cursor: pointer; flex: 1; min-width: 80px; }

    .tag-option input[type="radio"] {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }

    .tag-pill {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 10px 12px;
      background: var(--bg-card);
      border: 1.5px solid var(--border-default);
      border-radius: 8px;
      font-size: 13px;
      font-weight: 700;
      color: var(--text-secondary);
      transition: all 0.15s ease;
      text-align: center;
    }

    .tag-dot { width: 8px; height: 8px; border-radius: 50%; }
    .tag-pill.tag-adriana .tag-dot { background: var(--adriana); }
    .tag-pill.tag-can .tag-dot { background: var(--can); }
    .tag-pill.tag-beide .tag-dot { background: var(--beide); }

    .tag-option input:checked + .tag-pill.tag-adriana { background: var(--adriana-bg); border-color: var(--adriana); color: var(--adriana-text); }
    .tag-option input:checked + .tag-pill.tag-can { background: var(--can-bg); border-color: var(--can); color: var(--can-text); }
    .tag-option input:checked + .tag-pill.tag-beide { background: var(--beide-bg); border-color: var(--beide); color: var(--beide-text); }

    .modal-actions {
      display: flex;
      gap: 8px;
      margin-top: 20px;
      padding-top: 14px;
      border-top: 1px solid var(--border-subtle);
    }

    .btn {
      padding: 10px 18px;
      border-radius: 8px;
      border: none;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      font-family: inherit;
      transition: all 0.15s ease;
      letter-spacing: 0.01em;
    }

    .btn-primary {
      background: var(--accent);
      color: white;
      flex: 1;
    }

    .btn-primary:hover { background: var(--accent-hover); }
    .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

    .btn-secondary {
      background: var(--bg-card);
      color: var(--text-primary);
      border: 1px solid var(--border-default);
    }

    .btn-secondary:hover { background: var(--bg-hover); }

    .btn-ghost {
      background: transparent;
      color: var(--error);
      border: 1px solid rgba(239, 68, 68, 0.3);
    }

    .btn-ghost:hover { background: rgba(239, 68, 68, 0.1); }
    .btn-full { width: 100%; }

    .day-list { display: flex; flex-direction: column; gap: 8px; }

    /* IMPORT MODAL */
    .import-info {
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      padding: 12px 14px;
      border-radius: 8px;
      font-size: 13px;
      color: var(--text-secondary);
      margin-bottom: 14px;
      line-height: 1.5;
    }

    .import-events {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 8px;
      max-height: 240px;
      overflow-y: auto;
    }

    .import-event-item {
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      border-radius: 6px;
      padding: 10px 12px;
      font-size: 12px;
    }

    .import-event-title {
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 4px;
    }

    .import-event-meta {
      color: var(--text-muted);
      font-size: 11px;
      display: flex;
      flex-wrap: wrap;
      gap: 6px 10px;
    }

    .demo-import-btn {
      display: block;
      width: 100%;
      padding: 12px;
      margin-top: 10px;
      background: var(--bg-card);
      border: 1px dashed var(--border-strong);
      border-radius: 8px;
      color: var(--text-secondary);
      font-family: inherit;
      font-size: 12px;
      cursor: pointer;
      transition: all 0.15s ease;
    }

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

    .toast {
      position: fixed;
      top: 20px;
      left: 50%;
      transform: translateX(-50%) translateY(-100px);
      background: var(--bg-elevated);
      border: 1px solid var(--border-default);
      color: var(--text-primary);
      padding: 10px 18px;
      border-radius: 100px;
      font-size: 13px;
      font-weight: 600;
      box-shadow: var(--shadow-md);
      z-index: 200;
      transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      pointer-events: none;
      white-space: nowrap;
    }

    .toast.show { transform: translateX(-50%) translateY(0); }
    .toast.success { border-color: var(--success); }
    .toast.error { border-color: var(--error); }

    /* MOBILE */
    @media (max-width: 768px) {
      .week-view { display: none; }
      .view-switcher .view-btn[data-view="week"] { display: none; }
    }

    @media (max-width: 480px) {
      .app { padding: 12px 12px 100px; }
      .brand-text h1 { font-size: 18px; }
      .clock-time { font-size: 14px; }
      .clock-date { font-size: 10px; }
      .live-clock { padding: 6px 10px; gap: 8px; }
      .month-view { padding: 8px; }
      .month-cell { padding: 4px; aspect-ratio: 1 / 1.15; }
      .mc-day { font-size: 12px; width: 20px; height: 20px; line-height: 20px; }
      .mc-event { font-size: 9px; padding: 1px 4px; }
      .cal-title { font-size: 16px; }
      .field-row { grid-template-columns: 1fr; }
      .modal-actions { flex-direction: column-reverse; }
      .modal-actions .btn { width: 100%; }
      .icon-btn span { display: none; }
      .icon-btn { padding: 7px 9px; }
      .toolbar { gap: 8px; }
      .toolbar-left { flex: 1; }
      .login-card { padding: 32px 24px; }
      .fab { bottom: 16px; right: 16px; }
    }

    @media (min-width: 481px) {
      .modal { align-items: center; }
      .modal-card { border-radius: var(--radius-xl); max-height: 86vh; }
    }