/* ════════════════════════════════════════════════════════════════════════
   CALENDAR V2 — workspace styles (scoped under #cv2Overlay: a full-screen
   overlay appended to document.body — NOT a .tp panel, see calendar-v2.tab.js)
   Design language: INPUT DATA visual family — mint #24B47E accent,
   ink #14202A, wash #F6FAF8, line #E8ECEF, radii 24/14/12,
   Plus Jakarta Sans (display) + Inter (body).
   ════════════════════════════════════════════════════════════════════════ */

#cv2Overlay {
  --cv-ink: #14202A;
  --cv-ink-2: #38434E;
  --cv-mut: #7A858F;
  --cv-line: #E8ECEF;
  --cv-wash: #F6FAF8;
  --cv-card: #FFFFFF;
  --cv-accent: #24B47E;
  --cv-accent-soft: rgba(36, 180, 126, .12);
  --cv-accent-line: rgba(36, 180, 126, .35);
  --cv-gold: #D4A853;
  --cv-red: #E05252;
  --cv-amber: #E8A13D;
  --cv-blue: #2F6FED;
  --cv-ink-head: #0F1B2E;
  --cv-r-24: 24px;
  --cv-r-14: 14px;
  --cv-r-12: 12px;
  --cv-font: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --cv-font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

#cv2Overlay, #cv2Overlay * { box-sizing: border-box; }

/* Overlay root: full-viewport layer above the app shell. Hidden until .open
   (JS sets both .open and display). The app background stays untouched —
   the calendar owns the whole screen while it is open. */
#cv2Overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  background: var(--cv-wash);
  color: var(--cv-ink);
  font-family: var(--cv-font-body);
  overflow: hidden;
}

#cv2Overlay.open {
  display: block !important;
  animation: cv2OverlayIn .22s ease;
}

@keyframes cv2OverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.cv2-overlay-lock { overflow: hidden; }

#cv2Overlay .cv2-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
}

/* ── Header ── */
#cv2Overlay .cv2-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 28px 14px;
  flex-wrap: wrap;
}
#cv2Overlay .cv2-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .22em;
  color: var(--cv-accent);
}
#cv2Overlay .cv2-title {
  font-family: var(--cv-font);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--cv-ink-head);
  margin: 2px 0 4px;
}
#cv2Overlay .cv2-title span {
  color: var(--cv-accent);
  font-weight: 800;
}
#cv2Overlay .cv2-sub { font-size: 12.5px; color: var(--cv-mut); }
#cv2Overlay .cv2-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

#cv2Overlay .cv2-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cv-card);
  border: 1px solid var(--cv-line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--cv-ink-2);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#cv2Overlay .cv2-chip.dim { color: var(--cv-mut); font-weight: 600; }
#cv2Overlay .cv2-chip::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cv-accent);
  flex: none;
}

/* ── Buttons ── */
#cv2Overlay .cv2-btn {
  font-family: var(--cv-font-body);
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid var(--cv-line);
  background: var(--cv-card);
  color: var(--cv-ink-2);
  padding: 9px 16px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
#cv2Overlay .cv2-btn:hover { border-color: var(--cv-accent-line); color: var(--cv-ink); }
#cv2Overlay .cv2-btn:active { transform: translateY(1px); }
#cv2Overlay .cv2-btn.primary {
  background: var(--cv-accent);
  border-color: var(--cv-accent);
  color: #fff;
}
#cv2Overlay .cv2-btn.primary:hover { background: #1FA36F; }
#cv2Overlay .cv2-btn.ghost { background: transparent; }
#cv2Overlay .cv2-btn.danger { color: var(--cv-red); border-color: rgba(224, 82, 82, .35); }
#cv2Overlay .cv2-btn.danger:hover { background: rgba(224, 82, 82, .08); border-color: var(--cv-red); }
#cv2Overlay .cv2-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
#cv2Overlay .cv2-btn.sm { padding: 6px 11px; font-size: 11.5px; border-radius: 10px; }
#cv2Overlay .cv2-btn.icon { padding: 7px 9px; }

/* ── Section rail ── */
#cv2Overlay .cv2-rail {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 28px;
  background: rgba(246, 250, 248, .92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--cv-line);
  overflow-x: auto;
  scrollbar-width: none;
}
#cv2Overlay .cv2-rail::-webkit-scrollbar { display: none; }
#cv2Overlay .cv2-rail-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  padding: 6.5px 13px;
  font-family: var(--cv-font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--cv-mut);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
#cv2Overlay .cv2-rail-pill:hover { color: var(--cv-ink); background: var(--cv-card); border-color: var(--cv-line); }
#cv2Overlay .cv2-rail-pill.active {
  background: var(--cv-accent);
  border-color: var(--cv-accent);
  color: #fff;
}
#cv2Overlay .cv2-rail-num { font-size: 10px; font-weight: 800; opacity: .75; letter-spacing: .04em; }
#cv2Overlay .cv2-rail-prev button,
#cv2Overlay .cv2-rail-next button {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--cv-line);
  background: var(--cv-card);
  color: var(--cv-ink-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
#cv2Overlay .cv2-rail-prev button:disabled,
#cv2Overlay .cv2-rail-next button:disabled { opacity: .35; cursor: not-allowed; }

/* ── Body + sections ── */
#cv2Overlay .cv2-body { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 28px 60px; }
#cv2Overlay .cv2-sec { display: none; animation: cv2Fade .18s ease; }
#cv2Overlay .cv2-sec[data-active="1"] { display: block; }
@keyframes cv2Fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

#cv2Overlay .cv2-sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
#cv2Overlay .cv2-sec-title {
  font-family: var(--cv-font);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--cv-ink-head);
}
#cv2Overlay .cv2-sec-sub { font-size: 12.5px; color: var(--cv-mut); margin-top: 3px; }
#cv2Overlay .cv2-sec-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── KPI strip ── */
#cv2Overlay .cv2-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
#cv2Overlay .cv2-kpi {
  background: var(--cv-card);
  border: 1px solid var(--cv-line);
  border-radius: var(--cv-r-14);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#cv2Overlay .cv2-kpi-val {
  font-family: var(--cv-font);
  font-size: 22px;
  font-weight: 800;
  color: var(--cv-ink-head);
}
#cv2Overlay .cv2-kpi-val::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--cv-accent)); margin-right: 8px; vertical-align: middle; }
#cv2Overlay .cv2-kpi-lbl { font-size: 11px; font-weight: 700; color: var(--cv-mut); letter-spacing: .02em; }

/* ── Cards / panels ── */
#cv2Overlay .cv2-card {
  background: var(--cv-card);
  border: 1px solid var(--cv-line);
  border-radius: var(--cv-r-14);
  padding: 18px;
  margin-bottom: 14px;
}
#cv2Overlay .cv2-card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
#cv2Overlay .cv2-card-title { font-family: var(--cv-font); font-size: 14px; font-weight: 800; color: var(--cv-ink-head); }
#cv2Overlay .cv2-card-sub { font-size: 11.5px; color: var(--cv-mut); margin-top: 2px; }

/* ── Tables ── */
#cv2Overlay .cv2-table-wrap { overflow-x: auto; border: 1px solid var(--cv-line); border-radius: var(--cv-r-12); background: var(--cv-card); }
#cv2Overlay table.cv2-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 560px; }
#cv2Overlay .cv2-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--cv-mut);
  text-transform: uppercase;
  padding: 9px 12px;
  border-bottom: 1px solid var(--cv-line);
  background: var(--cv-wash);
  white-space: nowrap;
}
#cv2Overlay .cv2-table td { padding: 9px 12px; border-bottom: 1px solid var(--cv-line); color: var(--cv-ink-2); vertical-align: middle; }
#cv2Overlay .cv2-table tr:last-child td { border-bottom: none; }
#cv2Overlay .cv2-table tbody tr:hover td { background: rgba(36, 180, 126, .04); }
#cv2Overlay .cv2-table .num { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ── Chips / badges ── */
#cv2Overlay .cv2-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .03em;
  white-space: nowrap;
}
#cv2Overlay .cv2-pill.mint { background: var(--cv-accent-soft); color: #15885C; }
#cv2Overlay .cv2-pill.gold { background: rgba(212, 168, 83, .15); color: #A97F2E; }
#cv2Overlay .cv2-pill.grey { background: #EEF1F3; color: var(--cv-mut); }
#cv2Overlay .cv2-pill.blue { background: rgba(47, 111, 237, .12); color: #2F6FED; }
#cv2Overlay .cv2-pill.red { background: rgba(224, 82, 82, .12); color: var(--cv-red); }
#cv2Overlay .cv2-pill.amber { background: rgba(232, 161, 61, .14); color: #B97A1D; }

/* ── Segmented control ── */
#cv2Overlay .cv2-seg { display: inline-flex; background: #EEF1F3; border-radius: 12px; padding: 3px; gap: 2px; }
#cv2Overlay .cv2-seg button {
  border: none;
  background: transparent;
  border-radius: 9px;
  padding: 6px 13px;
  font-family: var(--cv-font-body);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--cv-mut);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
#cv2Overlay .cv2-seg button.active { background: var(--cv-card); color: var(--cv-ink); box-shadow: 0 1px 3px rgba(20, 32, 42, .12); }
#cv2Overlay .cv2-seg button:hover:not(.active) { color: var(--cv-ink); }

/* ── Day state dots ── */
#cv2Overlay .cv2-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
#cv2Overlay .cv2-dot.working { background: var(--cv-accent); }
#cv2Overlay .cv2-dot.partial { background: var(--cv-blue); }
#cv2Overlay .cv2-dot.nonworking { background: #B7BEC5; }
#cv2Overlay .cv2-dot.holiday { background: var(--cv-amber); }
#cv2Overlay .cv2-dot.company { background: var(--cv-red); }
#cv2Overlay .cv2-dot.country { background: var(--cv-gold); }

/* ── Country reference list ── */
#cv2Overlay .cv2-fw-list { display: flex; flex-direction: column; gap: 6px; }
#cv2Overlay .cv2-fw-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--cv-wash);
  border: 1px solid var(--cv-line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--cv-ink-2);
}
#cv2Overlay .cv2-fw-row .num { min-width: 88px; }

/* ── Empty states ── */
#cv2Overlay .cv2-empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--cv-mut);
}
#cv2Overlay .cv2-empty-icon { width: 54px; height: 54px; margin: 0 auto 12px; color: var(--cv-accent); }
#cv2Overlay .cv2-empty-icon svg { width: 100%; height: 100%; }
#cv2Overlay .cv2-empty-title { font-family: var(--cv-font); font-size: 14px; font-weight: 800; color: var(--cv-ink-2); margin-bottom: 4px; }
#cv2Overlay .cv2-empty-sub { font-size: 12px; }

/* ── Drawer ── */
#cv2Overlay .cv2-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 46, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 950;
}
#cv2Overlay .cv2-drawer-backdrop.open { opacity: 1; pointer-events: auto; }
#cv2Overlay .cv2-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 94vw);
  background: var(--cv-card);
  border-left: 1px solid var(--cv-line);
  box-shadow: -18px 0 44px rgba(15, 27, 46, .16);
  transform: translateX(102%);
  transition: transform .24s cubic-bezier(.32, .72, .32, 1);
  z-index: 960;
  display: flex;
  flex-direction: column;
}
#cv2Overlay .cv2-drawer.open { transform: none; }
#cv2Overlay .cv2-drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--cv-line);
}
#cv2Overlay .cv2-drawer-kicker { font-size: 10px; font-weight: 800; letter-spacing: .2em; color: var(--cv-accent); }
#cv2Overlay .cv2-drawer-title { font-family: var(--cv-font); font-size: 17px; font-weight: 800; color: var(--cv-ink-head); margin-top: 2px; flex: 1; }
#cv2Overlay .cv2-drawer-x, #cv2Overlay .cv2-modal .cv2-drawer-x {
  border: none;
  background: #EEF1F3;
  border-radius: 9px;
  width: 30px;
  height: 30px;
  color: var(--cv-ink-2);
  cursor: pointer;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#cv2Overlay .cv2-drawer-x svg { width: 14px; height: 14px; }
#cv2Overlay .cv2-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
#cv2Overlay .cv2-drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--cv-line);
  background: var(--cv-wash);
}

/* ── Modal ── */
#cv2Overlay .cv2-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 46, .42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 940;
}
#cv2Overlay .cv2-modal-backdrop.open { opacity: 1; pointer-events: auto; }
#cv2Overlay .cv2-modal {
  position: fixed;
  top: 4vh;
  left: 50%;
  transform: translate(-50%, -14px);
  width: min(1080px, 94vw);
  max-height: 92vh;
  background: var(--cv-card);
  border: 1px solid var(--cv-line);
  border-radius: var(--cv-r-24);
  box-shadow: 0 30px 70px rgba(15, 27, 46, .28);
  opacity: 0;
  pointer-events: none;
  transition: all .22s cubic-bezier(.32, .72, .32, 1);
  z-index: 950;
  display: flex;
  flex-direction: column;
}
#cv2Overlay .cv2-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
#cv2Overlay .cv2-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--cv-line);
}
#cv2Overlay .cv2-modal-title { font-family: var(--cv-font); font-size: 16px; font-weight: 800; color: var(--cv-ink-head); }
#cv2Overlay .cv2-modal-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
#cv2Overlay .cv2-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 22px;
  border-top: 1px solid var(--cv-line);
  background: var(--cv-wash);
  border-radius: 0 0 var(--cv-r-24) var(--cv-r-24);
}

/* ── Forms ── */
#cv2Overlay .cv2-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
#cv2Overlay .cv2-field > label { font-size: 11px; font-weight: 800; color: var(--cv-ink-2); letter-spacing: .03em; text-transform: uppercase; }
#cv2Overlay .cv2-field input[type="text"],
#cv2Overlay .cv2-field input[type="number"],
#cv2Overlay .cv2-field input[type="date"],
#cv2Overlay .cv2-field input[type="time"],
#cv2Overlay .cv2-field select,
#cv2Overlay .cv2-input,
#cv2Overlay .cv2-select {
  border: 1px solid var(--cv-line);
  border-radius: 12px;
  padding: 9px 12px;
  font-family: var(--cv-font-body);
  font-size: 12.5px;
  color: var(--cv-ink);
  background: var(--cv-card);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
#cv2Overlay .cv2-field input:focus, #cv2Overlay .cv2-field select:focus,
#cv2Overlay .cv2-input:focus, #cv2Overlay .cv2-select:focus {
  border-color: var(--cv-accent);
  box-shadow: 0 0 0 3px var(--cv-accent-soft);
}

/* ── Week grid (designer / preview) ── */
#cv2Overlay .cv2-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}
#cv2Overlay .cv2-week-day {
  border: 1px solid var(--cv-line);
  border-radius: var(--cv-r-12);
  background: var(--cv-card);
  padding: 12px;
  text-align: center;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all .15s;
}
#cv2Overlay .cv2-week-day:hover { border-color: var(--cv-accent-line); box-shadow: 0 4px 14px rgba(20, 32, 42, .07); }
#cv2Overlay .cv2-week-day.off { background: #FAFBFC; }
#cv2Overlay .cv2-week-day.off .cv2-week-name { color: var(--cv-mut); }
#cv2Overlay .cv2-week-name { font-family: var(--cv-font); font-size: 12px; font-weight: 800; color: var(--cv-ink-head); }
#cv2Overlay .cv2-week-hours { font-size: 11px; color: var(--cv-mut); font-variant-numeric: tabular-nums; }
#cv2Overlay .cv2-week-switch { display: flex; align-items: center; gap: 8px; }
#cv2Overlay .cv2-toggle {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--cv-line);
  background: #E4E8EA;
  position: relative;
  cursor: pointer;
  transition: all .15s;
  flex: none;
}
#cv2Overlay .cv2-toggle.on { background: var(--cv-accent); border-color: var(--cv-accent); }
#cv2Overlay .cv2-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s;
}
#cv2Overlay .cv2-toggle.on::after { left: 16px; }

/* ── Periods editor ── */
#cv2Overlay .cv2-period-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
#cv2Overlay .cv2-period-row input[type="time"] {
  border: 1px solid var(--cv-line);
  border-radius: 10px;
  padding: 7px 9px;
  font-family: var(--cv-font-body);
  font-size: 12px;
  width: 110px;
  color: var(--cv-ink);
  background: var(--cv-card);
}
#cv2Overlay .cv2-period-total { font-size: 11px; font-weight: 800; color: var(--cv-accent); min-width: 52px; }

/* ── Preview month grids ── */
#cv2Overlay .cv2-months {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
#cv2Overlay .cv2-month {
  background: var(--cv-card);
  border: 1px solid var(--cv-line);
  border-radius: var(--cv-r-14);
  padding: 14px;
}
#cv2Overlay .cv2-month-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
#cv2Overlay .cv2-month-name { font-family: var(--cv-font); font-size: 13px; font-weight: 800; color: var(--cv-ink-head); }
#cv2Overlay .cv2-month-stats { font-size: 10.5px; color: var(--cv-mut); font-weight: 700; }
#cv2Overlay .cv2-mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
#cv2Overlay .cv2-mdow { font-size: 9.5px; font-weight: 800; color: var(--cv-mut); text-align: center; padding: 3px 0; letter-spacing: .04em; }
#cv2Overlay .cv2-mday {
  aspect-ratio: 1;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--cv-ink-2);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .12s;
}
#cv2Overlay .cv2-mday:hover { border-color: var(--cv-accent-line); }
#cv2Overlay .cv2-mday.empty { background: none; cursor: default; }
#cv2Overlay .cv2-mday.off { background: #F2F4F5; color: #A8AFB6; }
#cv2Overlay .cv2-mday.working { background: var(--cv-accent-soft); color: #15885C; }
#cv2Overlay .cv2-mday.partial { background: rgba(47, 111, 237, .1); color: #2F6FED; }
#cv2Overlay .cv2-mday.holiday { background: rgba(232, 161, 61, .22); color: #B97A1D; }
#cv2Overlay .cv2-mday.company { background: rgba(224, 82, 82, .16); color: #C03939; }
#cv2Overlay .cv2-mday.country { background: rgba(212, 168, 83, .22); color: #A97F2E; }
#cv2Overlay .cv2-mday.today { outline: 2px solid var(--cv-ink-head); outline-offset: 1px; }
#cv2Overlay .cv2-mday.dim { opacity: .45; }

/* ── Legend ── */
#cv2Overlay .cv2-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 11px; color: var(--cv-mut); margin-top: 12px; }
#cv2Overlay .cv2-leg-item { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* ── Day detail panel ── */
#cv2Overlay .cv2-day-detail { background: var(--cv-card); border: 1px solid var(--cv-line); border-radius: var(--cv-r-14); padding: 16px; }
#cv2Overlay .cv2-day-detail-hdr { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
#cv2Overlay .cv2-day-detail-date { font-family: var(--cv-font); font-size: 15px; font-weight: 800; color: var(--cv-ink-head); }
#cv2Overlay .cv2-day-sources { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
#cv2Overlay .cv2-day-periods { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
#cv2Overlay .cv2-day-period {
  display: flex;
  justify-content: space-between;
  background: var(--cv-wash);
  border: 1px solid var(--cv-line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cv-ink-2);
}

/* ── Library list ── */
#cv2Overlay .cv2-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
#cv2Overlay .cv2-lib-item {
  background: var(--cv-card);
  border: 1px solid var(--cv-line);
  border-radius: var(--cv-r-14);
  padding: 14px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
#cv2Overlay .cv2-lib-item:hover { border-color: var(--cv-accent-line); box-shadow: 0 6px 18px rgba(20, 32, 42, .08); }
#cv2Overlay .cv2-lib-item.selected { border-color: var(--cv-accent); box-shadow: 0 0 0 3px var(--cv-accent-soft); }
#cv2Overlay .cv2-lib-name { font-family: var(--cv-font); font-size: 13.5px; font-weight: 800; color: var(--cv-ink-head); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
#cv2Overlay .cv2-lib-meta { font-size: 11px; color: var(--cv-mut); display: flex; flex-wrap: wrap; gap: 4px 12px; }
#cv2Overlay .cv2-lib-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ── Week strip (mini 7-day preview) ── */
#cv2Overlay .cv2-wstrip { display: flex; gap: 4px; margin-top: 10px; }
#cv2Overlay .cv2-wstrip span {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: #E4E8EA;
}
#cv2Overlay .cv2-wstrip span.working { background: var(--cv-accent); }
#cv2Overlay .cv2-wstrip span.partial { background: var(--cv-blue); }

/* ── Assignment center ── */
#cv2Overlay .cv2-assign-split { display: grid; grid-template-columns: 300px 1fr; gap: 16px; min-height: 380px; }
#cv2Overlay .cv2-assign-tree {
  border: 1px solid var(--cv-line);
  border-radius: var(--cv-r-12);
  overflow-y: auto;
  max-height: 480px;
  padding: 8px;
  background: var(--cv-wash);
}
#cv2Overlay .cv2-tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 12px;
  cursor: pointer;
  color: var(--cv-ink-2);
}
#cv2Overlay .cv2-tree-row:hover { background: var(--cv-card); }
#cv2Overlay .cv2-tree-row.active { background: var(--cv-accent-soft); color: #15885C; font-weight: 700; }
#cv2Overlay .cv2-tree-row .cv2-tree-chev { color: var(--cv-mut); font-size: 9px; width: 10px; }
#cv2Overlay .cv2-tree-row .cv2-tree-count { margin-left: auto; font-size: 10px; font-weight: 800; color: var(--cv-mut); }
#cv2Overlay .cv2-act-row td { cursor: default; }
#cv2Overlay .cv2-act-row.sel td { background: var(--cv-accent-soft) !important; }
#cv2Overlay .cv2-act-table { max-height: 440px; overflow-y: auto; }
#cv2Overlay .cv2-act-check { width: 18px; height: 18px; accent-color: var(--cv-accent); cursor: pointer; }

/* ── Impact / compare ── */
#cv2Overlay .cv2-delta { font-family: var(--cv-font); font-size: 21px; font-weight: 800; }
#cv2Overlay .cv2-delta.worse { color: var(--cv-red); }
#cv2Overlay .cv2-delta.better { color: var(--cv-accent); }
#cv2Overlay .cv2-delta.flat { color: var(--cv-mut); }
#cv2Overlay .cv2-split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#cv2Overlay .cv2-split2 .vs { position: relative; }
#cv2Overlay .cv2-vs-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--cv-ink-head);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  border-radius: 999px;
  padding: 4px 10px;
  z-index: 2;
  border: 3px solid var(--cv-wash);
}

/* ── Validation list ── */
#cv2Overlay .cv2-issue {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--cv-r-12);
  border: 1px solid var(--cv-line);
  background: var(--cv-card);
  margin-bottom: 8px;
  font-size: 12px;
}
#cv2Overlay .cv2-issue.error { border-color: rgba(224, 82, 82, .4); }
#cv2Overlay .cv2-issue.warn { border-color: rgba(232, 161, 61, .4); }
#cv2Overlay .cv2-issue-ico { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: none; }
#cv2Overlay .cv2-issue.error .cv2-issue-ico { background: rgba(224, 82, 82, .14); color: var(--cv-red); }
#cv2Overlay .cv2-issue.warn .cv2-issue-ico { background: rgba(232, 161, 61, .16); color: #B97A1D; }

/* ── Reports ── */
#cv2Overlay .cv2-report-opt { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
#cv2Overlay .cv2-export-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Print (reports section) ── */
#cv2PrintReport {
  display: none;
}
@media print {
  body > *:not(#cv2PrintReport) { display: none !important; }
  #cv2PrintReport {
    display: block !important;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    color: #14202A;
    padding: 24px;
  }
  #cv2PrintReport h1 { font-size: 22px; color: #0F1B2E; }
  #cv2PrintReport h3 { font-size: 14px; color: #14202A; margin-top: 18px; }
  #cv2PrintReport table { border-collapse: collapse; width: 100%; font-size: 11px; }
  #cv2PrintReport td { border: 1px solid #ddd; padding: 4px 8px; }
  #cv2PrintReport ul { font-size: 11px; color: #38434E; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  #cv2Overlay .cv2-head { padding: 16px 16px 10px; }
  #cv2Overlay .cv2-rail { padding: 8px 14px; }
  #cv2Overlay .cv2-body { padding: 16px 16px 40px; }
  #cv2Overlay .cv2-week-grid { grid-template-columns: repeat(4, 1fr); }
  #cv2Overlay .cv2-assign-split { grid-template-columns: 1fr; }
  #cv2Overlay .cv2-split2 { grid-template-columns: 1fr; }
  #cv2Overlay .cv2-vs-badge { display: none; }
}
@media (max-width: 560px) {
  #cv2Overlay .cv2-week-grid { grid-template-columns: repeat(2, 1fr); }
  #cv2Overlay .cv2-head-actions .cv2-btn { flex: 1; justify-content: center; }
}