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

/* LOGIN SCREEN */
#login-screen {
  min-height: 100vh;
  background: #f6f7f9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #fff;
  border-radius: 14px;
  padding: 40px 36px;
  width: 380px;
  max-width: 95vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  border-top: 4px solid #00B0F0;
}
.login-logo {
  font-size: 22px;
  font-weight: 700;
  color: #00B0F0;
  margin-bottom: 8px;
  text-align: center;
}
.login-box h2 {
  font-size: 17px;
  color: #374151;
  margin-bottom: 24px;
  text-align: center;
  font-weight: 600;
}
.login-box label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
  margin-top: 14px;
}
.login-box input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
}
.login-box input:focus { border-color: #00B0F0; }
.login-error {
  color: #ef4444;
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
}
.btn-login {
  width: 100%;
  margin-top: 20px;
  padding: 11px;
  font-size: 15px;
}

/* USER INFO IM HEADER */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
  border-left: 1px solid #e5e7eb;
  padding-left: 12px;
}
.user-role-badge {
  background: #e5e7eb;
  color: #374151;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.btn-logout {
  background: none;
  border: 1px solid #d1d5db;
  color: #6b7280;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
.btn-logout:hover { background: #fee2e2; color: #ef4444; border-color: #fca5a5; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f6f7f9;
  color: #1f2937;
  line-height: 1.5;
}

/* HEADER */
header {
  background: #ffffff;
  border-bottom: 3px solid #00B0F0;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
header h1 { font-size: 20px; color: #111827; flex: 1; }
.header-meta { color: #6b7280; font-size: 13px; }
.header-actions { display: flex; gap: 8px; }

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrapper input {
  padding: 8px 32px 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  width: 260px;
  outline: none;
  transition: border 0.2s;
}
.search-wrapper input:focus { border-color: #00B0F0; }
.search-clear {
  display: none;
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  align-items: center;
}
.search-clear:hover { color: #374151; }

/* MAIN */
main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 20px 48px;
}

.loading { color: #6b7280; text-align: center; padding: 40px; }

/* PROJECT CARD */
.project-card {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.project-header {
  background: #00B0F0;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.project-header h2 { font-size: 16px; font-weight: 700; }
.project-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-search {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  width: 180px;
  outline: none;
  background: rgba(255,255,255,0.9);
  color: #111827;
}
.task-search::placeholder { color: #6b7280; }
.task-search:focus { background: #fff; }

.project-header button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}
.project-header button:hover { background: rgba(255,255,255,0.35); }

.no-results-row td { color: #9ca3af; font-style: italic; }

/* TABLE */
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  background: #e5e7eb;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #d1d5db;
}
td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fafb; }

.col-aufgabe { width: 40%; }
.col-stichpunkte { width: 38%; }
.col-status { width: 16%; }
.col-aktion { width: 6%; text-align: center; }

.empty-row td { color: #9ca3af; font-style: italic; }

/* STATUS */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.status-Offen { background: #FF0000; }
.status-Warten { background: #FF6600; }
.status-Erledigt { background: #00B050; }

select.status-select {
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
select.status-select.status-Offen { background: #FF0000; }
select.status-select.status-Warten { background: #FF6600; }
select.status-select.status-Erledigt { background: #00B050; }

/* DELETE BUTTON */
.btn-delete {
  background: none;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s;
}
.btn-delete:hover { color: #ef4444; }

/* BUTTONS */
.btn-primary {
  background: #00B0F0;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-primary:hover { background: #0090cc; }

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}
.btn-secondary:hover { background: #e5e7eb; }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  width: 460px;
  max-width: 95vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.modal h2 { font-size: 18px; margin-bottom: 20px; color: #111827; }
.modal label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 4px; margin-top: 14px; }
.modal input, .modal select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
}
.modal input:focus, .modal select:focus { border-color: #00B0F0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* PROJECT TILE GRID (Startseite) */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.project-tile {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.project-tile:hover {
  box-shadow: 0 6px 20px rgba(0,176,240,0.2);
  transform: translateY(-2px);
}

.tile-header {
  background: #00B0F0;
  color: #fff;
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.tile-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.tile-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  align-self: flex-start;
}
.tile-badge.offen {
  background: #FF0000;
  color: #fff;
}

.tile-footer {
  background: #f0f9ff;
  border-top: 1px solid #bae6fd;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tile-task-count {
  font-size: 12px;
  color: #6b7280;
}
.tile-delete-btn {
  background: none;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  font-size: 15px;
  padding: 0 2px;
  transition: color 0.2s;
  line-height: 1;
}
.tile-delete-btn:hover { color: #ef4444; }

/* DETAIL PAGE – Zurück-Link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #00B0F0;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 20px;
}
.back-link:hover { text-decoration: underline; }

/* META-INFO (Zeitstempel / Kürzel) */
.task-meta {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

/* EDITABLE CELLS */
.editable {
  cursor: pointer;
  transition: background 0.15s;
}
.editable:hover {
  background: #eff6ff;
  outline: 1px dashed #00B0F0;
  border-radius: 4px;
}
.empty-cell {
  color: #9ca3af;
  font-style: italic;
}
.editable-project {
  cursor: pointer;
}
.editable-project:hover {
  opacity: 0.85;
  text-decoration: underline;
}
.inline-edit {
  width: 100%;
  border: 2px solid #00B0F0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  font-family: Arial, Helvetica, sans-serif;
  outline: none;
  background: #fff;
}

/* PRINT */
@media print {
  /* Hintergrundfarben erzwingen */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Interaktive Elemente ausblenden */
  header .header-actions,
  header .search-wrapper,
  .project-header-actions,
  .btn-delete { display: none !important; }

  body { background: #fff; }
  main { margin: 12px auto; padding: 0 16px; }

  header {
    position: static;
    box-shadow: none;
    border-bottom: 3px solid #00B0F0;
  }

  .project-card {
    box-shadow: none;
    break-inside: avoid;
    margin-bottom: 16px;
    border: 1px solid #d1d5db;
  }

  .project-header {
    background: #00B0F0 !important;
    color: #fff !important;
  }

  th { background: #e5e7eb !important; }

  select.status-select {
    -webkit-appearance: none;
    appearance: none;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
  }
  select.status-select.status-Offen  { background: #FF0000 !important; }
  select.status-select.status-Warten { background: #FF6600 !important; }
  select.status-select.status-Erledigt { background: #00B050 !important; }
}
