/* Calendar, tabs and section styles follow the frontend's WorkflowEdit.module.css. */
:root {
  --border: #e6e6e6;
  --bekka-color: #007acc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #f5f5f8;
  color: #1f1f1f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 14px;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px;
}

.pageTitle {
  margin: 0 0 20px;
  font-size: 1.4rem;
  font-weight: 600;
}

.section {
  background-color: white;
  border-radius: 8px;
  padding: 1.5rem 1rem 1rem 1rem;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.sectionHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sectionTitle {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.sectionHeader .sectionTitle {
  margin-bottom: 0;
}

.sectionSubtitle,
.summaryLabel {
  font-size: 12px;
  color: #5b5b5b;
}

.summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.summaryValue {
  font-size: 20px;
  font-weight: 600;
  color: #000;
  white-space: nowrap;
}

.unavailable {
  color: #5b5b5b;
}

/* Calendar: three months side by side, between the range arrows. */
.calendarRange {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendarMonths {
  flex: 1 0 0;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.calendarMonthTitle {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.rangeArrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: white;
  box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.05);
  color: #1f1f1f;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  transition: all 0.2s;
}

.rangeArrow:hover {
  border-color: var(--bekka-color);
  background-color: #f0f8ff;
}

.rangeArrowDisabled {
  opacity: 0.3;
  pointer-events: none;
}

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

.calendarWeekDay {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
}

.calendarDay {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

/* Hover/focus card with the day's outage times. */
.calendarDay {
  position: relative;
}

.calendarDay:focus {
  outline: 2px solid var(--bekka-color);
  outline-offset: 1px;
}

.dayCard {
  display: none;
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #1f1f1f;
  color: white;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.dayCardStart {
  left: 0;
  transform: none;
}

.dayCardEnd {
  left: auto;
  right: 0;
  transform: none;
}

.calendarDay:hover .dayCard,
.calendarDay:focus .dayCard {
  display: block;
}

.dayCardDate {
  font-weight: 600;
}

.dayCardSummary {
  color: #d1d5db;
}

.dayCardPeriods {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-variant-numeric: tabular-nums;
}

.dayCardMore {
  color: #d1d5db;
}

.calendarDayFuture {
  background-color: white;
  color: #c4c4c4;
  font-weight: 500;
}

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
  font-size: 12px;
  color: #5b5b5b;
}

.legend span:first-child {
  margin-right: 4px;
}

.legend span:last-child {
  margin-left: 4px;
}

.legendSwatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  position: relative;
  border-bottom: 2px solid #e6e6e6;
}

.tabs a {
  padding: 0.4rem 0.6rem;
  color: #666;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: color 0.3s;
}

.tabs a.active {
  color: var(--bekka-color);
}

.tabs a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--bekka-color);
}

/* Announcements */
.announcementSectionTitle {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.empty {
  font-size: 12px;
  color: #5b5b5b;
  padding: 4px 0 8px;
}

.announcement {
  padding: 12px 0;
  border-bottom: 1px solid #ececf5;
}

.announcement:last-child {
  border-bottom: none;
}

.announcementSubject {
  font-weight: 600;
}

.announcementPeriod {
  margin-top: 2px;
  font-size: 12px;
  color: #5b5b5b;
}

.announcementBody {
  margin-top: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.announcementBody a {
  color: var(--bekka-color);
}

/* Narrow screens: the months stack. */
@media (max-width: 760px) {
  .calendarMonths {
    grid-template-columns: minmax(0, 1fr);
  }
}
