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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  background: #2c3e50;
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 20px;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background 0.3s;
}

nav a:hover, nav a.active {
  background: #34495e;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-logout {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

/* Karten */
.card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h2 {
  margin-bottom: 15px;
  color: #2c3e50;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-primary {
  background: #3498db;
  color: white;
}

.btn-primary:hover {
  background: #2980b9;
}

.btn-success {
  background: #27ae60;
  color: white;
}

.btn-success:hover {
  background: #219a52;
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
  margin-top: 20px;
}

.btn-secondary {
  background: #95a5a6;
  color: white;
}

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

/* Formulare */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

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

/* Tabellen */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background: #f8f9fa;
  font-weight: 600;
}

tr:hover {
  background: #f8f9fa;
}

/* Status-Badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-ausstehend {
  background: #f39c12;
  color: white;
}

.status-genehmigt {
  background: #27ae60;
  color: white;
}

.status-abgelehnt {
  background: #e74c3c;
  color: white;
}

.status-zurueckgegeben {
  background: #95a5a6;
  color: white;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.geraet-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.geraet-bild {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 15px;
}

.geraet-card:hover {
  transform: translateY(-2px);
}

.geraet-card h3 {
  margin-bottom: 10px;
}

.geraet-card .kategorie {
  color: #7f8c8d;
  font-size: 14px;
  margin-bottom: 10px;
}

.geraet-card .verfuegbar {
  font-weight: bold;
  color: #27ae60;
}

.geraet-card .nicht-verfuegbar {
  color: #e74c3c;
}

/* Kalender */
#calendar {
  max-height: 600px;
  margin-top: 20px;
}

.fc-event {
  cursor: pointer;
}

/* Login */
.login-container {
  max-width: 400px;
  margin: 100px auto;
}

.login-container h1 {
  text-align: center;
  margin-bottom: 30px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  background: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  width: 90%;
  display: flex;
  flex-direction: column;
}

.modal-content > *:last-child {
  margin-top: auto;
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    margin: 2% auto;
    padding: 15px;
    max-height: 90vh;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  .modal-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
  }

  .popup-footer, .modal-footer {
    position: sticky;
    bottom: 0;
    background: white;
    padding-top: 15px;
    border-top: 1px solid #eee;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.close {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #e74c3c;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid #ddd;
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab.active {
  border-bottom-color: #3498db;
  color: #3498db;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  color: #7f8c8d;
  margin-top: 40px;
}

/* Messages */
.message {
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.message-success {
  background: #d4edda;
  color: #155724;
}

.message-error {
  background: #f8d7da;
  color: #721c24;
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero p {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.9);
  margin-bottom: 30px;
}

.hero .btn-primary {
  background: white;
  color: #667eea;
  font-weight: bold;
  padding: 15px 40px;
  font-size: 1.1rem;
}

.hero .btn-primary:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 50px;
}

.feature {
  text-align: center;
  padding: 20px;
}

.feature h3 {
  margin-bottom: 10px;
  color: #2c3e50;
}

/* Responsive */
@media (max-width: 768px) {
  .features {
    grid-template-columns: 1fr;
  }

  header .container {
    flex-direction: column;
    gap: 15px;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Custom Popup Styles */
.popup-content {
  max-width: 400px;
  border-radius: 10px;
}

.popup-header {
  background: #2c3e50;
  color: white;
  padding: 15px 20px;
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-header h3 {
  margin: 0;
}

.popup-header .close {
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.popup-header .close:hover {
  color: #ccc;
}

.popup-body {
  padding: 20px;
}

.popup-body p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.popup-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Larger modal for editing */
.modal-large {
  max-width: 600px;
}

/* Form section */
.form-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.form-section h3 {
  margin-bottom: 10px;
  color: #2c3e50;
}

/* Checkbox list for freigaben */
.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s;
}

.checkbox-item:hover {
  background: #e9ecef;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* Table styles for modals */
.table-container {
  overflow-x: auto;
  margin-bottom: 15px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.data-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #2c3e50;
}

.data-table td input,
.data-table td select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.data-table td:first-child input {
  width: calc(100% - 10px);
}

/* New ansprechpartner rows */
.new-ansprechpartner-row {
  margin-top: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 5px;
}

.new-ap-fields {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.new-ap-fields input,
.new-ap-fields select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-width: 120px;
}

.new-ap-fields input[type="text"],
.new-ap-fields input[type="email"] {
  flex: 1;
}

.new-ap-fields input[type="password"] {
  width: 120px;
}

/* Kategorie-Übersicht */
.kategorie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.kategorie-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #3498db;
}

.kategorie-name {
  font-weight: 600;
  color: #2c3e50;
}

.kategorie-count {
  color: #7f8c8d;
  font-size: 14px;
}

/* View Toggle */
.view-toggle {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.view-btn {
  background: #fff;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  color: #7f8c8d;
  transition: all 0.2s;
}

.view-btn:hover {
  background: #f0f0f0;
}

.view-btn.active {
  background: #3498db;
  color: white;
}
