:root {
  --bg: #0c1114;
  --surface: #171d20;
  --surface-soft: #20282b;
  --ink: #f3ead7;
  --muted: #a8a18f;
  --line: #465156;
  --accent: #e0a13c;
  --accent-dark: #f0bd62;
  --green: #6f9a80;
  --panel-green: #223932;
  --amber: #e0a13c;
  --alert: #de7b55;
  --focus: #e2b650;
  --shadow: 0 20px 42px rgba(0, 0, 0, 0.34);
  --radius: 6px;
  --font-body: "IBM Plex Sans", "Inter", "Avenir Next", Arial, sans-serif;
  --font-display: "IBM Plex Mono", "Space Mono", "Roboto Mono", "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(224, 161, 60, 0.14), transparent 26%),
    radial-gradient(circle at 100% 12%, rgba(65, 112, 120, 0.18), transparent 28%),
    linear-gradient(rgba(241, 234, 213, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 234, 213, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #151b1f 0%, var(--bg) 100%);
  background-size: auto, auto, 28px 28px, 28px 28px, auto;
  color: var(--ink);
  font-family: var(--font-body);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0e1417;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: #d8cfb9;
  font-size: 0.88rem;
  font-weight: 750;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}

h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

h3 {
  font-family: var(--font-display);
  font-size: 1.02rem;
}

.hidden {
  display: none !important;
}

.print-export {
  display: none;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 32px;
  align-items: center;
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.login-copy p:not(.eyebrow) {
  max-width: 620px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.55;
}

.login-panel,
.project-panel,
.shot-form,
.list-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
}

.login-panel::before,
.project-panel::before,
.shot-form::before,
.list-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 3px solid rgba(212, 154, 57, 0.75);
  border-radius: inherit;
  pointer-events: none;
}

.login-panel {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.login-panel span {
  color: var(--muted);
  font-size: 0.88rem;
}

.login-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.app-shell {
  width: min(1360px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding: 18px 0;
}

.topbar h1 {
  font-size: clamp(1.8rem, 3.4vw, 3.2rem);
}

.topbar-actions,
.card-actions,
.shot-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.student-chip,
#shotCount {
  font-family: var(--font-display);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 800;
}

.primary-button,
.secondary-button,
.ghost-button,
.login-row button,
.card-actions button {
  border-radius: var(--radius);
  min-height: 42px;
  padding: 10px 14px;
}

.primary-button,
.login-row button {
  background: var(--accent);
  color: #17100a;
}

.secondary-button {
  background: #0c1215;
  color: var(--ink);
  border: 1px solid var(--line);
}

.ghost-button,
.card-actions button {
  border: 1px solid var(--line);
  background: #11181b;
  color: var(--ink);
}

.full-width {
  width: 100%;
}

.workspace {
  display: grid;
  gap: 16px;
}

.project-panel,
.shot-form,
.list-panel {
  padding: 18px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading > p {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.project-grid,
.form-grid {
  display: grid;
  gap: 12px;
}

.project-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.shot-form {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 13px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shot-list {
  display: grid;
  gap: 10px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: #11181b;
}

.shot-card {
  display: grid;
  grid-template-columns: 38px minmax(150px, 0.95fr) minmax(92px, 0.45fr) minmax(260px, 1.8fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid var(--location-strip, var(--accent));
  border-radius: var(--radius);
  padding: 8px;
  background: #11181b;
}

.shot-card.dragging {
  opacity: 0.55;
  outline: 2px solid var(--focus);
}

.shot-order {
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #090e10;
  color: var(--accent);
  min-height: 44px;
  font-size: 0.95rem;
  font-weight: 900;
}

.shot-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.shot-main p,
dd {
  color: var(--muted);
}

.schedule-location,
.schedule-shot {
  display: grid;
  gap: 2px;
  border-radius: var(--radius);
  padding: 8px 10px;
  min-height: 44px;
  align-content: center;
}

.schedule-location {
  background: var(--location-bg, var(--panel-green));
}

.schedule-shot {
  background: #221f19;
}

.schedule-location span,
.schedule-shot span {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.schedule-location strong {
  font-family: var(--font-display);
  color: var(--location-text, var(--ink));
  font-size: 1.02rem;
  line-height: 1.1;
}

.schedule-shot strong {
  font-family: var(--font-display);
  font-size: 0.94rem;
  line-height: 1.1;
}

.shot-main p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-tags span {
  font-family: var(--font-display);
  border-radius: 4px;
  background: #1f332e;
  color: #d7e0ce;
  padding: 4px 7px;
  font-size: 0.72rem;
  font-weight: 850;
}

dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 0;
}

dt {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
}

dd {
  margin: 2px 0 0;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-actions {
  display: grid;
  gap: 6px;
  align-content: start;
}

.card-actions button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.card-actions button:last-child {
  color: var(--alert);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(217, 155, 53, 0.45);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .login-screen,
  .builder-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .shot-form {
    position: static;
  }

  .shot-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .schedule-location,
  .schedule-shot,
  .shot-main {
    grid-column: 2 / -1;
  }

  .card-actions {
    grid-column: 2 / -1;
    display: flex;
  }
}

@media (max-width: 640px) {
  .login-row,
  .form-grid,
  .shot-card,
  dl {
    grid-template-columns: 1fr;
  }

  .shot-order {
    min-height: 36px;
  }

  .schedule-location,
  .schedule-shot,
  .shot-main,
  .card-actions {
    grid-column: auto;
  }

}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: white;
    color: #111;
    font-family: Arial, sans-serif;
  }

  .login-screen,
  .topbar,
  .workspace {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .print-export {
    display: block;
  }

  .print-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 12px;
    align-items: start;
    margin-bottom: 8mm;
    border-bottom: 2px solid #111;
    padding-bottom: 5mm;
  }

  .print-header p {
    margin: 0 0 3mm;
    font-size: 9pt;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .print-header h1 {
    margin: 0;
    font-size: 22pt;
    line-height: 1;
  }

  .print-header dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3mm 5mm;
    margin: 0;
  }

  .print-header dt {
    color: #333;
    font-size: 7.5pt;
    font-weight: 700;
    text-transform: uppercase;
  }

  .print-header dd {
    margin: 1mm 0 0;
    color: #111;
    font-size: 9pt;
    font-weight: 700;
  }

  .schedule-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 7.2pt;
    line-height: 1.25;
  }

  .schedule-table th,
  .schedule-table td {
    border: 1px solid #555;
    padding: 2mm;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
  }

  .schedule-table thead {
    display: table-header-group;
  }

  .schedule-table th {
    background: #e6e6e6;
    color: #111;
    font-size: 7pt;
    font-weight: 800;
    text-transform: uppercase;
  }

  .schedule-table tr {
    break-inside: avoid;
  }

  .schedule-table th:nth-child(1),
  .schedule-table td:nth-child(1) {
    width: 8mm;
    text-align: center;
  }

  .schedule-table th:nth-child(2),
  .schedule-table td:nth-child(2) {
    width: 30mm;
  }

  .schedule-table th:nth-child(3),
  .schedule-table td:nth-child(3) {
    width: 22mm;
    text-align: center;
  }

  .schedule-table th:nth-child(4),
  .schedule-table td:nth-child(4),
  .schedule-table th:nth-child(5),
  .schedule-table td:nth-child(5),
  .schedule-table th:nth-child(6),
  .schedule-table td:nth-child(6) {
    width: 16mm;
  }

  .schedule-table th:nth-child(7),
  .schedule-table td:nth-child(7) {
    width: 22mm;
  }

  .schedule-table th:nth-child(8),
  .schedule-table td:nth-child(8) {
    width: 20mm;
  }

  .schedule-table th:nth-child(9),
  .schedule-table td:nth-child(9) {
    width: auto;
  }

  .schedule-table th:nth-child(10),
  .schedule-table td:nth-child(10),
  .schedule-table th:nth-child(11),
  .schedule-table td:nth-child(11) {
    width: 18mm;
  }

  .print-order,
  .print-location {
    font-weight: 800;
  }

  .print-location {
    background: #f1f4f3;
  }

  .print-scene-shot {
    font-weight: 800;
  }

  .print-empty {
    height: 24mm;
    text-align: center !important;
    vertical-align: middle !important;
  }

  .production-docs {
    break-before: page;
  }

  .production-docs h2 {
    margin: 0 0 5mm;
    border-bottom: 2px solid #111;
    padding-bottom: 3mm;
    font-size: 18pt;
  }

  .doc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7mm;
  }

  .doc-table-wrap {
    break-inside: avoid;
  }

  .doc-table-wrap h3 {
    margin: 0 0 2mm;
    font-size: 11pt;
    text-transform: uppercase;
  }

  .doc-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 7.5pt;
    line-height: 1.25;
  }

  .doc-table th,
  .doc-table td {
    border: 1px solid #555;
    padding: 2mm;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
  }

  .doc-table th {
    background: #e6e6e6;
    font-size: 7pt;
    font-weight: 800;
    text-transform: uppercase;
  }

  .checkbox-cell {
    width: 12mm;
    height: 7mm;
  }
}
