/* Schedule Calendar — Copeland Design Studio
   Read-only month view. Brand tokens mirror CDS_Portal.html. */

:root {
  --navy:     #001F5B;
  --navy-dk:  #000D2B;
  --orange:   #E8500A;
  --surface:  #0A1834;
  --surface2: #11223F;
  --border:   #1B2C4D;
  --border2:  #27395E;
  --text:     #C9D3E6;
  --muted:    #7A89A8;
  --white:    #FFFFFF;
  --green:    #059669;
  --red:      #DC2626;
}

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

body {
  background: var(--navy-dk);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top bar ─────────────────────────────────────────────── */
.cal-top {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 52px;
  padding: 0 20px;
  background: var(--navy);
  border-bottom: 2px solid var(--orange);
}
.cal-back {
  color: var(--white);
  text-decoration: none;
  background: rgba(255,255,255,.1);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}
.cal-back:hover { background: rgba(255,255,255,.2); }
.cal-brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--white);
  white-space: nowrap;
}
.cal-brand em { color: var(--orange); font-style: normal; }
.cal-sub { font-size: 11px; color: var(--muted); }
.cal-space { flex: 1; }
.cal-traknet {
  color: var(--white);
  background: var(--orange);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 4px;
  white-space: nowrap;
}
.cal-traknet:hover { background: #c9440a; }

/* ── Controls bar ────────────────────────────────────────── */
.cal-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  flex-wrap: wrap;
}
.cal-nav { display: flex; gap: 6px; }
.cal-nav button {
  background: var(--surface2);
  color: var(--white);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.cal-nav button:hover { border-color: var(--orange); }
.cal-month {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
  min-width: 190px;
}
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.cal-legend .lg { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.dot-start { background: var(--orange); }
.dot-due   { background: var(--red); }
.dot-final { background: var(--green); }
.dot-draft { background: var(--muted); }
.dot-m365  { background: #3B82F6; }

/* ── Banner (feed status) ────────────────────────────────── */
.cal-banner {
  margin: 0 20px 12px;
  padding: 9px 14px;
  background: rgba(220,38,38,.12);
  border: 1px solid rgba(220,38,38,.4);
  border-radius: 6px;
  font-size: 12px;
  color: #FCA5A5;
}

/* ── Month grid ──────────────────────────────────────────── */
.cal-wrap { flex: 1; padding: 0 20px 20px; }
.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}
.cal-dow span {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 4px 8px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-height: 96px;
  padding: 6px;
  cursor: default;
}
.cal-day.has-events { cursor: pointer; }
.cal-day.has-events:hover { border-color: var(--orange); }
.cal-day.other { opacity: 0.35; }
.cal-day.today { border-color: var(--orange); background: var(--surface2); }
.cal-day .dnum { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.cal-day.today .dnum { color: var(--orange); }

.pill {
  display: block;
  font-size: 10px;
  line-height: 1.3;
  padding: 3px 6px;
  border-radius: 3px;
  margin-bottom: 3px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill-start { background: rgba(232,80,10,.85); }
.pill-due   { background: rgba(220,38,38,.75); }
.pill-final { background: rgba(5,150,105,.75); }
.pill-draft { background: rgba(122,137,168,.45); }
.pill-m365  { background: rgba(59,130,246,.65); }
.pill-more  { background: none; color: var(--muted); font-weight: 700; }

/* ── Day detail modal ────────────────────────────────────── */
.cal-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-modal {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  width: min(560px, 94vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cal-modal .mh {
  background: var(--navy);
  color: var(--white);
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.cal-modal .mh button {
  background: none;
  border: none;
  color: var(--white);
  font-size: 19px;
  cursor: pointer;
  line-height: 1;
}
.cal-modal .mb { overflow-y: auto; padding: 14px 18px; }
.ev {
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 9px;
}
.ev:last-child { margin-bottom: 0; }
.ev .ev-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ev .ev-title { font-size: 13px; font-weight: 700; color: var(--white); }
.ev .ev-meta { font-size: 11px; color: var(--muted); line-height: 1.6; }
.ev a {
  display: inline-block;
  margin-top: 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
  text-decoration: none;
}
.ev a:hover { text-decoration: underline; }
.ev-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 18px 0; }

/* ── Footer ──────────────────────────────────────────────── */
.cal-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--muted);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 760px) {
  .cal-sub { display: none; }
  .cal-month { min-width: 0; font-size: 16px; }
  .cal-legend { margin-left: 0; }
  .cal-day { min-height: 64px; padding: 4px; }
  .pill { font-size: 9px; padding: 2px 4px; }
}
@media (max-width: 480px) {
  .cal-top { padding: 0 12px; gap: 8px; }
  .cal-bar, .cal-wrap, .cal-foot { padding-left: 12px; padding-right: 12px; }
  .cal-dow span { padding: 2px 4px; }
  .cal-day .dnum { font-size: 10px; }
}
