/* Lína — Reports (round 56) */

.reports-page { --cs-inset: rgba(0, 0, 0, 0.22); --cs-hover: rgba(255, 255, 255, 0.03); --cs-rule: rgba(255, 255, 255, 0.06); --cs-danger: #e0735f; display: flex; flex-direction: column; height: 100%; min-height: 0; }
.reports-header-icon {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-muted, #b8956e)); border-radius: 8px; color: #1a1a1f;
}
.reports-header-icon svg { width: 18px; height: 18px; }
.reports-header-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-primary); }
.reports-header .screenplay-header-right { display: flex; gap: 8px; align-items: center; }
.rpx-print { display: inline-flex; align-items: center; gap: 6px; width: auto !important; padding: 0 12px !important; }
.rpx-print svg { width: 15px; height: 15px; }

.reports-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px 1fr; }
.rpx-nav { border-right: 1px solid var(--border); overflow-y: auto; padding: 14px 10px; background: var(--bg-panel); }
.rpx-nav-group { margin-bottom: 14px; }
.rpx-nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-secondary); padding: 0 8px 6px; }
.rpx-nav-item {
  display: block; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 6px;
  padding: 7px 9px; color: var(--text-primary); cursor: pointer; margin-bottom: 2px;
}
.rpx-nav-item:hover { background: var(--bg-elevated); }
.rpx-nav-item.active { border-color: var(--accent); background: rgba(209, 139, 60, 0.1); }
.rpx-nav-item.unavailable { opacity: 0.5; }
.rpx-nav-title { display: block; font-size: 13px; font-weight: 600; }
.rpx-nav-desc { display: block; font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; line-height: 1.35; }

.rpx-main { overflow-y: auto; padding: 20px 24px 40px; min-width: 0; }
.rpx-intro h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.rpx-intro p { margin: 0 0 14px; color: var(--text-secondary); font-size: 13px; }
.rpx-intro-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.rpx-intro-row h2 { margin: 0; }
.rpx-hint { color: var(--text-secondary); font-size: 12.5px; margin: 0 0 12px; }
.rpx-dim { color: var(--text-secondary); font-weight: 400; font-size: 12px; }
.rpx-loading, .rpx-empty { padding: 30px; text-align: center; color: var(--text-secondary); border: 1px dashed var(--border); border-radius: 8px; }
.rpx-empty strong { display: block; color: var(--text-primary); margin-bottom: 6px; }

/* A printout, shown as it prints */
.rpx-paper { background: #fff; border-radius: 4px; box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45); max-width: 1100px; }
.rpx-frame { display: block; width: 100%; height: 600px; border: 0; background: #fff; border-radius: 4px; }

.rpx-toolbar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.rpx-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.rpx-field input, .rpx-field select, .rpx-field textarea { font-size: 13px; }
.rpx-field textarea { resize: vertical; min-height: 44px; }
.rpx-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

/* Tables in the app */
.rpx-grid { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px; }
.rpx-grid th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-secondary); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.rpx-grid td { padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); vertical-align: middle; }
.rpx-grid .n { text-align: right; white-space: nowrap; }
.rpx-grid td.behind { color: #e0735f; }
.rpx-grid input, .rpx-grid select { font-size: 12.5px; padding: 4px 6px; width: 100%; box-sizing: border-box; }
.rpx-grid input.rpx-pg { width: 90px; }
.rpx-grid input.rpx-num { width: 70px; }
.rpx-row-actions { text-align: right; }
.rpx-x { padding: 2px 7px !important; }
.rpx-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--bg-elevated); color: var(--text-secondary); }
.rpx-pill.final { background: rgba(79, 158, 99, 0.2); color: #6fbf73; }
.rpx-pill.draft { background: rgba(209, 139, 60, 0.18); color: var(--accent); }

/* Daily Production Report form */
.rpx-form h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; margin: 18px 0 8px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.rpx-form-row { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 10px; }
.rpx-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rpx-add { margin: -6px 0 10px; }
.rpx-add select { font-size: 12.5px; }
.rpx-form-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Progress */
.rpx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.rpx-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: var(--bg-panel); display: flex; flex-direction: column; gap: 4px; }
.rpx-card .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
.rpx-card strong { font-size: 18px; font-weight: 600; }
.rpx-card.behind strong { color: #e0735f; }
.rpx-card-sub { font-size: 12px; color: var(--text-secondary); min-height: 1em; }
.rpx-bar { height: 6px; background: var(--bg-elevated); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.rpx-bar span { display: block; height: 100%; background: var(--accent); }

/* Production book */
.rpx-book { margin-bottom: 14px; }
.rpx-book-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-panel); }

/* Department lists reuse the Breakdown's report UI */
.rpx-departments { min-height: 300px; }

@media (max-width: 900px) {
  .reports-body { grid-template-columns: 1fr; }
  .rpx-nav { border-right: none; border-bottom: 1px solid var(--border); max-height: 220px; }
  .rpx-main { padding: 16px; }
  .rpx-form-row { grid-template-columns: repeat(2, 1fr); }
  .rpx-notes { grid-template-columns: 1fr; }
}

/* Number and multi-line fields look like the app's other inputs */
.rpx-form input[type="number"], .rpx-form input[type="time"], .rpx-form input[type="date"] {
  background-color: #1f1f1f; color: #f0f0f0; border: 1px solid #3a3a3a; border-radius: 6px;
  height: var(--control-height); padding: 4px 8px; font-size: 13px; box-sizing: border-box; color-scheme: dark;
}
.rpx-form input[type="number"]:focus, .rpx-form input[type="time"]:focus, .rpx-form input[type="date"]:focus { border-color: #6aa9ff; outline: none; }
.rpx-form textarea { height: auto; line-height: 1.4; font-family: var(--font-ui); font-size: 13px; }
.rpx-form input[type="time"] { max-width: 150px; }
.rpx-form input:disabled, .rpx-form select:disabled, .rpx-form textarea:disabled { opacity: 0.75; }

/* Daily Production Report: status and autosave */
.rpx-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); margin-left: auto; }
.rpx-status .cs-status-select { min-width: 110px; height: 30px; padding: 3px 10px; }
.rpx-save-state { font-size: 12px; color: var(--text-secondary); min-width: 150px; }
.rpx-save-state[data-state="error"] { color: #e0735f; }
.rpx-save-state[data-state="saved"]::before { content: "✓ "; color: #6fbf73; }
.rpx-lock-note { margin: 0 0 12px; padding: 8px 12px; border-radius: 6px; font-size: 12.5px; border: 1px solid rgba(79, 158, 99, 0.45); background: rgba(79, 158, 99, 0.08); }

/* Daily Production Report: laid out like the call sheet editor (round 58) */
.rpx-dpr-panel { border: 1px solid var(--border); border-radius: 4px; background: rgba(0, 0, 0, 0.12); max-width: 1200px; }
.rpx-dpr-panel .cs-editor-header .rpx-save-state { margin-left: auto; text-align: right; }
.rpx-dpr-panel .cs-lock-note { margin: 12px 16px 0; }
.rpx-dpr-body { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.rpx-times-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }  /* wraps when zoomed in (L84) */
.rpx-notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.rpx-dpr-panel .cs-table .n { text-align: right; padding-right: 12px; }
.rpx-dpr-panel input[type="number"].cs-table-input { width: 100%; height: 28px; background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 3px 6px; color: var(--text-primary); font: inherit; font-size: 12.5px; box-sizing: border-box; }
.rpx-dpr-panel .cs-table tbody tr:hover input[type="number"].cs-table-input, .rpx-dpr-panel input[type="number"].cs-table-input:focus { border-color: var(--border); background: var(--cs-inset); outline: none; }
.rpx-dpr-panel input[type="time"], .rpx-dpr-panel input[type="date"] { color-scheme: dark; }
.rpx-dpr-panel .cs-table-input:disabled, .rpx-dpr-panel .cs-input:disabled { opacity: 0.6; cursor: not-allowed; }
.rpx-add-scene { width: auto !important; max-width: 280px; margin-left: auto; height: 28px !important; padding: 2px 8px !important; font-size: 12px !important; }
.rpx-added { display: inline-block; margin-left: 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--accent); }
.rpx-scene-status[data-status="complete"] { color: #6fbf73; font-weight: 600; }
.rpx-scene-status[data-status="partial"] { color: var(--accent); font-weight: 600; }
.rpx-scene-status[data-status="notShot"] { color: var(--cs-danger); font-weight: 600; }
.rpx-scene-status option { color: var(--text-primary); }
@media (max-width: 900px) {
  .rpx-times-grid { grid-template-columns: repeat(2, 1fr); }
  .rpx-notes-grid { grid-template-columns: 1fr; }
}
.rpx-dpr-panel .cs-production-header-details { grid-template-columns: repeat(4, 1fr); }

/* Production book: a paginated preview (round 60) */
.rpx-book-pages { font-size: 12px; color: var(--text-secondary); margin: -4px 0 10px; min-height: 16px; }
.rpx-paged-wrap { position: relative; background: #5b5b62; border-radius: 4px; max-width: 1100px; }
.rpx-paged-wrap .rpx-frame.rpx-paged { background: #5b5b62; opacity: 0; transition: opacity 0.2s ease; }
.rpx-paged-wrap .rpx-frame.rpx-paged.ready { opacity: 1; }
.rpx-paged-loading { position: absolute; inset: 0 0 auto 0; border: none; color: #e6e6e6; }

/* Reports for removed days (round 62) */
.rpx-subhead { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; margin: 22px 0 4px; color: var(--text-secondary); }
.rpx-removed-note { border-color: rgba(209, 139, 60, 0.5) !important; background: rgba(209, 139, 60, 0.08) !important; }

/* Round 82: weather days, pickups, frozen days (QA L34, L61) */
.rpx-wx-tag { display: inline-block; padding: 0 6px; border-radius: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; color: #9cbbe0; border: 1px solid rgba(95, 134, 179, 0.6); background: rgba(95, 134, 179, 0.14); }
.rpx-wx-row td { color: var(--text-secondary); }
.rpx-wx-note { border-color: rgba(95, 134, 179, 0.55) !important; background: rgba(95, 134, 179, 0.08) !important; }
.cs-day-badge.rpx-wx-badge { border-color: rgba(95, 134, 179, 0.7); }
.rpx-final-dot { font-size: 8px; vertical-align: middle; color: #8fcb9b; }
.rpx-row-btns { white-space: nowrap; }
.rpx-row-btns .rpx-continue { margin-right: 4px; }
.rpx-row-btns [hidden] { display: none; }
.rpx-moved-note { display: inline-block; font-size: 11px; color: var(--text-muted, #9a9aa8); margin-right: 6px; white-space: nowrap; }
.rpx-shot-else { display: inline-block; margin-left: 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; color: #8fcb9b; }

/* QA L100 (Round 11): a page count that couldn't be read */
.rpx-dpr-body .cs-table-input.is-invalid { outline: 2px solid var(--danger, #d64545); outline-offset: -2px; }

/* QA L94 (Round 11): the report picker as a dropdown on phones (mobile.css) */
.rpx-nav-select-wrap { display: none; }

/* Round 85 (QA L94): a report preview wider than a phone scrolls in its paper */
.rpx-paper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* QA Round 14 (Ana, Ruth): the row's buttons appearing after a status change
   (Continue…, Reschedule…) pushed the Pages, Setups and Note fields across,
   so the next click or typing missed them. The button column keeps its width,
   and the fields are visible before they're hovered. */
@media (min-width: 761px) {
  .rpx-dpr-scenes .rpx-row-btns-head { width: 210px; }
  .rpx-dpr-scenes td.rpx-row-btns { width: 210px; }
}
.rpx-dpr-scenes td .cs-table-input { border-color: var(--border-subtle, rgba(127, 127, 140, 0.22)); }
.rpx-dpr-scenes td input[type="number"].cs-table-input { border: 1px solid var(--border-subtle, rgba(127, 127, 140, 0.22)); background: transparent; color: var(--text-primary); height: 28px; padding: 3px 6px; border-radius: 4px; width: 100%; }
.rpx-dpr-scenes [data-f="note"] { min-width: 120px; }
