.agenda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
}

.agenda-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.agenda-current-range {
  font-weight: 600;
  font-size: 1rem;
  min-width: 250px;
  text-align: center;
}

.personal-event-form {
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.personal-event-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.personal-event-fields {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.personal-event-fields label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.form-message {
  min-height: 1.25rem;
  margin: 0 0 var(--space-3);
  color: var(--color-error);
  font-size: 0.85rem;
}

.agenda-grid-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow-x: auto;
  position: relative;
}

.agenda-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, minmax(140px, 1fr));
  min-width: 800px;
}

.agenda-time-column {
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  background: #fdfdfd;
}

.agenda-time-slot {
  height: 60px;
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-2);
  text-align: right;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  position: relative;
}

.agenda-time-slot::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 4px;
  height: 1px;
  background: var(--color-border);
}

.agenda-day-column {
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: relative;
}

.agenda-day-column:last-child {
  border-right: none;
}

.agenda-day-header {
  padding: var(--space-3);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  background: #fdfdfd;
  height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.agenda-day-header.is-today {
  background: var(--color-primary-soft);
}

.agenda-day-header.is-today strong {
  color: var(--color-primary);
}

.agenda-day-name {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

.agenda-day-date {
  font-size: 1rem;
  font-weight: 600;
}

.agenda-day-content {
  position: relative;
  height: calc(13 * 60px); /* 8h to 20h = 13 slots */
  background-image: linear-gradient(to bottom, var(--color-border) 1px, transparent 1px);
  background-size: 100% 60px;
}

.agenda-event {
  position: absolute;
  left: 4px;
  right: 4px;
  background: var(--color-primary-soft);
  border-left: 3px solid var(--color-primary);
  border-radius: 4px;
  padding: var(--space-1) var(--space-2);
  font-size: 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform var(--transition), box-shadow var(--transition);
  z-index: 2;
}

.agenda-event.personal {
  background: #ecfdf3;
  border-left-color: var(--color-success);
}

.agenda-event.personal .agenda-event-title {
  color: #15803d;
}

.personal-event-delete {
  position: absolute;
  top: 1px;
  right: 3px;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.personal-event-delete:hover {
  color: var(--color-error);
}

.agenda-event:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
  z-index: 10;
}

.agenda-event-title {
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-event-time {
  color: var(--color-text-secondary);
}

.agenda-event-location {
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-error);
  z-index: 5;
  pointer-events: none;
}

.agenda-now-line::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-error);
}

.agenda-legend {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.agenda-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.legend-dot.course { background: var(--color-primary); }
.legend-dot.exam { background: var(--color-error); }
.legend-dot.personal { background: var(--color-success); }
