:root {
  --bg: #f5f2ea;
  --ink: #1f1a17;
  --muted: #5c5047;
  --accent: #a13417;
  --accent-strong: #7e2410;
  --panel: #fffdfa;
  --danger: #a11212;
  --line: #dbcdbf;
  --shadow-soft: 0 8px 24px rgba(60, 34, 16, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top right, #ede2d6, var(--bg) 40%);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
}

.container {
  width: min(1080px, 94vw);
  margin: 2rem auto 3rem;
}

.hub-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1rem 0 1.1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.hub-brand {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.hub-links {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.hub-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.inline-form {
  margin: 0;
}

.inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 0.75rem;
}

.link-button {
  background: none;
  color: var(--accent-strong);
  padding: 0;
  border: 0;
  font: inherit;
  text-decoration: underline;
}

.nav-btn {
  padding: 0.45rem 0.75rem;
}

.hub-preference-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
}

.hub-preference-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.hub-preference-form select {
  width: 210px;
  padding: 0.4rem 0.55rem;
  margin: 0;
}

.hub-link {
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
}

.hub-link:hover {
  color: var(--accent-strong);
  background: rgba(123, 111, 101, 0.09);
}

.hub-link-active {
  background: #efe5d8;
  color: var(--ink);
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

h1,
h2 {
  margin: 0;
}

a {
  color: var(--accent-strong);
}

.btn,
button {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  padding: 0.6rem 0.95rem;
  line-height: 1.2;
}

.btn.secondary {
  background: #7b6f65;
}

.btn.danger {
  background: var(--danger);
}

.search {
  display: flex;
  gap: 0.6rem;
  margin: 0;
}

.search input {
  flex: 1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
  font: inherit;
  background: #fffcf8;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

label.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  margin-top: 1.5rem;
}

label.checkbox input {
  width: auto;
}

textarea {
  margin: 0.5rem 0 1rem;
  resize: vertical;
}

.errors {
  background: #fbe1de;
  border: 1px solid #f0b4ac;
  border-radius: 10px;
  padding: 0.8rem 1.1rem;
  margin: 0 0 1rem;
}

.notice {
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  margin: 0 0 1rem;
}

.notice-success {
  background: #e4f1e3;
  border: 1px solid #bbd9b6;
}

.notice-info {
  background: #efe7db;
  border: 1px solid #ddcdb8;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 1rem;
}

.poster {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
}

.actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.actions form {
  margin: 0;
}

.compact-actions {
  margin-top: 0;
}

.credit-actions {
  margin-top: 0.75rem;
}

.credit-actions[hidden] {
  display: none !important;
}

.empty {
  color: var(--muted);
}

.page-intro {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.45;
  max-width: 65ch;
}

.section-kicker {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-header {
  margin-top: 0.25rem;
}

.status-pill {
  display: inline-block;
  margin-left: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-ready {
  background: #d9efdf;
  color: #1f5a30;
}

.status-error {
  background: #f5d7d3;
  color: #7b1f1b;
}

.theatre-status {
  margin-left: 0;
}

.theatre-status-current {
  background: #dcebd8;
  color: #235a27;
}

.theatre-status-upcoming {
  background: #f5e4cc;
  color: #8a4c14;
}

.theatre-status-planning {
  background: #e3dde9;
  color: #5b3b72;
}

.theatre-status-archive {
  background: #ece7df;
  color: #63574d;
}

.audition-role-status {
  margin-left: 0.5rem;
}

.audition-role-status-upcoming {
  background: #f3ead7;
  color: #875214;
}

.audition-role-status-current {
  background: #dcebd8;
  color: #235a27;
}

.compact-list {
  margin-top: 0.6rem;
  color: var(--muted);
}

@media (max-width: 700px) {
  .hub-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .hub-links {
    gap: 0.75rem;
  }

  .hub-auth {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .detail-grid {
    grid-template-columns: 1fr;
  }

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

  .archive-search-row {
    flex-direction: column;
    align-items: stretch;
  }
}
/* --- Hub Landing Page --- */

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1.6rem;
}

.hub-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.6rem;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-card h2 {
  margin-bottom: 0.6rem;
}

.hub-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.hub-card:hover {
  border-color: #c9b7a5;
  box-shadow: 0 10px 24px rgba(60, 34, 16, 0.08);
}

.archive-year {
  margin-top: 2rem;
}

.archive-year h2 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.archive-item {
  padding: 0.85rem 0.4rem;
  border-bottom: 1px solid var(--line);
}

.archive-item:hover {
  background: #fcf8f2;
  border-radius: 10px;
}

.archive-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(140px, 1fr) minmax(180px, 1fr);
  gap: 1rem;
  align-items: start;
}

.people-grid {
  grid-template-columns: minmax(0, 2fr) minmax(140px, 1fr) minmax(140px, 1fr);
}

.person-cast-grid {
  grid-template-columns: minmax(0, 2fr) minmax(90px, 0.7fr) minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(0, 1.2fr);
}

.person-crew-grid {
  grid-template-columns: minmax(0, 2fr) minmax(90px, 0.7fr) minmax(0, 1.2fr) minmax(0, 1.3fr);
}

.works-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(110px, 0.6fr) minmax(0, 1.8fr);
}

.work-productions-grid {
  grid-template-columns: minmax(90px, 0.6fr) minmax(0, 1.6fr) minmax(0, 1.3fr) minmax(0, 1.3fr);
}

.archive-title {
  font-size: 1.08rem;
  line-height: 1.35;
}

.archive-meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.archive-search {
  align-items: stretch;
}

.archive-status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
}

.archive-toolbar {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.archive-toolbar-block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.toolbar-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-search-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.performance-summary-panel {
  margin-bottom: 1rem;
}

.performance-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.performance-group {
  padding-top: 0.25rem;
}

.performance-group-header {
  margin-bottom: 0.75rem;
}

.performance-list {
  margin: 0;
  padding-left: 1rem;
}

.performance-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.35rem 0;
}

.theatre-filter-field {
  min-width: 280px;
  flex: 1;
}

.theatre-filter-field label {
  margin-bottom: 0.35rem;
}

/* --- Archive Index --- */

.archive-year {
  margin-top: 2rem;
}

.archive-year h2 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.archive-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.archive-title {
  font-size: 1.05rem;
}

.archive-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .date-row {
    grid-template-columns: 1fr;
  }

  .archive-grid {
    grid-template-columns: 1fr;
  }

  .people-grid,
  .person-cast-grid,
  .person-crew-grid,
  .works-grid,
  .work-productions-grid {
    grid-template-columns: 1fr;
  }
}

.panel.subtle {
  margin-top: 1.2rem;
  opacity: 0.95;
}

.notes h2 {
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
}

.archive-record {
  margin-top: 1rem;
}

.detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(220px, 320px);
  gap: 1.4rem;
  align-items: start;
}

.record-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  row-gap: 0.6rem;
  column-gap: 1rem;
}

.record-label {
  font-weight: 700;
  color: var(--muted);
}

.record-value {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3rem;
}

.record-notes {
  margin-top: 1.4rem;
}

.detail-side .record-notes {
  margin-top: 0;
}

.archive-form {
  padding: 1.25rem;
  max-width: 920px;
}

.form-section + .form-section {
  margin-top: 1.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.form-section h2 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

.form-section-intro {
  margin: -0.1rem 0 0.9rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.auth-panel {
  max-width: 760px;
}

.date-picker-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.date-picker-row input {
  max-width: 220px;
}

.selected-date-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.selected-date-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffcf8;
}

.remove-date-btn {
  margin-left: auto;
}

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

.stack {
  margin-top: 1rem;
}

@media (max-width: 700px) {
  .record-grid {
    grid-template-columns: 1fr;
  }

  .record-label {
    margin-top: 0.8rem;
  }

  .date-picker-row,
  .selected-date-item {
    flex-direction: column;
    align-items: stretch;
  }

  .remove-date-btn {
    margin-left: 0;
  }

  .detail-shell {
    grid-template-columns: 1fr;
  }
}


.help {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.list {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
}

.credit-list {
  list-style: none;
  padding-left: 0;
}

.credit-item {
  border-top: 1px solid var(--line);
  padding: 0.9rem 0;
}

.credit-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.credit-main {
  font-size: 1rem;
}

.credit-role {
  font-style: italic;
}

.credit-notes {
  margin-top: 0.35rem;
  color: var(--muted);
}

.theatre-dashboard {
  margin-top: 1.5rem;
}

.home-header {
  margin-top: 0.5rem;
}

.home-intro {
  font-size: 1rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  background: #fcf8f2;
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.summary-value {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.2rem;
  line-height: 1.2;
}

.section-heading-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.archive-summary-strip {
  margin-bottom: 1rem;
}

.archive-tools-summary-strip {
  margin-bottom: 0;
}

.archive-empty-panel {
  padding: 1.1rem 1.2rem;
}

.archive-submeta {
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.archive-meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-top: 0.35rem;
}

.archive-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #f3ece3;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
}

.theatre-summary-panel {
  margin-bottom: 1.25rem;
}

.archive-tools-toolbar {
  margin-bottom: 1.25rem;
}

.archive-tools-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.production-attention-panel {
  margin-bottom: 1.25rem;
}

.production-attention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.theatre-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.theatre-status-summary {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.reports-grid {
  gap: 1.4rem 2rem;
}

.reports-grid .list li {
  margin-bottom: 0.55rem;
}

.theatre-status-summary-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.theatre-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.theatre-status-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8f1e9;
  color: inherit;
  text-decoration: none;
}

.theatre-status-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.theatre-status-card-label {
  font-size: 0.86rem;
  color: var(--muted);
}

.theatre-status-card-count {
  font-size: 1.5rem;
  line-height: 1;
}

@media (max-width: 700px) {
  .production-attention-item {
    flex-direction: column;
    align-items: stretch;
  }
}

.theatre-status-card-all {
  background: #f3ece3;
}

.theatre-status-card-planning {
  background: #f8efe5;
}

.theatre-status-card-upcoming {
  background: #f5efe2;
}

.theatre-status-card-current {
  background: #eef4ea;
}

.theatre-status-card-archive {
  background: #eee8df;
}

.entry-mode-note {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f7efe6;
  color: var(--text);
}

.entry-mode-note strong {
  font-size: 0.95rem;
}

.entry-mode-note span {
  color: var(--muted);
  font-size: 0.92rem;
}

.entry-mode-note-past {
  background: #f3ece3;
}

.entry-mode-note-upcoming {
  background: #f6efe2;
}

.theatre-form-context {
  margin-bottom: 1rem;
}

.form-record-context {
  margin-bottom: 1rem;
}

.upcoming-production {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  align-items: start;
}

.upcoming-production-thumb {
  width: 120px;
}

.flyer-thumb {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f2ebe3;
}

.flyer-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.production-flyer {
  width: min(320px, 100%);
  border-radius: 12px;
  border: 1px solid var(--line);
}

.billing-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
}

.inline-number {
  width: 100px;
}

.import-guidance {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.import-table-scroll {
  overflow-x: auto;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.import-table {
  width: 100%;
  min-width: 1550px;
  border-collapse: collapse;
  background: #fffcf8;
}

.import-table th,
.import-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0;
  vertical-align: middle;
}

.import-table th:last-child,
.import-table td:last-child {
  border-right: 0;
}

.import-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0b607d;
  color: #f8f5ef;
  font-size: 0.95rem;
  text-align: left;
  padding: 0.75rem 0.7rem;
  white-space: nowrap;
}

.import-table tbody tr:nth-child(even) {
  background: #f7f1e8;
}

.import-table tbody tr:hover {
  background: #efe5d8;
}

.import-row-state-ready {
  background: #f7fbf4;
}

.import-row-state-error {
  background: #fbefec;
}

.import-table td input,
.import-table td select,
.import-table td textarea {
  border: 0;
  border-radius: 0;
  background: transparent;
  margin: 0;
  min-width: 100%;
  padding: 0.75rem 0.7rem;
}

.import-table td input:focus,
.import-table td select:focus,
.import-table td textarea:focus {
  outline: 2px solid rgba(161, 52, 23, 0.18);
  outline-offset: -2px;
  background: #fffdfa;
}

.import-row-index {
  width: 60px;
  min-width: 60px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.import-status-cell {
  min-width: 150px;
  padding: 0.6rem 0.65rem !important;
  vertical-align: top !important;
}

.import-row-feedback {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.import-row-messages {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.import-row-error,
.import-row-warning {
  font-size: 0.82rem;
  line-height: 1.35;
}

.import-row-error {
  color: #8c241d;
}

.import-row-warning {
  color: #8a5a11;
}

.import-issues-panel {
  margin-bottom: 1rem;
}

.import-actions-cell {
  width: 110px;
  min-width: 110px;
}

.import-actions-cell .btn {
  width: 100%;
  border-radius: 0;
  padding: 0.75rem 0.7rem;
}

.import-table th:nth-child(2),
.import-table td:nth-child(2) {
  min-width: 150px;
}

.import-table th:nth-child(3),
.import-table td:nth-child(3) {
  min-width: 240px;
}

.import-table th:nth-child(4),
.import-table td:nth-child(4) {
  min-width: 270px;
}

.import-table th:nth-child(5),
.import-table td:nth-child(5) {
  min-width: 220px;
}

.import-table th:nth-child(6),
.import-table td:nth-child(6) {
  min-width: 160px;
}

.import-table th:nth-child(7),
.import-table td:nth-child(7),
.import-table th:nth-child(8),
.import-table td:nth-child(8),
.import-table th:nth-child(10),
.import-table td:nth-child(10) {
  min-width: 145px;
}

.import-table th:nth-child(9),
.import-table td:nth-child(9) {
  min-width: 220px;
}

.import-table th:nth-child(11),
.import-table td:nth-child(11) {
  min-width: 150px;
}

.import-table th:nth-child(12),
.import-table td:nth-child(12) {
  min-width: 220px;
}

@media (max-width: 700px) {
  .upcoming-production {
    grid-template-columns: 1fr;
  }

  .billing-row {
    flex-direction: column;
    align-items: stretch;
  }

  .theatre-summary-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .archive-tools-tabs {
    flex-direction: column;
    align-items: stretch;
  }
}
