/* Calendário: barra limpa, legenda discreta, dias e eventos compactos, painel lateral da peça. */
.cal-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-label { font-size: 18px; margin: 0 6px; min-width: 170px; text-align: center; letter-spacing: -.02em; }
.cal-filters { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item strong { color: var(--ink); }
.legend-hint { margin-left: auto; }
.ev-swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1px solid; }
.camp-swatch { width: 14px; height: 6px; border-radius: 3px; display: inline-block; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--line); gap: 1px; box-shadow: var(--shadow-sm); }
.cal-head { background: var(--surface-3); padding: 8px 10px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cal-day { background: var(--surface); min-height: 124px; padding: 6px; display: flex; flex-direction: column; gap: 3px; transition: background .12s; min-width: 0; }
.cal-week .cal-day { min-height: 440px; }
.cal-day.is-out { background: var(--surface-3); }
.cal-day.is-out .cal-num { color: #b9b5aa; }
.cal-day.is-past { background: #fbfaf7; }
.cal-day.is-past .cal-num { color: var(--muted); }
.cal-day.is-over { background: var(--orange-soft); outline: 2px dashed var(--orange); outline-offset: -3px; }
.cal-day-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-height: 22px; }
.cal-num { font-weight: 600; font-size: 13px; padding: 2px 6px; border-radius: 999px; }
.cal-day.is-today .cal-num { background: var(--ink); color: #fff; }
.cal-date { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-date-feriado { background: var(--err-soft); color: var(--err); }
.cal-date-comemorativa { background: var(--orange-soft); color: var(--ink); }
.camp-bar { display: block; height: 14px; border-radius: 4px; color: #fff; font-size: 10px; line-height: 14px; padding: 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.cal-events { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.ev { display: flex; align-items: center; gap: 5px; width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 6px; font: 500 12px var(--font); color: var(--ink); cursor: pointer; text-align: left; min-width: 0; transition: box-shadow .12s, transform .12s; }
.ev[draggable=true] { cursor: grab; }
.ev:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.ev.is-dragging { opacity: .4; }
.ev-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.ev-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-suggested, .ev-swatch.ev-suggested { border-style: dashed; border-color: var(--line-strong); background: var(--surface-3); }
.ev-approved, .ev-swatch.ev-approved { border-color: var(--orange-line); background: var(--orange-soft); }
.ev-scheduled, .ev-swatch.ev-scheduled { border-color: var(--info-line); background: var(--info-soft); }
.ev-published, .ev-swatch.ev-published { border-color: var(--ink); background: var(--ink); color: #fff; }
.ev-published .ev-time { color: #b9bcc5; }
.ev-failed, .ev-swatch.ev-failed { border-color: var(--err-line); background: var(--err-soft); }
.best-times { border-top: 1px dashed var(--line); padding-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.best { font-size: 11px; color: var(--muted); display: flex; gap: 5px; align-items: center; }

.drawer-body .piece-card { box-shadow: none; }
.drawer-body .piece-check { display: none; }

@media (max-width: 960px) {
    .cal { grid-template-columns: 1fr; }
    .cal-head { display: none; }
    .cal-day { min-height: 0; }
    .cal-day.is-out, .cal-day.is-empty { display: none; }
    .cal-day { flex-direction: row; align-items: flex-start; gap: 10px; padding: 10px 12px; }
    .cal-day-head { flex: none; width: 56px; flex-direction: column; align-items: flex-start; }
    .cal-day.is-today .cal-num::after { content: ' hoje'; font-weight: 500; }
    .cal-events { width: 100%; }
    .best-times { display: none; }
    .cal-filters { margin-left: 0; width: 100%; }
    .legend-hint { display: none; }
}
