/* === CSS extrahiert aus kontrakte.html (extrahiert 2026-04-26) === */
  @import url('/shared/fonts/inter.css');
  * { margin: 0; padding: 0; box-sizing: border-box; }

  :root {
    --bg: linear-gradient(145deg, #eef2f7 0%, #e4ecf4 25%, #dfe8f0 50%, #e8eef5 75%, #f0f4f8 100%);
    --nav-bg: rgba(255,255,255,0.55);
    --nav-border: rgba(255,255,255,0.5);
    --card-bg: rgba(255,255,255,0.45);
    --card-border: rgba(255,255,255,0.6);
    --card-hover-bg: rgba(255,255,255,0.65);
    --card-shadow: 0 2px 16px rgba(0,0,0,0.04);
    --card-hover-shadow: 0 12px 44px rgba(0,0,0,0.08);
    --text-primary: #1c1c1e;
    --text-secondary: #636366;
    --text-tertiary: #8e8e93;
    --badge-bg: rgba(4,179,214,0.1);
    --badge-color: #04b3d6;
    --toggle-bg: rgba(0,0,0,0.06);
    --toggle-knob: #fff;
    --input-bg: rgba(255,255,255,0.7);
    --modal-bg: rgba(255,255,255,0.85);
  }

  [data-theme="dark"] {
    --bg: linear-gradient(145deg, #1a1a2e 0%, #16213e 30%, #1a1a2e 60%, #0f3460 100%);
    --nav-bg: rgba(30,30,46,0.85);
    --nav-border: rgba(255,255,255,0.08);
    --card-bg: rgba(30,30,46,0.65);
    --card-border: rgba(255,255,255,0.08);
    --card-hover-bg: rgba(40,40,60,0.75);
    --card-shadow: 0 2px 16px rgba(0,0,0,0.2);
    --card-hover-shadow: 0 12px 44px rgba(0,0,0,0.3);
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #636366;
    --badge-bg: rgba(4,179,214,0.15);
    --badge-color: #2cc5e4;
    --toggle-bg: rgba(255,255,255,0.1);
    --toggle-knob: #1c1c1e;
    --input-bg: rgba(30,30,46,0.7);
    --modal-bg: rgba(30,30,46,0.92);
  }

  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    min-height: 100vh;
    background: var(--bg);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    -webkit-font-smoothing: antialiased;
    transition: background 0.4s;
  }

  @keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }

  /* ===== NAV ===== */
  nav {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--nav-bg);
    backdrop-filter: blur(44px) saturate(180%);
    -webkit-backdrop-filter: blur(44px) saturate(180%);
    border-bottom: 1px solid var(--nav-border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s;
  }

  .nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
  }
  .nav-logo { height: 28px; width: auto; }
  [data-theme="dark"] .nav-logo { filter: brightness(2.2) contrast(0.85); }

  .nav-back {
    font-size: 13px;
    font-weight: 500;
    color: var(--badge-color);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    min-height: 40px;
    display: flex;
    align-items: center;
  }
  .nav-back:hover { background: var(--badge-bg); }

  .nav-divider {
    width: 1px;
    height: 18px;
    background: var(--nav-border);
    flex-shrink: 0;
  }

  .nav-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    transition: color 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
  }

  .btn-chat-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid rgba(4,179,214,0.3);
    background: rgba(4,179,214,0.08);
    color: var(--badge-color);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    min-height: 40px;
  }
  .btn-chat-nav:hover { background: rgba(4,179,214,0.18); }

  .theme-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    min-height: 40px;
    padding: 4px 0;
  }
  .toggle-icon { font-size: 14px; line-height: 1; }
  .toggle-track {
    width: 44px; height: 26px;
    border-radius: 13px;
    background: var(--toggle-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    position: relative;
    transition: all 0.3s;
  }
  .toggle-knob {
    width: 20px; height: 20px;
    border-radius: 10px;
    background: var(--toggle-knob);
    position: absolute;
    top: 2px; left: 3px;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  }
  [data-theme="dark"] .toggle-knob { left: 21px; background: #f5f5f7; }

  /* ===== CONTAINER ===== */
  .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 24px 80px;
  }

  /* ===== STATS ===== */
  .stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(60px) saturate(180%);
    -webkit-backdrop-filter: blur(60px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    transition: background 0.3s;
  }
  .stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 100%);
    border-radius: 16px 16px 0 0;
    pointer-events: none;
  }
  [data-theme="dark"] .stat-card::before {
    background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%);
  }

  .stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    transition: color 0.3s;
  }
  .stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1;
    transition: color 0.3s;
  }
  .stat-value.blue { color: var(--badge-color); }
  .stat-value.red { color: #ff453a; }

  /* ===== FILTER BAR ===== */
  .filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }

  .search-wrap {
    position: relative;
    min-width: 220px;
    flex: 1;
    max-width: 360px;
  }
  .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 14px;
    pointer-events: none;
  }
  .search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    min-height: 40px;
  }
  .search-input:focus { border-color: var(--badge-color); }
  .search-input::placeholder { color: var(--text-tertiary); }

  .filter-select {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    min-height: 40px;
    cursor: pointer;
  }
  .filter-select:focus { border-color: var(--badge-color); }

  .filter-checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    min-height: 40px;
    padding: 0 4px;
    white-space: nowrap;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .filter-checkbox-wrap:hover { color: var(--text-primary); }
  .filter-checkbox-wrap input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--badge-color);
    cursor: pointer;
  }

  .filter-spacer { flex: 1; }

  .btn-new {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #04b3d6, #0090b0);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    min-height: 40px;
  }
  .btn-new:hover { opacity: 0.88; }

  .btn-export {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 13px;
    border-radius: 9px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    min-height: 40px;
  }
  .btn-export.excel { background: rgba(48,209,88,0.15); color: #30d158; border: 1px solid rgba(48,209,88,0.3); }
  .btn-export.excel:hover { background: rgba(48,209,88,0.25); }
  .btn-export.pdf { background: rgba(255,69,58,0.12); color: #ff453a; border: 1px solid rgba(255,69,58,0.3); }
  .btn-export.pdf:hover { background: rgba(255,69,58,0.22); }

  /* ===== HAUPT-KARTE ===== */
  .main-card {
    background: var(--card-bg);
    backdrop-filter: blur(60px) saturate(180%);
    -webkit-backdrop-filter: blur(60px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: background 0.3s;
  }

  /* ===== TABELLE ===== */
  .tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table.kontrakte-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }

  .kontrakte-tbl th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .kontrakte-tbl th:hover { color: var(--text-primary); }
  .kontrakte-tbl th.sort-asc::after { content: ' ↑'; color: var(--badge-color); }
  .kontrakte-tbl th.sort-desc::after { content: ' ↓'; color: var(--badge-color); }

  .kontrakte-tbl td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-primary);
    vertical-align: middle;
    transition: color 0.3s;
  }
  .kontrakte-tbl tr:last-child td { border-bottom: none; }
  .kontrakte-tbl tbody tr {
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .kontrakte-tbl tbody tr:hover { background: rgba(4,179,214,0.05); }

  /* Abgelaufene Zeilen */
  .kontrakte-tbl tr.expired td {
    color: var(--text-tertiary);
    text-decoration: line-through;
    opacity: 0.7;
  }
  .kontrakte-tbl tr.expired:hover { background: rgba(0,0,0,0.03); }

  /* ===== BADGES ===== */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
  }
  .badge.warning {
    background: rgba(255,69,58,0.12);
    color: #ff453a;
    border: 1px solid rgba(255,69,58,0.3);
  }
  .badge.aktiv {
    background: rgba(48,209,88,0.12);
    color: #30d158;
    border: 1px solid rgba(48,209,88,0.3);
  }
  .badge.expired-badge {
    background: rgba(142,142,147,0.12);
    color: var(--text-tertiary);
    border: 1px solid rgba(142,142,147,0.3);
  }

  /* ===== AKTIONEN ===== */
  .action-btns {
    display: flex;
    gap: 6px;
    align-items: center;
  }

  .btn-action {
    width: 30px; height: 30px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--toggle-bg);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    min-height: 40px;
    min-width: 40px;
  }
  .btn-action:hover { background: var(--card-hover-bg); color: var(--text-primary); }
  .btn-action.danger:hover { background: rgba(255,69,58,0.12); color: #ff453a; border-color: rgba(255,69,58,0.3); }

  /* ===== LOADING / EMPTY ===== */
  .state-box {
    padding: 60px 20px;
    text-align: center;
  }
  .state-icon { font-size: 48px; margin-bottom: 12px; }
  .state-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    transition: color 0.3s;
  }
  .state-sub {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.3s;
  }

  .skeleton {
    background: linear-gradient(90deg, var(--toggle-bg) 25%, rgba(255,255,255,0.05) 50%, var(--toggle-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
  }
  @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
  .skeleton-row { height: 44px; margin: 1px 0; border-radius: 0; }

  /* ===== MODAL ===== */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .modal-overlay.show { display: flex; }

  .modal {
    background: var(--modal-bg);
    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.25);
    padding: 28px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
  }
  @keyframes modalIn { from { opacity: 0; transform: scale(0.92) translateY(10px); } to { opacity: 1; transform: none; } }

  .modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: color 0.3s;
  }
  .modal-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 22px;
    transition: color 0.3s;
  }

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

  .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .modal-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }

  .modal-input, .modal-select, .modal-textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--card-border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    min-height: 44px;
  }
  .modal-input:focus, .modal-select:focus, .modal-textarea:focus { border-color: var(--badge-color); }
  .modal-input::placeholder, .modal-textarea::placeholder { color: var(--text-tertiary); }

  .modal-textarea {
    resize: vertical;
    min-height: 80px;
  }

  .modal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
  }

  .btn-save {
    flex: 1;
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #04b3d6, #0090b0);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }
  .btn-save:hover { opacity: 0.88; }
  .btn-save:disabled { opacity: 0.5; cursor: not-allowed; }

  .btn-delete {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,69,58,0.3);
    background: rgba(255,69,58,0.1);
    color: #ff453a;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }
  .btn-delete:hover { background: rgba(255,69,58,0.2); }

  .btn-cancel {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--toggle-bg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }
  .btn-cancel:hover { background: var(--card-hover-bg); color: var(--text-primary); }

  .modal-close-x {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--toggle-bg);
    color: var(--text-tertiary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
  }
  .modal-close-x:hover { background: var(--card-hover-bg); color: var(--text-primary); }

  /* ===== TOAST ===== */
  #toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .toast {
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: opacity 0.4s;
    max-width: 320px;
  }
  .toast.success { background: rgba(48,209,88,0.9); color: #fff; }
  .toast.error { background: rgba(255,69,58,0.9); color: #fff; }
  .toast.info { background: rgba(4,179,214,0.9); color: #fff; }

  /* ===== MOBILE ===== */
  @media (max-width: 640px) {
    .container { padding: 16px 12px 80px; }
    nav { padding: 0 16px; }

    .stats-row {
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .stats-row .stat-card:last-child {
      grid-column: 1 / -1;
    }

    .filter-bar { gap: 8px; }
    .search-wrap { min-width: 0; max-width: 100%; flex: 1 1 100%; order: 1; }
    .filter-select { flex: 1; min-width: 0; }
    .filter-checkbox-wrap { order: 10; }
    .filter-spacer { display: none; }
    .btn-new { order: 2; }
    .btn-export span { display: none; }
    .btn-export { padding: 7px 10px; }
    .btn-chat-nav span { display: none; }

    .form-row { grid-template-columns: 1fr; }

    .modal { padding: 20px; max-height: 95vh; }
    .modal-actions { flex-direction: column; }
    .btn-save, .btn-delete, .btn-cancel { flex: none; width: 100%; }

    /* Mobile: Tabelle als Cards */
    .tbl-wrap { overflow-x: auto; }
    .kontrakte-tbl td[data-label="Notizen"],
    .kontrakte-tbl th:nth-child(8) { display: none; }
  }


/* === Auto-generierte Klassen aus inline style="..." (kontrakte.html, 2 unique) === */
.s-9384ee { max-width:180px; }
.s-539b04 { text-align:center; }


/* === Auto-Klassen aus inline style="..." in kontrakte.js (4 unique) === */
.s-44265a { font-weight:500; }
.s-8b2da0 { white-space:nowrap; }
.s-1a0afa { color:var(--text-secondary); font-size:12px; }
.s-c157e3 { justify-content:center; }
