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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 10px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, #4472C4 0%, #365BA8 100%);
  color: white;
  padding: 20px;
  text-align: center;
}

header h1 {
  font-size: 28px;
  margin-bottom: 5px;
}

.warning {
  background: #fff3cd;
  border-left: 4px solid #ff9800;
  padding: 12px 15px;
  margin: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.controls {
  display: flex;
  gap: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
  flex-wrap: wrap;
}

.year-selector {
  display: flex;
  gap: 5px;
}

.year-btn {
  padding: 8px 16px;
  border: 2px solid #4472C4;
  background: white;
  color: #4472C4;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.year-btn.active {
  background: #4472C4;
  color: white;
}

.action-btns {
  display: flex;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.action-btns button, .action-btns label {
  padding: 8px 14px;
  border: none;
  background: #4472C4;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.action-btns button:hover, .action-btns label:hover {
  background: #365BA8;
}

input[type="file"] {
  display: none;
}

.tabs {
  display: flex;
  border-bottom: 2px solid #ddd;
  background: #f8f9fa;
}

.tab {
  flex: 1;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  color: #666;
  border-bottom: 3px solid transparent;
}

.tab.active {
  color: #4472C4;
  border-bottom-color: #4472C4;
}

.main-content {
  display: flex;
  min-height: 500px;
}

.view {
  display: none;
  flex: 1;
  padding: 20px;
}

.view.active {
  display: flex;
  width: 100%;
}

.calendar-container {
  flex: 1;
  padding-right: 20px;
}

.calendar-header {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #333;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.month-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  background: #f9f9f9;
  cursor: pointer;
  transition: all 0.2s;
}

.month-card:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.month-name {
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
  font-size: 16px;
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  font-size: 10px;
}

.mini-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #eee;
  border-radius: 2px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-header {
  text-align: center;
  font-weight: bold;
  padding: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  color: #666;
}

.day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  background: white;
}

.day-cell:hover:not(.weekend):not(.disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.day-cell.weekend {
  background: #f5f5f5 !important;
  cursor: not-allowed;
  color: #999;
}

.day-cell.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.day-cell.vollzeit {
  background: #C6EFCE !important;
  border-color: #4CAF50;
  color: #2E7D32;
}

.day-cell.teilzeit {
  background: #BDD7EE !important;
  border-color: #2196F3;
  color: #1565C0;
}

.day-cell.freigenommen {
  background: #FFE699 !important;
  border-color: #FF9800;
  color: #E65100;
}

.day-cell.frei {
  background: #E8E8E8 !important;
  border-color: #999;
  color: #666;
}

.day-cell.today {
  border: 3px solid #FF6B6B !important;
  box-shadow: 0 0 0 2px white, 0 0 0 5px #FF6B6B;
}

.week-day-item {
  padding: 15px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.week-day-item:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.week-day-date {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 14px;
}

.week-day-hours {
  color: #666;
  font-size: 13px;
}

.stats-panel {
  width: 320px;
  background: #f8f9fa;
  border-left: 1px solid #ddd;
  padding: 20px;
  overflow-y: auto;
}

.stats-section {
  margin-bottom: 25px;
}

.stats-title {
  font-size: 13px;
  font-weight: bold;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #ddd;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.stat-label {
  color: #666;
}

.stat-value {
  font-weight: bold;
  color: #333;
}

.stat-value.positive {
  color: #4CAF50;
}

.stat-value.negative {
  color: #f44336;
}

.guthaben-box {
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  margin-top: 10px;
  font-size: 14px;
}

.guthaben-box.positive {
  background: #C8E6C9;
  color: #2E7D32;
}

.guthaben-box.negative {
  background: #FFCDD2;
  color: #C62828;
}

.guthaben-box.zero {
  background: #F0F0F0;
  color: #666;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.nav-buttons button {
  padding: 8px 16px;
  background: #4472C4;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.nav-buttons button:hover {
  background: #365BA8;
}

@media (max-width: 1024px) {
  .main-content {
    flex-direction: column;
  }
  .stats-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid #ddd;
  }
  .calendar-container {
    padding-right: 0;
  }
}

@media (max-width: 768px) {
  .day-cell {
    font-size: 12px;
  }
  .month-grid {
    grid-template-columns: 1fr;
  }
  .controls {
    flex-direction: column;
  }
  .action-btns {
    margin-left: 0;
    width: 100%;
  }
  .action-btns button, .action-btns label {
    flex: 1;
  }
}
