/* Mieten cockpit — the room × month assignment board.
   Builds on cockpit.css (header/KPIs). Here we only style the matrix grid. */

.mc-board-head {
  border-left-color: var(--mud-palette-primary) !important;
}

.mc-year {
  min-width: 3.5rem;
  text-align: center;
  font-weight: 600;
  color: var(--mud-palette-primary);
}

/* Scroll container so the sticky header/first-column have something to stick to. */
.mc-board-scroll {
  overflow: auto;
  max-height: 70vh;
  padding: 0.4rem 0.6rem 0.6rem 0.6rem;
}

/* 13 columns: room label + 12 months. Dense, the way the landlord likes it. */
.mc-board {
  display: grid;
  grid-template-columns: minmax(150px, 230px) repeat(12, minmax(46px, 1fr));
  gap: 2px;
  min-width: 760px;
}

/* Header (months) row — sticky to the top of the scroll box. */
.mc-month-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--mud-palette-background-grey);
  color: var(--mud-palette-text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  padding: 0.3rem 0.1rem;
  border-radius: 6px;
}

/* Top-left corner — sticky on both axes. */
.mc-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 3;
  background: var(--mud-palette-background-grey);
  color: var(--mud-palette-text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.5rem;
  display: flex;
  align-items: center;
  border-radius: 6px;
}

/* Group header (Gebäude · Eingang) spanning the whole row. */
.mc-group {
  grid-column: 1 / -1;
  position: sticky;
  left: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--mud-palette-primary);
  background: linear-gradient(120deg, rgba(103, 160, 210, .12), rgba(179, 207, 232, .04));
  padding: 0.3rem 0.5rem;
  margin-top: 0.25rem;
  border-radius: 6px;
}

/* Room label — sticky first column. */
.mc-room {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  min-height: 30px;
  border-right: 1px solid var(--mud-palette-divider);
}

.mc-room-name {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-room-conflict {
  background: rgba(244, 67, 54, .06);
}

/* A month cell. */
.mc-cell {
  min-height: 30px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 0.7rem;
  color: var(--mud-palette-dark-text, #1D1D1B);
}

.mc-cell-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.25rem;
  max-width: 100%;
}

.mc-cell:not(.mc-empty) {
  cursor: pointer;
}

.mc-empty {
  background: repeating-linear-gradient(45deg, #fafafa, #fafafa 4px, #f0f0f0 4px, #f0f0f0 8px);
}

.mc-conflict {
  background: #E5737322;
  border: 1.5px solid var(--mud-palette-error);
  color: var(--mud-palette-error);
}

/* Customer colour palette (8 accessible tints, dark ink). */
.mc-cust-0 { background: #B3CFE8; }
.mc-cust-1 { background: #C8E6C9; }
.mc-cust-2 { background: #FFE0B2; }
.mc-cust-3 { background: #D1C4E9; }
.mc-cust-4 { background: #B2DFDB; }
.mc-cust-5 { background: #F8BBD0; }
.mc-cust-6 { background: #FFF59D; }
.mc-cust-7 { background: #CFD8DC; }

/* Legend. */
.mc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.6rem 1rem 0.9rem 1rem;
}

.mc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--mud-palette-text-secondary);
}

.mc-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--mud-palette-divider);
  display: inline-block;
}
