/* =========================================
   Calendar (consolidated)
   Source: moved from componentshub.css + hub.css
   ========================================= */

/* Utilities used by the calendar */
.u-mt-24 { margin-top: 24px; }
.u-mb-24 { margin-bottom: 24px; }
.u-gap-8 { gap: 8px; }
.u-flex-left { display: flex; justify-content: flex-start; }

/* Optional: allow sections without border (kept) */
.cal-section.no-border { border: 0; }

/* Calendar visual styles (from componentshub.css) */
.cal-wrap { text-align: left; max-width: 100%; margin: 0; }
.cal-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 6px; border-bottom: 1px solid #b08a48; }
.cal-date-big { font-size: 20px; font-weight: 600; line-height: 1.15; margin-bottom: 4px; }
.cal-week { color: #6c757d; font-size: 13px; font-weight: 400; }
.cal-tabs { display: inline-flex; gap: 8px; }
.cal-tab {
  border: 1px solid #b08a48;
  background: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.cal-tab-active { border-color: #b08a48; box-shadow: 0 0 0 2px rgba(176,138,72,0.15) inset; }

.cal-main { margin-top: 24px; }
.cal-section {
  background: #fff;
  border: 1px solid #b08a48;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
  max-width: 100%;
  box-sizing: border-box;
}

.cal-section-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-section-title { font-weight: 500; font-size: 13px; }
.cal-section-help { color: #b08a48; font-size: 12px; }
.cal-actions { margin-top: 8px; }

.cal-btn {
  background: #fff;
  color: #000;
  border: 1px solid #b08a48;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.cal-btn.ghost { background: #fff; }
.cal-btn:hover { border-color: #b08a48; }

.cal-note-editor {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;

}
.cal-note-editor textarea {
  width: 100%;
  resize: vertical;
  font-size: 13px;
  font-weight: 400;
  border: 1px solid #b08a48;
  border-radius: 6px;
  padding: 8px;
  background: #fff;
  box-sizing: border-box;
}

.cal-empty { color: #6c757d; font-style: italic; padding: 24px 0; }

/* Right-column mini calendar (from componentshub.css) */
.cal-side { background: #fff; border: 1px solid #b08a48; border-radius: 8px; padding: 12px; height: fit-content; }
.cal-side-head { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; margin-bottom: 8px; }
.cal-side-title { text-align: center; font-weight: 500; font-size: 13px; }
.cal-nav { background: #fff; border: 1px solid #b08a48; border-radius: 6px; cursor: pointer; height: 32px; }
.cal-weekdays { display: grid !important; grid-template-columns: repeat(7,1fr) !important; font-size: 12px; color: #6c757d; margin-bottom: 4px; text-align: center; gap: var(--space-10) !important; }
.cal-grid { display: grid !important; grid-template-columns: repeat(7,1fr) !important; gap: var(--space-10) !important; }
.cal-day-cell { border: 1px solid #b08a48; background: #fff; border-radius: 6px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 6px;
}
.cal-day-cell.muted { opacity: .45; }
.cal-day-cell.today { outline: 2px solid rgba(176,138,72,.5); }
.cal-day-cell.selected { background: rgba(176,138,72,.12); border-color: #b08a48; }
.cal-today-row { margin-top: 10px; display: flex; justify-content: center; }

/* Events list (from componentshub.css) */
.cal-list-date { font-weight: 600; margin-top: 10px; }
.cal-event {
  display: flex;
  display: inline-flex;
align-items: center;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(176,138,72,.35);
}
.cal-event:last-child { border-bottom: 0; }
.cal-event__text { font-size: 13px; }
.cal-event__actions { display: inline-flex; align-items: center; gap: 6px; }

.cal-icon-btn {
  background: #fff;
  border: 1px solid #b08a48;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}
.cal-icon-btn:hover { border-color: #b08a48; }
.cal-icon-btn--danger { border-color: #b04848; }

/* ===== Ultra-compact mode for right-rail (from hub.css) ===== */
#calendarRightRail.cal-side--compact {
  padding: 8px;
  border-radius: 8px;
  height: auto;
}
.cal-side--compact .cal-side-head {
  margin-bottom: 2px;
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
}
.cal-side--compact .cal-side-title { font-size: 11px; font-weight: 600; }
.cal-side--compact .cal-nav { height: 24px; border-radius: 6px; }
.cal-side--compact .cal-weekdays {
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 1px !important;
  font-size: 10px;
  margin-bottom: 2px;
  text-align: center;
}
.cal-side--compact .cal-grid {
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 1px !important;
}
.cal-side--compact .cal-day-cell {
  height: 22px;
  min-height: 22px;
  padding: 0;
  font-size: 11px;
  line-height: 1;
}
.cal-side--compact .cal-today-row { margin-top: 4px; }
