﻿/* Production Calendar - Broadcast Utility */

/* Header avatar - keep fully visible at right edge */
body.bu-app.cal-tool #bu-header-slot {
  overflow: visible;
}

body.bu-app.cal-tool .bu-app-header,
body.bu-app.cal-tool .bu-site-header.bu-app-header {
  padding-right: 28px;
  overflow: visible;
  box-sizing: border-box;
}

body.bu-app.cal-tool .bu-header-right {
  flex-shrink: 0;
  margin-left: auto;
  padding-right: 6px;
  overflow: visible;
}

body.bu-app.cal-tool #bu-user-area {
  flex-shrink: 0;
  overflow: visible;
}

body.bu-app.cal-tool #bu-user-area .bu-user-pill {
  flex-shrink: 0;
  overflow: visible;
  margin-right: 2px;
  box-sizing: border-box;
}

/* Editor mode: use full page width (shell defaults to 820px centered) */
body.bu-app.cal-tool:not(.bu-at-home) .av-home-main-col {
  max-width: none;
  margin: 0;
  width: 100%;
  padding: 16px 20px 28px;
}

body.bu-app.cal-tool:not(.bu-at-home) .bu-hub-stage {
  max-width: none;
  width: 100%;
}

.cal-empty {
  margin: 0;
}

/* Workspace: settings sidebar + calendar */
.cal-workspace-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
}
.cal-settings-side {
  position: sticky;
  top: 12px;
  background: #fff;
  border: 1px solid var(--bdr2, rgba(17, 24, 39, 0.11));
  border-radius: 12px;
  padding: 14px 14px 18px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(17, 24, 39, 0.05));
  max-height: calc(100vh - 80px);
  overflow: auto;
}
.cal-side-title { margin: 0 0 14px; font-size: 14px; font-weight: 700; color: var(--ink, #18181b); }
.cal-side-block { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--bdr, rgba(17, 24, 39, 0.07)); }
.cal-side-block:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.cal-side-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink3, #6b7280); margin-bottom: 8px; }
.cal-side-lbl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-side-lbl-row .cal-side-lbl { margin-bottom: 0; }
.cal-side-hint { margin: 8px 0 0; font-size: 11px; line-height: 1.4; color: var(--ink3, #6b7280); }
.cal-side-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cal-side-color { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink2, #3f3f46); margin: 0 !important; }
.cal-side-color input[type="color"] { width: 100%; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--bdr2); cursor: pointer; background: #fff; }
.cal-side-year { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink3); margin: 0 0 10px !important; }
.cal-side-year select { height: 34px; border-radius: 8px; border: 1px solid var(--bdr2); padding: 0 10px; }
.cal-btn-block { width: 100%; }
.cal-btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.cal-brand-logo-btns { display: flex; flex-direction: column; gap: 6px; }
.cal-type-list { display: flex; flex-direction: column; gap: 8px; }
.cal-type-row-edit { display: grid; grid-template-columns: 36px 1fr auto; gap: 6px; align-items: center; }
.cal-type-color { width: 36px !important; height: 32px !important; padding: 2px !important; border-radius: 8px !important; cursor: pointer; }
.cal-type-label { height: 32px; padding: 0 8px !important; font-size: 13px !important; }
.cal-type-del {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.cal-workspace-main { min-width: 0; }
@media (max-width: 960px) {
  .cal-workspace-layout { grid-template-columns: 1fr; }
  .cal-settings-side { position: static; max-height: none; }
}

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--bdr2, rgba(17, 24, 39, 0.11));
  border-radius: 12px; border-top: 3px solid var(--cal-accent, #0066ff);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(17, 24, 39, 0.05));
}

.cal-toolbar-title {
  flex: 1;
  min-width: 140px;
}

.cal-toolbar h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--h-ink, #0a0c12);
}

.cal-year-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink3, #6b7280);
}

.cal-year-pick select {
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--bdr2, rgba(17, 24, 39, 0.11));
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink, #18181b);
}

.cal-month-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 10px;
  background: var(--bg3, #f5f5f7);
  border: 1px solid var(--bdr2, rgba(17, 24, 39, 0.11));
}

.cal-nav-mode {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #18181b);
  letter-spacing: -0.01em;
}

.cal-nav-nums {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink2, #3f3f46);
  min-width: 4.5em;
  text-align: center;
}

.cal-nav-btn {
  width: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.cal-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--bdr2, rgba(17, 24, 39, 0.11));
  background: var(--bg3, #f5f5f7);
  color: var(--ink, #18181b);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.cal-btn:hover {
  border-color: rgba(0, 102, 255, 0.35);
}

.cal-btn-primary {
  background: linear-gradient(180deg, #1c2330 0%, #0a0c12 100%);
  border-color: rgba(10, 15, 30, 0.35);
  color: #fff;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--h-muted, #5a6170);
  margin-bottom: 12px;
}

.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cal-legend span > span {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.cal-legend-muted {
  opacity: 0.75;
}

.cal-status {
  font-size: 13px;
  color: var(--h-muted);
  min-height: 1.2em;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1.5px;
  background: rgba(10, 15, 30, 0.14);
  border: 1.5px solid rgba(10, 15, 30, 0.14);
  border-radius: 12px;
  overflow: hidden;
}

.cal-grid .cal-dow {
  background: var(--cal-primary, #0a0c12);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 10px 6px;
  color: #fff;
  border-bottom: 3px solid var(--cal-accent, #0066ff);
}

.cal-grid .cal-day {
  min-height: 118px;
  max-height: 160px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  padding: 8px;
  font-size: 12px;
  cursor: pointer;
  vertical-align: top;
  box-sizing: border-box;
}



.cal-grid .cal-day.other {
  opacity: 0.5;
  background: #f3f4f6;
}

.cal-grid .cal-day.today {
  box-shadow: inset 0 0 0 2px var(--cal-accent, #0066ff);
}

.cal-grid .cal-day-num {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--h-ink);
}

.cal-grid .cal-ev {
  font-size: 10px;
  padding: 4px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  color: #fff;
  line-height: 1.25;
  overflow: hidden;
}

.cal-grid .cal-ev.uncovered {
  background: #9ca3af !important;
  opacity: 1;
  filter: none;
  color: #fff;
}

.cal-grid .cal-ev-more {
  background: #444 !important;
  opacity: 1;
  filter: none;
}

.cal-ev-main {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-ev-type {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 9px;
  opacity: 0.95;
}

.cal-ev-time {
  font-weight: 700;
  opacity: 0.95;
}

.cal-ev-title {
  font-weight: 600;
}

.cal-ev-meta {
  font-size: 9px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.cal-share-box {
  padding: 14px;
  background: var(--h-glass-tint);
  border: 1px solid var(--h-glass-border);
  border-radius: var(--h-r-md);
  font-size: 13px;
}

.cal-share-box input {
  width: 100%;
  margin-top: 8px;
}

.hidden {
  display: none !important;
}

/* Modal */
.cal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.35);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.cal-modal-overlay.open {
  display: flex;
}

@media (min-width: 600px) {
  .cal-modal-overlay {
    align-items: center;
    padding: 20px;
  }
}

.cal-modal {
  width: 100%;
  max-width: 480px;
  max-height: min(90vh, 720px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--h-glass-border);
  border-radius: var(--h-r-lg) var(--h-r-lg) 0 0;
  box-shadow: var(--h-glass-shadow-lift);
}

@media (min-width: 600px) {
  .cal-modal {
    border-radius: var(--h-r-lg);
  }
}

.cal-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(10, 15, 30, 0.06);
}

.cal-modal-hdr h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--h-ink);
}

.cal-modal-x {
  background: transparent;
  border: 0;
  font-size: 24px;
  cursor: pointer;
  color: var(--h-muted);
  line-height: 1;
}

.cal-modal-body {
  padding: 16px 18px;
}

.cal-modal-hint {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--h-muted);
  line-height: 1.4;
}

.cal-modal-body label {
  display: block;
  font-size: 12px;
  color: var(--h-muted);
  margin: 12px 0 6px;
}

.cal-modal-body label:first-child {
  margin-top: 0;
}

.cal-modal-body input,
.cal-modal-body select,
.cal-modal-body textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--h-r-sm);
  border: 1px solid rgba(10, 15, 30, 0.1);
  background: rgba(255, 255, 255, 0.8);
  color: var(--h-ink);
}

.cal-modal-body input[type='checkbox'] {
  width: auto;
  margin-right: 8px;
}

.cal-modal-body input[type='color'] {
  height: 40px;
  padding: 4px;
  cursor: pointer;
}

.cal-type-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cal-type-row select {
  flex: 1;
  min-width: 0;
}

.cal-type-row .cal-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.cal-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cal-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.cal-swatch:hover {
  transform: scale(1.08);
}

.cal-swatch.on {
  border-color: #0a0c12;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0a0c12;
}

.cal-brand-logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cal-brand-logo-preview {
  width: 88px;
  height: 48px;
  border-radius: 8px;
  border: 1px dashed rgba(10, 15, 30, 0.2);
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--h-muted);
  overflow: hidden;
}

.cal-brand-logo-preview.has-img {
  border-style: solid;
  background: #fff;
}

.cal-brand-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cal-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cal-crew-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.cal-crew-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.cal-modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px;
  border-top: 1px solid rgba(10, 15, 30, 0.06);
}

@media (max-width: 720px) {
  .cal-grid .cal-day {
  min-height: 118px;
  max-height: 160px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  padding: 8px;
  font-size: 12px;
  cursor: pointer;
  vertical-align: top;
  box-sizing: border-box;
}

  .cal-ev-meta {
    display: none;
  }
}


