/* FilmPRO Dash shell — expand in later UI polish milestones */

.filmpro-dash-root {
  font-family: system-ui, Segoe UI, sans-serif;
  margin: 0;
  min-height: 100vh;
  background: #f5f6f8;
  color: #1a1a1a;
}

.filmpro-dash-header {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1rem;
  padding: 0 1.5rem 0 0;
  background: #0f2744;
  color: #f5f6f8;
}

.filmpro-dash-header-brand {
  min-width: 0;
  display: flex;
  align-items: stretch;
}

.filmpro-dash-logo {
  display: block;
  height: 56px;
  width: auto;
  max-width: min(320px, 60vw);
  object-fit: contain;
  object-position: left center;
}

.filmpro-dash-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.filmpro-dash-lang-switch {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.filmpro-dash-lang-radio label {
  color: #f5f6f8;
  margin-right: 0.85rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.filmpro-dash-lang-radio input {
  margin-right: 0.35rem;
}

.filmpro-dash-body {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 5rem);
  align-items: stretch;
}

.filmpro-dash-sidebar {
  width: 300px;
  flex-shrink: 0;
  padding: 1rem;
  background: #fff;
  border-right: 1px solid #d8dde6;
  overflow-y: auto;
  max-height: calc(100vh - 5rem);
}

.filmpro-dash-sidebar h2 {
  margin: 0.75rem 0;
  font-size: 1.05rem;
}

.filmpro-dash-filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.filmpro-dash-filter-actions button {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border: 1px solid #c5ccd8;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}

.filmpro-dash-filter-actions .btn-apply {
  background: #0f2744;
  color: #fff;
  border-color: #0f2744;
}

.filmpro-dash-filter-status {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: #5c6570;
}

.filmpro-dash-filter-field {
  margin-bottom: 0.65rem;
}

.filmpro-dash-filter-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.filmpro-dash-data-source {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
}

.filmpro-dash-main {
  flex: 1;
  padding: 1rem 1.5rem;
  min-width: 0;
}

.filmpro-dash-content {
  margin-top: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #d8dde6;
  min-height: 240px;
}

.filmpro-dash-content-loading {
  position: relative;
  min-height: 240px;
}

.filmpro-dash-content-loading .dash-spinner {
  margin-top: 4rem;
}

.filmpro-dash-filter-actions .btn-apply:disabled {
  opacity: 0.55;
  cursor: wait;
}

.filmpro-dash-placeholder {
  color: #5c6570;
  margin: 0;
}

.filmpro-dash-overview h2,
.filmpro-dash-overview h3,
.filmpro-dash-overview h4,
.filmpro-dash-overview h5 {
  margin: 1.25rem 0 0.6rem;
}

.filmpro-dash-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filmpro-dash-kpi {
  flex: 1 1 140px;
  background: #f0f3f8;
  border: 1px solid #d8dde6;
  border-radius: 6px;
  padding: 0.75rem;
}

.filmpro-dash-kpi-label {
  font-size: 0.75rem;
  color: #5c6570;
  margin-bottom: 0.25rem;
}

.filmpro-dash-kpi-value {
  font-size: 1.05rem;
  font-weight: 700;
}

.filmpro-dash-chart-block {
  margin: 0.5rem 0 1rem;
  overflow-x: auto;
}

.filmpro-dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 960px) {
  .filmpro-dash-two-col {
    grid-template-columns: 1fr;
  }
}

.filmpro-dash-section {
  margin-top: 0.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid #e4e8ef;
}

.filmpro-dash-plotly-page .filmpro-dash-dropdown {
  max-width: 420px;
  margin-bottom: 0.75rem;
}

.filmpro-dash-sankey-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.filmpro-dash-sankey-header h2 {
  margin: 0;
}

.filmpro-dash-sankey-theme-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.filmpro-dash-sankey-theme-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  user-select: none;
}

/* iPhone-style Dark toggle */
.filmpro-dash-ios-toggle label {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
}

.filmpro-dash-ios-toggle label > :not(input) {
  display: none;
}

.filmpro-dash-ios-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.filmpro-dash-ios-toggle label::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #c5ccd8;
  border-radius: 28px;
  transition: background 0.2s ease;
}

.filmpro-dash-ios-toggle label::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.filmpro-dash-ios-toggle label:has(input[type="checkbox"]:checked)::before {
  background: #34c759;
}

.filmpro-dash-ios-toggle label:has(input[type="checkbox"]:checked)::after {
  transform: translateX(20px);
}

.filmpro-dash-plotly {
  min-height: 640px;
}

.filmpro-dash-report-family {
  max-width: 420px;
  margin-bottom: 1rem;
}

.filmpro-dash-custom-reports-status {
  margin: 0.35rem 0 0.75rem;
  font-style: italic;
  color: #6b3a00;
  background: #fff6e8;
  border-left: 3px solid #d4a017;
  padding: 0.45rem 0.75rem;
  max-width: 40rem;
}

.filmpro-dash-report-family label,
.filmpro-dash-report-family-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #8b1a1a;
}

.filmpro-dash-doughnut-wrap {
  margin-left: 2.5rem;
  max-width: 620px;
  overflow: hidden;
}

.filmpro-dash-reports-chart-wrap {
  display: flex;
  justify-content: center;
  padding-left: 2%;
  overflow: hidden;
}

.filmpro-dash-reports-chart-wrap .filmpro-dash-chart-block {
  width: auto;
  max-width: 100%;
}

.filmpro-dash-heading-help {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.75rem 0 0.35rem;
}

.filmpro-dash-heading-help h4 {
  margin: 0;
}

.filmpro-dash-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 1px solid #8a93a3;
  color: #4a5568;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: help;
  user-select: none;
  flex-shrink: 0;
}

.filmpro-dash-reports-periods {
  font-weight: 600;
  margin: 0.25rem 0 0.5rem;
}

.filmpro-dash-reports-form {
  background: #f8fafc;
  border: 1px solid #d8dde6;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.filmpro-dash-outdir-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.filmpro-dash-outdir-input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border: 1px solid #c5ccd8;
  border-radius: 4px;
  font-size: 0.9rem;
}

.filmpro-dash-checklist label {
  display: block;
  margin: 0.35rem 0;
}

.filmpro-dash-reports-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.filmpro-dash-radio label {
  display: block;
  margin: 0.25rem 0;
}

.filmpro-dash-reports-form .btn-apply {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: #0f2744;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.filmpro-dash-download {
  display: inline-block;
  margin: 0.75rem 0 1rem;
  color: #0f2744;
  font-weight: 600;
}

.filmpro-dash-table-block {
  margin: 0.5rem 0 1rem;
}

.filmpro-dash-table-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.35rem;
}

.filmpro-dash-table-block .filmpro-dash-download {
  margin: 0;
}

.filmpro-dash-chart-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.filmpro-dash-chart-block .filmpro-dash-download {
  margin: 0;
}

.filmpro-dash-reports-results {
  margin-top: 0.5rem;
}

/* Update-database tab */
.filmpro-dbupdate {
  width: 80%;
  max-width: 80%;
}

.filmpro-dbupdate-intro {
  max-width: 52rem;
  line-height: 1.45;
}

.filmpro-dbupdate-section {
  margin: 1.5rem 0;
  padding-top: 0.5rem;
  border-top: 1px solid #d8dee6;
}

.filmpro-dbupdate-heading-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.17em;
  font-weight: 600;
  margin: 0.75rem 0 0.5rem;
}

.filmpro-dbupdate-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 1px solid #8a97a8;
  color: #445;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: help;
  user-select: none;
  background: #fff;
}

.filmpro-dbupdate-etl-help {
  margin: 0;
  flex: 1 1 auto;
  font-style: italic;
  line-height: 1.45;
  color: #333;
}

.filmpro-dbupdate-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.filmpro-dbupdate-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  width: 100%;
}

.filmpro-dbupdate-form-row-file {
  width: 100%;
}

.filmpro-dbupdate-field {
  min-width: 140px;
  flex: 0 1 160px;
}

.filmpro-dbupdate-field-wide {
  flex: 1 1 280px;
  min-width: 220px;
}

.filmpro-dbupdate-field-file {
  flex: 1 1 100%;
  width: 100%;
  max-width: 36rem;
  min-width: 0;
}

.filmpro-dbupdate-field label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.filmpro-dbupdate-upload {
  border: 1px dashed #8a97a8;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  background: #fff;
  cursor: pointer;
}

.filmpro-dbupdate-upload-name {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #445;
}

.filmpro-dbupdate-btn {
  background: #0f2744;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-weight: 600;
}

.filmpro-dbupdate-btn-danger {
  background: #7a1f1f;
}

.filmpro-dbupdate-etl-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0.85rem 0 1rem;
}

.filmpro-dbupdate-etl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
}

.filmpro-dbupdate-etl-btn {
  flex: 0 0 380px;
  width: 380px;
  min-height: 2.5rem;
  text-align: center;
  white-space: normal;
}

.filmpro-dbupdate-msg {
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.filmpro-dbupdate-table-wrap {
  width: 100%;
  background: #fff;
  border: 1px solid #d8dee6;
  border-radius: 4px;
  padding: 0.25rem;
  overflow-x: hidden;
}

.filmpro-dbupdate-etl-status {
  margin-top: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: #fff;
  border: 1px solid #d8dee6;
  border-radius: 4px;
}

.filmpro-dbupdate-etl-status.state-running {
  border-color: #c9a227;
  background: #fffbeb;
}

.filmpro-dbupdate-etl-status.state-success {
  border-color: #2f8f4e;
  background: #f0faf3;
}

.filmpro-dbupdate-etl-status.state-error {
  border-color: #b33;
  background: #fff0f0;
}
