﻿
    @font-face {
      font-family: 'IBM Plex Sans';
      src: url('../fonts/IBMPlexSans-VariableFont_wdth,wght.ttf') format('truetype');
      font-weight: 100 700;
      font-style: normal;
    }
    @font-face {
      font-family: 'IBM Plex Sans';
      src: url('../fonts/IBMPlexSans-Italic-VariableFont_wdth,wght.ttf') format('truetype');
      font-weight: 100 700;
      font-style: italic;
    }

    :root {
      --primary: #4f46e5;
      --primary-dark: #3730a3;
      --primary-light: #e0e7ff;
      --accent: #f59e0b;
      --bg: #f8fafc;
      --card: #ffffff;
      --text: #1e293b;
      --muted: #64748b;
      --border: #e2e8f0;
      --success: #10b981;
      --error: #ef4444;
      --radius: 12px;
      --shadow: 0 4px 24px rgba(0,0,0,0.08);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      padding: 0 0 60px;
    }

    /* ── HEADER ── */
    header {
      background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
      color: #fff;
      padding: 40px 24px 32px;
      text-align: center;
    }
    header h1 {
      font-size: clamp(1.8rem, 5vw, 3rem);
      font-weight: 800;
      letter-spacing: -0.5px;
    }
    header p {
      margin-top: 8px;
      font-size: 1.05rem;
      opacity: 0.85;
    }
    header a {
      display: inline-block;
      margin-top: 14px;
      color: rgba(255,255,255,0.8);
      font-size: 0.85rem;
      text-decoration: none;
      border: 1px solid rgba(255,255,255,0.35);
      padding: 6px 14px;
      border-radius: 6px;
      transition: background 0.2s;
    }
    header a:hover { background: rgba(255,255,255,0.12); }
    .star-icon { font-size: 2rem; margin-bottom: 8px; display: block; }

    /* ── MAIN LAYOUT ── */
    main {
      max-width: 900px;
      margin: 0 auto;
      padding: 32px 16px 0;
      display: flex;
      flex-direction: column;
      gap: 32px;
    }

    /* ── CARD ── */
    .card {
      background: var(--card);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 32px;
    }
    .card h2 {
      font-size: 1.25rem;
      font-weight: 700;
      margin-bottom: 24px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .card h2 .icon { font-size: 1.4rem; }

    /* ── FORM ── */
    .form-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
    }
    @media (max-width: 560px) {
      .form-grid { grid-template-columns: 1fr; }
    }
    .form-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .form-group.full { grid-column: 1 / -1; }

    label {
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    input, select {
      padding: 10px 14px;
      border: 1.5px solid var(--border);
      border-radius: 8px;
      font-size: 1rem;
      color: var(--text);
      background: #fff;
      transition: border-color 0.2s, box-shadow 0.2s;
      outline: none;
      width: 100%;
    }
    input:focus, select:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-light);
    }
    input::placeholder { color: #b0bac5; }

    /* ── SUBMIT ── */
    .btn-submit {
      width: 100%;
      padding: 14px;
      background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
      color: #fff;
      font-size: 1.05rem;
      font-weight: 700;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      transition: opacity 0.2s, transform 0.1s;
    }
    .btn-submit:hover { opacity: 0.92; }
    .btn-submit:active { transform: scale(0.99); }
    .btn-submit:disabled { opacity: 0.55; cursor: not-allowed; }

    /* ── TOAST ── */
    #toast {
      position: fixed;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%) translateY(80px);
      background: var(--success);
      color: #fff;
      padding: 14px 28px;
      border-radius: 50px;
      font-weight: 600;
      font-size: 0.95rem;
      box-shadow: 0 8px 32px rgba(0,0,0,0.18);
      transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), opacity 0.35s;
      opacity: 0;
      z-index: 9999;
      pointer-events: none;
    }
    #toast.show {
      transform: translateX(-50%) translateY(0);
      opacity: 1;
    }
    #toast.error { background: var(--error); }

    /* ── OVERVIEW ── */
    .overview-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 16px;
    }

    .shift-card {
      border: 1.5px solid var(--border);
      border-radius: 10px;
      overflow: visible;
      position: relative;
      cursor: pointer;
      transition: box-shadow 0.12s;
    }
    .shift-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.12); }
    .shift-card.selected {
      outline: 2.5px solid var(--success);
      box-shadow: 0 0 0 5px rgba(16,185,129,0.15);
    }
    /* Accordion – Ecken */
    .shift-card-header       { border-radius: 9px; }
    .shift-card.selected .shift-card-header { border-radius: 9px 9px 0 0; }
    .accordion-body {
      display: none;
      overflow: hidden;
      border-radius: 0 0 9px 9px;
      background: #fff;
    }
    .shift-card.selected .accordion-body { display: block; }
    .select-indicator {
      position: absolute;
      top: -8px; right: -8px;
      width: 22px; height: 22px;
      background: var(--success);
      border-radius: 50%;
      color: #fff;
      font-size: 0.7rem;
      font-weight: 800;
      display: none;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 6px rgba(0,0,0,0.25);
      z-index: 2;
    }
    .shift-card.selected .select-indicator { display: flex; }
    .shift-card-header {
      background: var(--primary);
      color: #fff;
      padding: 10px 14px;
      font-weight: 700;
      font-size: 0.9rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      /* border-radius wird per JS-Klasse gesteuert (accordion) */
    }
    .shift-badge {
      background: rgba(255,255,255,0.25);
      border-radius: 20px;
      padding: 1px 8px;
      font-size: 0.78rem;
      font-weight: 600;
    }
    .shift-card-body {
      padding: 10px 14px;
      min-height: 48px;
    }
    .person-entry {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 5px 0;
      border-bottom: 1px solid var(--border);
      font-size: 0.9rem;
    }
    .person-entry:last-child { border-bottom: none; }
    .person-dot {
      width: 8px; height: 8px;
      border-radius: 50%;
      background: var(--primary);
      flex-shrink: 0;
    }
    .empty-hint {
      font-size: 0.82rem;
      color: var(--muted);
      font-style: italic;
      padding: 4px 0;
    }

    .loading-hint {
      text-align: center;
      color: var(--muted);
      font-size: 0.92rem;
      padding: 24px 0;
    }

    /* ── DAY GROUPS ── */
    .day-group { margin-bottom: 28px; }
    .day-group:last-child { margin-bottom: 0; }
    .day-heading {
      font-size: 1rem;
      font-weight: 700;
      color: var(--primary-dark);
      background: var(--primary-light);
      border-radius: 6px;
      padding: 6px 12px 6px 14px;
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      user-select: none;
      width: 100%;
      transition: background 0.2s;
    }
    .day-heading:hover { background: #c7d2fe; }
    .day-heading .day-chevron {
      margin-left: auto;
      font-style: normal;
      font-size: 0.8rem;
      transition: transform 0.25s ease;
      display: inline-block;
    }
    .day-group.collapsed .day-chevron { transform: rotate(-90deg); }
    .day-group-content {
      overflow: hidden;
      transition: opacity 0.25s ease;
    }
    .day-group.collapsed .day-group-content {
      display: none;
    }
    .shift-time-badge {
      font-size: 0.72rem;
      font-weight: 600;
      background: rgba(255,255,255,0.18);
      border: 1px solid rgba(255,255,255,0.35);
      border-radius: 20px;
      padding: 1px 7px;
      white-space: nowrap;
    }

    /* ── CATEGORY BLOCKS ── */
    .cat-block {
      border: 1.5px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
      margin-bottom: 14px;
    }
    .cat-block:last-child { margin-bottom: 0; }
    .cat-header {
      padding: 11px 16px;
      font-weight: 700;
      font-size: 0.95rem;
      color: #fff;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .subcat-group {
      padding: 14px 16px;
      border-top: 1px solid var(--border);
      background: var(--bg);
    }
    .subcat-label {
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: var(--muted);
      margin-bottom: 6px;
    }
    .subcat-desc {
      font-size: 0.88rem;
      color: var(--muted);
      line-height: 1.5;
      margin-bottom: 12px;
    }
    /* ── SUBMIT-BEREICH ── */
    #submit-area {
      margin-top: 24px;
      padding-top: 20px;
      border-top: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    #selected-label {
      text-align: center;
      font-size: 0.95rem;
      font-weight: 600;
      color: var(--muted);
      transition: color 0.2s;
    }
    .slot-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-bottom: 8px;
      align-items: start;
    }
    .slot-row:last-child { margin-bottom: 0; }
    @media (max-width: 640px) {
      .slot-row { grid-template-columns: 1fr; }
    }

    /* ── SUCCESS MODAL ── */
    .modal-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15,23,42,0.6);
      z-index: 8000;
      align-items: center;
      justify-content: center;
      padding: 16px;
      backdrop-filter: blur(3px);
    }
    .modal-backdrop.open { display: flex; }

    .success-modal {
      background: #fff;
      border-radius: 20px;
      box-shadow: 0 32px 80px rgba(0,0,0,0.25);
      width: 100%;
      max-width: 420px;
      animation: popIn 0.28s cubic-bezier(.34,1.56,.64,1);
      overflow: hidden;
    }
    @keyframes popIn {
      from { transform: scale(0.88); opacity: 0; }
      to   { transform: scale(1);    opacity: 1; }
    }
    .success-modal-top {
      background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
      color: #fff;
      padding: 28px 24px 20px;
      text-align: center;
    }
    .success-modal-top .check-icon {
      font-size: 2.8rem;
      display: block;
      margin-bottom: 10px;
    }
    .success-modal-top h3 {
      font-size: 1.4rem;
      font-weight: 800;
    }
    .success-modal-top p {
      font-size: 0.92rem;
      opacity: 0.88;
      margin-top: 6px;
      line-height: 1.5;
    }
    .success-modal-body {
      padding: 24px 24px 20px;
      text-align: center;
    }
    .success-modal-body .qr-label {
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    .qr-frame {
      display: inline-block;
      border: 2.5px solid var(--border);
      border-radius: 14px;
      padding: 10px;
      background: #fff;
      box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    }
    .qr-frame img {
      display: block;
      width: 200px;
      height: 200px;
      border-radius: 8px;
      object-fit: contain;
    }
    .qr-hint {
      font-size: 0.8rem;
      color: var(--muted);
      margin-top: 12px;
      line-height: 1.5;
    }
    .success-modal-footer {
      padding: 0 24px 24px;
    }
    .btn-close-modal {
      width: 100%;
      padding: 13px;
      background: var(--primary);
      color: #fff;
      border: none;
      border-radius: 10px;
      font-size: 1rem;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.2s;
      font-family: inherit;
    }
    .btn-close-modal:hover { background: var(--primary-dark); }

    /* ── SPINNER ── */
    .spinner {
      display: inline-block;
      width: 18px; height: 18px;
      border: 3px solid rgba(255,255,255,0.4);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      vertical-align: middle;
      margin-right: 6px;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ── FOOTER ── */
    footer {
      text-align: center;
      padding: 40px 16px 28px;
      font-size: 0.82rem;
      color: var(--muted);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 16px;
    }
    footer p { line-height: 1.8; }
    footer .footer-admin { margin-bottom: 8px; }
    footer .footer-admin a {
      color: var(--muted);
      text-decoration: none;
      border: 1px solid var(--border);
      padding: 6px 14px;
      border-radius: 6px;
      transition: background 0.2s, color 0.2s;
    }
    footer .footer-admin a:hover { background: var(--border); color: var(--text); }
    footer .footer-meta {
      border-top: 1px solid var(--border);
      padding-top: 16px;
      width: 100%;
      max-width: 500px;
    }
    footer .footer-meta a {
      color: var(--muted);
      text-decoration: none;
    }
    footer .footer-meta a:hover { color: var(--text); text-decoration: underline; }
    footer .footer-note {
      font-size: 0.78rem;
      opacity: 0.7;
    }
  