
  :root{ --bg:#0f1724; --card:#0b1220; --accent:#6ee7b7; --muted:#94a3b8; --glass: rgba(255,255,255,0.03); }

  *{box-sizing:border-box;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial;}

  body{ margin:0;background:linear-gradient(180deg, #071226 0%, #071422 100%);color:#dbeafe; min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:32px; }

  .shell{ width:100%; max-width:calc(100vw - 64px); background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); border-radius:12px;padding:20px;box-shadow:0 10px 30px rgba(2,6,23,0.6); border:1px solid rgba(255,255,255,0.03); }

  header{display:flex;align-items:center;gap:16px;margin-bottom:14px}

  .logo{ width:64px;height:64px;border-radius:10px;background:linear-gradient(135deg,#0ea5a5,#7dd3fc); display:flex;align-items:center;justify-content:center;font-weight:700;color:#002; box-shadow:0 6px 18px rgba(14,165,165,0.12);font-size:24px; }

  h1{font-size:20px;margin:0}

  p.lead{margin:0;color:var(--muted);font-size:13px}

  .grid{display:grid;grid-template-columns:380px 1fr;gap:18px;margin-top:18px}

  .panel{background:var(--card);padding:16px;border-radius:10px;border:1px solid rgba(255,255,255,0.02)}

  .panel h2{margin:0 0 12px 0;font-size:15px;font-weight:600}

  label{display:block;font-size:15px;color:#e6eef8;margin-bottom:6px;margin-top:12px;font-weight:600}

  input[type=text], input[type=email], select, textarea{ width:100%;padding:10px;border-radius:8px;border:1px solid rgba(110,231,183,0.3); background:var(--glass);color:#94a3b8;font-size:13px; }

  input[type=text]:focus, input[type=email]:focus, select:focus, textarea:focus{ outline:none;border-color:rgba(110,231,183,0.6);box-shadow:0 0 0 3px rgba(110,231,183,0.1); }

  select{ appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 9L1 4h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; cursor: pointer; }

  select option{ background: #0b1220; color: #dbeafe; padding: 8px; }

  textarea{min-height:80px;resize:vertical;font-family:inherit}

  .btn{ display:inline-flex;align-items:center;gap:8px;border:0;padding:12px 20px; border-radius:8px;background:linear-gradient(90deg,var(--accent),#60a5fa); color:#002;font-weight:600;cursor:pointer;font-size:13px;white-space:nowrap; }

  .btn:disabled{opacity:0.5;cursor:not-allowed}

  .btn.secondary{background:transparent;border:1px solid rgba(255,255,255,0.08);color:var(--muted)}

  .btn.pdf{background:linear-gradient(90deg,#f59e0b,#ef4444);color:#fff}

  .btn-group{display:flex;gap:12px;margin-top:12px;flex-wrap:wrap;justify-content:center}

  .steps{display:flex;flex-direction:column;gap:10px;margin-top:12px}

  .step{ padding:12px;border-radius:8px; background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent); border:1px solid rgba(255,255,255,0.03); display:flex;align-items:center;justify-content:space-between; }

  .step strong{font-size:13px}

  .step .small{font-size:11px;color:var(--muted);margin-top:2px}

  /* Status Grid - Horizontale Anordnung unter den Buttons */
  .status-grid{display:flex;gap:12px;margin-top:16px;flex-wrap:wrap;justify-content:center}

  .status-box{ 
    flex:1; 
    min-width:180px;
    padding:10px 12px;
    border-radius:8px; 
    background:linear-gradient(180deg, rgba(255,255,255,0.015), transparent); 
    border:1px solid rgba(255,255,255,0.025); 
    display:flex;
    align-items:center;
    justify-content:space-between; 
  }

  .status-box strong{font-size:12px;white-space:nowrap;font-weight:500}

  .status-box .small{font-size:10px;color:var(--muted);margin-top:2px;white-space:nowrap;opacity:0.7}

  .pill{ background:rgba(255,255,255,0.05);padding:4px 10px;border-radius:999px; font-size:11px;color:var(--muted);font-weight:500;white-space:nowrap; }

  .pill.running{background:rgba(96,165,250,0.15);color:#60a5fa}

  .pill.success{background:rgba(34,197,94,0.15);color:#22c55e}

  table{width:100%;border-collapse:collapse;color:#e6eef8;font-size:13px}

  th,td{padding:10px 8px;border-bottom:1px solid rgba(255,255,255,0.03);text-align:left}

  th{color:var(--muted);font-weight:600;font-size:12px}

  tbody tr{cursor:pointer;transition:background 0.2s}

  tbody tr:hover{background:rgba(255,255,255,0.02)}

  tbody tr.selected{background:rgba(110,231,183,0.08)}

  .small{font-size:12px;color:var(--muted)}

  .preview{ white-space:pre-wrap; background:var(--card); padding:14px; border-radius:8px; border:1px solid rgba(255,255,255,0.03); font-size:12px; line-height:1.6; min-height:300px; max-height:80vh; overflow-y:auto; }

  footer{display:flex;justify-content:space-between;align-items:center;margin-top:14px;padding-top:14px;border-top:1px solid rgba(255,255,255,0.03)}

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

  .copyright{text-align:center;margin-top:20px;padding:12px;font-size:11px;color:var(--muted);line-height:1.6;border-top:1px solid rgba(255,255,255,0.03);width:100%;max-width:1400px}

  .info-box{ background:rgba(96,165,250,0.08);border:1px solid rgba(96,165,250,0.2); border-radius:8px;padding:12px;margin-top:12px;font-size:12px;line-height:1.5; }

  .success-box{ background:rgba(34,197,94,0.08);border:1px solid rgba(34,197,94,0.2); border-radius:8px;padding:12px;margin-top:12px;font-size:12px;line-height:1.5; }

  .source-badge{ font-size:10px; color:#60a5fa; background:rgba(96,165,250,0.12); padding:3px 6px; border-radius:6px; }

  /* Quelle: Google Places */
  .source-badge.google{ color:#22c55e; background:rgba(34,197,94,0.12); }

  /* Quelle: BA */
  .source-badge.ba{ color:#60a5fa; background:rgba(96,165,250,0.12); }

  /* Quelle: OSM */
  .source-badge.osm{ color:#f59e0b; background:rgba(245,158,11,0.12); }

  /* Toast Notifications */
  .toast-container{ position:fixed; top:20px; right:20px; z-index:10000; display:flex; flex-direction:column; gap:10px; max-width:400px; }
  
  .toast{ background:linear-gradient(135deg, #0b1220, #071226); border-radius:12px; padding:16px 20px; box-shadow:0 8px 32px rgba(0,0,0,0.4); border:1px solid rgba(255,255,255,0.1); display:flex; align-items:center; gap:12px; animation:slideIn 0.3s ease-out; min-width:300px; }
  
  .toast.success{ border-left:4px solid #22c55e; }
  .toast.error{ border-left:4px solid #ef4444; }
  .toast.warning{ border-left:4px solid #f59e0b; }
  .toast.info{ border-left:4px solid #60a5fa; }
  
  .toast-icon{ font-size:20px; flex-shrink:0; }
  .toast-content{ flex:1; font-size:13px; line-height:1.4; color:#dbeafe; }
  .toast-close{ cursor:pointer; color:#94a3b8; font-size:18px; padding:0 4px; transition:color 0.2s; flex-shrink:0; }
  .toast-close:hover{ color:#dbeafe; }
  
  @keyframes slideIn{ from{ transform:translateX(400px); opacity:0; } to{ transform:translateX(0); opacity:1; } }
  @keyframes slideOut{ from{ transform:translateX(0); opacity:1; } to{ transform:translateX(400px); opacity:0; } }
  .toast.hiding{ animation:slideOut 0.3s ease-in forwards; }

  .or-divider{ 
    text-align:center; 
    color:var(--accent); 
    font-weight:600; 
    font-size:12px; 
    margin:8px 0 4px 0;
    letter-spacing:0.5px;
  }

  input[type=text]:disabled, select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255,255,255,0.01);
  }

  @media (max-width:1024px){ .grid{grid-template-columns:1fr} }

  /* ========== HINTERGRUNDBILDER UND LAYOUT ========== */
  
  /* Hintergrundbild für Startseite (Breitformat) */
  #infoSection {
    background-image: url('../images/Wallpaper_breit.jpg') !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    overflow-y: auto !important;
  }
  
  /* Hintergrundbild für Hauptfenster (Hochformat) */
  #appContainer {
    background-image: url('../images/Wallpaper_hoch.jpg') !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    max-width: 1400px !important;
    margin: 20px auto !important;
    padding: 40px !important;
  }
  
  /* Dunkle halbtransparente Hintergründe für bessere Lesbarkeit - STARTSEITE */
  #infoSection > div {
    background: rgba(20, 15, 10, 0.85) !important;
    backdrop-filter: blur(5px);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 46, 0.3) !important;
  }
  
  /* Info-Boxen im Startfenster - gleiche Höhe */
  #infoSection > div:first-child > div[style*="display:grid"] {
    align-items: stretch !important;
  }
  
  /* Die beiden Info-Boxen (Features links, Workflow rechts) gleich hoch */
  #infoSection > div:first-child > div[style*="display:grid"] > div[style*="padding:35px"] {
    min-height: 550px !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Linien zwischen den Schritten im rechten Fenster */
  #infoSection > div:first-child > div[style*="display:grid"] > div[style*="padding:35px 30px"] div[style*="position:relative"]:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 48px;
    bottom: -10px;
    width: 2px;
    background: linear-gradient(180deg, rgba(110,231,183,0.4), rgba(59,130,246,0.2));
    z-index: 0;
  }
  
  /* "Was du brauchst" Sektion mehr zur Mitte */
  #infoSection > div:nth-child(2) > div {
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  
  /* ========== OPTISCHE ABGRENZUNGEN IM HAUPTFENSTER ========== */
  
  /* Header-Bereich */
  #appContainer > div:first-child {
    background: rgba(20, 15, 10, 0.85) !important;
    backdrop-filter: blur(5px);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 46, 0.3);
    margin-bottom: 20px !important;
  }
  
  /* Haupt-Panel mit allen Bereichen - OHNE Hintergrund */
  #appContainer .panel {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
  }
  
  /* Einzelne Bereiche mit Hintergrund und Abstand */
  #appContainer .panel > h2 {
    background: rgba(20, 15, 10, 0.85) !important;
    backdrop-filter: blur(5px);
    padding: 20px 30px;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 46, 0.3);
    margin: 20px 0 16px 0;
  }
  
  /* Container für die Eingabefelder - mit Hintergrund */
  #appContainer .panel > div[style*="display:grid"],
  #appContainer .panel > div[style*="display:flex"] {
    background: rgba(20, 15, 10, 0.85) !important;
    backdrop-filter: blur(5px);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 46, 0.3);
    margin-bottom: 20px;
  }
  
  /* Action-Buttons + Status zusammen in einem Block */
  #actionsAndStatus {
    background: rgba(20, 15, 10, 0.85) !important;
    backdrop-filter: blur(5px);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 46, 0.3);
    margin-bottom: 20px;
  }
  
  /* Button-Gruppe (ohne eigenen Hintergrund, da im Container) */
  .btn-group {
    background: transparent !important;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0;
    margin: 0;
  }
  
  /* Status-Grid (ohne eigenen Hintergrund, da im Container) */
  .status-grid {
    background: transparent !important;
    padding: 0;
    margin: 0;
  }
  
  /* Tabellen-Bereich mit Header zusammen */
  #resultsSection {
    background: rgba(20, 15, 10, 0.85) !important;
    backdrop-filter: blur(5px);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 46, 0.3);
    margin-bottom: 20px;
  }
  
  /* Tabelle ohne eigenen Hintergrund */
  #appContainer table {
    background: transparent !important;
    padding: 0;
    border: none;
  }
  
  /* Bewerbungsvorschau */
  #previewSection {
    background: rgba(20, 15, 10, 0.85) !important;
    backdrop-filter: blur(5px);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 46, 0.3);
    margin-top: 20px;
  }
  
  /* HR-Linien ausblenden, da wir jetzt Abstände haben */
  #appContainer hr {
    display: none;
  }
  
  /* Letztes Element ohne margin-bottom */
  #appContainer > div:last-child {
    margin-bottom: 0;
  }
  
  /* ========== TABELLEN-OPTIMIERUNGEN ========== */
  
  /* Firmen-Tabelle scrollbar machen wenn zu groß */
  #tableCompanies tbody {
    display: block;
    max-height: 500px;
    overflow-y: auto;
  }
  
  #tableCompanies thead,
  #tableCompanies tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
  }
  
  /* Optimierte Spaltenbreiten */
  #tableCompanies th:nth-child(1),
  #tableCompanies td:nth-child(1) {
    width: 40px !important;
  }
  
  #tableCompanies th:nth-child(2),
  #tableCompanies td:nth-child(2) {
    width: 45px !important;
  }
  
  #tableCompanies th:nth-child(8),
  #tableCompanies td:nth-child(8) {
    width: 80px !important;
  }
  
  #tableCompanies th:nth-child(9),
  #tableCompanies td:nth-child(9) {
    width: 100px !important;
  }
  
  /* Action-Buttons im Hauptfenster flexibel machen */
  #appContainer .btn {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }


/* Backdating Tooltip */
.backdate-label { position: absolute; bottom: 5px; right: 7px; }
.backdate-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 12px;
  color: #cbd5e1;
  width: 260px;
  pointer-events: none;
  z-index: 100;
  line-height: 1.8;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}
.backdate-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(96, 165, 250, 0.3);
}
.backdate-label:hover .backdate-tooltip { display: block; }
