/* Media team footage inbox. Same visual identity as the public site, admin density. */

:root {
  --ink: #10251c;
  --muted: #66756c;
  --cream: #fff8ec;
  --paper: #ffffff;
  --green: #1f6b44;
  --green-dark: #154c31;
  --gold: #f2b84b;
  --line: rgba(16, 37, 28, 0.12);
  --shadow: 0 18px 44px rgba(16, 37, 28, 0.12);
}

* { box-sizing: border-box; }

body.media-body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--cream), #fff 46%, #f5fbf6);
  min-height: 100vh;
}

.screen { display: none; }
.screen.is-active { display: block; }
.is-hidden { display: none !important; }

.centered-card {
  max-width: 460px;
  margin: 8vh auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 30px 24px;
  box-shadow: var(--shadow);
}

.screen-title {
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
}

.muted { color: var(--muted); line-height: 1.6; }
.small { font-size: 0.88rem; }
.status { min-height: 22px; font-weight: 700; color: var(--green-dark); margin: 14px 0 0; }
.status.is-error { color: #b3261e; }

.btn {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--green);
  color: var(--paper);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(31, 107, 68, 0.22);
}
.btn:disabled { opacity: 0.55; box-shadow: none; cursor: default; }
.btn-block { display: flex; width: 100%; }
.btn-block + .btn-block { margin-top: 10px; }
.btn-ghost { background: var(--paper); color: var(--green); border: 1px solid var(--line); box-shadow: none; }
.btn-small { min-height: 42px; padding: 0 18px; font-size: 0.95rem; }

.link-button {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  padding: 10px 6px;
  text-decoration: none;
}
.link-button:hover { color: var(--green); }

.text-link { display: inline-block; margin-top: 18px; color: var(--muted); font-weight: 700; text-decoration: none; }

.signin-form { display: grid; gap: 14px; margin: 20px 0 12px; }
.signin-form label { font-weight: 800; display: grid; gap: 6px; font-size: 0.92rem; }
.signin-form input {
  font: inherit;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfb;
  color: var(--ink);
}

/* ------------------------------------------------------------------ */

.media-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 248, 236, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.media-brand { display: flex; align-items: center; gap: 12px; }
.media-logo { width: 42px; height: 42px; border-radius: 14px; object-fit: cover; }
.media-brand strong, .media-brand small { display: block; line-height: 1.15; }
.media-brand small { color: var(--muted); font-weight: 700; }
.media-header-actions { display: flex; align-items: center; gap: 8px; }

.media-main { max-width: 1100px; margin: 0 auto; padding: 26px clamp(16px, 4vw, 40px) 60px; }

.inbox-summary { color: var(--muted); font-weight: 700; margin: 0 0 18px; }

.recording-list {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.recording-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recording-thumb {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 320px;
  object-fit: cover;
  border-radius: 16px;
  background: #0d1a13;
  margin-bottom: 14px;
}

.recording-assignment {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.recording-worker { font-weight: 800; }
.recording-line { color: var(--muted); font-size: 0.92rem; }

.status-badge {
  align-self: flex-start;
  margin: 10px 0 4px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: #e8f2eb;
  color: var(--green-dark);
}
.status-badge.is-new { background: var(--gold); color: #4a3208; }
.status-badge.is-incomplete { background: #fbe3e1; color: #8c241c; }

.recording-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.recording-actions .btn { flex: 1; min-width: 120px; }

.recording-note { margin: 10px 0 0; font-size: 0.85rem; color: #8c241c; font-weight: 700; min-height: 18px; }

.empty-state {
  grid-column: 1 / -1;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 24px;
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
}

/* ------------------------------------------------------------------ */

.player-dialog {
  border: 0;
  border-radius: 24px;
  padding: 0;
  width: min(94vw, 460px);
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(16, 37, 28, 0.35);
}
.player-dialog::backdrop { background: rgba(5, 16, 11, 0.62); }
.player-dialog-inner { padding: 18px; }
.player-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.player-frame-wrap { position: relative; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: #000; }
.player-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#playerMeta { margin: 12px 0 0; }

/* ------------------------------------------------------------------ */
/* Script editor (/scripts)                                            */
/* ------------------------------------------------------------------ */

.editor-intro { color: var(--muted); max-width: 720px; margin: 0 0 20px; line-height: 1.6; }

.seed-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fffaf0;
}
.seed-banner p { margin: 4px 0 0; max-width: 460px; }

.import-panel {
  max-width: 760px;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  overflow: hidden;
}
.import-panel > summary {
  padding: 16px 20px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}
.import-panel > summary::-webkit-details-marker { display: none; }
.import-panel > summary::before { content: "+ "; color: var(--green); }
.import-panel[open] > summary::before { content: "\2212 "; }
.import-body { padding: 0 20px 20px; display: grid; gap: 14px; }
.import-body code {
  background: #f1f6f2;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85em;
}

.import-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.import-file { display: inline-flex; align-items: center; }
.import-file input { display: none; }
.import-file span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--green);
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
}

.import-report:empty { display: none; }
.import-report {
  padding: 14px 16px;
  border-radius: 14px;
  background: #f7fbf8;
  border: 1px solid var(--line);
}
.import-report p { margin: 0 0 6px; }
.import-report p:last-child { margin-bottom: 0; }
.import-ok { color: var(--green-dark); font-weight: 800; }
.import-warn { color: #a8620c; font-weight: 800; font-size: 0.9rem; }
.import-problem { color: #b3261e; font-weight: 800; }
.import-problem-list { margin: 6px 0 0; padding-left: 20px; color: #b3261e; font-size: 0.9rem; }

.editor-list { display: grid; gap: 20px; margin-bottom: 20px; }

.editor-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.editor-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.editor-badge {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--green);
}

.editor-toggle { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.9rem; }
.editor-toggle input { width: 20px; height: 20px; accent-color: var(--green); }

.progress-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 760px;
  margin: 0 0 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}
.progress-summary:empty { display: none; }
.progress-summary strong { font-size: 1.1rem; }
.progress-summary span { color: var(--muted); font-weight: 700; font-size: 0.9rem; }

.completion-line {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 12px;
}
.completion-line.is-done { background: #eaf4ee; color: var(--green-dark); }
.completion-line.is-pending { background: #f4f6f5; color: var(--muted); }
.completion-tick { font-weight: 900; margin-right: 4px; }
.completion-count {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: #4a3208;
  font-size: 0.75rem;
}

.editor-id { margin: 0; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.editor-id code { background: #f1f6f2; padding: 3px 8px; border-radius: 8px; }

.editor-field { display: grid; gap: 6px; }
.editor-field > span { font-weight: 800; font-size: 0.9rem; }
.editor-field em { font-style: normal; font-weight: 600; color: var(--muted); }

.editor-field input,
.editor-field textarea {
  font: inherit;
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfb;
  color: var(--ink);
  resize: vertical;
}
.editor-field textarea { line-height: 1.6; }
.editor-field input:focus-visible,
.editor-field textarea:focus-visible {
  outline: 3px solid rgba(31, 107, 68, 0.3);
  outline-offset: 1px;
}

.editor-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.editor-hint { color: var(--muted); font-weight: 700; font-size: 0.82rem; min-height: 18px; }
.editor-hint.is-warn { color: #a8620c; }

.editor-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--green);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 620px) {
  .recording-list { grid-template-columns: 1fr; }
  .media-brand small { display: none; }
}
