/* Campaign Span — demo app styles */
.demo-page .site-footer { display: none; }
.demo-banner {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; align-items: center;
  padding: 9px 16px; font-size: .88rem; text-align: center;
  background: var(--accent-soft); color: var(--text); border-bottom: 1px solid var(--border);
}
.demo-banner a { font-weight: 700; color: var(--accent-ink); }

.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 110px); position: relative; }
.app-side { border-right: 1px solid var(--border); background: var(--surface); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; }
.ws-name { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.ws-name small { display: block; color: var(--muted); font-size: .78rem; }
.ws-dot { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--brand)); flex: none; }
.app-nav { display: flex; flex-direction: column; gap: 2px; }
.app-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); font-weight: 600; font-size: .93rem; }
.app-nav a svg { width: 18px; height: 18px; color: var(--muted); }
.app-nav a:hover { background: var(--surface-2); text-decoration: none; }
.app-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--link); }
.app-nav a[aria-current="page"] svg { color: var(--link); }
.side-field { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px; background: var(--surface-2); border-radius: 10px; }
.side-field label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.side-field select { padding: 8px 10px; font-size: .88rem; }
.side-field small { color: var(--muted); font-size: .76rem; line-height: 1.4; }

.app-main { min-width: 0; padding: 20px 24px 40px; }
.app-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.app-top h1 { font-size: 1.5rem; margin: 0; }
.app-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 210px; }
.menu button { display: block; width: 100%; text-align: left; font: inherit; font-size: .9rem; font-weight: 600; padding: 9px 12px; border: 0; background: none; color: var(--text); border-radius: 6px; cursor: pointer; }
.menu button:hover { background: var(--surface-2); }
.bell { position: relative; }
.badge-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #2E294E; font-size: 11px; font-weight: 800; display: grid; place-items: center; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar h2 { font-size: 1.15rem; margin: 0 8px 0 0; min-width: 150px; }
.toolbar select { width: auto; padding: 7px 10px; font-size: .88rem; }
.toolbar .spacer { flex: 1; }
.legend-note { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.legend-swatch { width: 16px; height: 12px; border-radius: 3px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, color-mix(in srgb, var(--warn) 30%, var(--surface-2)) 4px 8px); border: 1px solid var(--border); }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--border); gap: 1px; }
.cal-dow { background: var(--surface-2); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px; }
.cal-day { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.out { background: var(--surface-2); }
.cal-day.out .cal-num { color: var(--faint); }
.cal-day.gap { background: repeating-linear-gradient(135deg, var(--surface) 0 7px, color-mix(in srgb, var(--warn) 13%, var(--surface)) 7px 14px); }
.cal-day.drop { outline: 2px dashed var(--brand); outline-offset: -3px; }
.cal-day-head { display: flex; justify-content: space-between; align-items: center; }
.cal-num { font-size: .8rem; font-weight: 700; color: var(--muted); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--brand); color: var(--brand-ink); }
.add-btn { width: 22px; height: 22px; border-radius: 6px; border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; }
.cal-day:hover .add-btn, .add-btn:focus-visible { opacity: 1; }
.add-btn:hover { background: var(--surface-2); color: var(--link); }
.cal-day .chip { border: 0; border-left: 3px solid var(--c); font: inherit; font-size: 11.5px; font-weight: 600; cursor: grab; text-align: left; width: 100%; display: block; }
.cal-day .chip .tm { color: var(--muted); font-weight: 500; margin-right: 4px; }
.chip.dim { opacity: .55; }
.chip.dragging { opacity: .4; }
@media (hover: none) { .add-btn { opacity: 1; } }

/* Board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--surface-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 240px; }
.col.drop { outline: 2px dashed var(--brand); outline-offset: -3px; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 4px; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.col-head span { background: var(--surface); border-radius: 999px; padding: 1px 8px; font-size: .75rem; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; cursor: grab; text-align: left; font: inherit; color: inherit; width: 100%; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.kcard:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); }
.kcard.dragging { opacity: .4; }
.kcard .t { font-weight: 700; font-size: .9rem; line-height: 1.3; }
.kcard .row { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.kcard .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.col-more { font-size: .8rem; color: var(--muted); text-align: center; padding: 4px; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.panel h3 { font-size: 1rem; margin-bottom: 4px; }
.panel .sub { color: var(--muted); font-size: .85rem; margin-bottom: 14px; }
.panels { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); margin-top: 16px; }
.kpi-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.kpi-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.kpi-tile small { display: block; color: var(--muted); font-weight: 600; font-size: .8rem; }
.kpi-tile strong { display: block; font-size: 1.7rem; letter-spacing: -.02em; line-height: 1.2; margin: 2px 0; }
.kpi-tile .d { font-size: .8rem; font-weight: 700; }
.kpi-tile .d.up { color: var(--ok); }
.kpi-tile .d.down { color: var(--danger); }
.connected { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; align-items: center; }
.connected > small { color: var(--muted); font-weight: 600; margin-right: 4px; }

/* Charts */
.hbar { display: grid; grid-template-columns: 88px minmax(0, 1fr) 52px; gap: 6px 10px; align-items: center; font-size: .85rem; }
.hbar .lbl { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .track { height: 18px; position: relative; cursor: default; }
.hbar .fill { position: absolute; left: 0; top: 2px; bottom: 2px; background: var(--brand); border-radius: 0 4px 4px 0; transition: opacity .1s; }
.hbar .track:hover .fill, .hbar .track:focus .fill { opacity: .8; }
.hbar .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 6px; border-bottom: 1px solid var(--border); }
.vbars .vb { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; cursor: default; }
.vbars .vb .fill { background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.vbars .vb:hover .fill, .vbars .vb:focus .fill { opacity: .8; }
.vlabels { display: flex; gap: 8px; margin-top: 6px; }
.vlabels span { flex: 1; text-align: center; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; }
.chart-note { font-size: .8rem; color: var(--muted); margin-top: 10px; }
.tip { position: fixed; z-index: 200; pointer-events: none; background: var(--text); color: var(--bg); font-size: .8rem; line-height: 1.45; padding: 8px 10px; border-radius: 8px; box-shadow: var(--shadow-lg); max-width: 240px; }
.tip b { display: block; }

.reco-list .reco { align-items: center; }
.reco-list .reco p { flex: 1; font-size: .88rem; }
.reco-list .reco p b { font-size: .92rem; }
.reco .btn { flex: none; }
.reco .ico.ok { background: var(--ok-soft); color: var(--ok); }

.data-table { font-size: .88rem; }
.data-table th, .data-table td { padding: 9px 12px; }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Production */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { font: inherit; font-weight: 700; font-size: .9rem; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--link); border-bottom-color: var(--link); }
.proj-head { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; margin-bottom: 14px; }
.proj-head h2 { font-size: 1.25rem; margin: 0; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; font-size: .92rem; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 140px; padding: 8px 10px; font-size: .88rem; }
.inline-form input[type=time] { flex: 0 0 120px; }
.data-table select { padding: 5px 8px; font-size: .84rem; width: auto; }

/* Files */
.file-ico { width: 30px; height: 30px; border-radius: 7px; display: inline-grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; background: var(--muted); vertical-align: middle; margin-right: 8px; }
.upload-label { cursor: pointer; }
.upload-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-label:focus-within { outline: 3px solid var(--link); outline-offset: 2px; }

/* Team */
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; cursor: pointer; }
.switch input { accent-color: var(--link); width: 16px; height: 16px; }

/* Notifications */
.app { --notif-w: 360px; }
.notif-panel { position: absolute; top: 0; right: 0; width: min(var(--notif-w), 100%); height: 100%; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 30; display: flex; flex-direction: column; }
.notif-panel[hidden] { display: none; }
/* Wide screens: the panel docks as its own column so it never covers the calendar or board */
@media (min-width: 1100px) {
  .app.notif-open { grid-template-columns: 236px minmax(0, 1fr) var(--notif-w); }
  .app.notif-open .notif-panel { position: sticky; top: 68px; grid-column: 3; grid-row: 1; width: auto; height: calc(100vh - 68px); box-shadow: none; }
}
.notif-resize { position: absolute; top: 0; bottom: 0; left: -5px; width: 10px; cursor: col-resize; z-index: 2; touch-action: none; }
.notif-resize::after { content: ""; position: absolute; top: 50%; left: 3px; width: 4px; height: 44px; margin-top: -22px; border-radius: 4px; background: var(--border); transition: background .15s; }
.notif-resize:hover::after, .notif-resize:focus-visible::after, .app.resizing .notif-resize::after { background: var(--brand); }
.app.resizing { cursor: col-resize; user-select: none; }
.notif-head { display: flex; gap: 8px; align-items: center; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--border); }
.notif-head .icon-btn { width: 34px; height: 34px; }
#notif-list { overflow-y: auto; padding: 8px; }
.notif { padding: 10px 12px; border-radius: 10px; font-size: .86rem; display: grid; gap: 2px; }
.notif + .notif { border-top: 1px solid var(--border); border-radius: 0; }
.notif.unread { background: var(--brand-soft); border-radius: 10px; }
.notif b { font-size: .9rem; }
.notif small { color: var(--muted); }
.notif .via { color: var(--muted); font-size: .78rem; }
.empty { color: var(--muted); text-align: center; padding: 32px 12px; font-size: .9rem; }

/* Dialog */
dialog { border: 1px solid var(--border); border-radius: 16px; padding: 0; width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(10, 9, 20, .5); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dlg-head h2 { font-size: 1.15rem; margin: 0; }
.dlg-body { padding: 18px 20px 4px; }
.dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.dlg-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.tag-field { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; }
.tag-field.invalid { border-color: var(--danger); }
.tag-field legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.tag-field .req { color: var(--danger); font-size: .78rem; font-weight: 700; margin-left: 4px; }
.tag-field .hint { font-size: .8rem; color: var(--muted); margin: 0 0 10px; }
.tag-groups { display: grid; gap: 10px; }
.tag-groups small { font-weight: 700; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.tag-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag-checks label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: .84rem; font-weight: 600; cursor: pointer; }
.tag-checks input { accent-color: var(--link); margin: 0; }
.tag-checks label:has(input:checked) { background: var(--brand-soft); border-color: var(--link); color: var(--link); }
.danger-text { color: var(--danger); }

.toast-stack { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: min(460px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: 10px; font-size: .88rem; box-shadow: var(--shadow-lg); animation: toast-in .2s ease-out; }
.toast small { display: block; opacity: .75; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .app-side { border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; gap: 10px; }
  .ws-name { display: none; }
  .app-nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .app-nav a { flex: none; padding: 8px 10px; }
  .side-field { margin-top: 0; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 8px 10px; }
  .side-field select { width: auto; flex: 1; }
  .side-field small { display: none; }
  .app-main { padding: 16px; }
}
@media (max-width: 640px) {
  .cal-day { min-height: 70px; padding: 3px; }
  .cal-dow { padding: 6px 3px; font-size: .62rem; }
  .cal-day .chip { font-size: 0; height: 7px; padding: 0; border-left: 0; background: var(--c); border-radius: 3px; }
  .cal-num { font-size: .72rem; width: 20px; height: 20px; }
  .add-btn { display: none; }
  .dlg-grid { grid-template-columns: 1fr; }
  .app-top h1 { font-size: 1.25rem; }
  .app-actions { margin-left: 0; width: 100%; }
  .app-actions #new-entry { flex: 1; }
  .reco-list .reco { flex-wrap: wrap; }
}

/* Call sheet */
.call-sheet td { vertical-align: middle; }
.call-sheet .cs-role { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.call-sheet input[type=time] { width: auto; padding: 5px 6px; font-size: .84rem; }
.call-sheet .cs-acts { font-size: .82rem; min-width: 200px; }
.call-sheet .cs-acts span { display: block; line-height: 1.5; }
.call-sheet .cs-acts b { font-variant-numeric: tabular-nums; margin-right: 4px; }
.call-sheet .icon-btn { width: 30px; height: 30px; font-size: .8rem; }
.call-sheet tr.cs-cancelled td { opacity: .55; }
.call-sheet tr.cs-cancelled td strong { text-decoration: line-through; }
