:root {
  color-scheme: light;
  --navy: #1b2946;
  --blue: #365bd8;
  --ink: #24324a;
  --muted: #657186;
  --line: #e1e6ee;
  --bg: #f4f6fa;
  --red: #b83838;
  --amber: #9a6618;
  --green: #246b57;
  --radius: 10px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px/1.5 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  transition:
    background 0.12s,
    color 0.12s;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #809bff;
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 24px;
  letter-spacing: -0.6px;
  font-weight: 650;
}
h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 16px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--muted);
}
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 74px;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 0;
  gap: 17px;
  z-index: 20;
}
.brand {
  font-size: 40px;
  font-weight: 750;
  color: white;
  line-height: 1;
  margin-bottom: 24px;
}
.brand span {
  color: #95adff;
}
.rail-button {
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  border-radius: 9px;
  color: #b7c3db;
  font-size: 23px;
}
.rail-button.active,
.rail-button:hover {
  background: #ffffff16;
  color: white;
}
.rail-bottom {
  margin-top: auto;
  font-size: 18px;
  border: 1px solid #ffffff40;
  width: 32px;
  height: 32px;
}
.workspace {
  margin-left: 74px;
  padding: 24px 30px 10px;
  max-width: 2100px;
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.header-actions,
.view-actions,
.period-nav,
.period-bar,
.view-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 37px;
  padding: 7px 13px;
  border: 1px solid #dbe1eb;
  background: white;
  border-radius: 7px;
  color: var(--ink);
  white-space: nowrap;
  font-weight: 550;
}
.button:hover {
  background: #edf1f7;
}
.button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.button.primary:hover {
  background: #2749bd;
}
.button.dark {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}
.button.danger {
  color: var(--red);
  border-color: #e6bcbc;
}
.button.ghost {
  border-color: transparent;
  background: none;
  padding: 5px;
}
.icon-button {
  padding: 5px;
  width: 37px;
}
.save-status {
  font-size: 12px;
  color: var(--muted);
  margin-right: 8px;
}
.period-bar {
  justify-content: space-between;
  margin-bottom: 20px;
}
.period-nav {
  gap: 15px;
}
.period-nav h2 {
  font-size: 21px;
}
.period-nav .muted {
  font-size: 12px;
}
.date-picker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 14px;
  color: var(--muted);
  font-size: 12px;
}
.date-picker input {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  width: 139px;
}
.view-bar {
  justify-content: space-between;
  gap: 12px;
}
.segmented {
  display: flex;
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 8px;
  background: #e9edf4;
}
.segmented button {
  padding: 7px 14px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--muted);
  font-weight: 550;
}
.segmented button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 3px #18284b12;
}
select,
.search {
  min-height: 37px;
  padding: 7px 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
}
.summary-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 16px 0;
  font-size: 13px;
  min-height: 24px;
  flex-wrap: wrap;
}
.summary-bar strong {
  font-size: 16px;
  color: var(--ink);
}
.summary-warning {
  color: var(--red);
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
}
.summary-goal {
  color: var(--amber);
}
.body-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 20px;
  align-items: start;
}
.planning-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.film-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px;
  max-height: calc(100vh - 270px);
  overflow: auto;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}
.panel-heading h2 {
  font-size: 17px;
}
.search {
  width: 100%;
  margin-bottom: 8px;
}
.panel-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 15px;
}
.film-card {
  display: flex;
  gap: 11px;
  padding: 10px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  width: 100%;
  background: white;
  text-align: left;
  cursor: grab;
  position: relative;
  margin-bottom: 5px;
  color: var(--ink);
}
.film-card:hover {
  background: #f4f6fc;
}
.film-card.selected {
  border-color: #c7d3fc;
  background: #f1f4ff;
}
.poster {
  width: 42px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: #edf0f6;
}
.poster-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
}
.film-card h3 {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  margin: 2px 0 4px;
}
.film-meta {
  font-size: 12px;
  color: var(--muted);
}
.film-card .count {
  font-size: 12px;
  display: block;
  margin-top: 6px;
}
.logistics {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}
.logistics span {
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  color: #798397;
  background: white;
}
.logistics .received {
  background: #eaf5f0;
  color: var(--green);
  border-color: #c4e2d3;
}
.logistics .ordered {
  background: #fff5df;
  color: var(--amber);
  border-color: #ecd5a9;
}
.goal-under {
  color: var(--amber);
}
.goal-over {
  color: var(--red);
}
.goal-ok {
  color: var(--green);
}
.film-detail {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}
.detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.detail-row strong {
  color: var(--ink);
  font-weight: 500;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.timeline-scroll {
  max-height: calc(100vh - 290px);
  min-height: 330px;
  overflow: auto;
  position: relative;
}
.timeline {
  min-width: 680px;
}
.time-ruler,
.timeline-row {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
}
.time-ruler {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
  height: 41px;
}
.ruler-title {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--muted);
  border-right: 1px solid var(--line);
}
.ruler-hours {
  display: flex;
  position: relative;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
}
.ruler-hours span {
  position: absolute;
  top: 11px;
  transform: translateX(4px);
}
.day-heading {
  padding: 8px 14px;
  background: #f2f5fa;
  border-block: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 650;
}
.day-heading span {
  font-size: 11px;
  font-weight: 450;
  color: var(--muted);
}
.room-label {
  padding: 19px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid #edf0f5;
  font-size: 12px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  background: white;
}
.room-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-top: 6px;
  flex-shrink: 0;
}
.track {
  position: relative;
  border-bottom: 1px solid #edf0f5;
  background: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(var(--hour-width) - 1px),
    #e9edf4 calc(var(--hour-width) - 1px),
    #e9edf4 var(--hour-width)
  );
  min-height: 65px;
}
.track.drag-over {
  background-color: #edf2ff;
}
.session-block {
  position: absolute;
  top: 7px;
  height: 51px;
  border: 1px solid color-mix(in srgb, var(--film-color) 30%, white);
  border-left: 3px solid var(--film-color);
  border-radius: 5px;
  background: color-mix(in srgb, var(--film-color) 15%, white);
  padding: 5px 7px;
  color: var(--ink);
  text-align: left;
  cursor: grab;
  overflow: hidden;
  min-width: 16px;
  box-shadow: 0 1px 2px #12234408;
}
.session-block:hover {
  filter: brightness(0.96);
  box-shadow: 0 2px 6px #182f5520;
}
.session-block strong {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-block small {
  font-size: 11px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-block.conflict {
  border-color: #c84343;
  background: #fff0ed;
  border-left-color: #c84343;
}
.session-block.conflict::after {
  content: '!';
  position: absolute;
  right: 5px;
  top: 4px;
  color: var(--red);
  font-weight: 750;
}
.session-block.event {
  background: #f0f1f4;
  border-color: #c8ced8;
  border-left-color: #7c879a;
}
.track-hint {
  color: #8c97aa;
  position: absolute;
  inset: 20px auto auto 15px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
}
.track:hover .track-hint {
  opacity: 1;
}
.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  margin-top: 14px;
}
.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
  margin-bottom: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  white-space: nowrap;
}
dialog {
  border: 0;
  border-radius: 13px;
  padding: 0;
  width: min(620px, calc(100vw - 32px));
  max-height: 90vh;
  color: var(--ink);
  box-shadow: 0 25px 90px #10204035;
}
dialog::backdrop {
  background: #14213b66;
  backdrop-filter: blur(2px);
}
.modal-header {
  padding: 21px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.modal-body {
  padding: 20px 24px;
  max-height: 65vh;
  overflow: auto;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--navy);
  color: white;
  border-radius: 9px;
  box-shadow: 0 7px 30px #152e4225;
  z-index: 100;
  max-width: 90vw;
  display: none;
}
.toast.visible {
  display: block;
}
#print-area {
  display: none;
}
@media (max-width: 1100px) {
  .workspace {
    padding: 20px 18px 10px;
  }
  .body-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 12px;
  }
  .save-status {
    display: none;
  }
  .date-picker {
    display: none;
  }
  .segmented button {
    padding: 7px 10px;
  }
  .view-actions {
    gap: 6px;
  }
  .button {
    padding: 7px 10px;
  }
}
@media (max-width: 800px) {
  .rail {
    width: 54px;
  }
  .workspace {
    margin-left: 54px;
    padding: 16px 12px;
  }
  .app-header,
  .period-bar,
  .view-bar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .app-header {
    margin-bottom: 20px;
  }
  .header-actions {
    flex-wrap: wrap;
    gap: 5px;
  }
  .body-layout {
    grid-template-columns: 1fr;
  }
  .film-panel {
    max-height: none;
  }
  .timeline-scroll {
    max-height: 65vh;
  }
  .view-actions {
    flex-wrap: wrap;
  }
  .app-footer {
    flex-direction: column;
  }
  .period-nav h2 {
    font-size: 17px;
  }
  .film-panel #film-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}
